From a7b0a837d4d724cb88a2da46b027b2c4ca1a4ddb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 1 Sep 2021 18:46:06 +0200 Subject: [PATCH] Fix cancel button must be named "$cancel" everywhere. --- htdocs/comm/card.php | 4 ++-- htdocs/contrat/card.php | 15 ++++----------- htdocs/fourn/card.php | 4 ++-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index dd71918031a..f891bf722cc 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -108,7 +108,7 @@ if (!$sortorder) { if (!$sortfield) { $sortfield = "nom"; } -$cancelbutton = GETPOST('cancel', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); $object = new Client($db); $extrafields = new ExtraFields($db); @@ -152,7 +152,7 @@ if ($reshook < 0) { } if (empty($reshook)) { - if ($cancelbutton) { + if ($cancel) { $action = ""; } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 56e3d797086..11436fef7fa 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -806,8 +806,7 @@ if (empty($reshook)) { $action = 'edit_extras'; } } elseif ($action == 'setref_supplier') { - $cancelbutton = GETPOST('cancel', 'alpha'); - if (!$cancelbutton) { + if (!$cancel) { $object->oldcopy = dol_clone($object); $result = $object->setValueFrom('ref_supplier', GETPOST('ref_supplier', 'alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY'); @@ -823,9 +822,7 @@ if (empty($reshook)) { exit; } } elseif ($action == 'setref_customer') { - $cancelbutton = GETPOST('cancel', 'alpha'); - - if (!$cancelbutton) { + if (!$cancel) { $object->oldcopy = dol_clone($object); $result = $object->setValueFrom('ref_customer', GETPOST('ref_customer', 'alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY'); @@ -841,9 +838,7 @@ if (empty($reshook)) { exit; } } elseif ($action == 'setref') { - $cancelbutton = GETPOST('cancel', 'alpha'); - - if (!$cancelbutton) { + if (!$cancel) { $result = $object->fetch($id); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -878,9 +873,7 @@ if (empty($reshook)) { exit; } } elseif ($action == 'setdate_contrat') { - $cancelbutton = GETPOST('cancel', 'alpha'); - - if (!$cancelbutton) { + if (!$cancel) { $result = $object->fetch($id); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 971e98012b8..12b7b09cf53 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -54,7 +54,7 @@ $langs->loadLangs(array( )); $action = GETPOST('action', 'aZ09'); -$cancelbutton = GETPOST('cancel', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); // Security check $id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); @@ -93,7 +93,7 @@ if ($reshook < 0) { } if (empty($reshook)) { - if ($cancelbutton) { + if ($cancel) { $action = ""; }