From 7ca87d9874ef2af9f8aec4411e8f755d9e017c37 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+BB2A-Anthony@users.noreply.github.com> Date: Thu, 4 Jul 2024 21:34:43 +0200 Subject: [PATCH] FIX - Pos propal sign page number starting from the end (#30243) * FIX - Pos propal sign page number starting from the end * Update onlineSign.php --------- Co-authored-by: Anthony Berton Co-authored-by: Laurent Destailleur --- htdocs/core/ajax/onlineSign.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/ajax/onlineSign.php b/htdocs/core/ajax/onlineSign.php index 08a9ad5c05e..1e3480fa803 100644 --- a/htdocs/core/ajax/onlineSign.php +++ b/htdocs/core/ajax/onlineSign.php @@ -181,8 +181,12 @@ if ($action == "importSignature") { $s = $pdf->getTemplatesize($tppl); $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); $pdf->useTemplate($tppl); + $propalsignonspecificpage = getDolGlobalInt("PROPAL_SIGNATURE_ON_SPECIFIC_PAGE"); + if ($propalsignonspecificpage < 0) { + $propalsignonspecificpage = $pagecount - abs($propalsignonspecificpage); + } - if (getDolGlobalString("PROPAL_SIGNATURE_ON_ALL_PAGES") || getDolGlobalInt("PROPAL_SIGNATURE_ON_SPECIFIC_PAGE") == $i) { + if (getDolGlobalString("PROPAL_SIGNATURE_ON_ALL_PAGES") || $propalsignonspecificpage == $i) { // A signature image file is 720 x 180 (ratio 1/4) but we use only the size into PDF // TODO Get position of box from PDF template