diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 376697cfcad..e6c876c23f6 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -92,7 +92,7 @@ if (empty($reshook)) { $object->fetch($id); $result = $object->setValueFrom('fk_product_type', $_POST['fk_product_type']); - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } @@ -101,7 +101,7 @@ if (empty($reshook)) { $object->fetch($id); $result = $object->setValueFrom('fk_barcode_type', $_POST['fk_barcode_type']); - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } @@ -111,7 +111,7 @@ if (empty($reshook)) $object->fetch($id); //Todo: ajout verification de la validite du code barre en fonction du type $result = $object->setValueFrom('barcode', $_POST['barcode']); - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } @@ -227,7 +227,7 @@ if (empty($reshook)) if ($id > 0) { - Header("Location: fiche.php?id=".$id); + Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } else @@ -374,7 +374,7 @@ if (empty($reshook)) if ( ($object->type == 0 && $user->rights->produit->supprimer) || ($object->type == 1 && $user->rights->service->supprimer) ) { - $result = $object->delete($id); + $result = $object->delete($object->id); } if ($result > 0) @@ -677,7 +677,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) $object = new Product($db); $object->fetch($id, $ref); // For use with "pure canvas" (canvas that contains templates only) } - $objcanvas->assign_values($action, $id, $ref); // Set value for templates + $objcanvas->assign_values($action, $object->id, $ref); // Set value for templates $objcanvas->display_canvas($action); // Show template } else @@ -1277,7 +1277,7 @@ if ($action == 'clone' || $conf->use_javascript_ajax) array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("FeatureNotYetAvailable").')', 'value' => 0, 'disabled' => true) ); // Paiement incomplet. On demande si motif = escompte ou autre - $form->form_confirm($_SERVER["PHP_SELF"].'?id='.$id,$langs->trans('CloneProduct'),$langs->trans('ConfirmCloneProduct',$object->ref),'confirm_clone',$formquestion,'yes','action-clone',230,600); + $form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneProduct'),$langs->trans('ConfirmCloneProduct',$object->ref),'confirm_clone',$formquestion,'yes','action-clone',230,600); } @@ -1293,7 +1293,7 @@ if ($action == '' || $action == 'view') { if ($user->rights->produit->creer || $user->rights->service->creer) { - if ($object->no_button_edit <> 1) print ''.$langs->trans("Modify").''; + if ($object->no_button_edit <> 1) print 'id.'">'.$langs->trans("Modify").''; if ($object->no_button_copy <> 1) { @@ -1303,12 +1303,12 @@ if ($action == '' || $action == 'view') } else { - print ''.$langs->trans("ToClone").''; + print 'id.'">'.$langs->trans("ToClone").''; } } } - $object_is_used = $object->isObjectUsed($id); + $object_is_used = $object->isObjectUsed($object->id); if (($object->type == 0 && $user->rights->produit->supprimer) || ($object->type == 1 && $user->rights->service->supprimer)) { @@ -1320,7 +1320,7 @@ if ($action == '' || $action == 'view') } else { - print ''.$langs->trans("Delete").''; + print 'id.'">'.$langs->trans("Delete").''; } } else @@ -1391,7 +1391,7 @@ if ($id && ($action == '' || $action == 'view') && $object->status) { $objp = $db->fetch_object($result); $var=!$var; - print '