Skip to content
Snippets Groups Projects
Commit 7670ae46 authored by Marcos García de La Fuente's avatar Marcos García de La Fuente
Browse files

Fix [ bug #1778 ] Cancel button of edit ref. supplier contract card saves...

 Fix [ bug #1778 ] Cancel button of edit ref. supplier contract card saves changes instead of cancelling
parent de137dd0
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -718,19 +719,25 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
setEventMessage($object->error,'errors');
}
} elseif ($action=='setref_supplier') {
$result = $object->fetch($id);
if ($result < 0) {
setEventMessage($object->errors,'errors');
}
$object->ref_supplier=GETPOST('ref_supplier','alpha');
$result = $object->update($user);
if ($result < 0) {
setEventMessage($object->errors,'errors');
$action='editref_supplier';
} else {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
$cancelbutton = GETPOST('cancel');
if (!$cancelbutton) {
$result = $object->fetch($id);
if ($result < 0) {
setEventMessage($object->errors, 'errors');
}
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
$result = $object->update($user);
if ($result < 0) {
setEventMessage($object->errors, 'errors');
$action = 'editref_supplier';
} else {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
}
} elseif ($action=='setref') {
$object->ref=GETPOST('ref','alpha');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment