if (CRM_Core_Permission::check('administer CiviCRM data') || !empty($permissions[CRM_Core_Permission::EDIT])) {
$tabs['reminder'] = ['title' => ts('Schedule Reminders'), 'class' => 'livePage'] + $default;
}
- $tabs['conference'] = ['title' => ts('Conference Slots')] + $default;
+
$tabs['friend'] = ['title' => ts('Tell a Friend')] + $default;
$tabs['pcp'] = ['title' => ts('Personal Campaigns')] + $default;
$tabs['repeat'] = ['title' => ts('Repeat')] + $default;
unset($tabs['repeat']['class']);
}
- // @todo Move to eventcart extension
- // check if we're in shopping cart mode for events
- if (!(bool) Civi::settings()->get('enable_cart')) {
- unset($tabs['conference']);
- }
-
$eventID = $form->getVar('_id');
if ($eventID) {
// disable tabs based on their configuration status
* @throws \CRM_Core_Exception
*/
public static function &tabs() {
- // @todo Move to eventcart extension
- // check if we're in shopping cart mode for events
- $enableCart = (bool) Civi::settings()->get('enable_cart');
-
- $cacheKey = $enableCart ? 1 : 0;
+ $cacheKey = 0;
if (!(self::$_tabLinks)) {
self::$_tabLinks = [];
}
'field' => 'reminder',
];
}
- self::$_tabLinks[$cacheKey]['conference']
- = [
- 'title' => ts('Conference Slots'),
- 'url' => 'civicrm/event/manage/conference',
- 'field' => 'slot_label_id',
- ];
self::$_tabLinks[$cacheKey]['friend']
= [
'title' => ts('Tell a Friend'),
];
}
- if (!$enableCart) {
- unset(self::$_tabLinks[$cacheKey]['conference']);
- }
-
CRM_Utils_Hook::tabset('civicrm/event/manage', self::$_tabLinks[$cacheKey], []);
return self::$_tabLinks[$cacheKey];
}
<adminGroup>CiviEvent</adminGroup>
<weight>399</weight>
</item>
- <item>
- <path>civicrm/admin/options/conference_slot</path>
- <title>Conference Slot Labels</title>
- <page_callback>CRM_Admin_Page_Options</page_callback>
- <desc>Define conference slots and labels.</desc>
- <access_arguments>administer CiviCRM,access CiviEvent</access_arguments>
- <adminGroup>CiviEvent</adminGroup>
- <weight>415</weight>
- </item>
<item>
<path>civicrm/admin/setting/preferences/event</path>
<title>CiviEvent Component Settings</title>
<is_ssl>true</is_ssl>
<weight>960</weight>
</item>
- <item>
- <path>civicrm/event/manage/conference</path>
- <title>Conference Slots</title>
- <page_callback>CRM_Event_Form_ManageEvent_Conference</page_callback>
- <access_arguments>access CiviEvent</access_arguments>
- <is_ssl>true</is_ssl>
- <weight>950</weight>
- </item>
<item>
<path>civicrm/event/add</path>
<path_arguments>action=add</path_arguments>
}
else {
$this->_paymentProcessorIDs = [$payment_processor_id];
- $this->assignPaymentProcessor(FALSE);
+ $this->_paymentProcessors = CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors([ucfirst($this->_mode) . 'Mode'], $this->_paymentProcessorIDs);
+
+ if (!empty($this->_paymentProcessors)) {
+ foreach ($this->_paymentProcessors as $paymentProcessorID => $paymentProcessorDetail) {
+ if (empty($this->_paymentProcessor) && $paymentProcessorDetail['is_default'] == 1 || (count($this->_paymentProcessors) == 1)
+ ) {
+ $this->_paymentProcessor = $paymentProcessorDetail;
+ $this->assign('paymentProcessor', $this->_paymentProcessor);
+ // Setting this is a bit of a legacy overhang.
+ $this->_paymentObject = $paymentProcessorDetail['object'];
+ }
+ }
+ // It's not clear why we set this on the form.
+ $this->set('paymentProcessors', $this->_paymentProcessors);
+ }
CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE, FALSE);
}
$this->assign('currency', $this->getCurrency());
<?php
require_once 'eventcart.civix.php';
-// phpcs:disable
-use CRM_Eventcart_ExtensionUtil as E;
-// phpcs:enable
+use CRM_Event_Cart_ExtensionUtil as E;
/**
* Implements hook_civicrm_config().
function eventcart_civicrm_entityTypes(&$entityTypes) {
_eventcart_civix_civicrm_entityTypes($entityTypes);
}
+
+function eventcart_civicrm_tabset($name, &$tabs) {
+ if ($name === 'civicrm/event/manage' && Civi::settings()->get('enable_cart')) {
+ $tabs['conference'] = [
+ 'title' => E::ts('Conference Slots'),
+ 'link' => NULL,
+ 'valid' => TRUE,
+ 'active' => TRUE,
+ 'current' => FALSE,
+ 'class' => 'ajaxForm',
+ 'url' => 'civicrm/event/manage/conference',
+ 'field' => 'slot_label_id',
+ ];
+ }
+}
<is_public>true</is_public>
<is_ssl>false</is_ssl>
</item>
+ <item>
+ <path>civicrm/admin/options/conference_slot</path>
+ <title>Conference Slot Labels</title>
+ <page_callback>CRM_Admin_Page_Options</page_callback>
+ <desc>Define conference slots and labels.</desc>
+ <access_arguments>administer CiviCRM,access CiviEvent</access_arguments>
+ <adminGroup>CiviEvent</adminGroup>
+ <weight>415</weight>
+ </item>
+ <item>
+ <path>civicrm/event/manage/conference</path>
+ <title>Conference Slots</title>
+ <page_callback>CRM_Event_Form_ManageEvent_Conference</page_callback>
+ <access_arguments>access CiviEvent</access_arguments>
+ <is_ssl>true</is_ssl>
+ <weight>950</weight>
+ </item>
</menu>