Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
require_once 'CDM/Utils.php'; $events = CDM_Utils::getEvents( ); if ( ! empty( $events ) ) { $this->_multiValued['events'] = $events; $this->addElement( 'advmultiselect', 'events', ts( 'Events' ), $events, array('size' => 5, 'style' => 'width:200px', 'class' => 'advmultiselect') ); }
class CDM_Utils { static function getEvents( ) { require_once 'CRM/Event/BAO/Event.php'; $eventInfo = CRM_Event_BAO_Event::getCompleteInfo( ); if ( ! empty( $eventInfo ) ) { $events = array( ); foreach ( $eventInfo as $info ) { $events[$info['event_id']] = $info['title']; } return $events; } return null; }
<?phpecho "test\n"; require_once 'CRM/Event/BAO/Event.php'; $eventInfo = CRM_Event_BAO_Event::getCompleteInfo( );print_r($eventInfo);
<?phpecho "test\n"; require_once 'CRM/Event/BAO/Event.php'; $all = CRM_Event_BAO_Event::getCompleteInfo( );print_r($all);