Skip to content

Commit

Permalink
Merge pull request #16954 from eileenmcnaughton/email4
Browse files Browse the repository at this point in the history
[REF] Move generic preProcess function to the trait
  • Loading branch information
colemanw authored Apr 8, 2020
2 parents 7784539 + e656d97 commit 7a4a808
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 56 deletions.
12 changes: 0 additions & 12 deletions CRM/Activity/Form/Task/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
13 changes: 13 additions & 0 deletions CRM/Contact/Form/Task/EmailTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
13 changes: 0 additions & 13 deletions CRM/Contribute/Form/Task/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
13 changes: 0 additions & 13 deletions CRM/Event/Form/Task/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
18 changes: 0 additions & 18 deletions CRM/Member/Form/Task/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 7a4a808

Please sign in to comment.