From 709f376106ee446ac8ce04776f0fc78229b6c3d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 16 Jun 2007 14:02:02 +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 | 22 ++++++++++++++++------ htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 1ce89c4434b..f5ac849db67 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -37,12 +37,21 @@ if (!$user->admin) 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; + if ($_POST["MAIN_MAX_DECIMALS_UNIT"] > 8 + || $_POST["MAIN_MAX_DECIMALS_TTC"] > 8 + || $_POST["MAIN_MAX_DECIMALS_SHOWN"] > 8) + { + $mesg='
'.$langs->trans("ErrorDecimalLargerThanAreForbidden").'
'; + } + else + { + 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; + } } @@ -53,6 +62,7 @@ print_fiche_titre($langs->trans("LimitsSetup"),'','setup'); print $langs->trans("LimitsDesc")."
\n"; print "
\n"; +if ($mesg) print $mesg.'
'; if (isset($_GET["action"]) && $_GET["action"] == 'edit') { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b02aafcc59a..ef256aba274 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -16,6 +16,7 @@ GUISetup=Display SetupArea=Setup area SecuritySetup=Security setup ErrorModuleRequirePHPVersion=Error, this module requires PHP version %s or higher +ErrorDecimalLargerThanAreForbidden=Error, precision higher than %s are not supported. DictionnarySetup=Dictionnary setup DisableJavascript=Disable JavaScript functions DisableAjax=Disable AJAX functions diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 1e687fa963b..f86465a8df0 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -16,6 +16,7 @@ GUISetup=Affichage SetupArea=Espace configuration SecuritySetup=Configuration de la sécurité ErrorModuleRequirePHPVersion=Erreur, ce module requiert une version %s ou supérieure de PHP +ErrorDecimalLargerThanAreForbidden=Erreur, les précisions supérieures à %s ne sont pas supportées. DictionnarySetup=Dictionnaires DisableJavascript=Désactiver les fonctions javascript DisableAjax=Désactiver les fonctions ajax