| '.$langs->trans("Status").' | ';
diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php
index 71444072e8c..df6bc7a377c 100644
--- a/htdocs/product/photos.php
+++ b/htdocs/product/photos.php
@@ -52,7 +52,7 @@ $types[1] = $langs->trans("Service");
* Actions
*/
-if ($_POST["sendit"] && defined('MAIN_UPLOAD_DOC') && MAIN_UPLOAD_DOC == 1)
+if ($_POST["sendit"] && $conf->global->MAIN_UPLOAD_DOC)
{
if ($_GET["id"])
{
@@ -80,11 +80,12 @@ if ($_GET["action"] == 'delete' && $_GET["file"])
llxHeader("","",$langs->trans("CardProduct0"));
-if ($_GET["id"])
+if ($_GET["id"] || $_GET["ref"])
{
$product = new Product($db);
- $result = $product->fetch($_GET["id"]);
+ if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
+ if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
if ($result)
{
@@ -157,14 +158,26 @@ if ($_GET["id"])
$head[$h][1] = $langs->trans('Documents');
$h++;
- dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
+ $titre=$langs->trans("CardProduct".$product->type);
+ dolibarr_fiche_head($head, $hselected, $titre);
print($mesg);
print '';
+
+ // Reference
print '';
- print '| '.$langs->trans("Ref").' | '.$product->ref.' | ';
+ print ''.$langs->trans("Ref").' | ';
+ $product->load_previous_next_ref();
+ $previous_ref = $product->ref_previous?'ref_previous.'">'.img_previous().'':'';
+ $next_ref = $product->ref_next?'ref_next.'">'.img_next().'':'';
+ if ($previous_ref || $next_ref) print '';
+ print ' | ';
print ' ';
+
+ // Libelle
print '| '.$langs->trans("Label").' | '.$product->libelle.' | ';
print ' ';
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index e324e55c2b8..23270f28d27 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -80,7 +80,8 @@ if ($_POST["action"] == 'update_price' &&
llxHeader("","",$langs->trans("Price"));
$product = new Product($db);
-$result = $product->fetch($_GET["id"]);
+if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
+if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
$h=0;
@@ -146,12 +147,24 @@ $head[$h][0] = DOL_URL_ROOT.'/product/document.php?id='.$product->id;
$head[$h][1] = $langs->trans('Documents');
$h++;
-dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
+$titre=$langs->trans("CardProduct".$product->type);
+dolibarr_fiche_head($head, $hselected, $titre);
print '';
+
+// Reference
print '';
-print '| '.$langs->trans("Ref").' | '.$product->ref.' | ';
+print ''.$langs->trans("Ref").' | ';
+$product->load_previous_next_ref();
+$previous_ref = $product->ref_previous?'ref_previous.'">'.img_previous().'':'';
+$next_ref = $product->ref_next?'ref_next.'">'.img_next().'':'';
+if ($previous_ref || $next_ref) print '';
+print ' | ';
print ' ';
+
+// Libelle
print '| '.$langs->trans("Label").' | '.$product->libelle.' | ';
print ' ';
diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php
index e6c47183b66..d72fa43e8d6 100644
--- a/htdocs/product/stats/facture.php
+++ b/htdocs/product/stats/facture.php
@@ -47,16 +47,12 @@ $pagenext = $_GET["page"] + 1;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="f.datef";
-
+// Securite
+$socid = 0;
if ($user->societe_id > 0)
{
- $action = '';
$socid = $user->societe_id;
}
-else
-{
- $socid = 0;
-}
/*
@@ -67,10 +63,11 @@ else
llxHeader();
-if ($_GET["id"])
+if ($_GET["id"] || $_GET["ref"])
{
$product = new Product($db);
- $result = $product->fetch($_GET["id"]);
+ if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
+ if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
if ($result > 0)
{
@@ -101,7 +98,6 @@ if ($_GET["id"])
}
}
-
$head[$h][0] = DOL_URL_ROOT."/product/photos.php?id=".$product->id;
$head[$h][1] = $langs->trans("Photos");
$h++;
@@ -143,14 +139,24 @@ if ($_GET["id"])
$head[$h][1] = $langs->trans('Documents');
$h++;
- dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
-
+ $titre=$langs->trans("CardProduct".$product->type);
+ dolibarr_fiche_head($head, $hselected, $titre);
print '';
+ // Reference
print '';
- print '| '.$langs->trans("Ref").' | '.$product->ref.' | ';
+ print ''.$langs->trans("Ref").' | ';
+ $product->load_previous_next_ref();
+ $previous_ref = $product->ref_previous?'ref_previous.'">'.img_previous().'':'';
+ $next_ref = $product->ref_next?'ref_next.'">'.img_next().'':'';
+ if ($previous_ref || $next_ref) print '';
+ print ' | ';
print ' ';
+
+ // Libelle
print '| '.$langs->trans("Label").' | '.$product->libelle.' | ';
print ' ';
@@ -163,10 +169,10 @@ if ($_GET["id"])
else print $langs->trans("NotOnSell");
print '';
- print '| '.$langs->trans("Referers").' | ';
- print ''.$langs->trans("NbOfCustomers").' | ';
- print ''.$langs->trans("NbOfReferers").' | ';
- print ''.$langs->trans("TotalQuantity").' | ';
+ print ' | '.$langs->trans("Referers").' | ';
+ print ''.$langs->trans("NbOfCustomers").' | ';
+ print ''.$langs->trans("NbOfReferers").' | ';
+ print ''.$langs->trans("TotalQuantity").' | ';
print ' ';
// Propals
diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php
index 7851f580eba..8fb14b4029e 100644
--- a/htdocs/product/stats/fiche.php
+++ b/htdocs/product/stats/fiche.php
@@ -58,11 +58,11 @@ $mesg = '';
/*
*
*/
-
-if ($_GET["id"])
+if ($_GET["id"] || $_GET["ref"])
{
$product = new Product($db);
- $result = $product->fetch($_GET["id"]);
+ if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
+ if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
if ($result)
{
@@ -187,13 +187,24 @@ if ($_GET["id"])
$head[$h][1] = $langs->trans('Documents');
$h++;
- dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref);
-
+ $titre=$langs->trans("CardProduct".$product->type);
+ dolibarr_fiche_head($head, $hselected, $titre);
print '';
+
+ // Reference
print '';
- print '| '.$langs->trans("Ref").' | '.$product->ref.' | ';
+ print ''.$langs->trans("Ref").' | ';
+ $product->load_previous_next_ref();
+ $previous_ref = $product->ref_previous?'ref_previous.'">'.img_previous().'':'';
+ $next_ref = $product->ref_next?'ref_next.'">'.img_next().'':'';
+ if ($previous_ref || $next_ref) print '';
+ print ' | ';
print ' ';
+
+ // Libelle
print '| '.$langs->trans("Label").' | '.$product->libelle.' | ';
print '| '.$langs->trans("SellingPrice").' | '.price($product->price).' | ';
@@ -204,10 +215,10 @@ if ($_GET["id"])
else print $langs->trans("NotOnSell");
print ' ';
- print '| '.$langs->trans("Referers").' | ';
- print ''.$langs->trans("NbOfCustomers").' | ';
- print ''.$langs->trans("NbOfReferers").' | ';
- print ''.$langs->trans("TotalQuantity").' | ';
+ print ' | '.$langs->trans("Referers").' | ';
+ print ''.$langs->trans("NbOfCustomers").' | ';
+ print ''.$langs->trans("NbOfReferers").' | ';
+ print ''.$langs->trans("TotalQuantity").' | ';
print ' ';
// Propals
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index d0b1d2d1e85..94833a00254 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -98,12 +98,13 @@ if ($_POST["action"] == "transfert_stock" && $_POST["cancel"] <> $langs->trans("
* Fiche stock
*
*/
-if ($_GET["id"])
+if ($_GET["id"] || $_GET["ref"])
{
-
$product = new Product($db);
+ if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
+ if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
- if ( $product->fetch($_GET["id"]))
+ if ($result > 0)
{
$h=0;
@@ -175,9 +176,16 @@ if ($_GET["id"])
// Reference
print '';
- print '| '.$langs->trans("Ref").' | '.$product->ref.' | ';
+ print ''.$langs->trans("Ref").' | ';
+ $product->load_previous_next_ref();
+ $previous_ref = $product->ref_previous?'ref_previous.'">'.img_previous().'':'';
+ $next_ref = $product->ref_next?'ref_next.'">'.img_next().'':'';
+ if ($previous_ref || $next_ref) print '';
+ print ' | ';
print ' ';
-
+
// Libellé
print '| '.$langs->trans("Label").' | '.$product->libelle.' | ';
print ' ';
@@ -194,7 +202,7 @@ if ($_GET["id"])
// TVA
$langs->load("bills");
- print '| '.$langs->trans("VATRate").' | '.$product->tva_tx.' % | ';
+ print '| '.$langs->trans("VATRate").' | '.$product->tva_tx.'% | ';
// Stock
if ($product->type == 0 && $conf->stock->enabled)
@@ -221,9 +229,8 @@ if ($_GET["id"])
print " ";
/*
- * Contenu des stocks
- *
- */
+ * Contenu des stocks
+ */
print '
';
print '| '.$langs->trans("Warehouse").' | Valeur du stock | ';
$sql = "SELECT e.rowid, e.label, ps.reel FROM ".MAIN_DB_PREFIX."entrepot as e, ".MAIN_DB_PREFIX."product_stock as ps";
@@ -249,9 +256,8 @@ if ($_GET["id"])
print '';
/*
- * Correction du stock
- *
- */
+ * Correction du stock
+ */
if ($_GET["action"] == "correction")
{
print_titre ("Correction du stock");
@@ -288,10 +294,10 @@ if ($_GET["id"])
print '';
}
+
/*
- * Transfert de pièces
- *
- */
+ * Transfert de pièces
+ */
if ($_GET["action"] == "transfert")
{
print_titre ("Transfert de stock");
@@ -344,13 +350,13 @@ if ($_GET["id"])
print '';
}
+
/*
- *
- *
- */
+ *
+ */
if ($_GET["action"] == "definir")
{
- print_titre ("Créer un stock");
+ print_titre($langs->trans("SetStock"));
print " |