mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Add some minor adjustments
Fix CS Fix CS Fix CS
This commit is contained in:
@@ -38,7 +38,7 @@ class module_report_sqlaction extends module_report_sql implements module_report
|
|||||||
|
|
||||||
public function buildSql()
|
public function buildSql()
|
||||||
{
|
{
|
||||||
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
||||||
$this->params = array_merge(array(':action' => $this->action), $filter['params']);
|
$this->params = array_merge(array(':action' => $this->action), $filter['params']);
|
||||||
|
|
||||||
if ($this->groupby == false) {
|
if ($this->groupby == false) {
|
||||||
@@ -87,7 +87,7 @@ class module_report_sqlaction extends module_report_sql implements module_report
|
|||||||
|
|
||||||
public function sqlDistinctValByField($field)
|
public function sqlDistinctValByField($field)
|
||||||
{
|
{
|
||||||
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
||||||
$this->params = array_merge(array(':action' => $this->action), $filter['params']);
|
$this->params = array_merge(array(':action' => $this->action), $filter['params']);
|
||||||
|
|
||||||
$this->sql = "
|
$this->sql = "
|
||||||
@@ -103,6 +103,6 @@ class module_report_sqlaction extends module_report_sql implements module_report
|
|||||||
AND (d.action = :action)
|
AND (d.action = :action)
|
||||||
) AS tt " . ($this->filter->getOrderFilter() ? $this->filter->getOrderFilter() : '');
|
) AS tt " . ($this->filter->getOrderFilter() ? $this->filter->getOrderFilter() : '');
|
||||||
|
|
||||||
return array('sql' => $this->sql, 'params' => $this->params);
|
return array('sql' => $this->sql, 'params' => $this->params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@ class module_report_sqlconnexion extends module_report_sql implements module_rep
|
|||||||
|
|
||||||
public function buildSql()
|
public function buildSql()
|
||||||
{
|
{
|
||||||
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
||||||
$this->params = array_merge(array(), $filter['params']);
|
$this->params = array_merge(array(), $filter['params']);
|
||||||
|
|
||||||
if ($this->groupby == false) {
|
if ($this->groupby == false) {
|
||||||
@@ -76,7 +76,7 @@ class module_report_sqlconnexion extends module_report_sql implements module_rep
|
|||||||
|
|
||||||
public function sqlDistinctValByField($field)
|
public function sqlDistinctValByField($field)
|
||||||
{
|
{
|
||||||
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
||||||
$this->params = array_merge(array(), $filter['params']);
|
$this->params = array_merge(array(), $filter['params']);
|
||||||
|
|
||||||
$this->sql = '
|
$this->sql = '
|
||||||
@@ -88,6 +88,6 @@ class module_report_sqlconnexion extends module_report_sql implements module_rep
|
|||||||
WHERE (' . $filter['sql'] . ')
|
WHERE (' . $filter['sql'] . ')
|
||||||
) AS tt ORDER BY val ASC';
|
) AS tt ORDER BY val ASC';
|
||||||
|
|
||||||
return array('sql' => $this->sql, 'params' => $this->params);
|
return array('sql' => $this->sql, 'params' => $this->params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@ class module_report_sqldownload extends module_report_sql implements module_repo
|
|||||||
|
|
||||||
public function buildSql()
|
public function buildSql()
|
||||||
{
|
{
|
||||||
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
||||||
$this->params = array_merge(array(), $filter['params']);
|
$this->params = array_merge(array(), $filter['params']);
|
||||||
|
|
||||||
if ($this->groupby == false) {
|
if ($this->groupby == false) {
|
||||||
@@ -96,7 +96,7 @@ class module_report_sqldownload extends module_report_sql implements module_repo
|
|||||||
|
|
||||||
public function sqlDistinctValByField($field)
|
public function sqlDistinctValByField($field)
|
||||||
{
|
{
|
||||||
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
||||||
$this->params = array_merge(array(), $filter['params']);
|
$this->params = array_merge(array(), $filter['params']);
|
||||||
|
|
||||||
$this->sql = '
|
$this->sql = '
|
||||||
@@ -116,6 +116,6 @@ class module_report_sqldownload extends module_report_sql implements module_repo
|
|||||||
$this->sql .= $this->filter->getOrderFilter() ? : '';
|
$this->sql .= $this->filter->getOrderFilter() ? : '';
|
||||||
$this->sql .= $this->filter->getLimitFilter() ? : '';
|
$this->sql .= $this->filter->getLimitFilter() ? : '';
|
||||||
|
|
||||||
return array('sql' => $this->sql, 'params' => $this->params);
|
return array('sql' => $this->sql, 'params' => $this->params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@ class module_report_sqlfilter
|
|||||||
public static function constructDateFilter($dmin, $dmax)
|
public static function constructDateFilter($dmin, $dmax)
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'sql' => ($dmin && $dmax ? ' log_date.date > :date_min AND log_date.date < :date_max ' : false)
|
'sql' => ($dmin && $dmax ? ' log_date.date > :date_min AND log_date.date < :date_max ' : false)
|
||||||
, 'params' => ($dmin && $dmax ? array(':date_min' => $dmin, ':date_max' => $dmax) : array())
|
, 'params' => ($dmin && $dmax ? array(':date_min' => $dmin, ':date_max' => $dmax) : array())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ class module_report_sqlfilter
|
|||||||
$coll_filter = array();
|
$coll_filter = array();
|
||||||
foreach (array_filter(explode(',', $list_coll_id)) as $val) {
|
foreach (array_filter(explode(',', $list_coll_id)) as $val) {
|
||||||
$val = \phrasea::collFromBas($app, $val);
|
$val = \phrasea::collFromBas($app, $val);
|
||||||
if (!!$val) {
|
if ($val) {
|
||||||
$coll_filter[] = 'log_colls.coll_id = ' . $val;
|
$coll_filter[] = 'log_colls.coll_id = ' . $val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ class module_report_sqlfilter
|
|||||||
}
|
}
|
||||||
$finalfilter .= ' log.site = :log_site';
|
$finalfilter .= ' log.site = :log_site';
|
||||||
|
|
||||||
return array('sql' => $finalfilter, 'params' => $params);
|
return array('sql' => $finalfilter, 'params' => $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getGvSitFilter()
|
public function getGvSitFilter()
|
||||||
@@ -90,12 +90,12 @@ class module_report_sqlfilter
|
|||||||
$params[':log_site_gv_filter'] = $this->app['phraseanet.registry']->get('GV_sit');
|
$params[':log_site_gv_filter'] = $this->app['phraseanet.registry']->get('GV_sit');
|
||||||
}
|
}
|
||||||
|
|
||||||
return array('sql' => $sql, 'params' => $params);
|
return array('sql' => $sql, 'params' => $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserIdFilter($id)
|
public function getUserIdFilter($id)
|
||||||
{
|
{
|
||||||
return array('sql' => "log.usrid = :usr_id_filter", 'params' => array(':usr_id_filter' => $id));
|
return array('sql' => "log.usrid = :usr_id_filter", 'params' => array(':usr_id_filter' => $id));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDateFilter()
|
public function getDateFilter()
|
||||||
@@ -170,7 +170,7 @@ class module_report_sqlfilter
|
|||||||
|
|
||||||
$n ++;
|
$n ++;
|
||||||
}
|
}
|
||||||
$filter_user = array('sql' => implode(' AND ', $filter), 'params' => $params);
|
$filter_user = array('sql' => implode(' AND ', $filter), 'params' => $params);
|
||||||
|
|
||||||
$this->filter['user'] = $filter_user;
|
$this->filter['user'] = $filter_user;
|
||||||
}
|
}
|
||||||
@@ -197,7 +197,7 @@ class module_report_sqlfilter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->filter['collection'] = array('sql' => ' (' . implode(' OR ', array_unique($coll_filter)) . ') ', 'params' => array());
|
$this->filter['collection'] = array('sql' => ' (' . implode(' OR ', array_unique($coll_filter)) . ') ', 'params' => array());
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -215,7 +215,7 @@ class module_report_sqlfilter
|
|||||||
$params[":record_fil" . $n] = phrasea::collFromBas($this->app, $val);
|
$params[":record_fil" . $n] = phrasea::collFromBas($this->app, $val);
|
||||||
$n ++;
|
$n ++;
|
||||||
}
|
}
|
||||||
$this->filter['record'] = array('sql' => implode(' OR ', $dl_coll_filter), 'params' => $params);
|
$this->filter['record'] = array('sql' => implode(' OR ', $dl_coll_filter), 'params' => $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@@ -21,7 +21,7 @@ class module_report_sqlquestion extends module_report_sql implements module_repo
|
|||||||
|
|
||||||
public function buildSql()
|
public function buildSql()
|
||||||
{
|
{
|
||||||
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
||||||
$this->params = array_merge(array(), $filter['params']);
|
$this->params = array_merge(array(), $filter['params']);
|
||||||
|
|
||||||
if ($this->groupby == false) {
|
if ($this->groupby == false) {
|
||||||
@@ -62,7 +62,7 @@ class module_report_sqlquestion extends module_report_sql implements module_repo
|
|||||||
|
|
||||||
public function sqlDistinctValByField($field)
|
public function sqlDistinctValByField($field)
|
||||||
{
|
{
|
||||||
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
$filter = $this->filter->getReportFilter() ? : array('params' => array(), 'sql' => false);
|
||||||
$this->params = array_merge(array(), $filter['params']);
|
$this->params = array_merge(array(), $filter['params']);
|
||||||
|
|
||||||
$this->sql = "
|
$this->sql = "
|
||||||
@@ -76,6 +76,6 @@ class module_report_sqlquestion extends module_report_sql implements module_repo
|
|||||||
) as tt
|
) as tt
|
||||||
ORDER BY tt.val ASC";
|
ORDER BY tt.val ASC";
|
||||||
|
|
||||||
return array('sql' => $this->sql, 'params' => $this->params);
|
return array('sql' => $this->sql, 'params' => $this->params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -75,28 +75,38 @@ class patch_380a3 implements patchInterface
|
|||||||
DECLARE i INT DEFAULT 0;
|
DECLARE i INT DEFAULT 0;
|
||||||
DECLARE dest_coll_id INT;
|
DECLARE dest_coll_id INT;
|
||||||
DECLARE done INT DEFAULT 0;
|
DECLARE done INT DEFAULT 0;
|
||||||
DECLARE cur1 CURSOR FOR SELECT l.id, l.coll_list FROM log l LEFT JOIN log_colls lc ON (lc.log_id = l.id) WHERE (lc.log_id IS NULL) AND coll_list != '';
|
DECLARE result_set CURSOR FOR
|
||||||
|
SELECT l.id, l.coll_list
|
||||||
|
FROM log l
|
||||||
|
LEFT JOIN log_colls lc ON (lc.log_id = l.id)
|
||||||
|
WHERE (lc.log_id IS NULL) AND coll_list != '';
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
|
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
|
||||||
OPEN cur1;
|
OPEN result_set;
|
||||||
read_loop: LOOP
|
read_loop: LOOP
|
||||||
FETCH cur1 INTO l_log_id, l_coll_list;
|
FETCH result_set INTO l_log_id, l_coll_list;
|
||||||
IF done THEN
|
IF done THEN
|
||||||
LEAVE read_loop;
|
LEAVE read_loop;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
SET occurance = (SELECT LENGTH(l_coll_list) - LENGTH(REPLACE(l_coll_list, bound, ''))+1);
|
SET occurance = (SELECT LENGTH(l_coll_list) - LENGTH(REPLACE(l_coll_list, bound, ''))+1);
|
||||||
SET i=1;
|
SET i=1;
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
WHILE i <= occurance DO
|
WHILE i <= occurance DO
|
||||||
SET dest_coll_id = (SELECT REPLACE(SUBSTRING(SUBSTRING_INDEX(l_coll_list, bound, i), LENGTH(SUBSTRING_INDEX(l_coll_list, bound, i - 1)) + 1), ',', ''));
|
SET dest_coll_id = (SELECT REPLACE(
|
||||||
|
SUBSTRING(
|
||||||
|
SUBSTRING_INDEX(l_coll_list, bound, i),
|
||||||
|
LENGTH(SUBSTRING_INDEX(l_coll_list, bound, i - 1)) + 1
|
||||||
|
),
|
||||||
|
',',
|
||||||
|
''
|
||||||
|
));
|
||||||
IF dest_coll_id > 0 THEN
|
IF dest_coll_id > 0 THEN
|
||||||
INSERT INTO log_colls VALUES (null, l_log_id, dest_coll_id);
|
INSERT INTO log_colls VALUES (null, l_log_id, dest_coll_id);
|
||||||
END IF;
|
END IF;
|
||||||
SET i = i + 1;
|
SET i = i + 1;
|
||||||
END WHILE;
|
END WHILE;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
END LOOP;
|
END LOOP;
|
||||||
CLOSE cur1;
|
CLOSE result_set;
|
||||||
END;";
|
END;";
|
||||||
|
|
||||||
$stmt = $conn->prepare($procedure);
|
$stmt = $conn->prepare($procedure);
|
||||||
|
@@ -489,7 +489,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
*/
|
*/
|
||||||
public function move_to_collection(collection $collection, appbox $appbox)
|
public function move_to_collection(collection $collection, appbox $appbox)
|
||||||
{
|
{
|
||||||
if ($collection->get_base_id() === $this->get_collection()->get_base_id()) {
|
if ($this->get_collection()->get_base_id() === $collection->get_base_id()) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,6 +25,9 @@ require_once __DIR__ . "/../../vendor/autoload.php";
|
|||||||
|
|
||||||
$app = new Application();
|
$app = new Application();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo Remove this in next refactor
|
||||||
|
*/
|
||||||
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
||||||
|
|
||||||
$app->addLocale($event);
|
$app->addLocale($event);
|
||||||
|
@@ -24,7 +24,9 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
|||||||
require_once __DIR__ . "/../../vendor/autoload.php";
|
require_once __DIR__ . "/../../vendor/autoload.php";
|
||||||
|
|
||||||
$app = new Application();
|
$app = new Application();
|
||||||
|
/**
|
||||||
|
* @todo Remove this in next refactor
|
||||||
|
*/
|
||||||
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
||||||
|
|
||||||
$app->addLocale($event);
|
$app->addLocale($event);
|
||||||
|
@@ -76,7 +76,9 @@ foreach ($popbases as $key => $val) {
|
|||||||
$selection[$id_sbas]['liste'] = $liste;
|
$selection[$id_sbas]['liste'] = $liste;
|
||||||
|
|
||||||
$app = new Application();
|
$app = new Application();
|
||||||
|
/**
|
||||||
|
* @todo Remove this in next refactor
|
||||||
|
*/
|
||||||
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
||||||
|
|
||||||
$app->addLocale($event);
|
$app->addLocale($event);
|
||||||
|
@@ -56,7 +56,9 @@ $parm = $request->get_parms("dmin", // date minimal of the reporting
|
|||||||
|
|
||||||
|
|
||||||
$app = new Application();
|
$app = new Application();
|
||||||
|
/**
|
||||||
|
* @todo Remove this in next refactor
|
||||||
|
*/
|
||||||
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
||||||
|
|
||||||
$app->addLocale($event);
|
$app->addLocale($event);
|
||||||
|
@@ -23,8 +23,11 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
|||||||
|
|
||||||
require_once __DIR__ . "/../../vendor/autoload.php";
|
require_once __DIR__ . "/../../vendor/autoload.php";
|
||||||
|
|
||||||
$app = new Application('dev');
|
$app = new Application();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo Remove this in next refactor
|
||||||
|
*/
|
||||||
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
||||||
|
|
||||||
$app->addLocale($event);
|
$app->addLocale($event);
|
||||||
|
@@ -24,6 +24,9 @@ require_once __DIR__ . "/../../vendor/autoload.php";
|
|||||||
|
|
||||||
$app = new Application();
|
$app = new Application();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo Remove this in next refactor
|
||||||
|
*/
|
||||||
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
||||||
|
|
||||||
$app->addLocale($event);
|
$app->addLocale($event);
|
||||||
|
@@ -58,6 +58,9 @@ $param = $request->get_parms(
|
|||||||
|
|
||||||
$app = new Application();
|
$app = new Application();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo Remove this in next refactor
|
||||||
|
*/
|
||||||
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
|
||||||
|
|
||||||
$app->addLocale($event);
|
$app->addLocale($event);
|
||||||
|
Reference in New Issue
Block a user