Add some minor adjustments

Fix CS

Fix CS

Fix CS
This commit is contained in:
Nicolas Le Goff
2013-02-12 15:19:20 +01:00
parent 0cbaa17b25
commit c3f8e70fe5
14 changed files with 60 additions and 32 deletions

View File

@@ -43,7 +43,7 @@ class module_report_sqlfilter
$coll_filter = array();
foreach (array_filter(explode(',', $list_coll_id)) as $val) {
$val = \phrasea::collFromBas($app, $val);
if (!!$val) {
if ($val) {
$coll_filter[] = 'log_colls.coll_id = ' . $val;
}
}

View File

@@ -75,20 +75,30 @@ class patch_380a3 implements patchInterface
DECLARE i INT DEFAULT 0;
DECLARE dest_coll_id INT;
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;
OPEN cur1;
OPEN result_set;
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
LEAVE read_loop;
END IF;
SET occurance = (SELECT LENGTH(l_coll_list) - LENGTH(REPLACE(l_coll_list, bound, ''))+1);
SET i=1;
START TRANSACTION;
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
INSERT INTO log_colls VALUES (null, l_log_id, dest_coll_id);
END IF;
@@ -96,7 +106,7 @@ class patch_380a3 implements patchInterface
END WHILE;
COMMIT;
END LOOP;
CLOSE cur1;
CLOSE result_set;
END;";
$stmt = $conn->prepare($procedure);

View File

@@ -489,7 +489,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
*/
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;
}

View File

@@ -25,6 +25,9 @@ require_once __DIR__ . "/../../vendor/autoload.php";
$app = new Application();
/**
* @todo Remove this in next refactor
*/
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
$app->addLocale($event);

View File

@@ -24,7 +24,9 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent;
require_once __DIR__ . "/../../vendor/autoload.php";
$app = new Application();
/**
* @todo Remove this in next refactor
*/
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
$app->addLocale($event);

View File

@@ -76,7 +76,9 @@ foreach ($popbases as $key => $val) {
$selection[$id_sbas]['liste'] = $liste;
$app = new Application();
/**
* @todo Remove this in next refactor
*/
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
$app->addLocale($event);

View File

@@ -56,7 +56,9 @@ $parm = $request->get_parms("dmin", // date minimal of the reporting
$app = new Application();
/**
* @todo Remove this in next refactor
*/
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
$app->addLocale($event);

View File

@@ -23,8 +23,11 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent;
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);
$app->addLocale($event);

View File

@@ -24,6 +24,9 @@ require_once __DIR__ . "/../../vendor/autoload.php";
$app = new Application();
/**
* @todo Remove this in next refactor
*/
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
$app->addLocale($event);

View File

@@ -58,6 +58,9 @@ $param = $request->get_parms(
$app = new Application();
/**
* @todo Remove this in next refactor
*/
$event = new GetResponseEvent($app, Request::createFromGlobals(), HttpKernelInterface::MASTER_REQUEST);
$app->addLocale($event);