From de5ce535c0ea395be2233dd7eb2bfdf2f7ba0e79 Mon Sep 17 00:00:00 2001 From: Web Access Date: Thu, 28 Jan 2016 18:54:02 +0530 Subject: [PATCH] CRM-17878 --- CRM/Contribute/Form/Contribution/Confirm.php | 3 ++- CRM/Contribute/Form/Contribution/ThankYou.php | 1 + templates/CRM/Contribute/Form/Contribution/Confirm.tpl | 2 +- templates/CRM/Contribute/Form/Contribution/ThankYou.tpl | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index ddc7ab67a8..9856174e4c 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -378,6 +378,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr // assign contribution page id to the template so we can add css class for it $this->assign('contributionPageID', $this->_id); + $this->assign('is_for_organization', CRM_Utils_Array::value('is_for_organization', $this->_params)); $this->set('params', $this->_params); } @@ -2081,7 +2082,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr // If onbehalf-of-organization contribution / signup, add organization // and it's location. - if (isset($this->_values['onbehalf_profile_id']) && isset($behalfOrganization['organization_name'])) { + if (isset($this->_values['onbehalf_profile_id']) && isset($behalfOrganization['organization_name']) && !empty($this->_params['is_for_organization'])) { $ufFields = array(); foreach ($this->_fields['onbehalf'] as $name => $value) { $ufFields[$name] = 1; diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index 4e431d891e..073cbea3a6 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -66,6 +66,7 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont if ($this->_params['is_pay_later']) { $this->assign('pay_later_receipt', $this->_values['pay_later_receipt']); } + $this->assign('is_for_organization', CRM_Utils_Array::value('is_for_organization', $this->_params)); } /** diff --git a/templates/CRM/Contribute/Form/Contribution/Confirm.tpl b/templates/CRM/Contribute/Form/Contribution/Confirm.tpl index 308e37d465..c3a2dd54cf 100644 --- a/templates/CRM/Contribute/Form/Contribution/Confirm.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Confirm.tpl @@ -130,7 +130,7 @@ {/if} - {if $onbehalfProfile|@count} + {if $onbehalfProfile|@count && $is_for_organization}
{include file="CRM/UF/Form/Block.tpl" fields=$onbehalfProfile prefix='onbehalf'}
diff --git a/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl b/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl index 15e9e305e0..5057e20003 100644 --- a/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl +++ b/templates/CRM/Contribute/Form/Contribution/ThankYou.tpl @@ -188,7 +188,7 @@ {/if} - {if $onbehalfProfile|@count} + {if $onbehalfProfile|@count && $is_for_organization}
{include file="CRM/UF/Form/Block.tpl" fields=$onbehalfProfile prefix='onbehalf'}
-- 2.25.1