From 9e17fe8f4e95d458ebb3dc3de23606b2c49fa171 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 10 Feb 2022 15:16:59 +0100 Subject: [PATCH] Fix bad cancelation --- htdocs/fourn/facture/paiement.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 848e1a01173..6dc609041c8 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -47,6 +47,9 @@ $langs->loadLangs(array('companies', 'bills', 'banks', 'compta')); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); +$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $facid = GETPOST('facid', 'int'); $socid = GETPOST('socid', 'int'); @@ -110,6 +113,18 @@ $arrayfields = array(); * Actions */ +if ($cancel) { + if (!empty($backtopageforcancel)) { + header("Location: ".$backtopageforcancel); + exit; + } elseif (!empty($backtopage)) { + header("Location: ".$backtopage); + exit; + } + header("Location: ".DOL_URL_ROOT.'/fourn/facture/list.php'); + exit; +} + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $search_ref = ""; $search_account = ""; @@ -779,7 +794,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
'; print '
'; print ''; - print '   '; + print '   '; print '
'; }