File tree 1 file changed +2
-8
lines changed
1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -491,7 +491,7 @@ public function setDefaultValues() {
491
491
public function buildQuickForm () {
492
492
493
493
// FIXME: This probably needs to be done in preprocess
494
- if ($ this ->_action & CRM_Core_Action::UPDATE ) {
494
+ if ($ this ->_action & CRM_Core_Action::UPDATE && CRM_Utils_Array:: value ( ' financial_type_id ' , $ this -> _values ) ) {
495
495
$ financialTypeID = CRM_Contribute_PseudoConstant::financialType ($ this ->_values ['financial_type_id ' ]);
496
496
if (!CRM_Core_Permission::check ('edit contributions of type ' . $ financialTypeID )) {
497
497
CRM_Core_Error::fatal (ts ('You do not have permission to access this page. ' ));
@@ -651,13 +651,7 @@ public function buildQuickForm() {
651
651
$ attributes = CRM_Core_DAO::getAttribute ('CRM_Contribute_DAO_Contribution ' );
652
652
653
653
// Check permissions for financial type first
654
- $ financialTypes = CRM_Contribute_PseudoConstant::financialType ();
655
-
656
- foreach ($ financialTypes as $ finTypeId => $ type ) {
657
- if (!CRM_Core_Permission::check ('add new contributions of type ' . $ type )) {
658
- unset($ financialTypes [$ finTypeId ]);
659
- }
660
- }
654
+ CRM_Financial_BAO_FinancialType::addFinancialTypes ($ financialTypes );
661
655
662
656
$ financialType = $ this ->add ('select ' , 'financial_type_id ' ,
663
657
ts ('Financial Type ' ),
You can’t perform that action at this time.
0 commit comments