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', 'view'); $collection = new DatasetCollection($this->_templateobject); $sh = $this->setSearchHandler($collection); $sh->addConstraintChain(ownerConstraint()); parent::index($collection, $sh); $sidebar = new SidebarController($this->view); $sidebar->addList('Actions', array('new' => array('link' => array('modules' => $this->_modules, 'controller' => $this->name, 'action' => 'new'), 'tag' => 'New Dataset'))); $this->view->register('sidebar', $sidebar); $this->view->set('sidebar', $sidebar); }