diff --git a/htdocs/user.class.php b/htdocs/user.class.php index c1c6beca331..472bb10ae78 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005 Regis Houssin + * Copyright (C) 2005 Lionel COUSTEIX * * 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 @@ -54,6 +55,9 @@ class User var $note; var $code; var $email; + var $office_tel; + var $office_fax; + var $user_mobile; var $admin; var $login; var $pass; @@ -99,7 +103,7 @@ class User function fetch($login='') { // Recupere utilisateur - $sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.code, u.admin, u.login, u.pass, u.webcal_login, u.note,"; + $sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.office_phone, u.office_fax, u.user_mobile, u.code, u.admin, u.login, u.pass, u.webcal_login, u.note,"; $sql.= " u.fk_societe, u.fk_socpeople, "; $sql.= " ".$this->db->pdate("u.datec")." as datec, ".$this->db->pdate("u.tms")." as datem,"; $sql.= " ".$this->db->pdate("u.datelastaccess")." as datel"; @@ -127,6 +131,9 @@ class User $this->code = $obj->code; $this->login = $obj->login; $this->pass = $obj->pass; + $this->office_phone = $obj->office_phone; + $this->office_fax = $obj->office_fax; + $this->user_mobile = $obj->user_mobile; $this->email = $obj->email; $this->admin = $obj->admin; $this->contact_id = $obj->fk_socpeople; @@ -684,6 +691,9 @@ class User $sql .= " name = '$this->nom'"; $sql .= ", firstname = '$this->prenom'"; $sql .= ", login = '$this->login'"; + $sql .= ", office_phone = '$this->office_phone'"; + $sql .= ", office_fax = '$this->office_fax'"; + $sql .= ", user_mobile = '$this->user_mobile'"; $sql .= ", email = '$this->email'"; $sql .= ", admin = $this->admin"; $sql .= ", webcal_login = '$this->webcal_login'"; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 71fb342e8ab..2020b3daf99 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -4,6 +4,7 @@ * Copyright (C) 2004-2005 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005 Regis Houssin + * Copyright (C) 2005 Lionel COUSTEIX * * 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 @@ -71,7 +72,7 @@ if ($_POST["action"] == 'confirm_disable' && $_POST["confirm"] == "yes") $edituser = new User($db, $_GET["id"]); $edituser->fetch($_GET["id"]); $edituser->disable(); - Header("Location: index.php"); + Header("Location: ".DOL_URL_ROOT.'/user/fiche.php?id='.$_GET["id"]); } } @@ -107,6 +108,9 @@ if ($_POST["action"] == 'add' && $user->admin) $edituser->note = trim($_POST["note"]); $edituser->prenom = trim($_POST["prenom"]); $edituser->login = trim($_POST["login"]); + $edituser->office_phone = trim($_POST["office_phone"]); + $edituser->office_fax = trim($_POST["office_fax"]); + $edituser->user_mobile = trim($_POST["user_mobile"]); $edituser->email = trim($_POST["email"]); $edituser->admin = trim($_POST["admin"]); $edituser->webcal_login = trim($_POST["webcal_login"]); @@ -173,6 +177,9 @@ if ($_POST["action"] == 'update' && $user->admin) $edituser->note = $_POST["note"]; $edituser->prenom = $_POST["prenom"]; $edituser->login = $_POST["login"]; + $edituser->office_phone = $_POST["office_phone"]; + $edituser->office_fax = $_POST["office_fax"]; + $edituser->user_mobile = $_POST["user_mobile"]; $edituser->email = $_POST["email"]; $edituser->admin = $_POST["admin"]; $edituser->webcal_login = $_POST["webcal_login"]; @@ -291,6 +298,15 @@ if ($action == 'create') print ''.$langs->trans("Password").''; print ''; + print ''.$langs->trans("Phone").''; + print ''; + + print ''.$langs->trans("Fax").''; + print ''; + + print ''.$langs->trans("Mobile").''; + print ''; + print ''.$langs->trans("EMail").''; print ''; @@ -414,7 +430,7 @@ else print ''.$langs->trans("Lastname").''; print ''.$fuser->nom.''; - print ''; + print ''; if (file_exists($conf->users->dir_output."/".$fuser->id.".jpg")) { print ''; @@ -438,6 +454,14 @@ else { print ''.$langs->trans("LoginAccountDisable").''; } + + print ''.$langs->trans("Phone").''; + print ''.$fuser->office_phone.''; + print ''.$langs->trans("Fax").''; + print ''.$fuser->office_fax.''; + print ''.$langs->trans("Mobile").''; + print ''.$fuser->user_mobile.''; + print ''.$langs->trans("EMail").''; print ''.$fuser->email.''; print "\n"; @@ -547,15 +571,15 @@ else # $sql .= " WHERE ug.fk_usergroup IS NULL"; $sql .= " ORDER BY ug.nom"; - $result = $db->query($sql); - if ($result) + $resql = $db->query($sql); + if ($resql) { - $num = $db->num_rows(); + $num = $db->num_rows($resql); $i = 0; while ($i < $num) { - $obj = $db->fetch_object(); + $obj = $db->fetch_object($resql); $uss[$obj->rowid] = $obj->nom; $i++; @@ -656,8 +680,8 @@ else print ''; print ''; - print ''; - print ''; + print ''; print "".''; - print ''; + print ''; print "".''; - print ''; + print ''; + + print "".''; + print ''; + + print "".''; + print ''; + + print "".''; + print ''; print "".''; - print ''; + print ''; print "".''; if ($fuser->societe_id > 0) @@ -693,14 +726,14 @@ else } print "".'"; // Autres caractéristiques issus des autres modules $langs->load("other"); print "".''; - print ''; + 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 345e2242aaf..6cfceee4af6 100644 --- a/mysql/migration/1.1.0-2.0.0.sql +++ b/mysql/migration/1.1.0-2.0.0.sql @@ -249,6 +249,9 @@ alter table llx_boxes add box_order smallint default 0 NOT NULL; alter table llx_user drop column module_comm; alter table llx_user drop column module_compta; alter table llx_user add datelastaccess datetime; +alter table llx_user add office_phone varchar(20); +alter table llx_user add office_fax varchar(20); +alter table llx_user add user_mobile varchar(20); alter table llx_user_rights add rowid integer AUTO_INCREMENT PRIMARY KEY; diff --git a/mysql/tables/llx_user.sql b/mysql/tables/llx_user.sql index 366d9067856..8c7372be78b 100644 --- a/mysql/tables/llx_user.sql +++ b/mysql/tables/llx_user.sql @@ -30,6 +30,9 @@ create table llx_user name varchar(50), firstname varchar(50), code varchar(4), + office_phone varchar(20), + office_fax varchar(20), + user_mobile varchar(20), email varchar(255), admin smallint DEFAULT 0, webcal_login varchar(25),
'.$langs->trans("Lastname").''; + print ''; if (file_exists($conf->users->dir_output."/".$fuser->id.".jpg")) { print ''; @@ -666,17 +690,26 @@ else { print ''; } - print '

'.$langs->trans("PhotoFile").'
'; + print '

'.$langs->trans("PhotoFile").'
'; print '
'.$langs->trans("Firstname").'
'.$langs->trans("Login").'
'.$langs->trans("Phone").'
'.$langs->trans("Fax").'
'.$langs->trans("Mobile").'
'.$langs->trans("EMail").'
'.$langs->trans("Administrator").'
'.$langs->trans("Note").''; - print '
'.$langs->trans("LoginWebcal").'