From: Eileen McNaughton Date: Sat, 23 Sep 2023 12:01:25 +0000 (+1200) Subject: Simplify a couple of lines of code X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2b12c53049a06c6cf8ae10c02d4a9c5b89aa96e5;p=civicrm-core.git Simplify a couple of lines of code --- 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