$event_type = CRM_Core_OptionGroup::values('event_type', FALSE);
- foreach ($event_type as $eventId => $eventName) {
- $this->addElement('checkbox', "event_type_id[$eventId]", 'Event Type', $eventName);
- }
+ $this->add('select', 'event_type_id', ts('Event type'), $event_type, FALSE, array('class' => 'crm-select2 huge', 'multiple' => TRUE));
$eventsByDates = array();
$searchOption = array(ts('Show Current and Upcoming Events'), ts('Search All or by Date Range'));
}
$value = $this->get('event_type_id');
- $val = array();
if ($value) {
if (is_array($value)) {
- foreach ($value as $k => $v) {
- if ($v) {
- $val[$k] = $k;
- }
- }
- $type = implode(',', $val);
+ $type = implode(',', $value);
}
$clauses[] = "event_type_id IN ({$type})";
}
<div style="height: auto; vertical-align: bottom">{$form.eventsByDates.html}</div>
</td>
<td rowspan="2"><label>{ts}Event Type{/ts}</label>
- <div class="listing-box">
- {foreach from=$form.event_type_id item="event_val"}
- <div class="{cycle values="odd-row,even-row"}">
- {$event_val.html}
- </div>
- {/foreach}
- </div>
+ {$form.event_type_id.html}
</td>
<td class="right" rowspan="2"> {include file="CRM/common/formButtons.tpl"}</td>
</tr>