This commit is contained in:
Juanjo Menent 2015-08-07 18:01:13 +02:00
parent 841cc0fe5e
commit fd6f7dfa61

View File

@ -782,19 +782,31 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
exit; exit;
} }
} }
else {
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
exit;
}
} elseif ($action=='setref') { } elseif ($action=='setref') {
$cancelbutton = GETPOST('cancel');
if (!$cancelbutton) {
$result = $object->fetch($id); $result = $object->fetch($id);
if ($result < 0) { if ($result < 0) {
setEventMessage($object->errors, 'errors'); setEventMessage($object->errors, 'errors');
} }
$object->ref=GETPOST('ref','alpha'); $object->ref = GETPOST('ref', 'alpha');
$result = $object->update($user); $result = $object->update($user);
if ($result < 0) { if ($result < 0) {
setEventMessage($object->errors,'errors'); setEventMessage($object->errors, 'errors');
$action='editref'; $action = 'editref';
} else { } else {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
exit;
}
}
else {
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
exit; exit;
} }
} }