diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 4d62967fd51..3789a743402 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -25,7 +25,9 @@ ServicesOnSell=Services on sell ServicesNotOnSell=Services out of sell InternalRef=Internal reference LastRecorded=Last products/services on sell recorded -LastRecordedProducts=Last %s products/services recorded +LastRecordedProductsAndServices=Last %s products/services recorded +LastRecordedProducts=Last %s products recorded +LastRecordedServices=Last %s services recorded LastProducts=Last products CardProduct0=Product card CardProduct1=Service card @@ -64,6 +66,8 @@ SupplierRef=Supplier ref. ShowProduct=Show product ShowService=Show service ProductsAndServicesArea=Product and Services area +ProductsArea=Product area +ServicesArea=Services area AddToMyProposals=Add to my proposals AddToOtherProposals=Add to other proposals AddToMyBills=Add to my bills diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 7cec8306f56..895cbe8795d 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -24,7 +24,9 @@ ServicesOnSell=Services en vente ServicesNotOnSell=Services hors vente InternalRef=Référence interne LastRecorded=Derniers produits/services en vente enregistrés -LastRecordedProducts=Les %s derniers produits/services enregistrés +LastRecordedProductsAndServices=Les %s derniers produits/services enregistrés +LastRecordedProducts=Les %s derniers produits enregistrés +LastRecordedServices=Les %s derniers services enregistrés LastProducts=Derniers produits CardProduct0=Fiche produit CardProduct1=Fiche service @@ -62,7 +64,9 @@ Suppliers=Fournisseurs SupplierRef=Réf. fournisseur ShowProduct=Afficher produit ShowService=Afficher service -ProductsAndServicesArea=Espace Produit et Services +ProductsAndServicesArea=Espace Produits et Services +ProductsArea=Espace Produits +ServicesArea=Espace Services AddToMyProposals=Ajouter à mes propositions AddToOtherProposals=Ajouter aux autres propositions AddToMyBills=Ajouter à mes factures diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 2edf515da80..470ceb80780 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2006 Laurent Destailleur - * Copyright (C) 2005-2006 Regis Houssin + * Copyright (C) 2005-2007 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -41,9 +41,13 @@ $staticproduct=new Product($db); * */ +$transAreaType = $langs->trans("ProductsAndServicesArea"); +if (isset($_GET["type"]) && $_GET["type"] == 0) $transAreaType = $langs->trans("ProductsArea"); +if (isset($_GET["type"]) && $_GET["type"] == 1) $transAreaType = $langs->trans("ServicesArea"); + llxHeader("","",$langs->trans("ProductsAndServices")); -print_fiche_titre($langs->trans("ProductsAndServicesArea")); +print_fiche_titre($transAreaType); print ''; @@ -85,22 +89,35 @@ print '
'; print ''; if ($conf->produit->enabled) { - print ""; - print ''; - print ""; - print ""; - print ''; - print ""; + $statProducts = ""; + $statProducts.= ''; + $statProducts.= ""; + $statProducts.= ""; + $statProducts.= ''; + $statProducts.= ""; } if ($conf->service->enabled) { - print ""; - print ''; - print ""; - print ""; - print ''; - print ""; + $statServices = ""; + $statServices.= ''; + $statServices.= ""; + $statServices.= ""; + $statServices.= ''; + $statServices.= ""; } +if (isset($_GET["type"]) && $_GET["type"] == 0) +{ + print $statProducts; +} +else if (isset($_GET["type"]) && $_GET["type"] == 1) +{ + print $statServices; +} +else +{ + print $statProducts.$statServices; +} + print '
'.$langs->trans("Statistics").'
'.$langs->trans("ProductsNotOnSell").''.round($prodser[0][0]).'
'.$langs->trans("ProductsOnSell").''.round($prodser[0][1]).'
'.$langs->trans("ProductsNotOnSell").''.round($prodser[0][0]).'
'.$langs->trans("ProductsOnSell").''.round($prodser[0][1]).'
'.$langs->trans("ServicesNotOnSell").''.round($prodser[1][0]).'
'.$langs->trans("ServicesOnSell").''.round($prodser[1][1]).'
'.$langs->trans("ServicesNotOnSell").''.round($prodser[1][0]).'
'.$langs->trans("ServicesOnSell").''.round($prodser[1][1]).'
'; print ''; @@ -119,6 +136,7 @@ if ($conf->categorie->enabled && !$user->rights->categorie->voir) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_subproduct as sp ON p.rowid = sp.fk_product_subproduct"; $sql.= " WHERE sp.fk_product_subproduct IS NULL"; if ($conf->categorie->enabled && !$user->rights->categorie->voir) $sql.= " AND IFNULL(c.visible,1)=1 "; +if (isset($_GET["type"])) $sql.= " AND p.fk_product_type = ".$_GET["type"]; $sql.= " ORDER BY p.datec DESC "; $sql.= $db->plimit($max,0); $result = $db->query($sql) ; @@ -130,12 +148,16 @@ if ($result) $i = 0; if ($num > 0) - { - print ''; + { + $transRecordedType = $langs->trans("LastRecordedProductsAndServices",$max); + if (isset($_GET["type"]) && $_GET["type"] == 0) $transRecordedType = $langs->trans("LastRecordedProducts",$max); + if (isset($_GET["type"]) && $_GET["type"] == 1) $transRecordedType = $langs->trans("LastRecordedServices",$max); + + print '
'; - print ''; + print ''; - $var=True; + $var=True; while ($i < $num) { @@ -162,7 +184,7 @@ if ($result) print "rowid\">$objp->ref\n"; print ''; print ""; print '
'.$langs->trans("LastRecordedProducts",$max).'
'.$transRecordedType.'
'.dolibarr_trunc($objp->label,40).'"; - if ($objp->type==1) print $langs->trans("ShowService"); + if ($objp->fk_product_type==1) print $langs->trans("ShowService"); else print $langs->trans("ShowProduct"); print "';