X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FForm%2FSearch.php;h=92b7aea6c22ddfe7814fc235068be9a71993e099;hb=8b9023b8443e43410926f38892d94e774d9468b2;hp=e9419c8670fd8a4b876cfb1b74370af1c968eab8;hpb=0906de17549b2f129b0e97ae48b33f25f6393786;p=civicrm-core.git diff --git a/CRM/Event/Form/Search.php b/CRM/Event/Form/Search.php index e9419c8670..92b7aea6c2 100644 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@ -168,7 +168,11 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { */ public function buildQuickForm() { parent::buildQuickForm(); - $this->addElement('text', 'sort_name', ts('Participant Name or Email'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name')); + $this->addSortNameField(); + + if (CRM_Core_Permission::check('access deleted contacts') and Civi::settings()->get('contact_undelete')) { + $this->addElement('checkbox', 'deleted_contacts', ts('Search in Trash') . '
' . ts('(deleted contacts)')); + } CRM_Event_BAO_Query::buildSearchForm($this); @@ -205,7 +209,7 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { foreach ((array) $this->_formValues['participant_role_id'] as $participantRole) { $escapedRoles[] = CRM_Utils_Type::escape($participantRole, 'String'); } - $seatClause[] = '( participant.role_id IN ( "' . implode('" , "', $escapedRoles) . '" ) )'; + $seatClause[] = "( participant.role_id IN ( '" . implode("' , '", $escapedRoles) . "' ) )"; } // CRM-15379 @@ -243,6 +247,28 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search { } + /** + * Get the label for the sortName field if email searching is on. + * + * (email searching is a setting under search preferences). + * + * @return string + */ + protected function getSortNameLabelWithEmail() { + return ts('Participant Name or Email'); + } + + /** + * Get the label for the sortName field if email searching is off. + * + * (email searching is a setting under search preferences). + * + * @return string + */ + protected function getSortNameLabelWithOutEmail() { + return ts('Participant Name'); + } + /** * The post processing of the form gets done here. *