diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index b383fb91e64..24fa6740d55 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -233,12 +233,12 @@ if ($action == 'create') } else { - if ($id) + if ($_GET["id"]) { if ($action <> 're-edit') { $product = new Product($db); - $result = $product->fetch($id); + $result = $product->fetch($_GET["id"]); } if ( $result ) @@ -267,6 +267,10 @@ else $head[1][0] = DOL_URL_ROOT."/product/price.php?id=".$product->id; $head[1][1] = 'Prix'; + $head[2][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id; + $head[2][1] = 'Statistiques'; + + dolibarr_fiche_head($head, 0, 'Fiche '.$types[$product->type].' : '.$product->ref); print '
| Libellé | $product->libelle | "; - print 'Statistiques |
| Libellé | '.$product->libelle.' | |
| Prix de vente | '.price($product->price).' | '; if ($product->type == 1) { $nblignefour=4; @@ -291,11 +295,11 @@ else $nblignefour=3; } print '';
- print 'Fournisseurs [Ajouter]';
+ print 'Fournisseurs [Ajouter]';
$sql = "SELECT s.nom, s.idp";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur as pf";
- $sql .=" WHERE pf.fk_soc = s.idp AND pf.fk_product =$id";
+ $sql .=" WHERE pf.fk_soc = s.idp AND pf.fk_product = ".$product->id;
$sql .= " ORDER BY lower(s.nom)";
if ( $db->query($sql) )
@@ -370,54 +374,54 @@ else
print " \n"; - if ($action == 'edit_price' && $user->rights->produit->creer) - { - print ' Nouveau prix ';
- print "';
- }
-
- /*
- * Ajouter un fournisseur
- *
- */
- if ($action == 'ajout_fourn' && $user->rights->produit->creer)
- {
- print_titre ("Ajouter un fournisseur");
- print "';
- }
-
+ if ($action == 'edit_price' && $user->rights->produit->creer)
+ {
+ print 'Nouveau prix ';
+ print "';
}
-
+
+ /*
+ * Ajouter un fournisseur
+ *
+ */
+ if ($action == 'ajout_fourn' && $user->rights->produit->creer)
+ {
+ print_titre ("Ajouter un fournisseur");
+ print "';
+ }
+
+ }
+
/*
* Fiche en mode edition
*/
|