From 2b12c53049a06c6cf8ae10c02d4a9c5b89aa96e5 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sun, 24 Sep 2023 00:01:25 +1200 Subject: [PATCH] Simplify a couple of lines of code --- CRM/Event/Form/Registration/Register.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index c0f4b6bada..4d51e8c1c5 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -592,15 +592,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { $form->add('hidden', 'priceSetId', $priceSetID); // CRM-14492 Admin price fields should show up on event registration if user has 'administer CiviCRM' permissions - $adminFieldVisible = FALSE; - if (CRM_Core_Permission::check('administer CiviCRM data')) { - $adminFieldVisible = TRUE; - } - - $hideAdminValues = TRUE; - if (CRM_Core_Permission::check('edit event participants')) { - $hideAdminValues = FALSE; - } + $adminFieldVisible = CRM_Core_Permission::check('administer CiviCRM data'); + $hideAdminValues = !CRM_Core_Permission::check('edit event participants'); foreach ($form->_feeBlock as $field) { // public AND admin visibility fields are included for back-office registration and back-office change selections -- 2.25.1