From 9b736544dfee3071efc4b14e918d86e28c716d4f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 7 Jul 2005 13:54:24 +0000 Subject: [PATCH] Fix: valeur NULL des constantes MAIN_FORCE_SETLOCALE --- htdocs/master.inc.php | 9 +++++---- mysql/data/data.sql | 8 ++++---- mysql/migration/1.1.0-2.0.0.sql | 8 ++++---- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 2301b7143a1..a8028a48cd7 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005 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 @@ -175,10 +176,10 @@ $conf->langage_tiret=ereg_replace('_','-',$conf->langage); setlocale(LC_ALL, $conf->langage_tiret); // Compenser pb de locale avec windows setlocale(LC_ALL, $conf->langage); -if (defined("MAIN_FORCE_SETLOCALE_LC_ALL")) setlocale(LC_ALL, MAIN_FORCE_SETLOCALE_LC_ALL); -if (defined("MAIN_FORCE_SETLOCALE_LC_TIME")) setlocale(LC_TIME, MAIN_FORCE_SETLOCALE_LC_TIME); -if (defined("MAIN_FORCE_SETLOCALE_LC_NUMERIC")) setlocale(LC_NUMERIC, MAIN_FORCE_SETLOCALE_LC_NUMERIC); -if (defined("MAIN_FORCE_SETLOCALE_LC_MONETARY")) setlocale(LC_MONETARY, MAIN_FORCE_SETLOCALE_LC_MONETARY); +if (defined("MAIN_FORCE_SETLOCALE_LC_ALL") && MAIN_FORCE_SETLOCALE_LC_ALL) setlocale(LC_ALL, MAIN_FORCE_SETLOCALE_LC_ALL); +if (defined("MAIN_FORCE_SETLOCALE_LC_TIME") && MAIN_FORCE_SETLOCALE_LC_TIME) setlocale(LC_TIME, MAIN_FORCE_SETLOCALE_LC_TIME); +if (defined("MAIN_FORCE_SETLOCALE_LC_NUMERIC") && MAIN_FORCE_SETLOCALE_LC_NUMERIC) setlocale(LC_NUMERIC, MAIN_FORCE_SETLOCALE_LC_NUMERIC); +if (defined("MAIN_FORCE_SETLOCALE_LC_MONETARY") && MAIN_FORCE_SETLOCALE_LC_MONETARY) setlocale(LC_MONETARY, MAIN_FORCE_SETLOCALE_LC_MONETARY); require_once(DOL_DOCUMENT_ROOT ."/translate.class.php"); $langs = new Translate(DOL_DOCUMENT_ROOT ."/langs", $conf->langage); diff --git a/mysql/data/data.sql b/mysql/data/data.sql index f94678e145b..0e914841449 100644 --- a/mysql/data/data.sql +++ b/mysql/data/data.sql @@ -145,10 +145,10 @@ insert into llx_const (name, value, type, visible) values ('FACTURE_ADDON_PDF', -- -- Forcer les locales -- -INSERT INTO `llx_const` VALUES (150, 'MAIN_FORCE_SETLOCALE_LC_ALL', '', 'chaine', 1, ''); -INSERT INTO `llx_const` VALUES (152, 'MAIN_FORCE_SETLOCALE_LC_TIME', '', 'chaine', 1, ''); -INSERT INTO `llx_const` VALUES (156, 'MAIN_FORCE_SETLOCALE_LC_MONETARY', '', 'chaine', 1, ''); -INSERT INTO `llx_const` VALUES (158, 'MAIN_FORCE_SETLOCALE_LC_NUMERIC', '', 'chaine', 1, ''); +INSERT INTO `llx_const` VALUES ('', 'MAIN_FORCE_SETLOCALE_LC_ALL', 'MAIN_FORCE_SETLOCALE_LC_ALL', 'chaine', 1, ''); +INSERT INTO `llx_const` VALUES ('', 'MAIN_FORCE_SETLOCALE_LC_TIME', 'MAIN_FORCE_SETLOCALE_LC_TIME', 'chaine', 1, ''); +INSERT INTO `llx_const` VALUES ('', 'MAIN_FORCE_SETLOCALE_LC_MONETARY', 'MAIN_FORCE_SETLOCALE_LC_MONETARY', 'chaine', 1, ''); +INSERT INTO `llx_const` VALUES ('', 'MAIN_FORCE_SETLOCALE_LC_NUMERIC', 'MAIN_FORCE_SETLOCALE_LC_NUMERIC', 'chaine', 1, 'mettre la valeur C si problème de centimes'); -- Dictionnaires llx_c diff --git a/mysql/migration/1.1.0-2.0.0.sql b/mysql/migration/1.1.0-2.0.0.sql index 63a0c59abd1..408301da71e 100644 --- a/mysql/migration/1.1.0-2.0.0.sql +++ b/mysql/migration/1.1.0-2.0.0.sql @@ -1540,7 +1540,7 @@ create table llx_dolibarr_modules )type=innodb; -INSERT INTO `llx_const` VALUES (150, 'MAIN_FORCE_SETLOCALE_LC_ALL', '', 'chaine', 1, ''); -INSERT INTO `llx_const` VALUES (152, 'MAIN_FORCE_SETLOCALE_LC_TIME', '', 'chaine', 1, ''); -INSERT INTO `llx_const` VALUES (156, 'MAIN_FORCE_SETLOCALE_LC_MONETARY', '', 'chaine', 1, ''); -INSERT INTO `llx_const` VALUES (158, 'MAIN_FORCE_SETLOCALE_LC_NUMERIC', '', 'chaine', 1, ''); +insert into `llx_const` values ('', 'MAIN_FORCE_SETLOCALE_LC_ALL', 'MAIN_FORCE_SETLOCALE_LC_ALL', 'chaine', 1, ''); +insert into `llx_const` values ('', 'MAIN_FORCE_SETLOCALE_LC_TIME', 'MAIN_FORCE_SETLOCALE_LC_TIME', 'chaine', 1, ''); +insert into `llx_const` values ('', 'MAIN_FORCE_SETLOCALE_LC_MONETARY', 'MAIN_FORCE_SETLOCALE_LC_MONETARY', 'chaine', 1, ''); +insert into `llx_const` values ('', 'MAIN_FORCE_SETLOCALE_LC_NUMERIC', 'MAIN_FORCE_SETLOCALE_LC_NUMERIC', 'chaine', 1, 'mettre la valeur C si problème de centimes');