<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
class CRM_Member_Form_MembershipView extends CRM_Core_Form {
/**
- * The action links that we need to display for the browse screen
+ * The action links that we need to display for the browse screen.
*
* @var array
- * @static
*/
static $_links = NULL;
/**
- * Add context information at the end of a link
+ * Add context information at the end of a link.
*
* @return string
* extra query parameters
}
/**
- * Get action Links
+ * Get action Links.
*
* @return array
* (reference) of action links
}
/**
- * Perform create or delete action on related memberships
+ * Perform create or delete action on related memberships.
*
* @param string $action
* Create or delete.
}
/**
- * Set variables up before form is built
+ * Set variables up before form is built.
*
* @return void
*/
if ($id) {
$params = array('id' => $id);
-
CRM_Member_BAO_Membership::retrieve($params, $values);
+ if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()) {
+ $finTypeId = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $values['membership_type_id'], 'financial_type_id');
+ $finType = CRM_Contribute_PseudoConstant::financialType($finTypeId);
+ if (!CRM_Core_Permission::check('view contributions of type ' . $finType)) {
+ CRM_Core_Error::fatal(ts('You do not have permissionn to access this page.'));
+ }
+ }
+ $this->assign('financialTypeId', $finType);
$membershipType = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($values['membership_type_id']);
// Do the action on related Membership if needed
}
/**
- * Build the form object
+ * Build the form object.
*
* @return void
*/
)
);
}
+
}