diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 5cac6992dd5..146d0116b42 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -23,23 +23,28 @@ require("./pre.inc.php"); $user->getrights('produit'); +$langs->load("products"); + + if (!$user->rights->produit->lire) accessforbidden(); + if ($action == 'update') { $sql = "UPDATE ".MAIN_DB_PREFIX."product SET description='$desc' where rowid = $rowid"; $db->query($sql); } + /* * * */ -llxHeader("","","Accueil Produits et services"); +llxHeader("","",$langs->trans("ProductsAndServices")); -print_titre("Produits et services"); +print_titre($langs->trans("ProductsAndServices")); print ''; @@ -65,29 +70,30 @@ if ($db->query($sql)) } print '
'; -print ''; -if (defined("MAIN_MODULE_PRODUIT") && MAIN_MODULE_PRODUIT) +print ''; +if ($conf->produit->enabled) { print ""; - print ''; + print ''; print ""; print ""; - print ''; + print ''; print ""; } -if (defined("MAIN_MODULE_SERVICE") && MAIN_MODULE_SERVICE) +if ($conf->service->enabled) { print ""; - print ''; + print ''; print ""; print ""; - print ''; + print ''; print ""; } print '
Nombre
'.$langs->trans("Number").'
Produits hors vente'.round($prodser[0][0]).''.$langs->trans("ProductsNotOnSell").''.round($prodser[0][0]).'
Produits en vente'.round($prodser[0][1]).''.$langs->trans("ProductsOnSell").''.round($prodser[0][1]).'
Services hors vente'.round($prodser[1][0]).''.$langs->trans("ServicesNotOnSell").''.round($prodser[1][0]).'
Services en vente'.round($prodser[1][1]).''.$langs->trans("ServicesOnSell").''.round($prodser[1][1]).'
'; print ''; + /* * Derniers produits/services en vente */ @@ -102,14 +108,14 @@ if ($result) $i = 0; - $typeprodser[0]="Produit"; - $typeprodser[1]="Service"; + $typeprodser[0]=$langs->trans("Product"); + $typeprodser[1]=$langs->trans("Service"); if ($num > 0) { print ''; - print ''; + print ''; $var=True; while ($i < $num) @@ -132,7 +138,7 @@ if ($result) } else { - print $db->error() . "
" .$sql; + dolibarr_print_error(); } print '
Derniers produits/services en vente enregistrés
'.$langs->trans("LastRecorded").'
';