mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Signature: add and process returnPath in the signature app
This commit is contained in:
parent
0d62d8d1c6
commit
479a02bbc7
@ -124,9 +124,9 @@
|
|||||||
>
|
>
|
||||||
{{ $t("cancel") }}
|
{{ $t("cancel") }}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-delete" @click="undoSign">
|
<a class="btn btn-delete" :href="getReturnPath()">
|
||||||
{{ $t("cancel_signing") }}
|
{{ $t("cancel_signing") }}
|
||||||
</button>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -157,9 +157,7 @@ console.log(PdfWorker); // incredible but this is needed
|
|||||||
// pdfjsLib.GlobalWorkerOptions.workerSrc = PdfWorker;
|
// pdfjsLib.GlobalWorkerOptions.workerSrc = PdfWorker;
|
||||||
|
|
||||||
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
|
import Modal from "ChillMainAssets/vuejs/_components/Modal.vue";
|
||||||
import {
|
import { download_and_decrypt_doc } from "../StoredObjectButton/helpers";
|
||||||
download_and_decrypt_doc,
|
|
||||||
} from "../StoredObjectButton/helpers";
|
|
||||||
|
|
||||||
pdfjsLib.GlobalWorkerOptions.workerSrc = "pdfjs-dist/build/pdf.worker.mjs";
|
pdfjsLib.GlobalWorkerOptions.workerSrc = "pdfjs-dist/build/pdf.worker.mjs";
|
||||||
|
|
||||||
@ -215,7 +213,10 @@ const setPage = async (page: number) => {
|
|||||||
async function downloadAndOpen(): Promise<Blob> {
|
async function downloadAndOpen(): Promise<Blob> {
|
||||||
let raw;
|
let raw;
|
||||||
try {
|
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) {
|
} catch (e) {
|
||||||
console.error("error while downloading and decrypting document", e);
|
console.error("error while downloading and decrypting document", e);
|
||||||
throw e;
|
throw e;
|
||||||
@ -498,6 +499,12 @@ const removeNewZone = async () => {
|
|||||||
adding.value = false;
|
adding.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getReturnPath = () =>
|
||||||
|
window.location.search
|
||||||
|
? window.location.search.split("?returnPath=")[1] ??
|
||||||
|
window.location.pathname
|
||||||
|
: window.location.pathname;
|
||||||
|
|
||||||
downloadAndOpen();
|
downloadAndOpen();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -377,7 +377,10 @@ class WorkflowController extends AbstractController
|
|||||||
$signature = $this->entityManager->getRepository(EntityWorkflowStepSignature::class)->find($signature_id);
|
$signature = $this->entityManager->getRepository(EntityWorkflowStepSignature::class)->find($signature_id);
|
||||||
|
|
||||||
if ($signature->getSigner() instanceof User) {
|
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);
|
$metadataForm = $this->createForm(WorkflowSignatureMetadataType::class);
|
||||||
@ -401,7 +404,10 @@ class WorkflowController extends AbstractController
|
|||||||
$this->entityManager->persist($signature);
|
$this->entityManager->persist($signature);
|
||||||
$this->entityManager->flush();
|
$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(
|
return $this->render(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user