From 44a8179a5a6bac0deb6110fcde22e6933a6c8982 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Nov 2008 12:01:51 +0000 Subject: [PATCH] Make message more clear --- htdocs/langs/en_US/errors.lang | 2 +- htdocs/langs/fr_FR/errors.lang | 2 +- htdocs/product/stock/fiche-valo.php | 6 +- htdocs/product/stock/fiche.php | 12 +-- htdocs/product/stock/info.php | 32 ++++---- htdocs/product/stock/mouvement.php | 119 ++++++++++++++-------------- 6 files changed, 88 insertions(+), 85 deletions(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 62b74bc61d4..162a6721727 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -32,7 +32,7 @@ ErrorFunctionNotAvailableInPHP=Function %s is required for this feature b ErrorDirAlreadyExists=A directory with this name already exists. ErrorFieldCanNotContainSpecialCharacters=Field %s must not contains special characters. WarningAllowUrlFopenMustBeOn=Parameter allow_url_fopen must be set to on in filer php.ini for having this module working completely. You must modify this file manually. -WarningBuildScriptNotRunned=Script %s was not yet ran to build graphics. +WarningBuildScriptNotRunned=Script %s was not yet ran to build graphics, or there is no data to show. WarningBookmarkAlreadyExists=A bookmark with this title or this target (URL) already exists. WarningPassIsEmpty=Warning, database password is empty. This is a security hole. You should add a password to your database and change your conf.php file to reflect this. ErrorNoAccountancyModuleLoaded=No accountancy module activated \ No newline at end of file diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 71a1192f272..4e16606c3d3 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -32,7 +32,7 @@ ErrorFunctionNotAvailableInPHP=La fonction %s est requise pour cette fonc ErrorDirAlreadyExists=Un répertoire portant ce nom existe déjà. ErrorFieldCanNotContainSpecialCharacters=Le champ %s ne peut contenir de caractères spéciaux. WarningAllowUrlFopenMustBeOn=Attention, le paramètre allow_url_fopen doit etre positionné à on dans le fichier php.ini pour que ce module soit pleinement opérationnel. Vous devez modifier ce fichier manuellement. -WarningBuildScriptNotRunned=Le script %s n'a pas encore été lancé pour générer les graphiques. +WarningBuildScriptNotRunned=Le script %s n'a pas encore été lancé pour générer les graphiques ou il n'y a aucune donnée à afficher. WarningBookmarkAlreadyExists=Un marque-page avec ce titre ou cette destination (URL) existe déjà. WarningPassIsEmpty=Attention, le mot de passe de la base de donnée Dolibarr est vide. Cela représente une faille de sécurité. Il est recommandé d'ajouter manuellement un mot de passe à la base et de modifier le fichier conf.php pour refléter ce changement. ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé \ No newline at end of file diff --git a/htdocs/product/stock/fiche-valo.php b/htdocs/product/stock/fiche-valo.php index 077e96a0142..fe72b4aa8ae 100644 --- a/htdocs/product/stock/fiche-valo.php +++ b/htdocs/product/stock/fiche-valo.php @@ -18,7 +18,7 @@ */ /** - * \file htdocs/product/stock/fiche.php + * \file htdocs/product/stock/fiche-valo.php * \ingroup stock * \brief Page fiche de valorisation du stock dans l'entrepot * \version $Id$ @@ -127,8 +127,10 @@ if ($_GET["id"]) print "
\n"; $year = strftime("%Y",time()); + + $file=DOL_DATA_ROOT.'/entrepot/temp/entrepot-'.$entrepot->id.'-'.($year).'.png'; - if (file_exists(DOL_DATA_ROOT.'/entrepot/temp/entrepot-'.$entrepot->id.'-'.($year).'.png')) + if (file_exists($file)) { $url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_stock&file=entrepot-'.$entrepot->id.'-'.$year.'.png'; print 'Valorisation du stock année '.($year).''; diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index 02b952703cf..6d141e17a9d 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -144,7 +144,7 @@ if ($_GET["action"] == 'create') // Ref print ''.$langs->trans("Ref").''; - + print ''.$langs->trans("LocationSummary").''; // Description @@ -217,7 +217,7 @@ else $head[$h][0] = DOL_URL_ROOT.'/product/stock/mouvement.php?id='.$entrepot->id; $head[$h][1] = $langs->trans("StockMovements"); $h++; - + $head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche-valo.php?id='.$entrepot->id; $head[$h][1] = $langs->trans("EnhancedValue"); $h++; @@ -244,7 +244,7 @@ else print ''.$langs->trans("Ref").''; print $form->showrefnav($entrepot,'id','',1,'rowid','libelle'); print ''; - + print ''.$langs->trans("LocationSummary").''.$entrepot->lieu.''; // Description @@ -375,21 +375,21 @@ else print ""; print ''.$objp->produit.''; print ''.$objp->value.''; - + if ($user->rights->stock->mouvement->creer) { print ''; print $langs->trans("StockMovement"); print ""; } - + if ($user->rights->stock->creer) { print ''; print $langs->trans("StockCorrection"); print ""; } - + print ""; $i++; } diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php index 3aa9cc42e8c..ea5d94c9589 100644 --- a/htdocs/product/stock/info.php +++ b/htdocs/product/stock/info.php @@ -17,11 +17,11 @@ */ /** - \file htdocs/product/stock/info.php - \ingroup facture - \brief Page des informations d'un entrepot - \version $Id$ -*/ + \file htdocs/product/stock/info.php + \ingroup facture + \brief Page des informations d'un entrepot + \version $Id$ + */ require("./pre.inc.php"); @@ -57,22 +57,22 @@ $head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche-valo.php?id='.$entrepot->id; $head[$h][1] = $langs->trans("EnhancedValue"); $h++; - if ($conf->global->STOCK_USE_WAREHOUSE_BY_USER) - { - // Add the constant STOCK_USE_WAREHOUSE_BY_USER in cont table to use this feature. - // Should not be enabled by defaut because does not work yet correctly because - // there is no way to add values in the table llx_user_entrepot - $head[$h][0] = DOL_URL_ROOT.'/product/stock/user.php?id='.$entrepot->id; - $head[$h][1] = $langs->trans("Users"); - $h++; - } - +if ($conf->global->STOCK_USE_WAREHOUSE_BY_USER) +{ + // Add the constant STOCK_USE_WAREHOUSE_BY_USER in cont table to use this feature. + // Should not be enabled by defaut because does not work yet correctly because + // there is no way to add values in the table llx_user_entrepot + $head[$h][0] = DOL_URL_ROOT.'/product/stock/user.php?id='.$entrepot->id; + $head[$h][1] = $langs->trans("Users"); + $h++; +} + $head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id; $head[$h][1] = $langs->trans("Info"); $hselected=$h; $h++; -dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse").': '.$entrepot->libelle); +dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse")); print ''; + + print "
'; diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index e66fbbdf8e3..769ca00c19e 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -17,13 +17,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + /** - \file htdocs/product/stock/mouvement.php - \ingroup stock - \brief Page liste des mouvements de stocks - \version $Id$ -*/ + \file htdocs/product/stock/mouvement.php + \ingroup stock + \brief Page liste des mouvements de stocks + \version $Id$ + */ require("./pre.inc.php"); @@ -53,15 +53,15 @@ $sql.= " m.value, ".$db->pdate("m.datem")." as datem"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as s, ".MAIN_DB_PREFIX."stock_mouvement as m, ".MAIN_DB_PREFIX."product as p"; if ($conf->categorie->enabled && !$user->rights->categorie->voir) { - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; } $sql .= " WHERE m.fk_product = p.rowid AND m.fk_entrepot = s.rowid"; if ($_GET["id"]) - $sql .= " AND s.rowid ='".$_GET["id"]."'"; +$sql .= " AND s.rowid ='".$_GET["id"]."'"; if ($conf->categorie->enabled && !$user->rights->categorie->voir) { - $sql.= " AND IFNULL(c.visible,1)=1"; + $sql.= " AND IFNULL(c.visible,1)=1"; } $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit($conf->liste_limit + 1 ,$offset); @@ -69,80 +69,81 @@ $resql = $db->query($sql) ; if ($resql) { - $num = $db->num_rows($resql); - - if ($_GET["id"]) - { - $entrepot = new Entrepot($db); - $result = $entrepot->fetch($_GET["id"]); - if ($result < 0) + $num = $db->num_rows($resql); + + if ($_GET["id"]) { + $entrepot = new Entrepot($db); + $result = $entrepot->fetch($_GET["id"]); + if ($result < 0) + { dolibarr_print_error($db); + } } - } - - $i = 0; - - $texte = $langs->trans("ListOfStockMovements"); - llxHeader("","",$texte); - - - /* - * Affichage onglets - */ - if ($_GET["id"]) - { + + $i = 0; + + $texte = $langs->trans("ListOfStockMovements"); + llxHeader("","",$texte); + + + /* + * Affichage onglets + */ + if ($_GET["id"]) + { $h = 0; - + $head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche.php?id='.$entrepot->id; $head[$h][1] = $langs->trans("WarehouseCard"); $h++; - + $head[$h][0] = DOL_URL_ROOT.'/product/stock/mouvement.php?id='.$entrepot->id; $head[$h][1] = $langs->trans("StockMovements"); $hselected=$h; $h++; - - $head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche-valo.php?id='.$entrepot->id; - $head[$h][1] = $langs->trans("EnhancedValue"); - $h++; - if ($conf->global->STOCK_USE_WAREHOUSE_BY_USER) - { - // Add the constant STOCK_USE_WAREHOUSE_BY_USER in cont table to use this feature. - // Should not be enabled by defaut because does not work yet correctly because - // there is no way to add values in the table llx_user_entrepot - $head[$h][0] = DOL_URL_ROOT.'/product/stock/user.php?id='.$entrepot->id; - $head[$h][1] = $langs->trans("Users"); - $h++; - } - + $head[$h][0] = DOL_URL_ROOT.'/product/stock/fiche-valo.php?id='.$entrepot->id; + $head[$h][1] = $langs->trans("EnhancedValue"); + $h++; + + if ($conf->global->STOCK_USE_WAREHOUSE_BY_USER) + { + // Add the constant STOCK_USE_WAREHOUSE_BY_USER in cont table to use this feature. + // Should not be enabled by defaut because does not work yet correctly because + // there is no way to add values in the table llx_user_entrepot + $head[$h][0] = DOL_URL_ROOT.'/product/stock/user.php?id='.$entrepot->id; + $head[$h][1] = $langs->trans("Users"); + $h++; + } + $head[$h][0] = DOL_URL_ROOT.'/product/stock/info.php?id='.$entrepot->id; $head[$h][1] = $langs->trans("Info"); $h++; - + dolibarr_fiche_head($head, $hselected, $langs->trans("Warehouse")); - - print ''; - + + print '
'; + // Ref print ''; - - print ''; - + + print ''; + // Statut - print ''; - - print "
'.$langs->trans("Ref").''; print $form->showrefnav($entrepot,'id','',1,'rowid','libelle'); print '
'.$langs->trans("LocationSummary").''.$entrepot->lieu.'
'.$langs->trans("LocationSummary").''.$entrepot->lieu.'
'.$langs->trans("Status").''.$entrepot->getLibStatut(4).'
"; - - print ''; + print '
'.$langs->trans("Status").''.$entrepot->getLibStatut(4).'
"; + + print '
'; } $param="&id=".$_GET["id"]."&sref=$sref&snom=$snom"; - print_barre_liste($texte, $page, "mouvement.php", $param, $sortfield, $sortorder,'',$num); + print_barre_liste($texte, $page, "mouvement.php", $param, $sortfield, $sortorder,'',$num,0,''); + print ''; print ""; print_liste_field_titre($langs->trans("Date"),"mouvement.php", "m.datem","",$param,"",$sortfield,$sortorder);