diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue
index 2074c4163..5e3b0f0db 100644
--- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue
+++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue
@@ -124,9 +124,9 @@
>
{{ $t("cancel") }}
-
+
@@ -157,9 +157,7 @@ console.log(PdfWorker); // incredible but this is needed
// pdfjsLib.GlobalWorkerOptions.workerSrc = PdfWorker;
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
-import {
- download_and_decrypt_doc,
-} from "../StoredObjectButton/helpers";
+import { download_and_decrypt_doc } from "../StoredObjectButton/helpers";
pdfjsLib.GlobalWorkerOptions.workerSrc = "pdfjs-dist/build/pdf.worker.mjs";
@@ -215,7 +213,10 @@ const setPage = async (page: number) => {
async function downloadAndOpen(): Promise {
let raw;
try {
- raw = await download_and_decrypt_doc(signature.storedObject, signature.storedObject.currentVersion);
+ raw = await download_and_decrypt_doc(
+ signature.storedObject,
+ signature.storedObject.currentVersion
+ );
} catch (e) {
console.error("error while downloading and decrypting document", e);
throw e;
@@ -498,6 +499,12 @@ const removeNewZone = async () => {
adding.value = false;
};
+const getReturnPath = () =>
+ window.location.search
+ ? window.location.search.split("?returnPath=")[1] ??
+ window.location.pathname
+ : window.location.pathname;
+
downloadAndOpen();
diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php
index 277a18142..4e4b4928a 100644
--- a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php
+++ b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php
@@ -377,7 +377,10 @@ class WorkflowController extends AbstractController
$signature = $this->entityManager->getRepository(EntityWorkflowStepSignature::class)->find($signature_id);
if ($signature->getSigner() instanceof User) {
- return $this->redirectToRoute('chill_main_workflow_signature_add', ['id' => $signature_id]);
+ return $this->redirectToRoute('chill_main_workflow_signature_add', [
+ 'id' => $signature_id,
+ 'returnPath' => $request->query->get('returnPath', null),
+ ]);
}
$metadataForm = $this->createForm(WorkflowSignatureMetadataType::class);
@@ -401,7 +404,10 @@ class WorkflowController extends AbstractController
$this->entityManager->persist($signature);
$this->entityManager->flush();
- return $this->redirectToRoute('chill_main_workflow_signature_add', ['id' => $signature_id]);
+ return $this->redirectToRoute('chill_main_workflow_signature_add', [
+ 'id' => $signature_id,
+ 'returnPath' => $request->query->get('returnPath', null),
+ ]);
}
return $this->render(