From 5771bdefcadfec9d292473b5d7bdc5dfb2e69c1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Jun 2007 20:53:38 +0000 Subject: [PATCH] =?UTF-8?q?New:=20Ajout=20pages=20configuration=20pr=E9cis?= =?UTF-8?q?ions=20Dolibarr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/limits.php | 117 ++++++++++++++++++++++++++++++++++ htdocs/langs/en_US/admin.lang | 5 ++ htdocs/langs/en_US/main.lang | 2 + htdocs/langs/fr_FR/admin.lang | 5 ++ htdocs/langs/fr_FR/main.lang | 3 +- 5 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 htdocs/admin/limits.php diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php new file mode 100644 index 00000000000..1ce89c4434b --- /dev/null +++ b/htdocs/admin/limits.php @@ -0,0 +1,117 @@ + + * + * 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/limits.php + \brief Page de configuration des limites + \version $Revision$ +*/ + +require("./pre.inc.php"); + +$langs->load("companies"); +$langs->load("products"); +$langs->load("admin"); + +if (!$user->admin) + accessforbidden(); + + +if (isset($_POST["action"]) && $_POST["action"] == 'update') +{ + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"]); + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TTC", $_POST["MAIN_MAX_DECIMALS_TTC"]); + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"]); + + Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + exit; +} + + +llxHeader(); + +print_fiche_titre($langs->trans("LimitsSetup"),'','setup'); + +print $langs->trans("LimitsDesc")."
\n"; +print "
\n"; + + +if (isset($_GET["action"]) && $_GET["action"] == 'edit') +{ + $html=new Form($db); + + print '
'; + print ''; + + clearstatcache(); + $var=true; + + print ''; + print ''; + + $var=!$var; + print ''; + + $var=!$var; + print ''; + + $var=!$var; + print ''; + + + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_MAX_DECIMALS_UNIT").'
'.$langs->trans("MAIN_MAX_DECIMALS_TTC").'
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").'
'; + + print '
'; + print ''; + print '
'; + + print '
'; + print '
'; +} +else +{ + $var=true; + + print ''; + print ''; + + $var=!$var; + print ''; + + $var=!$var; + print ''; + + $var=!$var; + print ''; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("MAIN_MAX_DECIMALS_UNIT").''.$conf->global->MAIN_MAX_DECIMALS_UNIT.'
'.$langs->trans("MAIN_MAX_DECIMALS_TTC").''.$conf->global->MAIN_MAX_DECIMALS_TTC.'
'.$langs->trans("MAIN_MAX_DECIMALS_SHOWN").''.$conf->global->MAIN_MAX_DECIMALS_SHOWN.'

'; + + print '
'; + print ''.$langs->trans("Edit").''; + print '
'; +} + + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e580fc76a9a..b02aafcc59a 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -450,6 +450,11 @@ DictionnaryDesc=Define here all reference datas. You can complete predefined val ConstDesc=All other parameters not available in previous pages OnceSetupFinishedCreateUsers=Warning, you are a Dolibarr administrator user. Administrator users are used to setup Dolibarr. For a usual usage of Dolibarr, it is recommended to use a non administrator user created from Users & Groups menu. MiscellanousDesc=Define here all other parameters related to security. +LimitsSetup=Limits/Precision setup +LimitsDesc=You can define here limits and precision used by Dolibarr +MAIN_MAX_DECIMALS_UNIT=Max decimals for unit prices +MAIN_MAX_DECIMALS_TTC=Max decimals for prices with taxes +MAIN_MAX_DECIMALS_SHOWN=Max decimals for prices shown on screen (Excedented decimals will be replaced by three dots ...) ##### Users setup ##### UserGroupSetup=Users and groups module setup GeneratePassword=Suggest a generated password diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index fd8f65e9e6d..1592e113768 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -129,6 +129,8 @@ About=About WelcomeString=We are %s, and you are connected as user %s Number=Number Numero=Numero +Limit=Limit +Limits=Limits DevelopmentTeam=Development Team Logout=Logout Connection=Connection diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 1927b4c20e7..1e687fa963b 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -457,6 +457,11 @@ DictionnaryDesc=Definissez ici les donn ConstDesc=Tout autre parametre non editable dans les pages précédentes OnceSetupFinishedCreateUsers=Attention, vous êtes sous un compte administrateur de Dolibarr. Les administrateurs sont utilisés pour configurer Dolibarr. Pour une utilisation courante de Dolibarr, il est recommandé d'utiliser un compte non administrateur créé depuis le menu "Utilisateurs & Groupes". MiscellanousDesc=Définissez ici les autres paramètres en rapport avec la sécurité. +LimitsSetup=Configuration des limites et precisions +LimitsDesc=Vous pouvez définir ici les limites et précisions utilisées par Dolibarr +MAIN_MAX_DECIMALS_UNIT=Nombre de décimals maximum pour les prix unitaires +MAIN_MAX_DECIMALS_TTC=Nombre de décimals maximum pour les prix totaux toute taxe comprise +MAIN_MAX_DECIMALS_SHOWN=Nombre de décimals maximum pour les montant affichés à l'écran (Les décimals en trop sont remplacés par trois petits points: ...) ##### Users setup ##### UserGroupSetup=Configuration module utilisateurs et groupes GeneratePassword=Proposer un mot de passe généré diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 19e724b4184..f76516b9d30 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -52,7 +52,6 @@ InformationToHelpDiagnose=Voici les informations qui pourront aider au diagnosti MoreInformation=Plus d'information NotePublic=Note (publique) NotePrivate=Note (privée) - yes=oui Yes=Oui no=non @@ -131,6 +130,8 @@ About= WelcomeString=Nous sommes le %s, et vous êtes connecté(e) en tant que %s Number=Nombre Numero=Numéro +Limit=Limite +Limits=Limites DevelopmentTeam=Équipe de développement Logout=Déconnexion Connection=Connexion