public function index() { $errors = array(); $s_data = array(); if (!empty($this->_data['tablename'])) { $s_data['tablename'] = $this->_data['tablename']; } $this->setSearch('reportsSearch', 'useDefault', $s_data); $this->view->set('clickaction', 'view'); $reports = new ReportCollection($this->_templateobject); $sh = $this->setSearchHandler($reports); $cc = ownerConstraint(); $hasreport = new HasReport(); $report_list = $hasreport->getByRoles(); if (!empty($report_list)) { $cc->add(new Constraint('id', 'in', '(' . implode(',', array_keys($report_list)) . ')'), 'OR'); } $sh->addConstraintChain($cc); parent::index($reports, $sh); $sidebar = new SidebarController($this->view); $sidebarlist = array(); $sidebarlist['new_any'] = array('tag' => 'New Report', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'new')); if (!empty($this->_data['tablename'])) { $sidebarlist['new_this'] = array('tag' => 'New Report for ' . $this->_data['tablename'], 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'new', 'tablename' => $this->_data['tablename'])); } $sidebar->addList('Actions', $sidebarlist); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }
public function index() { $this->view->set('clickaction', 'edit'); parent::index(new CSFailureCodeCollection($this->_templateobject)); $sidebar = new SidebarController($this->view); $sidebar->addList('Actions', array('new' => array('link' => array_merge($this->_modules, array('controller' => $this->name, 'action' => 'new')), 'tag' => 'New Failure Code'), 'summary' => array('link' => array_merge($this->_modules, array('controller' => 'customerservices', 'action' => 'index')), 'tag' => 'Customer Service Summary'))); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }
public function index() { $errors = array(); $this->setSearch('TicketsSearch', 'useDefault'); parent::index(new TicketCollection($this->_templateobject)); $this->view->set('no_delete', true); $this->view->set('clickaction', 'view'); $sidebar = new SidebarController($this->view); $sidebar->addList('Actions', array('new' => array('link' => array('module' => 'ticketing', 'controller' => 'tickets', 'action' => 'new'), 'tag' => 'New Ticket'))); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }
public function index() { $errors = array(); $s_data = array(); $this->setSearch('outputSearch', 'useDefault', $s_data); $this->view->set('clickaction', 'edit'); $reports = new ReportDefinitionCollection($this->_templateobject); parent::index($reports); $sidebar = new SidebarController($this->view); $sidebarlist = array(); $sidebarlist['new'] = array('tag' => 'New Report Definition', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'new')); $sidebar->addList('Actions', $sidebarlist); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }
public function index() { $errors = array(); $s_data = array(); // Set context from calling module $this->setSearch('UzletSearch', 'Uzlets', $s_data); $this->view->set('clickaction', 'edit'); $uzlets = new UzletCollection($this->_uses[$this->modeltype]); parent::index($uzlets); $sidebar = new SidebarController($this->view); $sidebarlist = array(); $sidebarlist['new'] = array('tag' => 'New uzLet', 'link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'new')); $sidebar->addList('Actions', $sidebarlist); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }
protected function getComponents($_selected_ids = '') { // load the default display fields into the session // we need these as we cannot rely on getting the headings from the data itself $target = new $this->targetModel(); $collection_name = $this->targetModel . 'Collection'; $collection = new $collection_name($this->targetModel); if (empty($_selected_ids)) { return $collection; } if (!is_array($_selected_ids)) { $_selected_ids = array($_selected_ids); } // $sh = new SearchHandler($collection, FALSE); $sh = $this->setSearchHandler($collection, 'selector_components'); $sh->addConstraint(new constraint('id', 'in', '(' . implode(',', $_selected_ids) . ')')); // $sh->extractFields(); // $collection->load($sh); $this->search = null; if (isset($this->_data['ajax_print'])) { $sh->setLimit(0); } parent::index($collection, $sh); return $collection; }