From: eileen Date: Tue, 31 Mar 2020 22:32:39 +0000 (+1300) Subject: Move generic preProcess function to the trait X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e656d97c82aceef5c23140707d377762f29c1779;p=civicrm-core.git Move generic preProcess function to the trait This is still overriden on the contact email. --- diff --git a/CRM/Activity/Form/Task/Email.php b/CRM/Activity/Form/Task/Email.php index 67a247ccd6..ccddab7aef 100644 --- a/CRM/Activity/Form/Task/Email.php +++ b/CRM/Activity/Form/Task/Email.php @@ -21,18 +21,6 @@ class CRM_Activity_Form_Task_Email extends CRM_Activity_Form_Task { use CRM_Contact_Form_Task_EmailTrait; - /** - * Build all the data structures needed to build the form. - * - * @throws \CiviCRM_API3_Exception - */ - public function preProcess() { - CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); - parent::preProcess(); - $this->setContactIDs(); - $this->assign('single', $this->_single); - } - /** * List available tokens for this form. * diff --git a/CRM/Contact/Form/Task/EmailTrait.php b/CRM/Contact/Form/Task/EmailTrait.php index 0c4776b1fe..02602753dd 100644 --- a/CRM/Contact/Form/Task/EmailTrait.php +++ b/CRM/Contact/Form/Task/EmailTrait.php @@ -68,6 +68,19 @@ trait CRM_Contact_Form_Task_EmailTrait { */ public $_bccContactIds = []; + /** + * Build all the data structures needed to build the form. + * + * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception + */ + public function preProcess() { + CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); + parent::preProcess(); + $this->setContactIDs(); + $this->assign('single', $this->_single); + } + /** * Build the form object. * diff --git a/CRM/Contribute/Form/Task/Email.php b/CRM/Contribute/Form/Task/Email.php index f4819c6957..509c0e7dc0 100644 --- a/CRM/Contribute/Form/Task/Email.php +++ b/CRM/Contribute/Form/Task/Email.php @@ -21,19 +21,6 @@ class CRM_Contribute_Form_Task_Email extends CRM_Contribute_Form_Task { use CRM_Contact_Form_Task_EmailTrait; - /** - * Build all the data structures needed to build the form. - */ - public function preProcess() { - CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); - parent::preProcess(); - - // we have all the contribution ids, so now we get the contact ids - parent::setContactIDs(); - - $this->assign('single', $this->_single); - } - /** * List available tokens for this form. * diff --git a/CRM/Event/Form/Task/Email.php b/CRM/Event/Form/Task/Email.php index 2da1720e36..e771571054 100644 --- a/CRM/Event/Form/Task/Email.php +++ b/CRM/Event/Form/Task/Email.php @@ -22,19 +22,6 @@ class CRM_Event_Form_Task_Email extends CRM_Event_Form_Task { use CRM_Contact_Form_Task_EmailTrait; - /** - * Build all the data structures needed to build the form. - */ - public function preProcess() { - CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); - parent::preProcess(); - - // we have all the participant ids, so now we get the contact ids - parent::setContactIDs(); - - $this->assign('single', $this->_single); - } - /** * List available tokens for this form. * diff --git a/CRM/Member/Form/Task/Email.php b/CRM/Member/Form/Task/Email.php index aa6c7f1776..8db66116e1 100644 --- a/CRM/Member/Form/Task/Email.php +++ b/CRM/Member/Form/Task/Email.php @@ -22,24 +22,6 @@ class CRM_Member_Form_Task_Email extends CRM_Member_Form_Task { use CRM_Contact_Form_Task_EmailTrait; - /** - * Build all the data structures needed to build the form. - * - * @return void - * - * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - */ - public function preProcess() { - CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); - parent::preProcess(); - - // we have all the membership ids, so now we get the contact ids - parent::setContactIDs(); - - $this->assign('single', $this->_single); - } - /** * List available tokens for this form. *