// be clearer & safer here
$permissions = CRM_Core_Permission::event(CRM_Core_Permission::VIEW);
- // check if we're in shopping cart mode for events
- $enable_cart = Civi::settings()->get('enable_cart');
- if ($enable_cart) {
- }
while ($dao->fetch()) {
if (!empty($permissions) && in_array($dao->event_id, $permissions)) {
$info = [];
$info['location'] = $address;
$info['url'] = CRM_Utils_System::url('civicrm/event/info', 'reset=1&id=' . $dao->event_id, TRUE, NULL, FALSE);
- if ($enable_cart) {
+ // @todo Move to eventcart extension
+ // check if we're in shopping cart mode for events
+ if ((bool) Civi::settings()->get('enable_cart')) {
$reg = CRM_Event_Cart_BAO_EventInCart::get_registration_link($dao->event_id);
$info['registration_link'] = CRM_Utils_System::url($reg['path'], $reg['query'], TRUE);
$info['registration_link_text'] = $reg['label'];
$a = (array) $participant;
$this->copyValues($a);
- $this->email = $participant['email'] ?? NULL;
+ $this->email = $a['email'] ?? NULL;
}
/**
}
// check if we're in shopping cart mode for events
- $enableCart = Civi::settings()->get('enable_cart');
- if (!$enableCart) {
+ if (!(bool) Civi::settings()->get('enable_cart')) {
unset($tabs['conference']);
}
WHERE e.id = %1
";
//Check if repeat is configured
- $eventHasParent = CRM_Core_BAO_RecurringEntity::getParentFor($eventID, 'civicrm_event');
+ CRM_Core_BAO_RecurringEntity::getParentFor($eventID, 'civicrm_event');
$params = [
1 => [$eventID, 'Integer'],
2 => [$eventNameMapping->getId(), 'Integer'],
+--------------------------------------------------------------------+
*/
-/**
- *
- * @package CRM
- * @copyright CiviCRM LLC https://civicrm.org/licensing
- * $Id$
- *
- */
-
/**
* This is page is for Event Dashboard
*/
CRM_Utils_System::setTitle(ts('CiviEvent'));
$eventSummary = CRM_Event_BAO_Event::getEventSummary();
- $enableCart = Civi::settings()->get('enable_cart');
- $eventSummary['tab'] = CRM_Event_Page_ManageEvent::tabs($enableCart);
+ $eventSummary['tab'] = CRM_Event_Page_ManageEvent::tabs();
$actionColumn = FALSE;
if (!empty($eventSummary) &&
$this->assign('location', $values['location']);
if (CRM_Core_Permission::check(['access CiviEvent', 'edit all events'])) {
- $enableCart = Civi::settings()->get('enable_cart');
- $this->assign('manageEventLinks', CRM_Event_Page_ManageEvent::tabs($enableCart));
+ $this->assign('manageEventLinks', CRM_Event_Page_ManageEvent::tabs());
}
return parent::run();
* @return array
* (reference) of tab links
*/
- public static function &tabs($enableCart) {
+ public static function &tabs() {
+ $enableCart = Civi::settings()->get('enable_cart');
$cacheKey = $enableCart ? 1 : 0;
if (!(self::$_tabLinks)) {
self::$_tabLinks = [];