From b3af2c26b2b1c7bf94fd385281858e9fb0c9e301 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Wed, 18 Sep 2019 17:43:42 +0400 Subject: [PATCH 1/3] PHRAS-2686 --- .../Controller/Prod/QueryController.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php index 1e8724c0ee..66458e9e90 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php @@ -214,7 +214,7 @@ class QueryController extends Controller if (min($d2top, $d2bottom) < 4) { if ($d2bottom < 4) { if($page != 1){ - $string .= ""; + $string .= ""; } for ($i = 1; ($i <= 4 && (($i <= $npages) === true)); $i++) { if ($i == $page) @@ -223,13 +223,13 @@ class QueryController extends Controller $string .= '' . $i . ''; } if ($npages > 4) - $string .= ""; - $string .= ''; + $string .= ""; + $string .= ''; } else { $start = $npages - 4; if (($start) > 0){ - $string .= ''; - $string .= ''; + $string .= ''; + $string .= ''; }else $start = 1; for ($i = ($start); $i <= $npages; $i++) { @@ -239,11 +239,11 @@ class QueryController extends Controller $string .= '' . $i . ''; } if($page < $npages){ - $string .= ""; + $string .= ""; } } } else { - $string .= ''; + $string .= ''; for ($i = ($page - 2); $i <= ($page + 2); $i++) { if ($i == $page) @@ -252,10 +252,10 @@ class QueryController extends Controller $string .= '' . $i . ''; } - $string .= ''; + $string .= ''; } } - $string .= '
'; + $string .= '
'; $explain = $this->render( "prod/results/infos.html.twig", @@ -470,7 +470,6 @@ class QueryController extends Controller $json['results'] = $this->render($template, ['results'=> $result]); } - return $this->app->json($json); } From c16dc45208cec0c9a23e721c468c90ffc14b2869 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Fri, 20 Sep 2019 11:10:26 +0400 Subject: [PATCH 2/3] PHRAS-2686 --- lib/Alchemy/Phrasea/Controller/Prod/QueryController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php index 66458e9e90..790e33525d 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/QueryController.php @@ -224,11 +224,11 @@ class QueryController extends Controller } if ($npages > 4) $string .= ""; - $string .= ''; + $string .= ''; } else { $start = $npages - 4; if (($start) > 0){ - $string .= ''; + $string .= ''; $string .= ''; }else $start = 1; @@ -243,7 +243,7 @@ class QueryController extends Controller } } } else { - $string .= ''; + $string .= ''; for ($i = ($page - 2); $i <= ($page + 2); $i++) { if ($i == $page) @@ -252,7 +252,7 @@ class QueryController extends Controller $string .= '' . $i . ''; } - $string .= ''; + $string .= ''; } } $string .= '
'; From dbaca5bb94bca453f57a4321b11ee943be273bda Mon Sep 17 00:00:00 2001 From: aynsix Date: Fri, 27 Sep 2019 11:49:09 +0400 Subject: [PATCH 3/3] reactivate permalink when record moved from TRASH 4.1 --- .../Phrasea/Controller/Prod/MoveCollectionController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollectionController.php b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollectionController.php index c4fe729538..50e2219e0d 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollectionController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollectionController.php @@ -114,6 +114,7 @@ class MoveCollectionController extends Controller $trashCollectionsBySbasId = []; foreach ($records as $record) { + $oldCollectionId = $record->getCollection()->get_coll_id(); $record->move_to_collection($collection, $this->getApplicationBox()); if ($request->request->get("chg_coll_son") == "1") { @@ -130,7 +131,7 @@ class MoveCollectionController extends Controller $trashCollectionsBySbasId[$sbasId] = $record->getDatabox()->getTrashCollection(); } if ($trashCollectionsBySbasId[$sbasId] !== null) { - if ($record->getCollection()->get_coll_id() == $trashCollectionsBySbasId[$sbasId]->get_coll_id() && $collection->get_coll_id() !== $trashCollectionsBySbasId[$sbasId]->get_coll_id()) { + if ($oldCollectionId == $trashCollectionsBySbasId[$sbasId]->get_coll_id() && $collection->get_coll_id() !== $trashCollectionsBySbasId[$sbasId]->get_coll_id()) { // record is already in trash so active it foreach ($record->get_subdefs() as $subdef) { if (($pl = $subdef->get_permalink())) {