+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
*/
/**
/**
* Should we bypass permissions.
*
- * @var boolean
+ * @var bool
*/
protected $_skipPermission;
/**
* Store profile ids if multiple profile ids are passed using comma separated.
* Currently lets implement this functionality only for dialog mode
+ * @var array
*/
- protected $_profileIds = array();
+ protected $_profileIds = [];
/**
* Contact profile having activity fields?
protected $_recordId = NULL;
- /*
+ /**
+ *
* fetch multirecord as well as non-multirecord fields
+ * @var int
*/
protected $_allFields = NULL;
$this->_profileIds = $profileIds;
}
else {
- $this->_profileIds = array($gid);
+ $this->_profileIds = [$gid];
}
$this->_activityId = CRM_Utils_Request::retrieve('aid', 'Positive', $this, FALSE, 0, 'GET');
$admin = TRUE;
}
- $values = array();
+ $values = [];
$fields = CRM_Core_BAO_UFGroup::getFields($this->_profileIds, FALSE, CRM_Core_Action::VIEW,
NULL, NULL, FALSE, $this->_restrict,
$this->_skipPermission, NULL,
}
if ($this->_isContactActivityProfile) {
- $contactFields = $activityFields = array();
+ $contactFields = $activityFields = [];
foreach ($fields as $fieldName => $field) {
if (CRM_Utils_Array::value('field_type', $field) == 'Activity') {
$activityFields,
$values,
TRUE,
- array(array('activity_id', '=', $this->_activityId, 0, 0))
+ [['activity_id', '=', $this->_activityId, 0, 0]]
);
}
}
}
// $profileFields array can be used for customized display of field labels and values in Profile/View.tpl
- $profileFields = array();
- $labels = array();
+ $profileFields = [];
+ $labels = [];
foreach ($fields as $name => $field) {
//CRM-14338
}
foreach ($values as $title => $value) {
- $profileFields[$labels[$title]] = array(
+ $profileFields[$labels[$title]] = [
'label' => $title,
'value' => $value,
- );
+ ];
}
$template->assign_by_ref('row', $values);
if (($this->_multiRecord & CRM_Core_Action::VIEW) && $this->_recordId && !$this->_allFields) {
$fieldDetail = reset($fields);
$fieldId = CRM_Core_BAO_CustomField::getKeyID($fieldDetail['name']);
- $customGroupDetails = CRM_Core_BAO_CustomGroup::getGroupTitles(array($fieldId));
+ $customGroupDetails = CRM_Core_BAO_CustomGroup::getGroupTitles([$fieldId]);
$multiRecTitle = $customGroupDetails[$fieldId]['groupTitle'];
}
else {
$title .= ' - ' . $displayName;
}
- $title = isset($multiRecTitle) ? ts('View %1 Record', array(1 => $multiRecTitle)) : $title;
+ $title = isset($multiRecTitle) ? ts('View %1 Record', [1 => $multiRecTitle]) : $title;
CRM_Utils_System::setTitle($title);
// invoke the pagRun hook, CRM-3906