From f7869f64018e9c7260328061f24ef24286505b17 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 1 Apr 2020 11:19:44 +1300 Subject: [PATCH] [REF] move buildQuickForm function to the trait Note that Contact had an extra assign. It seems likely the extra assign is not required but it would not be a bad thing on the others --- CRM/Activity/Form/Task/Email.php | 11 ----------- CRM/Contact/Form/Task/Email.php | 11 ----------- CRM/Contact/Form/Task/EmailTrait.php | 14 ++++++++++++++ CRM/Contribute/Form/Task/Email.php | 10 ---------- CRM/Event/Form/Task/Email.php | 10 ---------- CRM/Member/Form/Task/Email.php | 13 ------------- 6 files changed, 14 insertions(+), 55 deletions(-) diff --git a/CRM/Activity/Form/Task/Email.php b/CRM/Activity/Form/Task/Email.php index 4f548bb7d6..67a247ccd6 100644 --- a/CRM/Activity/Form/Task/Email.php +++ b/CRM/Activity/Form/Task/Email.php @@ -33,17 +33,6 @@ class CRM_Activity_Form_Task_Email extends CRM_Activity_Form_Task { $this->assign('single', $this->_single); } - /** - * Build the form object. - * - * @throws \CRM_Core_Exception - */ - public function buildQuickForm() { - // Enable form element. - $this->assign('emailTask', TRUE); - CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this); - } - /** * List available tokens for this form. * diff --git a/CRM/Contact/Form/Task/Email.php b/CRM/Contact/Form/Task/Email.php index b49a523c16..afd39cd3a3 100644 --- a/CRM/Contact/Form/Task/Email.php +++ b/CRM/Contact/Form/Task/Email.php @@ -76,17 +76,6 @@ class CRM_Contact_Form_Task_Email extends CRM_Contact_Form_Task { } } - /** - * Build the form object. - */ - public function buildQuickForm() { - //enable form element - $this->assign('suppressForm', FALSE); - $this->assign('emailTask', TRUE); - - CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this); - } - /** * List available tokens for this form. * diff --git a/CRM/Contact/Form/Task/EmailTrait.php b/CRM/Contact/Form/Task/EmailTrait.php index 796e2ff283..0c4776b1fe 100644 --- a/CRM/Contact/Form/Task/EmailTrait.php +++ b/CRM/Contact/Form/Task/EmailTrait.php @@ -63,10 +63,24 @@ trait CRM_Contact_Form_Task_EmailTrait { /** * Store only "bcc" contact ids. + * * @var array */ public $_bccContactIds = []; + /** + * Build the form object. + * + * @throws \CRM_Core_Exception + */ + public function buildQuickForm() { + // Suppress form might not be required but perhaps there was a risk some other process had set it to TRUE. + $this->assign('suppressForm', FALSE); + $this->assign('emailTask', TRUE); + + CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this); + } + /** * Process the form after the input has been submitted and validated. * diff --git a/CRM/Contribute/Form/Task/Email.php b/CRM/Contribute/Form/Task/Email.php index 757dbaa4cb..f4819c6957 100644 --- a/CRM/Contribute/Form/Task/Email.php +++ b/CRM/Contribute/Form/Task/Email.php @@ -34,16 +34,6 @@ class CRM_Contribute_Form_Task_Email extends CRM_Contribute_Form_Task { $this->assign('single', $this->_single); } - /** - * Build the form object. - */ - public function buildQuickForm() { - //enable form element - $this->assign('emailTask', TRUE); - - CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this); - } - /** * List available tokens for this form. * diff --git a/CRM/Event/Form/Task/Email.php b/CRM/Event/Form/Task/Email.php index 428832243d..2da1720e36 100644 --- a/CRM/Event/Form/Task/Email.php +++ b/CRM/Event/Form/Task/Email.php @@ -35,16 +35,6 @@ class CRM_Event_Form_Task_Email extends CRM_Event_Form_Task { $this->assign('single', $this->_single); } - /** - * Build the form object. - */ - public function buildQuickForm() { - //enable form element - $this->assign('emailTask', TRUE); - - CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this); - } - /** * List available tokens for this form. * diff --git a/CRM/Member/Form/Task/Email.php b/CRM/Member/Form/Task/Email.php index bb837547a6..aa6c7f1776 100644 --- a/CRM/Member/Form/Task/Email.php +++ b/CRM/Member/Form/Task/Email.php @@ -40,19 +40,6 @@ class CRM_Member_Form_Task_Email extends CRM_Member_Form_Task { $this->assign('single', $this->_single); } - /** - * Build the form object. - * - * @return void - * @throws \CRM_Core_Exception - */ - public function buildQuickForm() { - //enable form element - $this->assign('emailTask', TRUE); - - CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this); - } - /** * List available tokens for this form. * -- 2.25.1