Fix cancel button

This commit is contained in:
ldestailleur
2025-10-07 14:40:15 +02:00
parent f815571248
commit dd4f55ca0a

View File

@@ -45,6 +45,7 @@ if (!$user->admin) {
}
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09');
$forceCSP = getDolGlobalString("MAIN_SECURITY_FORCECSP");
$selectarrayCSPDirectives = GetContentPolicyDirectives();
@@ -57,6 +58,10 @@ $error = 0;
* Actions
*/
if ($cancel) {
$action = '';
}
$reg = array();
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1];
@@ -356,7 +361,7 @@ print '</div>';
print '<div class="center">';
print '<input type="submit" class="button small" name="updateandstay" value="'.$langs->trans("Save").'">';
print '<input class="button button-cancel small" type="submit" name="preview" value="'.$langs->trans("Cancel").'">';
print '<input class="button button-cancel small" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';