From 946d8b80b084bf98112f4421769750fe6a3e0888 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 26 Mar 2020 16:56:35 +1300 Subject: [PATCH] [NFC] minor form cleanup. Most notably fix calling a non-static method statically but also remove comment that clearly came in by copy & paste, --- CRM/Activity/Form/Task.php | 2 ++ CRM/Activity/Form/Task/Email.php | 11 +++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CRM/Activity/Form/Task.php b/CRM/Activity/Form/Task.php index 1ee135bd7f25..c16964876815 100644 --- a/CRM/Activity/Form/Task.php +++ b/CRM/Activity/Form/Task.php @@ -39,6 +39,8 @@ public function preProcess() { * Common pre-process function. * * @param CRM_Core_Form $form + * + * @throws \CRM_Core_Exception */ public static function preProcessCommon(&$form) { $form->_activityHolderIds = []; diff --git a/CRM/Activity/Form/Task/Email.php b/CRM/Activity/Form/Task/Email.php index dcb050f05628..ed83f5863091 100644 --- a/CRM/Activity/Form/Task/Email.php +++ b/CRM/Activity/Form/Task/Email.php @@ -35,7 +35,7 @@ class CRM_Activity_Form_Task_Email extends CRM_Activity_Form_Task { * * @var array */ - public $_templates = NULL; + public $_templates; /** * Build all the data structures needed to build the form. @@ -43,10 +43,7 @@ class CRM_Activity_Form_Task_Email extends CRM_Activity_Form_Task { 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->setContactIDs(); $this->assign('single', $this->_single); } @@ -56,7 +53,6 @@ public function preProcess() { public function buildQuickForm() { // Enable form element. $this->assign('emailTask', TRUE); - CRM_Contact_Form_Task_EmailCommon::buildQuickForm($this); } @@ -73,8 +69,7 @@ public function postProcess() { * @return array */ public function listTokens() { - $tokens = CRM_Core_SelectValues::contactTokens(); - return $tokens; + return CRM_Core_SelectValues::contactTokens(); } }