diff --git a/COPYRIGHT b/COPYRIGHT index 7eba3660168..709849581e0 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -25,3 +25,4 @@ Copyright (C) 2005 - Rodolphe Quiedeville - Eric Seigne - Matthieu Valleton +- Regis Houssin diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 632ae8a3cba..88f05896c7b 100755 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -65,4 +65,5 @@ NoLogin=No login CreateDolibarrLogin=Create Dolibarr account TasksHistoryForThisContact=Tasks history for this contact LoginAccountDisable=Account disabled, put a new login to activate it. -ErrorFailedToSaveFile=Error - Failed to save file \ No newline at end of file +ErrorFailedToSaveFile=Error - Failed to save file +GuiLanguage=Interface language \ No newline at end of file diff --git a/htdocs/langs/fr_FR/users.lang b/htdocs/langs/fr_FR/users.lang index 33d307aa79b..74ec6b8b216 100755 --- a/htdocs/langs/fr_FR/users.lang +++ b/htdocs/langs/fr_FR/users.lang @@ -66,3 +66,4 @@ CreateDolibarrLogin=Cr TasksHistoryForThisContact=Historique des actions pour ce contact LoginAccountDisable=Le compte est désactivé, mettre un nouveau login pour l'activer. ErrorFailedToSaveFile=Erreur - l'enregistrement du fichier a échoué +GuiLanguage=Langage de l'interface diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index d712d819cb5..3fee3ff472a 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -166,6 +166,7 @@ if (! defined('MAIN_LANG_DEFAULT')) { define('MAIN_LANG_DEFAULT',"fr_FR"); } + $conf->langage=MAIN_LANG_DEFAULT; // On corrige $conf->langage si il ne vaut pas le code long: fr -> fr_FR par exemple diff --git a/htdocs/user.class.php b/htdocs/user.class.php index c9b9ffa33c7..f9d59e551c9 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -4,6 +4,7 @@ * Copyright (c) 2004-2005 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 @@ -31,6 +32,7 @@ \author Laurent Destailleur \author Sebastien Di Cintio \author Benoit Mortier + \author Regis Houssin \version $Revision$ */ @@ -60,6 +62,7 @@ class User var $datem; var $societe_id; var $webcal_login; + var $gui_lang; var $datelastaccess; var $error; @@ -97,7 +100,7 @@ class User function fetch($login='') { $sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.code, u.admin, u.login, u.pass, u.webcal_login, u.note,"; - $sql.= " u.fk_societe, u.fk_socpeople,"; + $sql.= " u.fk_societe, u.fk_socpeople, u.gui_lang,"; $sql.= " ".$this->db->pdate("u.datec")." as datec, ".$this->db->pdate("u.tms")." as datem,"; $sql.= " ".$this->db->pdate("u.datelastaccess")." as datel"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; @@ -130,13 +133,13 @@ class User $this->contact_id = $obj->fk_socpeople; $this->note = stripslashes($obj->note); $this->lang = 'fr_FR'; // \todo Gérer la langue par défaut d'un utilisateur Dolibarr - + $this->datec = $obj->datec; $this->datem = $obj->datem; $this->datelastaccess = $obj->datel; $this->webcal_login = $obj->webcal_login; - + $this->gui_lang = $obj->gui_lang; $this->societe_id = $obj->fk_societe; } $this->db->free($result); @@ -658,6 +661,7 @@ class User $sql .= ", webcal_login = '$this->webcal_login'"; $sql .= ", code = '$this->code'"; $sql .= ", note = '$this->note'"; + $sql .= ", gui_lang = '$this->gui_lang'"; $sql .= " WHERE rowid = ".$this->id; $result = $this->db->query($sql); diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 67e3e85ae33..71b8b81a50b 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -101,6 +101,7 @@ if ($_POST["action"] == 'add' && $user->admin) $edituser->email = trim($_POST["email"]); $edituser->admin = trim($_POST["admin"]); $edituser->webcal_login = trim($_POST["webcal_login"]); + $edituser->gui_lang = trim($_POST["gui_lang"]); $db->begin(); @@ -167,6 +168,7 @@ if ($_POST["action"] == 'update' && $user->admin) $edituser->email = $_POST["email"]; $edituser->admin = $_POST["admin"]; $edituser->webcal_login = $_POST["webcal_login"]; + $edituser->gui_lang = $_POST["gui_lang"]; $ret=$edituser->update(); if ($ret < 0) @@ -300,6 +302,11 @@ if ($action == 'create') print "".''.$langs->trans("LoginWebcal").''; print ''; } + // Langue par defaut + print ''.$langs->trans("GuiLanguage").''; + $html=new Form($db); + $html->select_lang(MAIN_LANG_DEFAULT,'gui_lang'); + print ''; print "".''; print ""; @@ -467,6 +474,10 @@ else print ''.$fuser->webcal_login.' '; print "\n"; } + // Langue par defaut + print ''.$langs->trans("GuiLanguage").''; + print ''.$fuser->gui_lang.' '; + print "\n"; print "\n"; // print "
\n"; @@ -680,6 +691,12 @@ else $langs->load("other"); print "".''.$langs->trans("LoginWebcal").''; print ''; + + // Langue par defaut + print ''.$langs->trans("GuiLanguage").''; + $html=new Form($db); + $html->select_lang(MAIN_LANG_DEFAULT,'gui_lang'); + print ''; print ''; diff --git a/mysql/migration/1.1.0-2.0.0.sql b/mysql/migration/1.1.0-2.0.0.sql index 57d912c4c05..1238dac0915 100644 --- a/mysql/migration/1.1.0-2.0.0.sql +++ b/mysql/migration/1.1.0-2.0.0.sql @@ -340,6 +340,7 @@ alter table llx_facturedet add date_start date; alter table llx_facturedet add date_end date; alter table llx_user add egroupware_id integer; +alter table llx_user add gui_lang varchar(5); alter table llx_societe add code_client varchar(15) after nom; alter table llx_societe add code_fournisseur varchar(15) after code_client; alter table llx_societe add code_compta varchar(15) after code_fournisseur; diff --git a/mysql/tables/llx_user.sql b/mysql/tables/llx_user.sql index 19b48f01216..d3dc65e0600 100644 --- a/mysql/tables/llx_user.sql +++ b/mysql/tables/llx_user.sql @@ -39,6 +39,8 @@ create table llx_user fk_socpeople integer DEFAULT 0, note text, datelastaccess datetime, + egroupware_id integer, + gui_lang varchar(5), UNIQUE INDEX(login) )type=innodb;