CRM-16526 CIVI-3 Bug fix for permission for API
authorEdsel <edsel.lopez@jmaconsulting.biz>
Mon, 8 Feb 2016 13:01:08 +0000 (18:31 +0530)
committerPradeep Nayak <pradpnayak@gmail.com>
Mon, 22 Feb 2016 18:11:38 +0000 (23:41 +0530)
----------------------------------------
* CRM-16526: ACLs for Financial Types
  https://issues.civicrm.org/jira/browse/CRM-16526

api/v3/Contribution.php

index 1ac600a5b69b60fc800cac97bb44ed2e4d5fd59f..6ab0c195e8bf30415535da11a50af87c87bfcca0 100644 (file)
@@ -48,7 +48,7 @@ function civicrm_api3_contribution_create(&$params) {
 
   if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()) {
     if (empty($params['id'])) {
-      $op = 'add';
+      $op = CRM_Core_Action::ADD;
     }
     else {
       if (empty($params['financial_type_id'])) {
@@ -57,7 +57,7 @@ function civicrm_api3_contribution_create(&$params) {
           'return' => 'financial_type_id',
         ));
       }
-      $op = 'edit';
+      $op = CRM_Core_Action::UPDATE;
     }
     CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($types, $op);
     if (!in_array($params['financial_type_id'], array_keys($types))) {