From 6d43e496aa938a46e5b09df9f915a58c54a003ca Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Mon, 3 Oct 2016 17:07:29 +0530 Subject: [PATCH] additional changes --- CRM/Contribute/Form/ContributionBase.php | 5 ++++- templates/CRM/UF/Form/Block.tpl | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index b0fa99acdf..0544744211 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -702,7 +702,10 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { $this->assign($name, $fields); - if (count($viewOnlyFileValues)) { + if ($profileContactType && count($viewOnlyFileValues[$profileContactType])) { + $this->assign('viewOnlyPrefixFileValues', $viewOnlyFileValues); + } + elseif (count($viewOnlyFileValues)) { $this->assign('viewOnlyFileValues', $viewOnlyFileValues); } diff --git a/templates/CRM/UF/Form/Block.tpl b/templates/CRM/UF/Form/Block.tpl index 7e7b525e23..76b85ac64c 100644 --- a/templates/CRM/UF/Form/Block.tpl +++ b/templates/CRM/UF/Form/Block.tpl @@ -135,8 +135,8 @@ {if $n eq 'organization_name' && !empty($form.onbehalfof_id)} {$form.onbehalfof_id.html} {/if} - {if $field.html_type eq 'File' && $viewOnlyFileValues.$prefix} - {$viewOnlyFileValues.$prefix.$n} + {if $field.html_type eq 'File' && $viewOnlyPrefixFileValues} + {$viewOnlyPrefixFileValues.$prefix.$n} {else} {$form.$prefix.$n.html} {/if} -- 2.25.1