Skip to content

Commit

Permalink
Merge pull request #9763 from eileenmcnaughton/price_forms
Browse files Browse the repository at this point in the history
Price forms fixes: part of CRM-19517 + cleanup & symptom fix for CRM-19953
  • Loading branch information
eileenmcnaughton authored Feb 2, 2017
2 parents ebb3cec + 8268052 commit c7c6740
Show file tree
Hide file tree
Showing 9 changed files with 250 additions and 120 deletions.
28 changes: 27 additions & 1 deletion CRM/Financial/BAO/FinancialType.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,33 @@ public static function checkPermissionedLineItems($id, $op, $force = TRUE) {
}

/**
* Check if FT-ACL is turned on or off
* Check if the logged in user has permission to edit the given financial type.
*
* This is called when determining if they can edit things like option values
* in price sets. At the moment it is not possible to change an option value from
* a type you do not have permission to to a type that you do.
*
* @todo it is currently not possible to edit disabled types if you have ACLs on.
* Do ACLs still apply once disabled? That question should be resolved if tackling
* that gap.
*
* @param int $financialTypeID
*
* @return bool
*/
public static function checkPermissionToEditFinancialType($financialTypeID) {
if (!self::isACLFinancialTypeStatus()) {
return TRUE;
}
// @todo consider adding back in disabled types here.
CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($financialTypes, CRM_Core_Action::UPDATE);
return isset($financialTypes[$financialTypeID]);
}

/**
* Check if FT-ACL is turned on or off.
*
* @todo rename this function e.g isFinancialTypeACLsEnabled.
*
* @return bool
*/
Expand Down
8 changes: 3 additions & 5 deletions CRM/Price/BAO/PriceFieldValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2017
* $Id$
*
*/

/**
Expand All @@ -43,9 +41,9 @@ class CRM_Price_BAO_PriceFieldValue extends CRM_Price_DAO_PriceFieldValue {
* Insert/update a new entry in the database.
*
* @param array $params
* (reference), array $ids.
*
* @param $ids
* @param array $ids
* Deprecated variable.
*
* @return CRM_Price_DAO_PriceFieldValue
*/
Expand Down Expand Up @@ -157,7 +155,7 @@ public static function retrieve(&$params, &$defaults) {
}

/**
* Retrive the all values for given field id.
* Retrieve all values for given field id.
*
* @param int $fieldId
* Price_field_id.
Expand Down
Loading

0 comments on commit c7c6740

Please sign in to comment.