diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php
index 0025bf21759..856311d8ead 100644
--- a/htdocs/product/fiche.php
+++ b/htdocs/product/fiche.php
@@ -74,23 +74,23 @@ if ($_POST["action"] == 'update' &&
$product->duration_unit = $_POST["duration_unit"];
if ($product->check())
- {
- if ($product->update($product->id, $user))
- {
- $_GET["action"] = '';
- $mesg = 'Fiche mise à jour';
- }
- else
- {
- $_GET["action"] = 're-edit';
- $mesg = 'Fiche non mise à jour !' . "
" . $product->mesg_error;
- }
- }
+ {
+ if ($product->update($product->id, $user))
+ {
+ $_GET["action"] = '';
+ $mesg = 'Fiche mise à jour';
+ }
+ else
+ {
+ $_GET["action"] = 're-edit';
+ $mesg = 'Fiche non mise à jour !' . "
" . $product->mesg_error;
+ }
+ }
else
- {
- $_GET["action"] = 're-edit';
- $mesg = 'Fiche non mise à jour !' . "
" . $product->mesg_error;
- }
+ {
+ $_GET["action"] = 're-edit';
+ $mesg = 'Fiche non mise à jour !' . "
" . $product->mesg_error;
+ }
}
Header("Location: fiche.php?id=".$product->id);
}
@@ -99,19 +99,15 @@ if ($_POST["action"] == 'update' &&
if ($_POST["action"] == 'addinpropal')
{
$propal = New Propal($db);
-
$propal->fetch($_POST["propalid"]);
+
$result = $propal->insert_product($_GET["id"], $_POST["qty"], $_POST["remise_percent"]);
if ( $result < 0)
{
$mesg = "erreur $result";
}
- else
- {
- $mesg = ucfirst($types[$type]) . ' ajouté à la proposition ';
- $mesg .= ''.$propal->ref.'';
- }
- $_GET["action"] = '';
+
+ Header("Location: ../comm/propal.php?propalid=".$propal->id);
}
if ($_POST["action"] == 'addinfacture' &&
@@ -267,10 +263,10 @@ else
if ($_GET["id"])
{
if ($_GET["action"] <> 're-edit')
- {
- $product = new Product($db);
- $result = $product->fetch($_GET["id"]);
- }
+ {
+ $product = new Product($db);
+ $result = $product->fetch($_GET["id"]);
+ }
if ( $result )
{
@@ -310,7 +306,8 @@ else
$head[$h][1] = 'Statistiques';
dolibarr_fiche_head($head, 0, 'Fiche '.$types[$product->type].' : '.$product->ref);
- print($mesg);
+
+ print($mesg);
print '
| Référence | '.$product->ref.' | '; @@ -602,7 +599,6 @@ print ""; if ($_GET["id"] && $_GET["action"] == '' && $product->envente) { - $htmls = new Form($db); $propal = New Propal($db); @@ -636,9 +632,8 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente) print "propalid\">$objp->ref | \n"; print "idp\">$objp->nom | \n"; print "". strftime("%d %B %Y",$objp->dp)." | \n"; - print '