Remove duplicated code and add a note about what this is all about
authorSeamus Lee <seamuslee001@gmail.com>
Fri, 29 Jul 2016 21:14:12 +0000 (07:14 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Mon, 1 Aug 2016 11:40:15 +0000 (21:40 +1000)
CRM/Contribute/Form/Task/PDF.php

index 6c064d0cb39cd88fec5f6f1dd013e0aec10be1b2..d4c111cdb764532cf8623297672b343f23f576d6 100644 (file)
@@ -154,10 +154,6 @@ AND    {$this->_componentClause}";
     $params = $this->controller->exportValues($this->_name);
     $elements = self::getElements($this->_contributionIds, $params, $this->_contactIds);
 
-    $fromEmail = $params['fromEmailAddress'];
-    $from = CRM_Utils_Array::value($fromEmail, $this->_emails);
-    $fromDetails = explode(' <', $from);
-
     foreach ($elements['details'] as $contribID => $detail) {
       $input = $ids = $objects = array();
 
@@ -201,6 +197,7 @@ AND    {$this->_componentClause}";
 
       $values = array();
       if (isset($params['fromEmailAddress']) && !$elements['createPdf']) {
+        // CRM-19129 Allow useres the choice of From Email to send the receipt from.
         $fromEmail = $params['fromEmailAddress'];
         $from = CRM_Utils_Array::value($fromEmail, $this->_emails);
         $fromDetails = explode(' <', $from);