CRM-17878
authorWeb Access <rohan.katkar@webaccessglobal.com>
Thu, 28 Jan 2016 13:24:02 +0000 (18:54 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Thu, 28 Jan 2016 13:24:02 +0000 (18:54 +0530)
CRM/Contribute/Form/Contribution/Confirm.php
CRM/Contribute/Form/Contribution/ThankYou.php
templates/CRM/Contribute/Form/Contribution/Confirm.tpl
templates/CRM/Contribute/Form/Contribution/ThankYou.tpl

index ddc7ab67a8ff0f2ca1c3caf858aa4dafd5d5e816..9856174e4c578bed4758fb166842e7c2ea74cf00 100644 (file)
@@ -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;
index 4e431d891e4e4e715200ecde2812c7c9e8769ea7..073cbea3a6544aadc5a41ffe8b5dd6f6dc5451ef 100644 (file)
@@ -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));
   }
 
   /**
index 308e37d465166a5e24be5e1860edfaa56e3a0fbb..c3a2dd54cf2dedbf5be41cda4512e0efd0796fd5 100644 (file)
     {/if}
 
 
-    {if $onbehalfProfile|@count}
+    {if $onbehalfProfile|@count && $is_for_organization}
       <div class="crm-group onBehalf_display-group label-left crm-profile-view">
          {include file="CRM/UF/Form/Block.tpl" fields=$onbehalfProfile prefix='onbehalf'}
       </div>
index 15e9e305e05ab249244d9b787178e511ba2bc0ff..5057e200032fee6883e7c0793fdaab3809b6cbcc 100644 (file)
     </div>
   {/if}
 
-  {if $onbehalfProfile|@count}
+  {if $onbehalfProfile|@count && $is_for_organization}
     <div class="crm-group onBehalf_display-group label-left crm-profile-view">
       {include file="CRM/UF/Form/Block.tpl" fields=$onbehalfProfile prefix='onbehalf'}
      </div>