X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FPage%2FManageEvent.php;h=3183936fedb8261c039c1ab542e7f6d382c61598;hb=a4d42ed6184ae28d52b0273bcb53597b87605f26;hp=7af2bac53cba40e17f1d803455e6734e47dbbc66;hpb=86d6172a4e2d39cd119eead245fcb31106b66972;p=civicrm-core.git diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index 7af2bac53c..3183936fed 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -1,9 +1,9 @@ array( 'name' => ts('Disable'), - 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Event_BAO_Event' . '\',\'' . 'enable-disable' . '\' );"', - 'ref' => 'disable-action', + 'ref' => 'crm-enable-disable', 'title' => ts('Disable Event'), ), CRM_Core_Action::ENABLE => array( 'name' => ts('Enable'), - 'extra' => 'onclick = "enableDisable( %%id%%,\'' . 'CRM_Event_BAO_Event' . '\',\'' . 'disable-enable' . '\' );"', - 'ref' => 'enable-action', + 'ref' => 'crm-enable-disable', 'title' => ts('Enable Event'), ), CRM_Core_Action::DELETE => array( @@ -102,6 +100,8 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { /** * Get tab Links for events * + * @param $enableCart + * * @return array (reference) of tab links */ static function &tabs($enableCart) { @@ -110,48 +110,58 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { self::$_tabLinks = array(); } if (!isset(self::$_tabLinks[$cacheKey])) { - self::$_tabLinks[$cacheKey] = array( - 'settings' => array( + self::$_tabLinks[$cacheKey]['settings'] = + array( 'title' => ts('Info and Settings'), 'url' => 'civicrm/event/manage/settings', 'field' => 'id' - ), - 'location' => array( + ); + self::$_tabLinks[$cacheKey]['location'] = + array( 'title' => ts('Location'), 'url' => 'civicrm/event/manage/location', 'field' => 'loc_block_id', - ), - 'fee' => array( + ); + + self::$_tabLinks[$cacheKey]['fee'] = + array( 'title' => ts('Fees'), 'url' => 'civicrm/event/manage/fee', 'field' => 'is_monetary', - ), - 'registration' => array( + ); + self::$_tabLinks[$cacheKey]['registration'] = + array( 'title' => ts('Online Registration'), 'url' => 'civicrm/event/manage/registration', 'field' => 'is_online_registration', - ), - 'reminder' => array( + ); + if (CRM_Core_Permission::check('administer CiviCRM')) { + self::$_tabLinks[$cacheKey]['reminder'] = + array( 'title' => ts('Schedule Reminders'), 'url' => 'civicrm/event/manage/reminder', 'field' => 'reminder', - ), - 'conference' => array( + ); + } + self::$_tabLinks[$cacheKey]['conference'] = + array( 'title' => ts('Conference Slots'), 'url' => 'civicrm/event/manage/conference', 'field' => 'slot_label_id', - ), - 'friend' => array( + ); + self::$_tabLinks[$cacheKey]['friend'] = + array( 'title' => ts('Tell a Friend'), 'url' => 'civicrm/event/manage/friend', 'field' => 'friend', - ), - 'pcp' => array( + ); + self::$_tabLinks[$cacheKey]['pcp'] = + array( 'title' => ts('Personal Campaign Pages'), 'url' => 'civicrm/event/manage/pcp', 'field' => 'is_pcp_enabled', - ), - ); + ); + } if (!$enableCart) { @@ -351,7 +361,7 @@ ORDER BY start_date desc $manageEvent[$dao->id]['reminder'] = CRM_Core_BAO_ActionSchedule::isConfigured($dao->id, $mappingID); $manageEvent[$dao->id]['is_pcp_enabled'] = CRM_Utils_Array::value($dao->id, $eventPCPS); $manageEvent[$dao->id]['event_type'] = CRM_Utils_Array::value($manageEvent[$dao->id]['event_type_id'], $eventType); - + // allow hooks to set 'field' value which allows configuration pop-up to show a tab as enabled/disabled CRM_Utils_Hook::tabset('civicrm/event/manage/rows', $manageEvent, array('event_id' => $dao->id)); } @@ -406,6 +416,13 @@ ORDER BY start_date desc $form->run(); } + /** + * @param $params + * @param bool $sortBy + * @param $force + * + * @return string + */ function whereClause(&$params, $sortBy = TRUE, $force) { $values = array(); $clauses = array(); @@ -494,6 +511,10 @@ ORDER BY start_date desc return !empty($clauses) ? implode(' AND ', $clauses) : '(1)'; } + /** + * @param $whereClause + * @param $whereParams + */ function pager($whereClause, $whereParams) { $params['status'] = ts('Event %%StatusMessage%%'); @@ -516,6 +537,10 @@ SELECT count(id) $this->assign_by_ref('pager', $this->_pager); } + /** + * @param $whereClause + * @param $whereParams + */ function pagerAtoZ($whereClause, $whereParams) { $query = "