Update use of CRM_Utils_System::setTitle() for legacycustomsearches
authorMatthew Wire <mjw@mjwconsult.co.uk>
Sun, 5 Sep 2021 19:39:52 +0000 (20:39 +0100)
committerMatthew Wire <mjw@mjwconsult.co.uk>
Sun, 5 Sep 2021 19:42:30 +0000 (20:42 +0100)
14 files changed:
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ActivitySearch.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Base.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ContribSYBNT.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ContributionAggregate.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/DateAdded.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/EventAggregate.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/FullText.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Group.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/PriceSet.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Proximity.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/RandomSegment.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/TagContributions.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ZipCodeRange.php

index 3cc5e6d4e7cf9f63e8922e3811ad0ec6e7845ad0..7c403fd0c1a6ef089cfab08ba0675a7e0d6f9835 100644 (file)
@@ -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
    */
index 6550170deb77ce295fb58a75ea2a7b0b5b003e6f..6c275cdc07305fc6dc0e55934ce69213f19e1062 100644 (file)
@@ -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);
   }
 
   /**
index de292bb76ab8db355466a41af16f7efb24f0bed1..cbd887c39fcaff96984be93fece2adfefa75e109 100644 (file)
@@ -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
    */
index 0b0698c5a9618bf4654327a5e076d64abc53f225..2e640827baae63a559b8ed3577e4b57694e22707 100644 (file)
@@ -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
    */
index 8fca291f52b2822e877caebc0dd4c3d06a682d20..2e4877bac7a91eebebc58522de8f025a5e20695b 100644 (file)
@@ -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
    */
index 29e76dbeaab4cf446171f3d8734b53c4299539ea..af1bd242387b048dd331b84f51968c00382e3dc1 100644 (file)
@@ -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
    */
index 12b793fa2fd81741459df170551d7505a3397991..dcc3ea12f1769cd4b5c8e834b130e19c9fcde2ec 100644 (file)
@@ -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
index 1cc949d4f9e9b10657c51441f800d30e7f23fdee..7eabd91dadcd8757d7e2aaa5e2870ff1fd8f0987 100644 (file)
@@ -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.
    *
index 74e5aa006ebb9d4f39f12cf71a98c3bf3593161e..49b5b32e9544dc91cb135c3db1cb791d6b38c07e 100644 (file)
@@ -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);
   }
 
   /**
index 8d211aafcf7b5087a8fdcc6eb588d86c8baa5cbc..11533db374e747421e69d37284c8b8375817bebf 100644 (file)
@@ -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.
    *
index b09d151fce841d67af35cca6a8e01b5e72252558..db5110b049181512cb23dcaa18a08ea028601f9e 100644 (file)
@@ -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
    */
index 8ea2b519a9f6018337f2a07c165d61b64988644f..70bc6b8f19a6c49c460e99ca9766a6bbd36bd28b 100644 (file)
@@ -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
    */
index 7b1cd6a65d5f37574e7d774e0feea2c6dad9611d..a0995d50ad7207a17b857cba8fcec2b30d7eb370 100644 (file)
@@ -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
    */
index 98887e8f2e4cc573b8b3b3c768d4df66afc21714..77dec63eab1a0de57a1c12e1f7ba27c32594fb22 100644 (file)
@@ -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
    */