diff --git a/lib/classes/module/report/download.class.php b/lib/classes/module/report/download.class.php index f6fb027906..7e6f69ff12 100644 --- a/lib/classes/module/report/download.class.php +++ b/lib/classes/module/report/download.class.php @@ -28,7 +28,7 @@ class module_report_download extends module_report 'usrid' => 'log.usrid', 'coll_id' => 'record.coll_id', 'xml' => 'record.xml', - 'ddate' => "log.date", + 'ddate' => "log_docs.date", 'id' => 'log_docs.id', 'log_id' => 'log_docs.log_id', 'record_id' => 'log_docs.record_id', @@ -39,6 +39,7 @@ class module_report_download extends module_report 'file' => 'subdef.file' ); + protected $isInformative; /** * constructor * @@ -277,5 +278,16 @@ class module_report_download extends module_report return $array; } + public function IsInformative() + { + return $this->isInformative; + } + + public function setIsInformative($isInformative) + { + $this->isInformative = $isInformative; + } + + } diff --git a/lib/classes/module/report/sqldownload.class.php b/lib/classes/module/report/sqldownload.class.php index b9de558c26..bc54ddccf4 100644 --- a/lib/classes/module/report/sqldownload.class.php +++ b/lib/classes/module/report/sqldownload.class.php @@ -18,17 +18,23 @@ class module_report_sqldownload extends module_report_sql implements module_report_sqlReportInterface { + protected $restrict = false; + public function __construct(module_report $report) { parent::__construct($report); + if($report->isInformative()) + { + $this->restrict = true; + } } public function buildSql() { $registry = registry::get_instance(); $report_filters = $this->filter->getReportFilter(); - $record_filters = $this->filter->getRecordFilter() ?: array('sql'=>'', 'params'=> array()); - $this->params = array_merge($report_filters['params'], $record_filters['params']); + $record_filters = $this->filter->getRecordFilter() ? : array('sql' => '', 'params' => array()); + $this->params = array_merge($report_filters['params'], $record_filters['params']); if ($this->groupby == false) { @@ -58,17 +64,19 @@ class module_report_sqldownload extends module_report_sql implements module_repo $this->sql .= $report_filters['sql'] ? : ''; $this->sql .= ' AND ( log_docs.action = \'download\' OR log_docs.action = \'mail\')'; - + if($this->restrict) + $this->sql .= ' AND ( log_docs.final = "document" OR log_docs.final = "preview")'; $this->sql .= empty($record_filters['sql']) ? '' : ' AND ( ' . $record_filters['sql'] . ' )'; - $this->sql .= $this->filter->getOrderFilter() ?: ''; + $this->sql .= $this->filter->getOrderFilter() ? : ''; +// var_dump(str_replace(array_keys($this->params), array_values($this->params), $this->sql), $this->sql, $this->params); $stmt = $this->connbas->prepare($this->sql); $stmt->execute($this->params); $this->total_row = $stmt->rowCount(); $stmt->closeCursor(); - $this->sql .= $this->filter->getLimitFilter() ?: ''; + $this->sql .= $this->filter->getLimitFilter() ? : ''; } else { @@ -141,14 +149,15 @@ class module_report_sqldownload extends module_report_sql implements module_repo $this->sql .= ( $name == 'record_id' && $this->on == 'DOC') ? ' , final' : ''; - if ($this->filter->getOrderFilter()) $this->sql .= $this->filter->getOrderFilter(); + if ($this->filter->getOrderFilter()) + $this->sql .= $this->filter->getOrderFilter(); $stmt = $this->connbas->prepare($this->sql); $stmt->execute($this->params); $this->total = $stmt->rowCount(); $stmt->closeCursor(); - $this->sql .= $this->filter->getLimitFilter() ?: ''; + $this->sql .= $this->filter->getLimitFilter() ? : ''; } return $this; diff --git a/www/report/tab.php b/www/report/tab.php index 7da2bbb74b..664ac07e2c 100644 --- a/www/report/tab.php +++ b/www/report/tab.php @@ -396,8 +396,9 @@ function getHistory($obj, $param, $twig, $conf, $dl = false, $title) elseif (!empty($param['on']) && !empty($param['user'])) $filter->addfilter($param['on'], '=', $param['user']); if ($dl) - $filter->addfilter("(log_docs.final = 'document'", "OR", "log_docs.final = 'preview')"); - + { + $obj->setIsInformative(true); + } $tab_filter = $filter->getTabFilter(); $obj->setFilter($tab_filter); diff --git a/www/skins/report/report-table.css b/www/skins/report/report-table.css index dba1e017e7..47e5c349e3 100644 --- a/www/skins/report/report-table.css +++ b/www/skins/report/report-table.css @@ -129,6 +129,7 @@ iframe{ padding: 0 auto; clear:both; margin-bottom:10px; + overflow:auto; } .report-table table { @@ -417,15 +418,11 @@ table.tablesorter tr th.SortDown { } .onload{ - background-image:url(ajax-loader.gif); - background-position:center center; - background-repeat:no-repeat; -} -.onloadd{ background-image:url(ajax-loader2.gif); background-position:center center; background-repeat:no-repeat; } + .ui-tabs, .ui-tabs .ui-tabs-panel{ padding:0; }