/**
* Is this the first page?
*
- * @var boolean
+ * @var bool
*/
protected $_first = FALSE;
/**
* Are we in single form mode or wizard mode?
*
- * @var boolean
+ * @var bool
*/
protected $_single;
/**
* Are we actually managing an event template?
- * @var boolean
+ * @var bool
*/
protected $_isTemplate = FALSE;
/**
- * Pre-populate fields based on this template event_id
- * @var integer
+ * Pre-populate fields based on this template event_id.
+ *
+ * @var int
*/
protected $_templateId;
/**
* The campaign id of the existing event, we use this to know if we need to update
* the participant records
+ * @var int
*/
protected $_campaignID = NULL;
/**
* Check if repeating event.
+ * @var bool
*/
public $_isRepeatingEvent;
}
$this->_single = TRUE;
- $params = array('id' => $this->_id);
+ $params = ['id' => $this->_id];
CRM_Event_BAO_Event::retrieve($params, $eventInfo);
// its an update mode, do a permission check
$ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id');
$ufCreate = CRM_ACL_API::group(CRM_Core_Permission::CREATE, NULL, 'civicrm_uf_group', $ufGroups);
$ufEdit = CRM_ACL_API::group(CRM_Core_Permission::EDIT, NULL, 'civicrm_uf_group', $ufGroups);
- $checkPermission = array(
- array(
+ $checkPermission = [
+ [
'administer CiviCRM',
'manage event profiles',
- ),
- );
+ ],
+ ];
if (CRM_Core_Permission::check($checkPermission) || !empty($ufCreate) || !empty($ufEdit)) {
$this->assign('perm', TRUE);
}
// Set Done button URL and breadcrumb. Templates go back to Manage Templates,
// otherwise go to Manage Event for new event or ManageEventEdit if event if exists.
- $breadCrumb = array();
+ $breadCrumb = [];
if (!$this->_isTemplate) {
if ($this->_id) {
$this->_doneUrl = CRM_Utils_System::url(CRM_Utils_System::currentPath(),
$this->_doneUrl = CRM_Utils_System::url('civicrm/event/manage',
'reset=1'
);
- $breadCrumb = array(
- array(
+ $breadCrumb = [
+ [
'title' => ts('Manage Events'),
'url' => $this->_doneUrl,
- ),
- );
+ ],
+ ];
}
}
else {
$this->_doneUrl = CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1');
- $breadCrumb = array(
- array(
+ $breadCrumb = [
+ [
'title' => ts('Manage Event Templates'),
'url' => $this->_doneUrl,
- ),
- );
+ ],
+ ];
}
CRM_Utils_System::appendBreadCrumb($breadCrumb);
}
* For edit/view mode the default values are retrieved from the database.
*/
public function setDefaultValues() {
- $defaults = array();
+ $defaults = [];
if (isset($this->_id)) {
- $params = array('id' => $this->_id);
+ $params = ['id' => $this->_id];
CRM_Event_BAO_Event::retrieve($params, $defaults);
$this->_campaignID = CRM_Utils_Array::value('campaign_id', $defaults);
}
elseif ($this->_templateId) {
- $params = array('id' => $this->_templateId);
+ $params = ['id' => $this->_templateId];
CRM_Event_BAO_Event::retrieve($params, $defaults);
$defaults['is_template'] = $this->_isTemplate;
$defaults['template_id'] = $defaults['id'];
}
if ($this->_single) {
- $buttons = array(
- array(
+ $buttons = [
+ [
'type' => 'upload',
'name' => ts('Save'),
'isDefault' => TRUE,
- ),
- array(
+ ],
+ [
'type' => 'upload',
'name' => ts('Save and Done'),
'spacing' => ' ',
'subName' => 'done',
- ),
- array(
+ ],
+ [
'type' => 'cancel',
'name' => ts('Cancel'),
- ),
- );
+ ],
+ ];
$this->addButtons($buttons);
}
else {
- $buttons = array();
+ $buttons = [];
if (!$this->_first) {
- $buttons[] = array(
+ $buttons[] = [
'type' => 'back',
'name' => ts('Previous'),
'spacing' => ' ',
- );
+ ];
}
- $buttons[] = array(
+ $buttons[] = [
'type' => 'upload',
'name' => ts('Continue'),
'spacing' => ' ',
'isDefault' => TRUE,
- );
- $buttons[] = array(
+ ];
+ $buttons[] = [
'type' => 'cancel',
'name' => ts('Cancel'),
- );
+ ];
$this->addButtons($buttons);
}
}
CRM_Core_Session::setStatus(ts("'%1' information has been saved.",
- array(1 => CRM_Utils_Array::value('title', CRM_Utils_Array::value($subPage, $this->get('tabHeader')), $className))
+ [1 => CRM_Utils_Array::value('title', CRM_Utils_Array::value($subPage, $this->get('tabHeader')), $className)]
), ts('Saved'), 'success');
$config = CRM_Core_Config::singleton();
*/
public static function addProfileEditScripts() {
CRM_UF_Page_ProfileEditor::registerProfileScripts();
- CRM_UF_Page_ProfileEditor::registerSchemas(array('IndividualModel', 'ParticipantModel'));
+ CRM_UF_Page_ProfileEditor::registerSchemas(['IndividualModel', 'ParticipantModel']);
}
}