_id; $params = array(); $defaults = array(); if (isset($eventId)) { $params = array('id' => $eventId); } CRM_Event_BAO_Event::retrieve($params, $defaults); $defaults = array_merge($defaults, $parentDefaults); $defaults['id'] = $eventId; return $defaults; } /** * Function to build the form * * @return void * @access public */ public function buildQuickForm() { $slots = CRM_Core_OptionGroup::values('conference_slot'); $this->add('select', 'slot_label_id', ts('Conference Slot'), array( '' => ts('- select -')) + $slots, FALSE ); $this->addEntityRef('parent_event_id', ts('Parent Event'), array( 'entity' => 'event', 'placeholder' => ts('- any -'), 'select' => array('minimumInputLength' => 0), ) ); parent::buildQuickForm(); } public function postProcess() { $params = array(); $params = $this->exportValues(); if (trim($params['parent_event_name']) === '') { # believe me... $params['parent_event_id'] = ''; } //update events table $params['id'] = $this->_id; CRM_Event_BAO_Event::add($params); parent::endPostProcess(); } /** * Return a descriptive name for the page, used in wizard header * * @return string * @access public */ public function getTitle() { return ts('Conference Slots'); } }