function preProcess() { parent::preProcess(); $matches = array(); preg_match("/.*_(\\d+)_(\\d+)/", $this->getAttribute('name'), $matches); $event_id = $matches[1]; $participant_id = $matches[2]; $event_in_cart = $this->cart->get_event_in_cart_by_event_id($event_id); $this->conference_event = $event_in_cart->event; $this->main_participant = $event_in_cart->get_participant_by_id($participant_id); $this->contact_id = $this->main_participant->contact_id; $this->main_participant->display_name = CRM_Contact_BAO_Contact::displayName($this->contact_id); $events = new CRM_Event_BAO_Event(); $query = <<<EOS \t SELECT civicrm_event.*, slot.label AS slot_label FROM civicrm_event JOIN civicrm_option_value slot ON civicrm_event.slot_label_id = slot.value JOIN civicrm_option_group og ON slot.option_group_id = og.id \t WHERE \t\tparent_event_id = {$this->conference_event->id} AND civicrm_event.is_active = 1 AND COALESCE(civicrm_event.is_template, 0) = 0 AND og.name = 'conference_slot' \t ORDER BY \t\tslot.weight, start_date EOS; $events->query($query); while ($events->fetch()) { if (!array_key_exists($events->slot_label, $this->events_by_slot)) { $this->events_by_slot[$events->slot_label] = array(); } $this->events_by_slot[$events->slot_label][] = clone $events; } }