Merge branch '3.8'

This commit is contained in:
Romain Neutron
2013-09-19 14:53:55 +02:00
12 changed files with 1952 additions and 1749 deletions

View File

@@ -148,7 +148,7 @@ class databox extends base
} }
if (!$row) { if (!$row) {
throw new NotFoundHttpException(sprintf('databox %d not found', $sbas_id)); throw new NotFoundHttpException(sprintf('databox %d not found', $this->id));
} }
$this->ord = $row['ord']; $this->ord = $row['ord'];

View File

@@ -72,7 +72,10 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
$cache_id = 'feed_' . md5($sbasid . '_' . $sbas_coll . '_' . $dmin . '_' . $dmax); $cache_id = 'feed_' . md5($sbasid . '_' . $sbas_coll . '_' . $dmin . '_' . $dmax);
try { try {
return $app['phraseanet.appbox']->get_data_from_cache($cache_id); $result = $app['phraseanet.appbox']->get_data_from_cache($cache_id);
$result->setApplication($app);
return $result;
} catch (Exception $e) { } catch (Exception $e) {
} }
@@ -231,4 +234,21 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
return false; return false;
} }
} }
private function setApplication(Application $app)
{
$this->app = $app;
}
public function __sleep()
{
$vars = array();
foreach ($this as $key => $value) {
if (in_array($key, array('app')))
continue;
$vars[] = $key;
}
return $vars;
}
} }

View File

@@ -58,71 +58,70 @@ class patch_380a3 implements patchInterface
{ {
$conn = $databox->get_connection(); $conn = $databox->get_connection();
try { $removeProc = "DROP PROCEDURE IF EXISTS explode_log_table";
$removeProc = "DROP PROCEDURE IF EXISTS explode_log_table";
$stmt = $conn->prepare($removeProc); $stmt = $conn->prepare($removeProc);
$stmt->execute(); $stmt->execute();
$stmt->closeCursor(); $stmt->closeCursor();
unset($stmt); unset($stmt);
$procedure = " $procedure = "
CREATE PROCEDURE explode_log_table(bound VARCHAR(255)) CREATE PROCEDURE explode_log_table(bound VARCHAR(255))
BEGIN BEGIN
DECLARE l_log_id INT UNSIGNED DEFAULT 0; DECLARE l_log_id INT UNSIGNED DEFAULT 0;
DECLARE l_coll_list TEXT; DECLARE l_coll_list TEXT;
DECLARE occurance INT DEFAULT 0; DECLARE occurance INT DEFAULT 0;
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 result_set CURSOR FOR DECLARE result_set CURSOR FOR
SELECT l.id, l.coll_list SELECT l.id, l.coll_list
FROM log l FROM log l
LEFT JOIN log_colls lc ON (lc.log_id = l.id) LEFT JOIN log_colls lc ON (lc.log_id = l.id)
WHERE (lc.log_id IS NULL) AND coll_list != ''; 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 result_set; OPEN result_set;
read_loop: LOOP read_loop: LOOP
FETCH result_set 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( SET dest_coll_id = (SELECT REPLACE(
SUBSTRING( SUBSTRING(
SUBSTRING_INDEX(l_coll_list, bound, i), SUBSTRING_INDEX(l_coll_list, bound, i),
LENGTH(SUBSTRING_INDEX(l_coll_list, bound, i - 1)) + 1 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 result_set; CLOSE result_set;
END;"; END;";
$stmt = $conn->prepare($procedure); $stmt = $conn->prepare($procedure);
$stmt->execute(); $stmt->execute();
$stmt->closeCursor(); $stmt->closeCursor();
unset($stmt);
$sql = "CALL explode_log_table(',')"; $sql = "CALL explode_log_table(',')";
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
$stmt->execute(); $stmt->execute();
$stmt->closeCursor(); $stmt->closeCursor();
unset($stmt);
} catch (\PDOEXception $e) {
return false;
}
$stmt = $conn->prepare($removeProc);
$stmt->execute();
$stmt->closeCursor();
return true; return true;
} }
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,9 @@
#BasketBrowser h1 {
font-size: 14px;
line-height: 20px;
margin: 0;
padding: 0;
}
#BasketBrowser .Browser{ #BasketBrowser .Browser{
background-color: #111111; background-color: #111111;
} }
@@ -13,6 +19,9 @@
position:relative; position:relative;
height:100px; height:100px;
} }
#BasketBrowser .result .PNB10 {
overflow: hidden;
}
#BasketBrowser .results .datas{ #BasketBrowser .results .datas{
top:50px; top:50px;
@@ -49,6 +58,7 @@
box-shadow: none; box-shadow: none;
line-height: 18px; line-height: 18px;
text-align: center; text-align: center;
vertical-align:top;
} }
#BasketBrowser .result td.thumbnail .counter{ #BasketBrowser .result td.thumbnail .counter{
@@ -120,4 +130,4 @@
} }
#BasketBrowser form ul li label{ #BasketBrowser form ul li label{
margin: 0 0 0 40px; margin: 0 0 0 40px;
} }