Merge pull request #21513 from JKingsnorth/core-2846-1-improve-start-end-date-validation
[civicrm-core.git] / CRM / Event / Form / ManageEvent.php
index 74c595c4999b06129f199cb8a0fac22b7b24830b..4f2030fd849865a2bc8e52fd083a42ef8874a0a0 100644 (file)
@@ -88,10 +88,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
    * Set variables up before form is built.
    */
   public function preProcess() {
-    $config = CRM_Core_Config::singleton();
-    if (in_array('CiviEvent', $config->enableComponents)) {
-      $this->assign('CiviEvent', TRUE);
-    }
+    $this->assign('CiviEvent', CRM_Core_Component::isEnabled('CiviEvent'));
     CRM_Core_Form_RecurringEntity::preProcess('civicrm_event');
 
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add', 'REQUEST');
@@ -180,7 +177,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
     $ufEdit = CRM_ACL_API::group(CRM_Core_Permission::EDIT, NULL, 'civicrm_uf_group', $ufGroups);
     $checkPermission = [
       [
-        'administer CiviCRM',
+        'administer CiviCRM data',
         'manage event profiles',
       ],
     ];
@@ -354,8 +351,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
         [1 => CRM_Utils_Array::value('title', CRM_Utils_Array::value($subPage, $this->get('tabHeader')), $className)]
       ), $this->getTitle(), 'success');
 
-      $config = CRM_Core_Config::singleton();
-      if (in_array('CiviCampaign', $config->enableComponents)) {
+      if (CRM_Core_Component::isEnabled('CiviCampaign')) {
         $values = $this->controller->exportValues($this->_name);
         $newCampaignID = $values['campaign_id'] ?? NULL;
         $eventID = $values['id'] ?? NULL;