Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

Commit

Permalink
Fix drastik#239 hide configuration fields that we do not use
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Sep 4, 2020
1 parent 41e0579 commit e6fa943
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Releases use the following numbering system:
* Support translating text strings in javascript.
* Fix issues with popup notifications not showing in some circumstances (eg. "Card declined").
* Disable logging for `civicrm_stripe_paymentintent` table.
* Fix [#239](https://lab.civicrm.org/extensions/stripe/-/issues/239): Hide configuration fields that we don't use.

* Fix PHP notices:
* When a checking for an extension dependency that is not yet downloaded or installed.
Expand Down
12 changes: 10 additions & 2 deletions stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ function stripe_civicrm_buildForm($formName, &$form) {
// Do nothing, we won't attempt further stripe processing
}
break;

case 'CRM_Admin_Form_PaymentProcessor':
// Hide configuration fields that we don't use
foreach (['accept_credit_cards', 'url_site', 'url_recur', 'test_url_site', 'test_url_recur'] as $element)
if ($form->elementExists($element)) {
$form->removeElement($element);
}
break;
}
}

Expand All @@ -204,14 +212,14 @@ function stripe_civicrm_check(&$messages) {
* Implements hook_civicrm_navigationMenu().
*/
function stripe_civicrm_navigationMenu(&$menu) {
_stripe_civix_insert_navigation_menu($menu, 'Administer/CiviContribute', array(
_stripe_civix_insert_navigation_menu($menu, 'Administer/CiviContribute', [
'label' => E::ts('Stripe Settings'),
'name' => 'stripe_settings',
'url' => 'civicrm/admin/setting/stripe',
'permission' => 'administer CiviCRM',
'operator' => 'OR',
'separator' => 0,
));
]);
_stripe_civix_navigationMenu($menu);
}

Expand Down

0 comments on commit e6fa943

Please sign in to comment.