From 4b0ef10052a6de5107afad8440d7f30fbb2c8bd6 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 14 Jan 2003 23:50:55 +0000 Subject: [PATCH] Gestion du champs description : BUG 2165 https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=2165&group_id=1915 --- htdocs/user.class.php3 | 12 ++++++++---- htdocs/user/fiche.php3 | 16 ++++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/htdocs/user.class.php3 b/htdocs/user.class.php3 index 092eed980dc..d7f9995bb58 100644 --- a/htdocs/user.class.php3 +++ b/htdocs/user.class.php3 @@ -1,5 +1,5 @@ +/* Copyright (c) 2002-2003 Rodolphe Quiedeville * * 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 @@ -26,6 +26,7 @@ class User { var $fullname; var $nom; var $prenom; + var $note; var $code; var $email; var $admin; @@ -55,7 +56,7 @@ class User { Function fetch($login='') { - $sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.code, u.admin, u.module_comm, u.module_compta, u.login, u.webcal_login"; + $sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.code, u.admin, u.module_comm, u.module_compta, u.login, u.webcal_login, u.note"; $sql .= " FROM llx_user as u"; if ($this->id) { @@ -73,9 +74,11 @@ class User { $obj = $this->db->fetch_object($result , 0); $this->id = $obj->rowid; - $this->nom = $obj->name; - $this->prenom = $obj->firstname; + $this->nom = stripslashes($obj->name); + $this->prenom = stripslashes($obj->firstname); + $this->note = stripslashes($obj->note); + $this->fullname = $this->prenom . ' ' . $this->nom; $this->admin = $obj->admin; $this->webcal_login = $obj->webcal_login; @@ -168,6 +171,7 @@ class User { $sql .= ", login = '$this->login'"; $sql .= ", email = '$this->email'"; $sql .= ", admin = $this->admin"; + $sql .= ", note = '$this->note'"; $sql .= " WHERE rowid = $this->id"; $result = $this->db->query($sql); diff --git a/htdocs/user/fiche.php3 b/htdocs/user/fiche.php3 index ceea00e9465..6cefa152a9a 100644 --- a/htdocs/user/fiche.php3 +++ b/htdocs/user/fiche.php3 @@ -1,5 +1,5 @@ +/* Copyright (C) 2002-2003 Rodolphe Quiedeville * * 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 +31,7 @@ if ($HTTP_POST_VARS["action"] == 'add' && $user->admin) $edituser = new User($db,0); $edituser->nom = $HTTP_POST_VARS["nom"]; + $edituser->note = $HTTP_POST_VARS["note"]; $edituser->prenom = $HTTP_POST_VARS["prenom"]; $edituser->login = $HTTP_POST_VARS["login"]; $edituser->email = $HTTP_POST_VARS["email"]; @@ -46,6 +47,7 @@ if ($action == 'update' && $user->admin) $edituser->fetch(); $edituser->nom = $nom; + $edituser->note = $HTTP_POST_VARS["note"]; $edituser->prenom = $prenom; $edituser->login = $login; $edituser->email = $email; @@ -94,9 +96,8 @@ if ($action == 'create') print ''; - print 'Description'; - print ""; print ''; @@ -134,6 +135,9 @@ else print 'Administrateur'; print ''.$yn[$fuser->admin].''; + print 'Note'; + print ''.nl2br($fuser->note).' '; + print ''; print '
'; @@ -185,8 +189,8 @@ else print '"; print '';
Description'; - print "