parent::preProcess();
// and also the profile is of type 'Profile'
- $query = "
+ $query = '
SELECT module,is_reserved
FROM civicrm_uf_group
LEFT JOIN civicrm_uf_join ON uf_group_id = civicrm_uf_group.id
WHERE civicrm_uf_group.id = %1
-";
+';
$params = [1 => [$this->_gid, 'Integer']];
$dao = CRM_Core_DAO::executeQuery($query, $params);
$isProfile = FALSE;
while ($dao->fetch()) {
- $isProfile = ($isProfile || ($dao->module == "Profile"));
+ $isProfile = ($isProfile || ($dao->module === 'Profile'));
}
//Check that the user has the "add contacts" Permission
- $canAdd = CRM_Core_Permission::check("add contacts");
+ $canAdd = CRM_Core_Permission::check('add contacts');
//Remove need for Profile module type when using reserved profiles [CRM-14488]
if (!$dao->N || (!$isProfile && !($dao->is_reserved && $canAdd))) {
// set the title
if ($this->_multiRecord && $this->_customGroupTitle) {
- $groupTitle = ($this->_multiRecord & CRM_Core_Action::UPDATE) ? 'Edit ' . $this->_customGroupTitle . ' Record' : $this->_customGroupTitle;
+ $this->setTitle(($this->_multiRecord & CRM_Core_Action::UPDATE) ? 'Edit ' . $this->_customGroupTitle . ' Record' : $this->_customGroupTitle);
}
else {
- $groupTitle = CRM_Core_BAO_UFGroup::getFrontEndTitle($this->_ufGroup['id']);
+ $this->setTitle(CRM_Core_BAO_UFGroup::getFrontEndTitle($this->_ufGroup['id']));
}
- CRM_Utils_System::setTitle($groupTitle);
+
$this->assign('recentlyViewed', FALSE);
- if ($this->_context != 'dialog') {
+ if ($this->_context !== 'dialog') {
$this->_postURL = $this->_ufGroup['post_URL'];
$this->_cancelURL = $this->_ufGroup['cancel_URL'];
}
if (!$this->_postURL) {
- if ($this->_context == 'Search') {
+ if ($this->_context === 'Search') {
$this->_postURL = CRM_Utils_System::url('civicrm/contact/search');
}
elseif ($this->_id && $this->_gid) {
}
// When saving (not deleting) and not in an ajax popup
- if (empty($_POST[$this->_deleteButtonName]) && $this->_context != 'dialog') {
+ if (empty($_POST[$this->_deleteButtonName]) && $this->_context !== 'dialog') {
CRM_Core_Session::setStatus(ts('Your information has been saved.'), ts('Thank you.'), 'success');
}