From: Tim Mallezie Date: Wed, 2 Sep 2015 09:55:07 +0000 (+0200) Subject: CRM-17134 Add softcontributions to contribution message template X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a49aa7dd0f16ecff2a7d7c2d9fdb93813ae8c323;p=civicrm-core.git CRM-17134 Add softcontributions to contribution message template --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 0aeb690578..a5123448f7 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2481,6 +2481,11 @@ WHERE contribution_id = %1 "; $values['address'] = $addressDetails[0]['display']; } if ($this->_component == 'contribute') { + //get soft contributions + $softContributions = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($this->id, TRUE); + if (!empty($softContributions)) { + $values['softContributions'] = $softContributions['soft_credit']; + } if (isset($this->contribution_page_id)) { CRM_Contribute_BAO_ContributionPage::setValues( $this->contribution_page_id, @@ -2753,6 +2758,9 @@ WHERE contribution_id = %1 "; if (!empty($values['customGroup'])) { $template->assign('customGroup', $values['customGroup']); } + if (!empty($values['softContributions'])) { + $template->assign('softContributions', $values['softContributions']); + } if ($this->_component == 'event') { $template->assign('title', $values['event']['title']); $participantRoles = CRM_Event_PseudoConstant::participantRole();