mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
Fix merge 3.8
This commit is contained in:
@@ -233,12 +233,8 @@ class module_report
|
||||
/**
|
||||
*
|
||||
*/
|
||||
<<<<<<< HEAD
|
||||
protected $cor_query = [];
|
||||
=======
|
||||
protected $dateField = 'log.date';
|
||||
protected $cor_query = array();
|
||||
>>>>>>> 3.8
|
||||
protected $isInformative;
|
||||
|
||||
/**
|
||||
@@ -840,14 +836,8 @@ class module_report
|
||||
return $this->report;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
$databox = $this->app['phraseanet.appbox']->get_databox($this->sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
=======
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
|
||||
|
||||
$conn = connection::getPDOConnection($this->app, $this->sbas_id);
|
||||
>>>>>>> 3.8
|
||||
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
|
||||
|
||||
@@ -861,15 +851,7 @@ class module_report
|
||||
$stmt->execute($this->params);
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
<<<<<<< HEAD
|
||||
} catch (DBALException $e) {
|
||||
=======
|
||||
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\ncount==%s\n\n", __FILE__, __LINE__, count($rs)), FILE_APPEND);
|
||||
|
||||
} catch (PDOException $e) {
|
||||
>>>>>>> 3.8
|
||||
echo $e->getMessage();
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -886,12 +868,7 @@ class module_report
|
||||
$this->buildResult($this->app, $rs);
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
|
||||
//calculate prev and next page
|
||||
<<<<<<< HEAD
|
||||
$this->calculatePages();
|
||||
=======
|
||||
$this->calculatePages($rs);
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
|
||||
>>>>>>> 3.8
|
||||
//do we display navigator ?
|
||||
$this->setDisplayNav();
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
|
||||
|
@@ -141,7 +141,6 @@ class module_report_activity extends module_report
|
||||
return $this->report;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
/**
|
||||
* Get all questions by user
|
||||
*
|
||||
@@ -195,8 +194,6 @@ class module_report_activity extends module_report
|
||||
|
||||
return $this->result;
|
||||
}
|
||||
=======
|
||||
>>>>>>> 3.8
|
||||
|
||||
// ================== Site activity : Top questions (le second radio ...) ================
|
||||
/**
|
||||
@@ -334,13 +331,8 @@ class module_report_activity extends module_report
|
||||
*/
|
||||
public function getDownloadByBaseByDay($tab = false)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
$this->title = $this->app->trans('report:: telechargements par jour');
|
||||
|
||||
=======
|
||||
$this->title = _('report:: telechargements par jour');
|
||||
$this->setDateField('log_docs.date');
|
||||
>>>>>>> 3.8
|
||||
$sqlBuilder = new module_report_sql($this->app, $this);
|
||||
$filter = $sqlBuilder->getFilters()->getReportFilter();
|
||||
$params = array_merge([], $filter['params']);
|
||||
@@ -410,9 +402,7 @@ class module_report_activity extends module_report
|
||||
$this->result[$nb_row]['preview'] = '<b>' . $total['tot_prev'] . '</b>';
|
||||
$this->result[$nb_row]['total'] = '<b>' . $total['tot_dl'] . '</b>';
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
$this->calculatePages();
|
||||
=======
|
||||
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, var_export($this->result, true)), FILE_APPEND);
|
||||
foreach($this->result as $k=>$row) {
|
||||
$_row = array();
|
||||
@@ -423,8 +413,7 @@ class module_report_activity extends module_report
|
||||
}
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, var_export($this->result, true)), FILE_APPEND);
|
||||
|
||||
$this->calculatePages($rs);
|
||||
>>>>>>> 3.8
|
||||
$this->calculatePages();
|
||||
$this->setDisplayNav();
|
||||
$this->setReport();
|
||||
|
||||
@@ -752,27 +741,15 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activity(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$res = [];
|
||||
$datefilter =
|
||||
module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter =
|
||||
module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
|
||||
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
=======
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$res = array();
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
|
||||
$params = array(':site_id' => $app['phraseanet.configuration']['main']['key']);
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
/*
|
||||
>>>>>>> 3.8
|
||||
$sql = "
|
||||
SELECT tt.id, HOUR(tt.heures) AS heures
|
||||
FROM (
|
||||
@@ -826,15 +803,9 @@ class module_report_activity extends module_report
|
||||
$res = array();
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
|
||||
<<<<<<< HEAD
|
||||
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
=======
|
||||
$params = array(':site_id' => $app['phraseanet.configuration']['main']['key']);
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
/*
|
||||
>>>>>>> 3.8
|
||||
$sql = "
|
||||
SELECT tt.ddate, COUNT( DATE_FORMAT( tt.ddate, '%d' ) ) AS activity
|
||||
FROM (
|
||||
@@ -879,27 +850,13 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activityQuestion(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$datefilter =
|
||||
module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter =
|
||||
module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
|
||||
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
=======
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$result = array();
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_search.date');
|
||||
|
||||
$params = array(':site_id' => $app['phraseanet.configuration']['main']['key']);
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
/*
|
||||
>>>>>>> 3.8
|
||||
$sql = "
|
||||
SELECT tt.usrid, tt.user, sum(1) AS nb
|
||||
FROM (
|
||||
@@ -944,27 +901,15 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activiteTopQuestion(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$datefilter =
|
||||
module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter =
|
||||
module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
|
||||
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
=======
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$result = array();
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_search.date');
|
||||
|
||||
$params = array(':site_id' => $app['phraseanet.configuration']['main']['key']);
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
|
||||
/*
|
||||
>>>>>>> 3.8
|
||||
$sql = "
|
||||
SELECT TRIM(tt.search) AS question, tt.usrid, tt.user, SUM(1) AS nb
|
||||
FROM (
|
||||
@@ -1017,15 +962,11 @@ class module_report_activity extends module_report
|
||||
$result = [];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
|
||||
<<<<<<< HEAD
|
||||
$params = [];
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
=======
|
||||
$params = array();
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
|
||||
|
||||
/*
|
||||
>>>>>>> 3.8
|
||||
$sql = "
|
||||
SELECT tt.referrer, SUM(1) AS nb_view
|
||||
FROM (
|
||||
@@ -1074,25 +1015,14 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activiteAddedDocument(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
|
||||
$params = [];
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
=======
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$result = array();
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax,'log_docs.date');
|
||||
|
||||
$params = array();
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
|
||||
/*
|
||||
>>>>>>> 3.8
|
||||
$sql = "
|
||||
SELECT tt.ddate, COUNT( DATE_FORMAT( tt.ddate, '%d' ) ) AS activity
|
||||
FROM (
|
||||
@@ -1134,25 +1064,14 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activiteEditedDocument(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
|
||||
$params = [];
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
=======
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$result = array();
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
|
||||
|
||||
$params = array();
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
|
||||
/*
|
||||
>>>>>>> 3.8
|
||||
$sql = "
|
||||
SELECT tt.ddate, COUNT( DATE_FORMAT( tt.ddate, '%d' ) ) AS activity
|
||||
FROM (
|
||||
@@ -1194,25 +1113,14 @@ class module_report_activity extends module_report
|
||||
//============================= Dashboard =========================
|
||||
public static function activiteAddedTopTenUser(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
$result = [];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
|
||||
$params = [];
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
|
||||
=======
|
||||
$conn = connection::getPDOConnection($app, $sbas_id);
|
||||
$result = array();
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
|
||||
|
||||
$params = array();
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
/*
|
||||
>>>>>>> 3.8
|
||||
$sql = "
|
||||
SELECT tt.usrid, tt.user, sum( 1 ) AS nb
|
||||
FROM (
|
||||
|
@@ -38,14 +38,8 @@ class module_report_connexion extends module_report
|
||||
*/
|
||||
public function __construct(Application $app, $arg1, $arg2, $sbas_id, $collist)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
|
||||
parent::__construct($app, $arg1, $arg2, $sbas_id, '');
|
||||
$this->title = $this->app->trans('report::Connexions');
|
||||
=======
|
||||
// parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
|
||||
parent::__construct($app, $arg1, $arg2, $sbas_id, "");
|
||||
$this->title = _('report::Connexions');
|
||||
>>>>>>> 3.8
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,18 +140,10 @@ class module_report_connexion extends module_report
|
||||
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
|
||||
<<<<<<< HEAD
|
||||
$params = array_merge([
|
||||
':site_id' => $app['conf']->get(['main', 'key'])
|
||||
],
|
||||
$datefilter['params'],
|
||||
$collfilter['params']
|
||||
=======
|
||||
$params = array_merge(array(
|
||||
':site_id' => $app['phraseanet.configuration']['main']['key']
|
||||
),
|
||||
$datefilter['params']
|
||||
>>>>>>> 3.8
|
||||
);
|
||||
|
||||
$finalfilter = $datefilter['sql'] . ' AND ';
|
||||
|
@@ -43,14 +43,8 @@ class module_report_download extends module_report
|
||||
*/
|
||||
public function __construct(Application $app, $arg1, $arg2, $sbas_id, $collist)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
|
||||
parent::__construct($app, $arg1, $arg2, $sbas_id, '');
|
||||
$this->title = $this->app->trans('report:: telechargements');
|
||||
=======
|
||||
// parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
|
||||
parent::__construct($app, $arg1, $arg2, $sbas_id, "");
|
||||
$this->title = _('report:: telechargements');
|
||||
>>>>>>> 3.8
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,16 +183,9 @@ class module_report_download extends module_report
|
||||
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
|
||||
<<<<<<< HEAD
|
||||
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
=======
|
||||
$params = array(':site_id' => $app['phraseanet.configuration']['main']['key']);
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
>>>>>>> 3.8
|
||||
|
||||
$finalfilter = $datefilter['sql'] . ' AND ';
|
||||
$finalfilter .= 'log.site = :site_id';
|
||||
@@ -242,16 +229,9 @@ class module_report_download extends module_report
|
||||
$databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id);
|
||||
$conn = $databox->get_connection();
|
||||
|
||||
<<<<<<< HEAD
|
||||
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
|
||||
$collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
|
||||
$params = array_merge($params, $datefilter['params'], $collfilter['params']);
|
||||
=======
|
||||
$params = array(':site_id' => $app['phraseanet.configuration']['main']['key']);
|
||||
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
|
||||
$params = array_merge($params, $datefilter['params']);
|
||||
>>>>>>> 3.8
|
||||
|
||||
$finalfilter = "";
|
||||
$array = [
|
||||
|
@@ -450,13 +450,7 @@ class module_report_nav extends module_report
|
||||
WHERE (id = :value)';
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
$params2 = [':value' => $val];
|
||||
=======
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
|
||||
|
||||
$params2 = array(':value' => $val);
|
||||
>>>>>>> 3.8
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute($params2);
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
@@ -39,14 +39,8 @@ class module_report_question extends module_report
|
||||
*/
|
||||
public function __construct(Application $app, $arg1, $arg2, $sbas_id, $collist)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
|
||||
parent::__construct($app, $arg1, $arg2, $sbas_id, '');
|
||||
$this->title = $this->app->trans('report:: question');
|
||||
=======
|
||||
// parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
|
||||
parent::__construct($app, $arg1, $arg2, $sbas_id, "");
|
||||
$this->title = _('report:: question');
|
||||
>>>>>>> 3.8
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -89,12 +89,6 @@ class module_report_sqlconnexion extends module_report_sql implements module_rep
|
||||
WHERE (' . $filter['sql'] . ')
|
||||
) AS tt ORDER BY val ASC';
|
||||
|
||||
<<<<<<< HEAD
|
||||
return ['sql' => $this->sql, 'params' => $this->params];
|
||||
=======
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->sql), FILE_APPEND);
|
||||
|
||||
return array('sql' => $this->sql, 'params' => $this->params);
|
||||
>>>>>>> 3.8
|
||||
}
|
||||
}
|
||||
|
@@ -26,12 +26,7 @@ class module_report_sqldownload extends module_report_sql implements module_repo
|
||||
|
||||
public function buildSql()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
$customFieldMap = [];
|
||||
=======
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
|
||||
$customFieldMap = array();
|
||||
>>>>>>> 3.8
|
||||
|
||||
$filter = $this->filter->getReportFilter() ? : ['params' => [], 'sql' => false];
|
||||
$this->params = array_merge([], $filter['params']);
|
||||
@@ -82,12 +77,7 @@ class module_report_sqldownload extends module_report_sql implements module_repo
|
||||
'subdef.file' => 'tt.file',
|
||||
'subdef.mime' => 'tt.mime',
|
||||
'log_docs.final' => 'tt.final',
|
||||
<<<<<<< HEAD
|
||||
];
|
||||
=======
|
||||
);
|
||||
// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->sql), FILE_APPEND);
|
||||
>>>>>>> 3.8
|
||||
|
||||
} elseif ($this->on == 'DOC') {
|
||||
$this->sql = '
|
||||
|
@@ -34,40 +34,12 @@ class module_report_sqlfilter
|
||||
|
||||
public static function constructDateFilter($dmin, $dmax, $dateField = 'log_date.date')
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
return [
|
||||
'sql' => ($dmin && $dmax ? ' log_date.date > :date_min AND log_date.date < :date_max ' : false)
|
||||
, 'params' => ($dmin && $dmax ? [':date_min' => $dmin, ':date_max' => $dmax] : [])
|
||||
];
|
||||
}
|
||||
|
||||
public static function constructCollectionFilter(Application $app, $list_coll_id)
|
||||
{
|
||||
$ret = ['sql' => '', 'params' => []];
|
||||
$coll_filter = [];
|
||||
foreach (array_filter(explode(',', $list_coll_id)) as $val) {
|
||||
$val = \phrasea::collFromBas($app, $val);
|
||||
if ($val) {
|
||||
$coll_filter[] = 'log_colls.coll_id = ' . $val;
|
||||
}
|
||||
}
|
||||
$collections = array_unique($coll_filter);
|
||||
|
||||
if (count($collections) > 0) {
|
||||
$ret['sql'] = ' (' . implode(' OR ', $collections) . ') ';
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
=======
|
||||
return array(
|
||||
'sql' => ($dmin && $dmax ? ' '.$dateField.' > :date_min AND '.$dateField.' < :date_max ' : false)
|
||||
, 'params' => ($dmin && $dmax ? array(':date_min' => $dmin, ':date_max' => $dmax) : array())
|
||||
);
|
||||
}
|
||||
|
||||
>>>>>>> 3.8
|
||||
public function getCorFilter()
|
||||
{
|
||||
return $this->cor_query;
|
||||
@@ -77,12 +49,8 @@ class module_report_sqlfilter
|
||||
{
|
||||
$sql = '';
|
||||
|
||||
<<<<<<< HEAD
|
||||
$params = [':log_site' => $this->app['conf']->get(['main', 'key'])];
|
||||
|
||||
=======
|
||||
$params = array(':log_site' => $this->app['phraseanet.configuration']['main']['key']);
|
||||
>>>>>>> 3.8
|
||||
if ($this->filter['date'] && $this->filter['date']['sql'] !== '') {
|
||||
$sql .= $this->filter['date']['sql'] . ' AND ';
|
||||
$params = array_merge($params, $this->filter['date']['params']);
|
||||
@@ -92,13 +60,9 @@ class module_report_sqlfilter
|
||||
$params = array_merge($params, $this->filter['user']['params']);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
return ['sql' => $finalfilter, 'params' => $params];
|
||||
=======
|
||||
$sql .= ' log.site = :log_site';
|
||||
|
||||
return array('sql' => $sql, 'params' => $params);
|
||||
>>>>>>> 3.8
|
||||
}
|
||||
|
||||
public function getGvSitFilter()
|
||||
@@ -113,12 +77,7 @@ class module_report_sqlfilter
|
||||
|
||||
public function getUserIdFilter($id)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
return ['sql' => "log.usrid = :usr_id_filter", 'params' => [':usr_id_filter' => $id]];
|
||||
=======
|
||||
return array('sql' => "log.usrid = :usr_id_filter", 'params' => array(':usr_id_filter' => $id));
|
||||
// return array('sql' => "log.usrid=" . (int)$id, 'params' => array());
|
||||
>>>>>>> 3.8
|
||||
}
|
||||
|
||||
public function getDateFilter()
|
||||
@@ -153,25 +112,6 @@ class module_report_sqlfilter
|
||||
private function dateFilter(module_report $report)
|
||||
{
|
||||
$this->filter['date'] = false;
|
||||
/*
|
||||
if ($report->getDmin() && $report->getDmax()) {
|
||||
$this->filter['date'] = [
|
||||
'sql' => ' (log.date > :date_min_f AND log.date < :date_max_f) '
|
||||
<<<<<<< HEAD
|
||||
, 'params' => [
|
||||
':date_min_f' => $report->getDmin()
|
||||
, ':date_max_f' => $report->getDmax()
|
||||
]
|
||||
];
|
||||
=======
|
||||
, 'params' => array(
|
||||
':date_min_f' => $report->getDmin()
|
||||
, ':date_max_f' => $report->getDmax()
|
||||
)
|
||||
);
|
||||
>>>>>>> 3.8
|
||||
}
|
||||
*/
|
||||
$sql = "";
|
||||
if($report->getDmin()) {
|
||||
$sql = $report->getDateField().">=" . $this->conn->quote($report->getDmin());
|
||||
@@ -225,39 +165,6 @@ class module_report_sqlfilter
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
private function collectionFilter(module_report $report)
|
||||
{
|
||||
$this->filter['collection'] = false;
|
||||
$coll_filter = [];
|
||||
|
||||
if ($report->getUserId() == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$tab = array_filter(explode(",", $report->getListCollId()));
|
||||
|
||||
if (count($tab) > 0) {
|
||||
foreach ($tab as $val) {
|
||||
$val = \phrasea::collFromBas($this->app, $val);
|
||||
if (!!$val) {
|
||||
$coll_filter[] = 'log_colls.coll_id = ' . $val;
|
||||
}
|
||||
}
|
||||
|
||||
$collections = array_unique($coll_filter);
|
||||
|
||||
if (count($collections) > 0) {
|
||||
$this->filter['collection'] = array('sql' => ' (' . implode(' OR ', array_unique($coll_filter)) . ') ', 'params' => array());
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
=======
|
||||
>>>>>>> 3.8
|
||||
private function recordFilter(module_report $report)
|
||||
{
|
||||
$this->filter['record'] = false;
|
||||
|
Reference in New Issue
Block a user