Fix: Do not loose data from post if it fails

This commit is contained in:
Laurent Destailleur 2012-03-04 13:07:36 +01:00
parent 4677ebd4aa
commit 06dc5aa9dd

View File

@ -100,7 +100,7 @@ if (empty($reshook))
if ($action == 'setbarcodetype' && $user->rights->barcode->creer)
{
$object->fetch($id);
$result = $object->setValueFrom('fk_barcode_type', $_POST['barcodetype_id']);
$result = $object->setValueFrom('fk_barcode_type', $_POST['fk_barcode_type']);
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
exit;
}
@ -118,7 +118,7 @@ if (empty($reshook))
if ($action == 'setaccountancy_code_buy')
{
$object->fetch($id,$ref);
$result = $object->setValueFrom('accountancy_code_buy', $_POST['productaccountancycodebuy']);
$result = $object->setValueFrom('accountancy_code_buy', $_POST['accountancy_code_buy']);
if ($result < 0)
{
$mesg=join(',',$product->errors);
@ -131,7 +131,7 @@ if (empty($reshook))
$object->fetch($id,$ref);
$product->accountancy_code_sell=$_POST["productaccountancycodesell"];
$result=$product->update($product->id,$user,1,0,1);
$result = $object->setValueFrom('accountancy_code_sell', $_POST['productaccountancycodesell']);
$result = $object->setValueFrom('accountancy_code_sell', $_POST['accountancy_code_sell']);
if ($result < 0)
{
$mesg=join(',',$product->errors);