<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
*/
/**
- *
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
- * This class generates form components for processing Event
- *
+ * This class generates form components for processing Event.
*/
class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
/**
- * The id of the event we are proceessing.
+ * The id of the event we are processing.
*
* @var int
*/
/**
* Set variables up before form is built.
- *
- * @return void
*/
public function preProcess() {
$config = CRM_Core_Config::singleton();
$this->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);
}
/**
- * 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();
/**
* Build the form object.
- *
- * @return void
*/
public function buildQuickForm() {
$session = CRM_Core_Session::singleton();