diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php new file mode 100644 index 00000000000..bc7e771582c --- /dev/null +++ b/htdocs/admin/produit.php @@ -0,0 +1,79 @@ + + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + */ + +/** + \file htdocs/admin/produit.php + \ingroup produit + \brief Page d'administration/configuration du module Produit + \version $Revision$ +*/ + +require("./pre.inc.php"); + +$langs->load("admin"); +$langs->load("propal"); + +if (!$user->admin) + accessforbidden(); + + +if ($_POST["action"] == 'nbprod') +{ + dolibarr_set_const($db, "PRODUIT_LIMIT_SIZE", $_POST["value"]); + Header("Location: produit.php"); + exit; +} + + + +/* + * Affiche page + */ + +llxHeader('',$langs->trans("ProductSetup")); + + +print_titre($langs->trans("ProductSetup")); + +/* + * Formulaire parametres divers + */ + +print '
'; +print "
"; +print ""; +print ""; +print ""; +print " \n"; +print " \n"; +print " \n"; +print ""; +print ''; +print ""; +print ''; +print ''; +print '
".$langs->trans("Name")."".$langs->trans("Value")." 
'.$langs->trans("NumberOfProductShowInSelect").'global->PRODUIT_LIMIT_SIZE."\">
'; +print '
'; + +$db->close(); + +llxFooter(); +?> diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index 93ae71185a0..c21068ff625 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -41,8 +41,9 @@ if (!$user->admin) if ($_POST["action"] == 'nbprod') { - dolibarr_set_const($db, "PROPALE_NEW_FORM_NB_PRODUCT",$value); + dolibarr_set_const($db, "PROPALE_NEW_FORM_NB_PRODUCT",$_POST["value"]); Header("Location: propale.php"); + exit; } if ($_GET["action"] == 'set') { @@ -296,8 +297,8 @@ print " ".$langs->trans("Value")."\n"; print "  \n"; print ""; print ''.$langs->trans("NumberOfProductLines").''; -print ""; -print ''; +print ""; +print ''; print ''; print ''; print ''; diff --git a/htdocs/includes/modules/modProduit.class.php b/htdocs/includes/modules/modProduit.class.php index 06cffdce5fc..9aa6f3266bf 100644 --- a/htdocs/includes/modules/modProduit.class.php +++ b/htdocs/includes/modules/modProduit.class.php @@ -20,7 +20,6 @@ * * $Id$ * $Source$ - * */ /** @@ -71,6 +70,7 @@ class modProduit extends DolibarrModules // Dépendances $this->depends = array(); $this->requiredby = array("modStock","modService","modBarcode"); + $this->config_page_url = "produit.php"; // Constantes $this->const = array(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 0a736b63312..4d80c560770 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -351,6 +351,9 @@ DNContactActiveExample=Desactivated synchronization DNContact=Contacts' DN DNContactExample=Complete DN (ex: ou=contacts,dc=society,dc=com) TypeExample=OpenLdap, Egroupware or Active Directory +##### Products ##### +ProductSetup=Products module setup +NumberOfProductShowInSelect=Max number of products in combos select lists (0=no limit) ##### Sendings ##### SendingsSetup=Sending module setup SendingsReceiptModel=Sending receipt model diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 496b525eb2a..534ed561ed7 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -351,6 +351,9 @@ DNContact=DN des contacts DNContactActiveExample=Synchronisation désactivée DNContactExample=DN complet (ex: ou=contacts,dc=societe,dc=com) TypeExample=OpenLdap, Egroupware ou Active Directory +##### Products ##### +ProductSetup=Configuration du module Produits +NumberOfProductShowInSelect=Nombre de produits max dans les listes déroulantes (0=aucune limite) ##### Sendings ##### SendingsSetup=Configuration du module Expéditions/Livraisons SendingsReceiptModel=Modèle du bordereau de livraison diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 273dae15714..3e9b75c8d15 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -119,6 +119,10 @@ if (isset($user->conf->SIZE_LISTE_LIMIT) && $user->conf->SIZE_LISTE_LIMIT > 0) { $conf->liste_limit = $user->conf->SIZE_LISTE_LIMIT; } +if (isset($user->conf->PRODUIT_LIMIT_SIZE)) +{ + $conf->produit->limit_size = $user->conf->PRODUIT_LIMIT_SIZE; +} if (isset($user->conf->MAIN_LANG_DEFAULT) && $user->conf->MAIN_LANG_DEFAULT) { if ($conf->langage != $user->conf->MAIN_LANG_DEFAULT) @@ -130,12 +134,6 @@ if (isset($user->conf->MAIN_LANG_DEFAULT) && $user->conf->MAIN_LANG_DEFAULT) } } -$conf->produit->limit_size=50; -if (isset($user->conf->PRODUIT_LIMIT_SIZE)) -{ - $conf->produit->limit_size = $user->conf->PRODUIT_LIMIT_SIZE; -} - // Remplace conf->css par valeur personnalisée if (isset($user->conf->MAIN_THEME) && $user->conf->MAIN_THEME) { diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index b647ddbfd7f..3f7fe8cd5fc 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -335,6 +335,10 @@ else { if (! $conf->global->SIZE_LISTE_LIMIT) $conf->global->SIZE_LISTE_LIMIT=20; $conf->liste_limit=$conf->global->SIZE_LISTE_LIMIT; +// $conf->produit->limit_size = constante de taille maximale des select de produit +if (! isset($conf->global->PRODUIT_LIMIT_SIZE)) $conf->global->PRODUIT_LIMIT_SIZE=50; +$conf->produit->limit_size=$conf->global->PRODUIT_LIMIT_SIZE; + // $conf->theme et $conf->css if (! $conf->global->MAIN_THEME) $conf->global->MAIN_THEME="eldy"; $conf->theme=$conf->global->MAIN_THEME;