/** * Retrieve system report grid blocks * * @return array */ public function getGrids() { $grids = array(); $gridsData = $this->getGridsData(); if (!$this->hasGridsData() || empty($gridsData) || !is_array($gridsData)) { return $grids; } foreach ($this->getGridsData() as $reports) { foreach ($reports as $title => $data) { $grids[$title] = new Varien_Object(); if (!empty($data['error'])) { $grids[$title]->setDataCount(0); $grids[$title]->setError($data['error']); continue; } /** @var Enterprise_Support_Block_Adminhtml_Sysreport_View_Tab_Grid $block */ $block = $this->getLayout()->createBlock('enterprise_support/adminhtml_sysreport_view_tab_grid'); $block->setId('grid_' . md5($title))->setGridData($data); $grids[$title]->setDataCount($this->_dataHelper->getSysReportDataCount($data)); $grids[$title]->setGridObject($block); } } return $grids; }
/** * Renders grid column * * @param Varien_Object $row * @return mixed */ public function _getValue(Varien_Object $row) { $rawText = parent::_getValue($row); $text = $this->_dataHelper->getReportValueText($rawText); return $this->_htmlHelper->getGridCellHtml($text, $rawText); }
/** * Generate system reports by specified report types * * @param string|array $types * * @return array */ public function generateReport($types) { $commands = $this->_dataHelper->getSysReportCommandsListByReportTypes($types); return $this->getTool()->run($commands)->getReport(); }