Skip to content
Snippets Groups Projects
Unverified Commit f210a1b5 authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #21362 from eileenmcnaughton/prof_edit

[REF] Fix form to call this->setTitle()
parents 3b943db7 fa1f7018
No related branches found
No related tags found
No related merge requests found
......@@ -104,23 +104,23 @@ class CRM_Profile_Form_Edit extends CRM_Profile_Form {
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))) {
......@@ -141,16 +141,16 @@ SELECT module,is_reserved
// 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'];
......@@ -160,7 +160,7 @@ SELECT module,is_reserved
}
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) {
......@@ -260,7 +260,7 @@ SELECT module,is_reserved
}
// 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');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment