Merge branch '3.8'

Conflicts:
	lib/Alchemy/Phrasea/Controller/Prod/Export.php
	lib/Alchemy/Phrasea/Core/Version.php
	lib/Alchemy/Phrasea/Helper/Prod.php
	lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php
	lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php
	lib/classes/User/Adapter.php
	lib/classes/caption/Field/Value.php
	lib/classes/collection.php
	lib/classes/module/report/filter.php
	lib/classes/task/period/ftp.php
	templates/web/common/dialog_export.html.twig
	templates/web/report/ajax_dashboard_content_child.html.twig
	tests/Alchemy/Tests/Phrasea/Controller/Admin/UsersTest.php
This commit is contained in:
Romain Neutron
2013-12-18 12:12:58 +01:00
44 changed files with 389 additions and 170 deletions

View File

@@ -560,6 +560,12 @@ class collection implements cache_cacheableInterface
</sugestedValues>
</baseprefs>';
$sql = "SELECT GREATEST(0, MAX(ord)) + 1 AS ord FROM bas WHERE sbas_id = :sbas_id";
$stmt = $conn->prepare($sql);
$stmt->execute(array(':sbas_id' => $sbas_id));
$ord = $stmt->fetch(\PDO::FETCH_ASSOC);
$stmt->closeCursor();
$sql = "INSERT INTO coll (coll_id, asciiname, prefs, logo)
VALUES (null, :name, :prefs, '')";
@@ -574,11 +580,15 @@ class collection implements cache_cacheableInterface
$new_id = (int) $connbas->lastInsertId();
$sql = "INSERT INTO bas (base_id, active, server_coll_id, sbas_id, aliases)
$sql = "INSERT INTO bas (base_id, active, ord, server_coll_id, sbas_id, aliases)
VALUES
(null, 1, :server_coll_id, :sbas_id, '')";
(null, 1, :ord, :server_coll_id, :sbas_id, '')";
$stmt = $conn->prepare($sql);
$stmt->execute([':server_coll_id' => $new_id, ':sbas_id' => $sbas_id]);
$stmt->execute([
':server_coll_id' => $new_id,
':sbas_id' => $sbas_id,
':ord' => $ord['ord'] ?: 1,
]);
$stmt->closeCursor();
$new_bas = $conn->lastInsertId();
@@ -633,7 +643,7 @@ class collection implements cache_cacheableInterface
VALUES
(null, 1, :server_coll_id, :sbas_id, '')";
$stmt = $databox->get_appbox()->get_connection()->prepare($sql);
$stmt->execute([':server_coll_id' => $coll_id, ':sbas_id' => $sbas_id]);
$stmt->execute([':server_coll_id' => $coll_id, ':sbas_id' => $databox->get_sbas_id()]);
$stmt->closeCursor();
$new_bas = $databox->get_appbox()->get_connection()->lastInsertId();
@@ -641,7 +651,7 @@ class collection implements cache_cacheableInterface
$databox->delete_data_from_cache(databox::CACHE_COLLECTIONS);
cache_databox::update($app, $sbas_id, 'structure');
cache_databox::update($app, $databox->get_sbas_id(), 'structure');
phrasea::reset_baseDatas($databox->get_appbox());