mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 21:43:18 +00:00
fix #138 report / user downloads
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -18,9 +18,15 @@
|
||||
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()
|
||||
@@ -58,11 +64,13 @@ 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() ? : '';
|
||||
|
||||
// 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();
|
||||
@@ -141,7 +149,8 @@ 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);
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user