X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FForm%2FManageEvent.php;h=d759c0f4a13a8a87493f210d17dc2260540a45f1;hb=8b9023b8443e43410926f38892d94e774d9468b2;hp=b2ab7e354183cdac7170b968646779be76e6a1b3;hpb=f85b80630e8324121dcdef2d7aacd432946b541f;p=civicrm-core.git diff --git a/CRM/Event/Form/ManageEvent.php b/CRM/Event/Form/ManageEvent.php index b2ab7e3541..d759c0f4a1 100644 --- a/CRM/Event/Form/ManageEvent.php +++ b/CRM/Event/Form/ManageEvent.php @@ -1,7 +1,7 @@ assign('isRepeatingEntity', $isRepeatingEntity); } + // CRM-16776 - show edit/copy/create buttons for Profiles if user has required permission. + $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); + $ufCreate = CRM_ACL_API::group(CRM_Core_Permission::CREATE, NULL, 'civicrm_uf_group', $ufGroups); + $ufEdit = CRM_ACL_API::group(CRM_Core_Permission::EDIT, NULL, 'civicrm_uf_group', $ufGroups); + $checkPermission = array( + array( + 'administer CiviCRM', + 'manage event profiles', + ), + ); + if (CRM_Core_Permission::check($checkPermission) || !empty($ufCreate) || !empty($ufEdit)) { + $this->assign('perm', TRUE); + } + // also set up tabs CRM_Event_Form_ManageEvent_TabHeader::build($this); @@ -242,11 +250,9 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { } /** - * Set default values for the form. For edit/view mode - * the default values are retrieved from the database + * Set default values for the form. * - * - * @return void + * For edit/view mode the default values are retrieved from the database. */ public function setDefaultValues() { $defaults = array(); @@ -273,8 +279,6 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { /** * Build the form object. - * - * @return void */ public function buildQuickForm() { $session = CRM_Core_Session::singleton();