Fix: affichage du header en fonction du produit/service

This commit is contained in:
Regis Houssin 2006-06-10 09:27:34 +00:00
parent 4a02dce0cf
commit 4c7024033c
12 changed files with 28 additions and 22 deletions

View File

@ -34,6 +34,7 @@ require('./pre.inc.php');
require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php");
$langs->load("other"); $langs->load("other");
$langs->load("products");
$user->getrights('produit'); $user->getrights('produit');
@ -81,7 +82,7 @@ if ($_POST["sendit"] && $conf->upload)
llxHeader(); llxHeader("","",$langs->trans("CardProduct".$product->type));
if ($product->id) if ($product->id)

View File

@ -314,8 +314,6 @@ if ($_POST["cancel"] == $langs->trans("Cancel"))
} }
llxHeader("","",$langs->trans("ProductServiceCard"));
$html = new Form($db); $html = new Form($db);
@ -333,6 +331,8 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer)
$product = $e_product; $product = $e_product;
} }
llxHeader("","",$langs->trans("CardProduct".$product->type));
print '<form action="fiche.php" method="post">'; print '<form action="fiche.php" method="post">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="type" value="'.$_GET["type"].'">'."\n"; print '<input type="hidden" name="type" value="'.$_GET["type"].'">'."\n";
@ -421,6 +421,7 @@ if ($_GET["id"] || $_GET["ref"])
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type));
} }
if ( $result ) if ( $result )

View File

@ -135,8 +135,6 @@ if ($_POST["cancel"] == $langs->trans("Cancel"))
} }
llxHeader("","",$langs->trans("CardProduct".$product->type));
/* /*
* Fiche produit * Fiche produit
@ -148,6 +146,7 @@ if ($_GET["id"] || $_GET["ref"])
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type));
} }
if ( $result ) if ( $result )

View File

@ -77,8 +77,6 @@ if ($_GET["action"] == 'delete' && $_GET["file"])
* *
*/ */
llxHeader("","",$langs->trans("CardProduct0"));
if ($_GET["id"] || $_GET["ref"]) if ($_GET["id"] || $_GET["ref"])
{ {
@ -86,6 +84,8 @@ if ($_GET["id"] || $_GET["ref"])
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type));
if ($result) if ($result)
{ {

View File

@ -88,12 +88,11 @@ if ($_POST["action"] == 'update_price' &&
* Affiche historique prix * Affiche historique prix
*/ */
llxHeader("","",$langs->trans("Price"));
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type));
$h=0; $h=0;

View File

@ -39,7 +39,7 @@ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
$langs->load("bills"); $langs->load("bills");
$langs->load("product"); $langs->load("products");
$mesg = ''; $mesg = '';
@ -134,7 +134,7 @@ if ($cancel == $langs->trans("Cancel"))
exit; exit;
} }
llxHeader("","",$langs->trans("ProductServiceCard")); llxHeader("","",$langs->trans("CardProduct".$product->type));
$html = new Form($db); $html = new Form($db);

View File

@ -34,6 +34,7 @@ require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php");
$langs->load("orders"); $langs->load("orders");
$langs->load("products");
$mesg = ''; $mesg = '';
@ -66,14 +67,14 @@ else
* *
*/ */
llxHeader();
if ($_GET["id"] || $_GET["ref"]) if ($_GET["id"] || $_GET["ref"])
{ {
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type));
if ($result > 0) if ($result > 0)
{ {

View File

@ -34,6 +34,7 @@ require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php");
$langs->load("contracts"); $langs->load("contracts");
$langs->load("products");
$mesg = ''; $mesg = '';
@ -65,14 +66,14 @@ else
* *
*/ */
llxHeader();
if ($_GET["id"] || $_GET["ref"]) if ($_GET["id"] || $_GET["ref"])
{ {
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type));
if ($result > 0) if ($result > 0)
{ {

View File

@ -34,6 +34,7 @@ require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php");
$langs->load("bills"); $langs->load("bills");
$langs->load("products");
$mesg = ''; $mesg = '';
@ -60,14 +61,14 @@ if ($user->societe_id > 0)
* *
*/ */
llxHeader();
if ($_GET["id"] || $_GET["ref"]) if ($_GET["id"] || $_GET["ref"])
{ {
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type));
if ($result > 0) if ($result > 0)
{ {

View File

@ -50,8 +50,6 @@ else
} }
llxHeader('',$langs->trans("Statistics"));
$mesg = ''; $mesg = '';
@ -63,6 +61,8 @@ if ($_GET["id"] || $_GET["ref"])
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type));
if ($result) if ($result)
{ {

View File

@ -32,6 +32,8 @@ require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/propal.class.php"); require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php");
$langs->load("products");
$mesg = ''; $mesg = '';
$page = $_GET["page"]; $page = $_GET["page"];
@ -63,13 +65,14 @@ else
* *
*/ */
llxHeader();
if ($_GET["id"] || $_GET["ref"]) if ($_GET["id"] || $_GET["ref"])
{ {
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type));
if ( $result > 0) if ( $result > 0)
{ {

View File

@ -49,8 +49,6 @@ $types[0] = $langs->trans("Product");
$types[1] = $langs->trans("Service"); $types[1] = $langs->trans("Service");
llxHeader("","",$langs->trans("CardProduct0"));
if ($_POST["action"] == "create_stock") if ($_POST["action"] == "create_stock")
{ {
$product = new Product($db); $product = new Product($db);
@ -104,6 +102,8 @@ if ($_GET["id"] || $_GET["ref"])
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type));
if ($result > 0) if ($result > 0)
{ {