From 9fe25d90e3095d0e41ca25bc5e40c3e5ad8d9d7a Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 14 Sep 2021 22:33:01 +0200 Subject: [PATCH] Fixed redirect to saved object after Workflow Save --- Layout/default/Linework/Index.php | 6 +++--- Layout/default/Pipework/Index.php | 2 +- Layout/default/menu.php | 4 ++-- application/Linework/LineworkController.php | 13 ++++++++++++- application/Pipework/PipeworkController.php | 13 ++++++++++++- 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/Layout/default/Linework/Index.php b/Layout/default/Linework/Index.php index b42e5d111..df66e3a0e 100644 --- a/Layout/default/Linework/Index.php +++ b/Layout/default/Linework/Index.php @@ -170,7 +170,7 @@ -
$filter])?>" enctype="multipart/form-data" > + $filter, "s" => $pagination['start']])?>" enctype="multipart/form-data" > workflowitems as $item): ?> @@ -297,8 +297,8 @@ $(document).ready(function() { var hash = window.location.hash.substr(1); var match = hash.match(/object=(\d+)/); if(match && match[1]) { - building = match[1] - var pos = $('#object-' + term).offset().top; + term = match[1] + var pos = $('#termination-' + term).offset().top; $(window).scrollTop(pos - 150 ); } }); diff --git a/Layout/default/Pipework/Index.php b/Layout/default/Pipework/Index.php index a669289c2..9468fb7c4 100644 --- a/Layout/default/Pipework/Index.php +++ b/Layout/default/Pipework/Index.php @@ -162,7 +162,7 @@
- $filter])?>" enctype="multipart/form-data" > + $pagination['start'], "filter" => $filter])?>" enctype="multipart/form-data" > workflowitems as $item): ?> diff --git a/Layout/default/menu.php b/Layout/default/menu.php index b5c01b2bc..216983245 100644 --- a/Layout/default/menu.php +++ b/Layout/default/menu.php @@ -37,8 +37,8 @@ diff --git a/application/Linework/LineworkController.php b/application/Linework/LineworkController.php index 4dc13f1fd..59aebcc23 100644 --- a/application/Linework/LineworkController.php +++ b/application/Linework/LineworkController.php @@ -306,8 +306,19 @@ class LineworkController extends mfBaseController { } + $sq = ""; + $query = []; + if(is_numeric($this->request->s) && $this->request->s > 0) { + $query["s"] = $this->request->s; + } + if (is_array($this->request->filter)) { + $query["filter"] = $this->request->filter; + } + + $qs = http_build_query($query); + $this->layout->setFlash("Workflow Eintrag erfolgreich gespeichert.", "success"); - $this->redirect("Linework","Index", http_build_query(["filter" => $this->request->filter]), "object=".$termination_id); + $this->redirect("Linework","Index", $qs, "object=".$termination_id); diff --git a/application/Pipework/PipeworkController.php b/application/Pipework/PipeworkController.php index 3f85a9ca2..7076ceb95 100644 --- a/application/Pipework/PipeworkController.php +++ b/application/Pipework/PipeworkController.php @@ -302,8 +302,19 @@ class PipeworkController extends mfBaseController { } + $sq = ""; + $query = []; + if(is_numeric($this->request->s) && $this->request->s > 0) { + $query["s"] = $this->request->s; + } + if (is_array($this->request->filter)) { + $query["filter"] = $this->request->filter; + } + + $qs = http_build_query($query); + $this->layout->setFlash("Workflow Eintrag erfolgreich gespeichert.", "success"); - $this->redirect("Pipework","Index", http_build_query(["filter" => $this->request->filter]), "object=".$building_id); + $this->redirect("Pipework","Index", $qs, "object=".$building_id);