Gestion du champs description : BUG 2165

https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=2165&group_id=1915
This commit is contained in:
Rodolphe Quiedeville 2003-01-14 23:50:55 +00:00
parent 8c4d2f3a43
commit 4b0ef10052
2 changed files with 18 additions and 10 deletions

View File

@ -1,5 +1,5 @@
<?PHP <?PHP
/* Copyright (c) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (c) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -26,6 +26,7 @@ class User {
var $fullname; var $fullname;
var $nom; var $nom;
var $prenom; var $prenom;
var $note;
var $code; var $code;
var $email; var $email;
var $admin; var $admin;
@ -55,7 +56,7 @@ class User {
Function fetch($login='') 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"; $sql .= " FROM llx_user as u";
if ($this->id) { if ($this->id) {
@ -73,8 +74,10 @@ class User {
$obj = $this->db->fetch_object($result , 0); $obj = $this->db->fetch_object($result , 0);
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->nom = $obj->name; $this->nom = stripslashes($obj->name);
$this->prenom = $obj->firstname; $this->prenom = stripslashes($obj->firstname);
$this->note = stripslashes($obj->note);
$this->fullname = $this->prenom . ' ' . $this->nom; $this->fullname = $this->prenom . ' ' . $this->nom;
$this->admin = $obj->admin; $this->admin = $obj->admin;
@ -168,6 +171,7 @@ class User {
$sql .= ", login = '$this->login'"; $sql .= ", login = '$this->login'";
$sql .= ", email = '$this->email'"; $sql .= ", email = '$this->email'";
$sql .= ", admin = $this->admin"; $sql .= ", admin = $this->admin";
$sql .= ", note = '$this->note'";
$sql .= " WHERE rowid = $this->id"; $sql .= " WHERE rowid = $this->id";
$result = $this->db->query($sql); $result = $this->db->query($sql);

View File

@ -1,5 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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 = new User($db,0);
$edituser->nom = $HTTP_POST_VARS["nom"]; $edituser->nom = $HTTP_POST_VARS["nom"];
$edituser->note = $HTTP_POST_VARS["note"];
$edituser->prenom = $HTTP_POST_VARS["prenom"]; $edituser->prenom = $HTTP_POST_VARS["prenom"];
$edituser->login = $HTTP_POST_VARS["login"]; $edituser->login = $HTTP_POST_VARS["login"];
$edituser->email = $HTTP_POST_VARS["email"]; $edituser->email = $HTTP_POST_VARS["email"];
@ -46,6 +47,7 @@ if ($action == 'update' && $user->admin)
$edituser->fetch(); $edituser->fetch();
$edituser->nom = $nom; $edituser->nom = $nom;
$edituser->note = $HTTP_POST_VARS["note"];
$edituser->prenom = $prenom; $edituser->prenom = $prenom;
$edituser->login = $login; $edituser->login = $login;
$edituser->email = $email; $edituser->email = $email;
@ -94,9 +96,8 @@ if ($action == 'create')
print '<td class="valeur"><input size="30" type="text" name="login" value=""></td></tr>'; print '<td class="valeur"><input size="30" type="text" name="login" value=""></td></tr>';
print '<tr><td valign="top">Description</td><td>'; print '<tr><td valign="top">Note</td><td>';
print "<textarea name=\"desc\" rows=\"12\" cols=\"40\">"; print "<textarea name=\"note\" rows=\"12\" cols=\"40\">";
print $user->description;
print "</textarea></td></tr>"; print "</textarea></td></tr>";
print '<tr><td align="center" colspan="2"><input value="Enregistrer" type="submit"></td></tr>'; print '<tr><td align="center" colspan="2"><input value="Enregistrer" type="submit"></td></tr>';
@ -134,6 +135,9 @@ else
print '<td width="25%" valign="top">Administrateur</td>'; print '<td width="25%" valign="top">Administrateur</td>';
print '<td width="25%">'.$yn[$fuser->admin].'</td></tr>'; print '<td width="25%">'.$yn[$fuser->admin].'</td></tr>';
print '<tr><td width="25%" valign="top">Note</td>';
print '<td colspan="3">'.nl2br($fuser->note).'&nbsp;</td></tr>';
print '</table>'; print '</table>';
print '<br><table width="100%" border="1" cellspacing="0" cellpadding="2">'; print '<br><table width="100%" border="1" cellspacing="0" cellpadding="2">';
@ -185,8 +189,8 @@ else
print '<tr><td valign="top">Description</td><td>'; print '<tr><td valign="top">Description</td><td>';
print "<textarea name=\"desc\" rows=\"12\" cols=\"40\">"; print "<textarea name=\"note\" rows=\"12\" cols=\"40\">";
print $fuser->description; print $fuser->note;
print "</textarea></td></tr>"; print "</textarea></td></tr>";
print '<tr><td align="center" colspan="2"><input value="Enregistrer" type="submit"></td></tr>'; print '<tr><td align="center" colspan="2"><input value="Enregistrer" type="submit"></td></tr>';