<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
* class constructor
*
* @param string $title title of the page
- * @param int $mode mode of the page
+ * @param int $mode mode of the page
*
- * @return CRM_Core_Page
+ * @return \CRM_Core_Page_Basic
*/
function __construct($title = NULL, $mode = NULL) {
parent::__construct($title, $mode);
$fields = &$object->fields();
$key = '';
- if (CRM_Utils_Array::value('title', $fields)) {
+ if (!empty($fields['title'])) {
$key = 'title';
}
- elseif (CRM_Utils_Array::value('label', $fields)) {
+ elseif (!empty($fields['label'])) {
$key = 'label';
}
- elseif (CRM_Utils_Array::value('name', $fields)) {
+ elseif (!empty($fields['name'])) {
$key = 'name';
}
$object->orderBy($key . ' asc');
}
-
+ //@todo FIXME - using the CRM_Core_DAO::VALUE_SEPARATOR creates invalid html - if you can find the form
+ // this is loaded onto then replace with something like '__' & test
+ $separator = CRM_Core_DAO::VALUE_SEPARATOR;
+ $contactTypes = CRM_Contact_BAO_ContactType::getSelectElements(FALSE, TRUE, $separator);
// find all objects
$object->find();
while ($object->fetch()) {
$values[$object->id] = array();
CRM_Core_DAO::storeValues($object, $values[$object->id]);
- CRM_Contact_DAO_RelationshipType::addDisplayEnums($values[$object->id]);
+ if (is_a($object, 'CRM_Contact_DAO_RelationshipType')) {
+ $values[$object->id]['contact_type_a_display'] = $contactTypes[$values[$object->id]['contact_type_a']];
+ $values[$object->id]['contact_type_b_display'] = $contactTypes[$values[$object->id]['contact_type_b']];
+ }
// populate action links
$this->action($object, $action, $values[$object->id], $links, $permission);
$newAction = $action;
$hasDelete = $hasDisable = TRUE;
- if (CRM_Utils_Array::value('name', $values) && in_array($values['name'], array(
+ if (!empty($values['name']) && in_array($values['name'], array(
'encounter_medium', 'case_type', 'case_status'))) {
static $caseCount = NULL;
if (!isset($caseCount)) {
$values['class'] = 'reserved';
// check if object is relationship type
$object_type = get_class($object);
- if ($object_type == 'CRM_Contact_BAO_RelationshipType' || $object_type == 'CRM_Core_BAO_LocationType') {
+
+ $exceptions = array(
+ 'CRM_Contact_BAO_RelationshipType',
+ 'CRM_Core_BAO_LocationType',
+ 'CRM_Badge_BAO_Layout',
+ );
+
+ if (in_array($object_type, $exceptions)) {
$newAction = CRM_Core_Action::VIEW + CRM_Core_Action::UPDATE;
}
else {
* @param int $mode - what mode for the form ?
* @param int $id - id of the entity (for update, view operations)
*
+ * @param bool $imageUpload
+ * @param bool $pushUserContext
+ *
* @return void
*/
function edit($mode, $id = NULL, $imageUpload = FALSE, $pushUserContext = TRUE) {