Fix cancel button must be named "$cancel" everywhere.
This commit is contained in:
parent
270eede593
commit
a7b0a837d4
@ -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 = "";
|
||||
}
|
||||
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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 = "";
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user