_getList()->setIsDisabledLimit(true); if (null != $this->_restAlias && array_key_exists($this->_restAlias, $this->_getDataObj()->getReport4Select())) { $this->_getDataObj()->setReportId($this->_restAlias); } else { $this->_doc->display404(); } parent::_initAction(); } protected function _addListItem($list = null, $template = 'list.tpl') { App_Report_View::initTips(); $data = $this->_getDataObj()->getReportById($this->_getDataObj()->getReportId()); $item = array( 'dateDue' => !$data['dueDateMonth'] ? '-' : App_Report_AbstractObj::getMonthName($data['dueDateMonth']) . ' ' . $data['dueDateDay'], 'section' => $data['section'], 'topic' => $data['topic'], 'description' => $data['description'] == '' ? '-' : $data['description'], 'backUrl' => Qs_SiteMap::findFirst(null, array('type' => 'Report_Admin'), null, 'url'), 'tpl' => Qs_SiteMap::getTemplate('Report/detail.tpl') ); $this->_additem($item); $item = array( 'tpl' => Qs_SiteMap::getTemplate('Report/legend.tpl') ); $this->_additem($item); $this->_setTemplatePath(array('Report/Admin', 'ViewController')); $list = $list ? $list : $this->_getList(); $list->userReportDeleteUrl = $this->url(array('action' => 'deleteFile')); $list->userReportRejectUrl = $this->url(array('action' => 'rejectFile')); $list->dueDateMonth = $data['dueDateMonth']; $list->reportId = $this->_getDataObj()->getReportId(); $this->_doc->addStylesheet('css/jquery.fancybox.css'); $this->_doc->addScript('js/jquery.fancybox.js'); $params = array( 'containerId' => 'report-grid', 'requestUrl' => $this->url(), ); $this->_doc->addScript('js/app/report/admin/list.js'); $this->_doc->addInitObject('app.report.admin.List', array($params)); return parent::_addListItem($list, $template); } /** * @param Qs_ViewController_List $list * * @return $this */ protected function _bindListColumns($list) { $list->addColumn( 'text', 'name', array('title' => 'School Name', 'orderBy' => 'name') ); $list->addColumn( 'detailReports', 'reports', array('title' => 'Reports', 'attribs' => 'class=reports-column') ); return $this; } protected function _renderListRow(array $filter) { $this->_doc->setGroupName('ITEMS'); $this->_getDataObj()->setFilter(array('id' => $filter['schoolId'])); $this->_addListItem(); return $this->_doc->fetch(Qs_Sitemap::getTemplate('Doc/clean.tpl')); } }