}
//Process this function only when you get this variable
if ($params['allowRepeatConfigToSubmit'] == 1) {
- if (CRM_Utils_Array::value('entity_table', $params) && CRM_Utils_Array::value('entity_id', $params) && $type) {
+ if (!empty($params['entity_table']) && !empty($params['entity_id']) && $type) {
$params['used_for'] = $type;
if (empty($params['parent_entity_id'])) {
$params['parent_entity_id'] = self::$_parentEntityId;
/**
* Check if repeating event.
*/
- protected $_isRepeatingEvent;
+ public $_isRepeatingEvent;
/**
* Set variables up before form is built.
$params['dateColumns'] = array('start_date');
$params['excludeDateRangeColumns'] = array('start_date', 'end_date');
$params['entity_table'] = 'civicrm_event';
+ $params['entity_id'] = $this->_id;
//Unset event id
unset($params['id']);
* @return array
*/
static public function getParticipantCountforEvent($listOfRelatedEntities = array()) {
+ $participantDetails = array();
if (!empty($listOfRelatedEntities)) {
$implodeRelatedEntities = implode(',', array_map(function ($entity) {
return $entity['id'];
WHERE p.event_id = e.id AND p.event_id IN ({$implodeRelatedEntities})
GROUP BY p.event_id";
$dao = CRM_Core_DAO::executeQuery($query);
- $participantDetails = array();
while ($dao->fetch()) {
$participantDetails['countByID'][$dao->event_id] = $dao->participant_count;
$participantDetails['countByName'][$dao->event_id][$dao->event_data] = $dao->participant_count;
class CRM_Event_Form_ManageEvent_TabHeader {
/**
- * @param CRM_Core_Form $form
+ * @param CRM_Event_Form_ManageEvent $form
*
* @return array
*/
}
/**
- * @param CRM_Core_Form $form
+ * @param CRM_Event_Form_ManageEvent $form
*
* @return array
* @throws Exception
$tabs['pcp'] = array('title' => ts('Personal Campaigns')) + $default;
$tabs['repeat'] = array('title' => ts('Repeat')) + $default;
+ // Repeat tab must refresh page when switching repeat mode so js & vars will get set-up
+ if (!$form->_isRepeatingEvent) {
+ unset($tabs['repeat']['class']);
+ }
+
// check if we're in shopping cart mode for events
$enableCart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
'enable_cart'
}
/**
- * @param $form
+ * @param CRM_Event_Form_ManageEvent $form
*/
public static function reset(&$form) {
$tabs = self::process($form);