Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Price forms fixes: part of CRM-19517 + cleanup & symptom fix for CRM-19953 #9763

Merged
merged 5 commits into from
Feb 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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