From ef43e34e214be070a7b59dbe494ba3cba58d7f2b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Jul 2006 00:27:20 +0000 Subject: [PATCH] Trad: Quelques traduction sur gestion stock Look: Ajout picto sur stats produit --- htdocs/product/stats/fiche.php | 8 +-- htdocs/product/stock/entrepot.class.php | 22 ++++++ htdocs/product/stock/product.php | 96 +++++++++++++++---------- 3 files changed, 83 insertions(+), 43 deletions(-) diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php index de794607fae..acb0e8aacce 100644 --- a/htdocs/product/stats/fiche.php +++ b/htdocs/product/stats/fiche.php @@ -244,7 +244,7 @@ if ($_GET["id"] || $_GET["ref"]) if ($ret < 0) dolibarr_print_error($db); $langs->load("propal"); print ''; - print ''.$langs->trans("Proposals").''; + print ''.img_object('','propal').' '.$langs->trans("Proposals").''; print ''; print $product->stats_propale['customers']; print ''; @@ -261,7 +261,7 @@ if ($_GET["id"] || $_GET["ref"]) if ($ret < 0) dolibarr_print_error($db); $langs->load("orders"); print ''; - print ''.$langs->trans("Orders").''; + print ''.img_object('','order').' '.$langs->trans("Orders").''; print ''; print $product->stats_commande['customers']; print ''; @@ -278,7 +278,7 @@ if ($_GET["id"] || $_GET["ref"]) if ($ret < 0) dolibarr_print_error($db); $langs->load("contracts"); print ''; - print ''.$langs->trans("Contracts").''; + print ''.img_object('','contract').' '.$langs->trans("Contracts").''; print ''; print $product->stats_contrat['customers']; print ''; @@ -295,7 +295,7 @@ if ($_GET["id"] || $_GET["ref"]) if ($ret < 0) dolibarr_print_error($db); $langs->load("bills"); print ''; - print ''.$langs->trans("Bills").''; + print ''.img_object('','bill').' '.$langs->trans("Bills").''; print ''; print $product->stats_facture['customers']; print ''; diff --git a/htdocs/product/stock/entrepot.class.php b/htdocs/product/stock/entrepot.class.php index af084f5972c..16e2546c403 100644 --- a/htdocs/product/stock/entrepot.class.php +++ b/htdocs/product/stock/entrepot.class.php @@ -331,5 +331,27 @@ class Entrepot return $this->statuts[$statut]; } + + + /** + * \brief Renvoie nom clicable (avec eventuellement le picto) + * \param withpicto Inclut le picto dans le lien + * \param option Sur quoi pointe le lien + * \return string Chaine avec URL + */ + function getNomUrl($withpicto=0,$option='') + { + global $langs; + + $result=''; + + $lien=''; + $lienfin=''; + + if ($withpicto) $result.=($lien.img_object($langs->trans("ShowStock"),'stock').$lienfin.' '); + $result.=$lien.$this->libelle.$lienfin; + return $result; + } + } ?> diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 689a6059649..8b663142d77 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -226,7 +226,7 @@ if ($_GET["id"] || $_GET["ref"]) // Stock if ($product->type == 0 && $conf->stock->enabled) { - print ''.$langs->trans("Stock").''; + print ''.$langs->trans("TotalStock").''; if ($product->no_stock) { print "Pas de définition de stock pour ce produit"; @@ -247,30 +247,6 @@ if ($_GET["id"] || $_GET["ref"]) print ""; - /* - * Contenu des stocks - */ - print '
'; - print ''; - $sql = "SELECT e.rowid, e.label, ps.reel FROM ".MAIN_DB_PREFIX."entrepot as e, ".MAIN_DB_PREFIX."product_stock as ps"; - $sql .= " WHERE ps.fk_entrepot = e.rowid AND ps.fk_product = ".$product->id; - $sql .= " ORDER BY lower(e.label)"; - - $resql=$db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; $total = 0; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - print ''; ; - $total = $total + $obj->reel; - $i++; - } - } - print '
'.$langs->trans("Warehouse").'Valeur du stock
'.$obj->label.''.$obj->reel.'
'.$langs->trans("Total").':'.$total."
"; - } print ''; @@ -279,12 +255,14 @@ if ($_GET["id"] || $_GET["ref"]) */ if ($_GET["action"] == "correction") { - print_titre ("Correction du stock"); + print_titre($langs->trans("StockCorrection")); print "
id\" method=\"post\">\n"; print ''; print ''; - print ''; + + // Entrepot + print ''; - print ''; - print ''; + print ''; print ''; print '
'.$langs->trans("Warehouse").''.$langs->trans("Warehouse").''; + print 'Nb de pièce
'.$langs->trans("NumberOfUnit").'
 '; print '
'; @@ -419,19 +398,58 @@ print "
\n"; if ($_GET["action"] == '' ) { - if ($user->rights->stock->mouvement->creer) - { - print 'Transfert'; - } - - if ($user->rights->stock->creer) - { - print 'Correction stock'; - } + if ($user->rights->stock->mouvement->creer) + { + print ''.$langs->trans("StockMovement").''; + } + + if ($user->rights->stock->creer) + { + print ''.$langs->trans("StockCorrection").''; + } } print '
'; + + +/* + * Contenu des stocks + */ +print '
'; +print ''; +print ''; + +$sql = "SELECT e.rowid, e.label, ps.reel FROM ".MAIN_DB_PREFIX."entrepot as e, ".MAIN_DB_PREFIX."product_stock as ps"; +$sql .= " WHERE ps.fk_entrepot = e.rowid AND ps.fk_product = ".$product->id; +$sql .= " ORDER BY lower(e.label)"; + +$entrepotstatic=new Entrepot($db); + +$resql=$db->query($sql); +if ($resql) +{ + $num = $db->num_rows($resql); + $i=0; $total=0; $var=false; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $entrepotstatic->id=$obj->rowid; + $entrepotstatic->libelle=$obj->label; + print ''; + print ''; + print ''; + print ''; ; + $total = $total + $obj->reel; + $i++; + $var=!$var; + } +} +print '"; +print "
'.$langs->trans("Warehouse").''.$langs->trans("NumberOfUnit").'
'.$entrepotstatic->getNomUrl(1).''.$obj->reel.'
'.$langs->trans("Total").':'.$total."
"; + + + $db->close();