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 21:34:34 +0000 (07:34 +1000)
CRM/Contribute/Form/Task/PDF.php

index 7304458e064205e89d2b60912696febff1ff70b8..e1003561c96f58e84bb26a344372d869a2622da2 100644 (file)
@@ -162,10 +162,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();
 
@@ -203,6 +199,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);