[REF] move buildQuickForm function to the trait
authoreileen <emcnaughton@wikimedia.org>
Tue, 31 Mar 2020 22:19:44 +0000 (11:19 +1300)
committereileen <emcnaughton@wikimedia.org>
Wed, 1 Apr 2020 21:57:18 +0000 (10:57 +1300)
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
CRM/Contact/Form/Task/Email.php
CRM/Contact/Form/Task/EmailTrait.php
CRM/Contribute/Form/Task/Email.php
CRM/Event/Form/Task/Email.php
CRM/Member/Form/Task/Email.php

index 4f548bb7d65b51bb1c33c81c595a5df20fd56446..67a247ccd6b34e72265b79a5ae04502970c29114 100644 (file)
@@ -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.
    *
index b49a523c163e951753142385c39b7bcb12f3affa..afd39cd3a3c4c4d7d20982e532c9e046fda2ab4c 100644 (file)
@@ -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.
    *
index 796e2ff283157c9855e184f244b65205ec6dbe90..0c4776b1fec88010ddbf2f3b6b5407c5659bbb78 100644 (file)
@@ -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.
    *
index 757dbaa4cbb8d2a374a89312e8025028d6dc7378..f4819c6957b76f2ba2e3822c8bf24a1f7daf448d 100644 (file)
@@ -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.
    *
index 428832243d6b07e34bc089f4df83df22edc70e94..2da1720e362da2abcc82e95f8b79015706eb5a00 100644 (file)
@@ -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.
    *
index bb837547a6427c431985e4c257171d24d3e0bd06..aa6c7f1776970c2ba58aefc8750796107b30e20f 100644 (file)
@@ -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.
    *