Ejemplo n.º 1
0
 public static function failureCodes($search_data = null, &$errors = array(), $customerservice)
 {
     $search = new customerServicesSearch();
     // Search by Failure Code
     $search->addSearchField('cs_failurecode_id', 'Failure Code', 'select', 'All', 'basic');
     $failurecodes = new CSFailureCode();
     $options = array('' => 'All');
     $options += $failurecodes->getAll();
     $search->setOptions('cs_failurecode_id', $options);
     // Search by Start Period
     $search->addSearchField('start', 'Start Period', 'select', 'All', 'advanced');
     $options = array('' => 'All');
     $options += $customerservice->periodList();
     $search->setOptions('start', $options);
     // Search by End Period
     $search->addSearchField('end', 'End Period', 'select', 'All', 'advanced');
     $search->setOptions('end', $options);
     $search->setSearchData($search_data, $errors, 'failureCodes');
     return $search;
 }
Ejemplo n.º 2
0
 public function failureCodeSummary()
 {
     $errors = array();
     $s_data = $this->setSearch();
     $customerservice = new CustomerServiceCollection($this->_templateobject);
     $sh = $customerservice->setSearch($s_data);
     $servicesummary = $customerservice->failureCodeSummary($sh);
     $this->search = customerServicesSearch::failureCodes($s_data, $errors, $customerservice);
     if (count($errors) > 0) {
         $flash = Flash::Instance();
         $flash->addErrors($errors);
         $this->search->clear();
     }
     $this->view->set('customerservice', $servicesummary);
     $sidebar = new SidebarController($this->view);
     $sidebar->addList('Actions', array('all' => array('link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'index')), 'tag' => 'Customer Service Summary'), 'failurecodes' => array('link' => array_merge($this->_modules, array('controller' => 'csfailurecodes', 'action' => 'index')), 'tag' => 'View Failure Codes')));
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
     $this->view->set('page_title', $this->getPageName('Failure Codes', 'Summary for'));
 }