From 2cb9b29a8eddcd71fcd6a458aeb30a6c16add7cc Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Sun, 5 Sep 2021 20:39:52 +0100 Subject: [PATCH] Update use of CRM_Utils_System::setTitle() for legacycustomsearches --- .../Form/Search/Custom/ActivitySearch.php | 12 ------------ .../CRM/Contact/Form/Search/Custom/Base.php | 18 ++++++++++++------ .../Form/Search/Custom/ContribSYBNT.php | 12 ------------ .../Search/Custom/ContributionAggregate.php | 12 ------------ .../Contact/Form/Search/Custom/DateAdded.php | 12 ------------ .../Form/Search/Custom/EventAggregate.php | 12 ------------ .../Contact/Form/Search/Custom/FullText.php | 9 --------- .../CRM/Contact/Form/Search/Custom/Group.php | 14 -------------- .../Contact/Form/Search/Custom/PriceSet.php | 8 +++----- .../Contact/Form/Search/Custom/Proximity.php | 12 ------------ .../Form/Search/Custom/RandomSegment.php | 12 ------------ .../CRM/Contact/Form/Search/Custom/Sample.php | 12 ------------ .../Form/Search/Custom/TagContributions.php | 12 ------------ .../Form/Search/Custom/ZipCodeRange.php | 12 ------------ 14 files changed, 15 insertions(+), 154 deletions(-) diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ActivitySearch.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ActivitySearch.php index 3cc5e6d4e7..7c403fd0c1 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ActivitySearch.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ActivitySearch.php @@ -390,18 +390,6 @@ ORDER BY contact_a.sort_name'; return $this->_columns; } - /** - * @param $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); - } - } - /** * @return null */ diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Base.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Base.php index 6550170deb..6c275cdc07 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Base.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Base.php @@ -22,6 +22,12 @@ class CRM_Contact_Form_Search_Custom_Base { protected $_stateID; + /** + * The title of this form + * @var string + */ + protected $_title = NULL; + /** * Class constructor. * @@ -228,17 +234,17 @@ class CRM_Contact_Form_Search_Custom_Base { } /** - * Set the title. + * Setter function for title. * * @param string $title + * The title of the form. */ public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); + if (empty($title)) { + $title = ts('Search'); } + $this->_title = $title; + CRM_Utils_System::setTitle($title); } /** diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ContribSYBNT.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ContribSYBNT.php index de292bb76a..cbd887c39f 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ContribSYBNT.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ContribSYBNT.php @@ -365,18 +365,6 @@ AND c.receive_date < {$this->start_date_1} return NULL; } - /** - * @param $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); - } - } - /** * @param string $tableAlias */ diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ContributionAggregate.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ContributionAggregate.php index 0b0698c5a9..2e640827ba 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ContributionAggregate.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ContributionAggregate.php @@ -320,18 +320,6 @@ civicrm_contact AS contact_a {$this->_aclFrom} return $this->_columns; } - /** - * @param $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); - } - } - /** * @return null */ diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/DateAdded.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/DateAdded.php index 8fca291f52..2e4877bac7 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/DateAdded.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/DateAdded.php @@ -361,18 +361,6 @@ class CRM_Contact_Form_Search_Custom_DateAdded extends CRM_Contact_Form_Search_C return 'CRM/Contact/Form/Search/Custom.tpl'; } - /** - * @param $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); - } - } - /** * @return mixed */ diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/EventAggregate.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/EventAggregate.php index 29e76dbeaa..af1bd24238 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/EventAggregate.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/EventAggregate.php @@ -335,18 +335,6 @@ class CRM_Contact_Form_Search_Custom_EventAggregate extends CRM_Contact_Form_Sea return $this->_columns; } - /** - * @param $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); - } - } - /** * @param string $tableAlias */ diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/FullText.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/FullText.php index 12b793fa2f..dcc3ea12f1 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/FullText.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/FullText.php @@ -519,15 +519,6 @@ FROM {$this->_tableName} contact_a public function alterRow(&$row) { } - /** - * @param $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - } - /** * @param int|array $limit * @return string diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Group.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Group.php index 1cc949d4f9..7eabd91dad 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Group.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Group.php @@ -652,20 +652,6 @@ WHERE gcc.group_id = {$ssGroup->id} return 'CRM/Contact/Form/Search/Custom.tpl'; } - /** - * Set title on search. - * - * @param string $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); - } - } - /** * Build ACL clause. * diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/PriceSet.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/PriceSet.php index 74e5aa006e..49b5b32e95 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/PriceSet.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/PriceSet.php @@ -333,12 +333,10 @@ INNER JOIN {$this->_tableName} tempTable ON ( tempTable.contact_id = contact_a.i * @param $title */ public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Export Price Set Info for an Event')); + if (empty($title)) { + $title = ts('Export Price Set Info for an Event'); } + parent::setTitle($title); } /** diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Proximity.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Proximity.php index 8d211aafcf..11533db374 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Proximity.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Proximity.php @@ -270,18 +270,6 @@ class CRM_Contact_Form_Search_Custom_Proximity extends CRM_Contact_Form_Search_C public function alterRow(&$row) { } - /** - * @param $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); - } - } - /** * Validate form input. * diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/RandomSegment.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/RandomSegment.php index b09d151fce..db5110b049 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/RandomSegment.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/RandomSegment.php @@ -332,18 +332,6 @@ class CRM_Contact_Form_Search_Custom_RandomSegment extends CRM_Contact_Form_Sear return 'CRM/Contact/Form/Search/Custom.tpl'; } - /** - * @param $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); - } - } - /** * @return mixed */ diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php index 8ea2b519a9..70bc6b8f19 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php @@ -206,18 +206,6 @@ LEFT JOIN civicrm_state_province state_province ON state_province.id = address.s $row['sort_name'] .= ' ( altered )'; } - /** - * @param $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); - } - } - /** * @param string $tableAlias */ diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/TagContributions.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/TagContributions.php index 7b1cd6a65d..a0995d50ad 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/TagContributions.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/TagContributions.php @@ -236,18 +236,6 @@ WHERE $where return $this->_columns; } - /** - * @param $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); - } - } - /** * @return null */ diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ZipCodeRange.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ZipCodeRange.php index 98887e8f2e..77dec63eab 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ZipCodeRange.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ZipCodeRange.php @@ -188,18 +188,6 @@ LEFT JOIN civicrm_email email ON ( email.contact_id = contact_a.id AND return 'CRM/Contact/Form/Search/Custom.tpl'; } - /** - * @param $title - */ - public function setTitle($title) { - if ($title) { - CRM_Utils_System::setTitle($title); - } - else { - CRM_Utils_System::setTitle(ts('Search')); - } - } - /** * @param string $tableAlias */ -- 2.25.1