Corrections pour register_glo

This commit is contained in:
Rodolphe Quiedeville 2004-07-13 14:00:29 +00:00
parent ad9b652c67
commit 35ad01f9b7

View File

@ -233,12 +233,12 @@ if ($action == 'create')
} }
else else
{ {
if ($id) if ($_GET["id"])
{ {
if ($action <> 're-edit') if ($action <> 're-edit')
{ {
$product = new Product($db); $product = new Product($db);
$result = $product->fetch($id); $result = $product->fetch($_GET["id"]);
} }
if ( $result ) if ( $result )
@ -267,6 +267,10 @@ else
$head[1][0] = DOL_URL_ROOT."/product/price.php?id=".$product->id; $head[1][0] = DOL_URL_ROOT."/product/price.php?id=".$product->id;
$head[1][1] = 'Prix'; $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); dolibarr_fiche_head($head, 0, 'Fiche '.$types[$product->type].' : '.$product->ref);
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
@ -282,8 +286,8 @@ else
print "<b>Cet article n'est pas en vente</b>"; print "<b>Cet article n'est pas en vente</b>";
} }
print '</td></tr>'; print '</td></tr>';
print "<tr><td>Libellé</td><td>$product->libelle</td>"; print '<tr><td>Libellé</td><td colspan="2">'.$product->libelle.'</td></tr>';
print '<td><a href="stats/fiche.php?id='.$id.'">Statistiques</a></td></tr>';
print '<tr><td>Prix de vente</td><td>'.price($product->price).'</td>'; print '<tr><td>Prix de vente</td><td>'.price($product->price).'</td>';
if ($product->type == 1) { if ($product->type == 1) {
$nblignefour=4; $nblignefour=4;
@ -291,11 +295,11 @@ else
$nblignefour=3; $nblignefour=3;
} }
print '<td valign="top" rowspan="'.$nblignefour.'">'; print '<td valign="top" rowspan="'.$nblignefour.'">';
print 'Fournisseurs [<a href="fiche.php?id='.$id.'&amp;action=ajout_fourn">Ajouter</a>]'; print 'Fournisseurs [<a href="fiche.php?id='.$product->id.'&amp;action=ajout_fourn">Ajouter</a>]';
$sql = "SELECT s.nom, s.idp"; $sql = "SELECT s.nom, s.idp";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."product_fournisseur as pf"; $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)"; $sql .= " ORDER BY lower(s.nom)";
if ( $db->query($sql) ) if ( $db->query($sql) )