public function viewcreate_update() { $locations = Location::dictionary(); if (count($locations) > 1) { $locations = array('' => 'Select a Location...') + $locations; Event::$data->template->content->agentlist = array('' => 'Select a Location First...'); Event::$data->template->content->queuelist = array('' => 'Select a Location First...'); } else { $locid = key($locations); $agentlist = callcenter_agent::getagentsbylocation($locid); $agentoptions = ''; if (count($agentlist) < 1) { echo '<option value="">No agents found at location...</option>'; } else { foreach ($agentlist as $key => $agent) { $agentoptions[$agent['cca_id']] = $agent['cca_loginid'] . ' - ' . $agent['cca_displayname']; } } Event::$data->template->content->agentlist = $agentoptions; $queuelist = callcenter_queue::getqueuesbylocation($locid); $queueoptions = ''; if (count($queuelist) < 1) { echo '<option value="">No queues found at location...</option>'; } else { foreach ($queuelist as $key => $queue) { $queueoptions[$queue['ccq_id']] = $queue['ccq_name']; } } Event::$data->template->content->queuelist = $queueoptions; } Event::$data->template->content->locations = $locations; }
public static function dropdown($data, $selected = NULL, $extra = '') { // standardize the $data as an array, strings default to the class_type if (!is_array($data)) { $data = array('name' => $data); } // add in all the defaults if they are not provided $defaults = array('nullOption' => FALSE, 'multitenancy' => TRUE); $data = arr::merge($defaults, $data); $options = Location::dictionary($data['multitenancy']); if ($data['nullOption']) { array_unshift($options, $data['nullOption']); } $data = array_diff($data, $defaults); // use kohana helper to generate the markup return form::dropdown($data, $options, $selected, $extra); }
public function viewcreate_update() { Event::$data->template->content->locations = Location::dictionary(); Event::$data->template->content->mohoptions = callcenter_queue::getMOHOptions(); Event::$data->template->content->tbsoptions = callcenter_queue::getTBSOptions(); }
public function viewcreate_update() { Event::$data->template->content->locations = Location::dictionary(); Event::$data->template->content->agent_types = callcenter_agent::getTypes(); Event::$data->template->content->statuses = callcenter_agent::getStatuses(); }