From 69b879308e7e6b904b290cf02a1f48edd8502344 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 10 Feb 2022 12:19:13 +1300 Subject: [PATCH] Fix deprecated warnings, smary grumpy-mode issues in legacy searches This gets rid of some deprecated warnings and also makes the pager work in smarty grumpy mode --- .../Contact/Form/Search/Custom/MultipleValues.php | 2 +- .../CRM/Contact/Form/Search/Custom/Sample.php | 3 +-- .../Contact/Form/Search/Custom/ZipCodeRange.php | 9 +++------ templates/CRM/common/pager.tpl | 15 +++++++-------- 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/MultipleValues.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/MultipleValues.php index 8f148a5362..f0b940c6d7 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/MultipleValues.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/MultipleValues.php @@ -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']); diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php index 775dada57b..e5dfac33f7 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Sample.php @@ -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(); diff --git a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ZipCodeRange.php b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ZipCodeRange.php index bbbb2e25ae..6e03d716fd 100644 --- a/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ZipCodeRange.php +++ b/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/ZipCodeRange.php @@ -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 []; } /** diff --git a/templates/CRM/common/pager.tpl b/templates/CRM/common/pager.tpl index 9e9ed8cc43..cc18e61ab5 100644 --- a/templates/CRM/common/pager.tpl +++ b/templates/CRM/common/pager.tpl @@ -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}
{if $location eq 'top'} - {$pager->_response.titleTop} + {$pager->_response.titleTop|smarty:nodefaults} {else} - {$pager->_response.titleBottom} + {$pager->_response.titleBottom|smarty:nodefaults} {/if} - - {$pager->_response.first}  - {$pager->_response.back}  - {$pager->_response.next}  - {$pager->_response.last}  + {$pager->_response.first|smarty:nodefaults}  + {$pager->_response.back|smarty:nodefaults}  + {$pager->_response.next|smarty:nodefaults}  + {$pager->_response.last|smarty:nodefaults}  {$pager->_response.status} -- 2.25.1