From 895d596dee8ac429e2bbe8b78cf102672e2d4819 Mon Sep 17 00:00:00 2001 From: Edsel Date: Tue, 14 Jul 2015 18:28:16 +0530 Subject: [PATCH] ICM-17 Added conditions in template files for ACL Fts --- CRM/Contribute/Form/ContributionView.php | 3 +++ CRM/Financial/BAO/FinancialType.php | 3 +++ CRM/Member/Form/MembershipView.php | 3 +++ .../CRM/Contribute/Form/ContributionView.tpl | 10 ++++++---- templates/CRM/Member/Form/MembershipView.tpl | 16 ++++++++-------- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/CRM/Contribute/Form/ContributionView.php b/CRM/Contribute/Form/ContributionView.php index 63e2eabb93..62580e0a00 100644 --- a/CRM/Contribute/Form/ContributionView.php +++ b/CRM/Contribute/Form/ContributionView.php @@ -60,6 +60,9 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form { CRM_Core_Error::fatal(ts('You do not have permission to access this page.')); } } + elseif ($this->_action & CRM_Core_Action::VIEW) { + $this->assign('noACL', TRUE); + } CRM_Contribute_BAO_Contribution::resolveDefaults($values); $cancelledStatus = TRUE; $status = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); diff --git a/CRM/Financial/BAO/FinancialType.php b/CRM/Financial/BAO/FinancialType.php index 537a50603a..8d1297200c 100644 --- a/CRM/Financial/BAO/FinancialType.php +++ b/CRM/Financial/BAO/FinancialType.php @@ -290,6 +290,9 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType { } public static function checkPermissionedLineItems($id, $op, $force = TRUE) { + if (!self::isACLFinancialTypeStatus()) { + return TRUE; + } $lineItems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($id); $flag = FALSE; foreach ($lineItems as $items) { diff --git a/CRM/Member/Form/MembershipView.php b/CRM/Member/Form/MembershipView.php index b72fff1a92..11fb2e13a2 100644 --- a/CRM/Member/Form/MembershipView.php +++ b/CRM/Member/Form/MembershipView.php @@ -166,6 +166,9 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form { CRM_Core_Error::fatal(ts('You do not have permissionn to access this page.')); } } + else { + $this->assign('noACL', TRUE); + } $this->assign('financialTypeId', $finType); $membershipType = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($values['membership_type_id']); diff --git a/templates/CRM/Contribute/Form/ContributionView.tpl b/templates/CRM/Contribute/Form/ContributionView.tpl index f8012fb89c..27a911fd9e 100644 --- a/templates/CRM/Contribute/Form/ContributionView.tpl +++ b/templates/CRM/Contribute/Form/ContributionView.tpl @@ -26,7 +26,8 @@