Add option PROPAL_SIGNATURE_ON_SPECIFIC_PAGE

This commit is contained in:
Laurent Destailleur 2024-04-18 00:01:22 +02:00
parent b1fd07a655
commit 42b0fa2e88
2 changed files with 8 additions and 7 deletions

View file

@ -1,7 +1,6 @@
<?php
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*/
/*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
@ -18,7 +17,7 @@
/**
* \file /htdocs/core/ajax/onlineSign.php
* \brief File to make Ajax action on Knowledge Management
* \brief File to make Ajax action to add the signature of a document
*/
if (!defined('NOTOKENRENEWAL')) {
@ -172,7 +171,7 @@ if ($action == "importSignature") {
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
$pdf->useTemplate($tppl);
if (getDolGlobalString("PROPAL_SIGNATURE_ON_ALL_PAGES")) {
if (getDolGlobalString("PROPAL_SIGNATURE_ON_ALL_PAGES") || getDolGlobalInt("PROPAL_SIGNATURE_ON_SPECIFIC_PAGE") == $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
@ -189,7 +188,7 @@ if ($action == "importSignature") {
}
}
if (!getDolGlobalString("PROPAL_SIGNATURE_ON_ALL_PAGES")) {
if (!getDolGlobalString("PROPAL_SIGNATURE_ON_ALL_PAGES") && !getDolGlobalInt("PROPAL_SIGNATURE_ON_SPECIFIC_PAGE")) {
// 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
@ -636,7 +635,7 @@ if ($action == "importSignature") {
}
} else {
$error++;
$response = "cannot find Rib";
$response = "cannot find BAN/RIB";
}
if (!$error) {
@ -693,7 +692,7 @@ echo $response;
/**
* Output the signature file
* Output the signature file into the PDF object.
*
* @param TCPDF $pdf PDF handler
* @param Translate $langs Language

View file

@ -208,6 +208,8 @@ if ($action == 'confirm_refusepropal' && $confirm == 'yes') {
$object->fetch(0, $ref);
}
// $action == "dosign" is handled later...
/*
* View