+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
+ | Copyright CiviCRM LLC (c) 2004-2020 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC (c) 2004-2020
*/
/**
$ids = CRM_Core_PseudoConstant::allGroup();
$heirGroups = CRM_Contact_BAO_Group::getGroupsHierarchy($ids);
- $allGroups = array();
+ $allGroups = [];
foreach ($heirGroups as $id => $group) {
// make sure that this group has public visibility
if ($onlyPublicGroups && $group['visibility'] == 'User and User Admin Only') {
$groupSelect = $groupHierarchy;
}
- $groupSelect = array('' => ts('- select group -')) + $groupSelect;
+ $groupSelect = ['' => ts('- select group -')] + $groupSelect;
if (count($groupSelect) > 1) {
$session = CRM_Core_Session::singleton();
$msg = ts('Add to a group');
}
- $this->addField('group_id', array('class' => 'crm-action-menu fa-plus', 'placeholder' => $msg, 'options' => $groupSelect));
+ $this->addField('group_id', ['class' => 'crm-action-menu fa-plus', 'placeholder' => $msg, 'options' => $groupSelect]);
- $this->addButtons(array(
- array(
- 'type' => 'next',
- 'name' => ts('Add'),
- 'isDefault' => TRUE,
- ),
- )
- );
+ $this->addButtons([
+ [
+ 'type' => 'next',
+ 'name' => ts('Add'),
+ 'isDefault' => TRUE,
+ ],
+ ]);
}
}
* Post process form.
*/
public function postProcess() {
- $contactID = array($this->_contactId);
+ $contactID = [$this->_contactId];
$groupId = $this->controller->exportValue('GroupContact', 'group_id');
$method = ($this->_context == 'user') ? 'Web' : 'Admin';
if ($groupContact && $this->_context != 'user') {
$groups = CRM_Core_PseudoConstant::group();
- CRM_Core_Session::setStatus(ts("Contact has been added to '%1'.", array(1 => $groups[$groupId])), ts('Added to Group'), 'success');
+ CRM_Core_Session::setStatus(ts("Contact has been added to '%1'.", [1 => $groups[$groupId]]), ts('Added to Group'), 'success');
}
}