Fix deprecated warnings, smary grumpy-mode issues in legacy searches
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 9 Feb 2022 23:19:13 +0000 (12:19 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 9 Feb 2022 23:19:13 +0000 (12:19 +1300)
This gets rid of some deprecated warnings and also makes the pager work in smarty grumpy mode

ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/MultipleValues.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php
ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ZipCodeRange.php
templates/CRM/common/pager.tpl

index 8f148a5362c5f7911d26e11208ce79de9a53a340..f0b940c6d7ad262f5a5089ab381f59aafdc808ac 100644 (file)
@@ -87,7 +87,7 @@ class CRM_Contact_Form_Search_Custom_MultipleValues extends CRM_Contact_Form_Sea
 
     $this->setTitle(ts('Multiple Value Custom Group Search and Export'));
 
-    $form->add('text', 'sort_name', ts('Contact Name'), TRUE);
+    $form->add('text', 'sort_name', ts('Contact Name'));
 
     $contactTypes = ['' => ts('- any contact type -')] + CRM_Contact_BAO_ContactType::getSelectElements();
     $form->add('select', 'contact_type', ts('Find...'), $contactTypes, ['class' => 'crm-select2 huge']);
index 775dada57bf6b34fd9626f9b868f9ff234ec2e71..e5dfac33f7bab17145e98b29099eb9b1179a33bf 100644 (file)
@@ -50,8 +50,7 @@ class CRM_Contact_Form_Search_Custom_Sample extends CRM_Contact_Form_Search_Cust
 
     $form->add('text',
       'household_name',
-      ts('Household Name'),
-      TRUE
+      ts('Household Name')
     );
 
     $stateProvince = ['' => ts('- any state/province -')] + CRM_Core_PseudoConstant::stateProvince();
index bbbb2e25aed75c4fc8983805ba5174cf8d68d1fb..6e03d716fd91947720985cb6c96b3142dfe97e75 100644 (file)
@@ -47,14 +47,12 @@ class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Searc
   public function buildForm(&$form) {
     $form->add('text',
       'postal_code_low',
-      ts('Postal Code Start'),
-      TRUE
+      ts('Postal Code Start')
     );
 
     $form->add('text',
       'postal_code_high',
-      ts('Postal Code End'),
-      TRUE
+      ts('Postal Code End')
     );
 
     /**
@@ -73,8 +71,7 @@ class CRM_Contact_Form_Search_Custom_ZipCodeRange extends CRM_Contact_Form_Searc
    * @return array
    */
   public function summary() {
-    $summary = [];
-    return $summary;
+    return [];
   }
 
   /**
index 9e9ed8cc43e0234b33663618ee330336e3b19077..cc18e61ab53586344ad5363ed683c9cf4f069bfa 100644 (file)
@@ -7,22 +7,21 @@
  | and copyright information, see https://civicrm.org/licensing       |
  +--------------------------------------------------------------------+
 *}
-{if $pager and $pager->_response}
+{if $pager|smarty:nodefaults and $pager->_response|smarty:nodefaults}
     {if $pager->_response.numPages > 1}
         <div class="crm-pager">
             <span class="element-right">
             {if $location eq 'top'}
-              {$pager->_response.titleTop}
+              {$pager->_response.titleTop|smarty:nodefaults}
             {else}
-              {$pager->_response.titleBottom}
+              {$pager->_response.titleBottom|smarty:nodefaults}
             {/if}
             </span>
-          </span>
           <span class="crm-pager-nav">
-          {$pager->_response.first}&nbsp;
-          {$pager->_response.back}&nbsp;
-          {$pager->_response.next}&nbsp;
-          {$pager->_response.last}&nbsp;
+          {$pager->_response.first|smarty:nodefaults}&nbsp;
+          {$pager->_response.back|smarty:nodefaults}&nbsp;
+          {$pager->_response.next|smarty:nodefaults}&nbsp;
+          {$pager->_response.last|smarty:nodefaults}&nbsp;
           {$pager->_response.status}
           </span>