diff --git a/lib/Alchemy/Phrasea/Core/Version.php b/lib/Alchemy/Phrasea/Core/Version.php index 0de30582bb..c8e1841294 100644 --- a/lib/Alchemy/Phrasea/Core/Version.php +++ b/lib/Alchemy/Phrasea/Core/Version.php @@ -18,7 +18,7 @@ namespace Alchemy\Phrasea\Core; */ class Version { - protected static $number = '3.8.3-alpha.2'; + protected static $number = '3.8.3-alpha.3'; protected static $name = 'Diplodocus'; public static function getNumber() diff --git a/lib/classes/collection.php b/lib/classes/collection.php index 8e5dacc3c7..4fa8e865fc 100644 --- a/lib/classes/collection.php +++ b/lib/classes/collection.php @@ -565,6 +565,12 @@ class collection implements cache_cacheableInterface '; + $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, '')"; @@ -579,11 +585,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(array(':server_coll_id' => $new_id, ':sbas_id' => $sbas_id)); + $stmt->execute(array( + ':server_coll_id' => $new_id, + ':sbas_id' => $sbas_id, + ':ord' => $ord['ord'] ?: 1, + )); $stmt->closeCursor(); $new_bas = $conn->lastInsertId(); @@ -638,7 +648,7 @@ class collection implements cache_cacheableInterface VALUES (null, 1, :server_coll_id, :sbas_id, '')"; $stmt = $databox->get_appbox()->get_connection()->prepare($sql); - $stmt->execute(array(':server_coll_id' => $coll_id, ':sbas_id' => $sbas_id)); + $stmt->execute(array(':server_coll_id' => $coll_id, ':sbas_id' => $databox->get_sbas_id())); $stmt->closeCursor(); $new_bas = $databox->get_appbox()->get_connection()->lastInsertId(); @@ -646,7 +656,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()); diff --git a/lib/classes/patch/381alpha1a.php b/lib/classes/patch/383alpha3a.php similarity index 95% rename from lib/classes/patch/381alpha1a.php rename to lib/classes/patch/383alpha3a.php index c8919b9fc3..7693cc8936 100644 --- a/lib/classes/patch/381alpha1a.php +++ b/lib/classes/patch/383alpha3a.php @@ -11,10 +11,10 @@ use Alchemy\Phrasea\Application; -class patch_381alpha1a implements patchInterface +class patch_383alpha3a implements patchInterface { /** @var string */ - private $release = '3.8.1-alpha.1'; + private $release = '3.8.3-alpha.3'; /** @var array */ private $concern = array(base::APPLICATION_BOX); diff --git a/templates/web/admin/collection/reorder.html.twig b/templates/web/admin/collection/reorder.html.twig index fefbf8401c..f1fd740618 100644 --- a/templates/web/admin/collection/reorder.html.twig +++ b/templates/web/admin/collection/reorder.html.twig @@ -2,6 +2,8 @@
@@ -87,7 +89,7 @@ var html = _.template($("#alert_"+ (datas.success ? "success" : "error") +"_tpl").html(), { content:datas.msg }); - $('#table-order').insertBefore(html); + $('#notification').html(html); }, complete : function() { $this.attr('disabled', false); |