Fix cancel button must be named "$cancel" everywhere.

This commit is contained in:
Laurent Destailleur 2021-09-01 18:46:06 +02:00
parent 270eede593
commit a7b0a837d4
3 changed files with 8 additions and 15 deletions

View File

@ -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 = "";
}

View File

@ -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');

View File

@ -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 = "";
}