From 337750c95bbe6389e78ff3fbddbf087ddc35cf3d Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Wed, 27 Nov 2013 09:34:48 -0800 Subject: [PATCH] CRM-13849 - eliminate unused formRule function ---------------------------------------- * CRM-13849: Mailing search should not be restricted to specific mailings when mailing events are specified http://issues.civicrm.org/jira/browse/CRM-13849 --- CRM/Mailing/BAO/Query.php | 42 ++++----------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/CRM/Mailing/BAO/Query.php b/CRM/Mailing/BAO/Query.php index d409d6f9ec..dc639f2f12 100644 --- a/CRM/Mailing/BAO/Query.php +++ b/CRM/Mailing/BAO/Query.php @@ -397,42 +397,6 @@ class CRM_Mailing_BAO_Query { $form->add('checkbox', 'mailing_forward', ts('Forwards')); $form->assign('validCiviMailing', TRUE); - // $form->addFormRule(array('CRM_Mailing_BAO_Query', 'formRule'), $form); - } - - /** - * global form rule - * - * @param array $fields the input form values - * @param array $files the uploaded files if any - * @param array $options additional user data - * - * @return true if no errors, else array of errors - * @access public - * @static - */ - static function formRule($fields, $files, $self) { - $errors = array(); - // if an event filter is specified, then a mailing selector must also be specified - if ((CRM_Utils_Array::value('mailing_delivery_status', $fields) || - CRM_Utils_Array::value('mailing_open_status', $fields) || - CRM_Utils_Array::value('mailing_click_status', $fields) || - CRM_Utils_Array::value('mailing_reply_status', $fields) || - CRM_Utils_Array::value('mailing_bounce_types', $fields) - ) && - (!CRM_Utils_Array::value('mailing_id', $fields) && - !CRM_Utils_Array::value('mailing_date_low', $fields) && - !CRM_Utils_Array::value('mailing_date_high', $fields) - ) - ) { - $errors['mailing_id'] = ts('Must specify mailing name or date'); - // Keep search form opened in case of form rule. - if (is_a($self, 'CRM_Contact_Form_Search_Advanced') && !isset(CRM_Contact_BAO_Query::$_openedPanes['Mailings'])) { - CRM_Contact_BAO_Query::$_openedPanes['Mailings'] = TRUE; - $self->assign('openedPanes', CRM_Contact_BAO_Query::$_openedPanes); - } - } - return $errors; } static function addShowHide(&$showHide) { @@ -440,9 +404,11 @@ class CRM_Mailing_BAO_Query { $showHide->addShow('MailingForm_show'); } - static function searchAction(&$row, $id) {} + static function searchAction(&$row, $id) { + } - static function tableNames(&$tables) {} + static function tableNames(&$tables) { + } /** * Filter query results based on which contacts do (not) have a particular mailing event in their history. -- 2.25.1