setView('TaoEventLog/log.tpl'); } /** * Load json data with results * dates for GUI should be in user time zone */ public function search() { $this->returnJson(new EventLogDatatable()); } /** * Export log entries from database to csv file * dates should be in UTC * * @throws \Exception */ public function export() { $delimiter = $this->getParameter('field_delimiter', ','); $enclosure = $this->getParameter('field_encloser', '"'); $sortBy = $this->getParameter('sortby', ''); $sortOrder = $this->getParameter('sortorder', ''); $exportParameters = []; if ($this->hasRequestParameter('filtercolumns')) { $parameters = $this->getRequestParameter('filtercolumns'); if (is_array($parameters)) { $exportParameters = $parameters; } } $csvExporter = new LogEntryCsvStdOutExporter( new LogEntryRepository($exportParameters, $sortBy, $sortOrder), $delimiter, $enclosure ); setcookie('fileDownload', 'true', 0, '/'); $csvExporter->export(); } /** * @param string $name * @param mixed $defaultValue * * @return string */ protected function getParameter($name, $defaultValue) { return $this->hasRequestParameter($name) ? html_entity_decode($this->getRequestParameter($name)) : $defaultValue; } }