Fix: Affichage statut sur liste des users.
This commit is contained in:
parent
f5e642dfbd
commit
1c113d04d7
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@ -33,6 +33,7 @@ $user->getrights();
|
||||
if (! $user->rights->user->user->lire && ! $user->admin) accessforbidden();
|
||||
|
||||
$langs->load("users");
|
||||
$langs->load("companies");
|
||||
|
||||
$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"];
|
||||
|
||||
@ -47,13 +48,17 @@ $offset = $limit * $page ;
|
||||
if (! $sortfield) $sortfield="u.login";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$userstatic=new User($db);
|
||||
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
print_titre($langs->trans("ListOfUsers"));
|
||||
|
||||
$sql = "SELECT u.rowid, u.name, u.firstname, u.admin, u.code, u.fk_societe, u.login, ".$db->pdate("u.datec")." as datec,";
|
||||
$sql.= " u.ldap_sid, s.nom";
|
||||
$sql.= " u.ldap_sid, u.statut,";
|
||||
$sql.= " s.nom";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.idp";
|
||||
$sql.= " WHERE 1=1";
|
||||
@ -81,6 +86,7 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("Code"),"index.php","u.code",$param,"","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Company"),"index.php","u.fk_societe",$param,"","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),"index.php","u.datec",$param,"","",$sortfield);
|
||||
print_liste_field_titre($langs->trans("Status"),"index.php","u.status",$param,"",'align="right"',$sortfield);
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
@ -89,24 +95,12 @@ if ($result)
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
if ($obj->login)
|
||||
print '<td><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a>';
|
||||
if ($obj->admin)
|
||||
{
|
||||
print '<td><a href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a>';
|
||||
if ($obj->admin)
|
||||
{
|
||||
print img_picto($langs->trans("Administrator"),'star');
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td><a class="impayee" href="fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' Inactif</a>';
|
||||
if ($obj->admin)
|
||||
{
|
||||
print img_picto($langs->trans("Administrator"),'star');
|
||||
}
|
||||
print '</td>';
|
||||
print img_picto($langs->trans("Administrator"),'star');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.ucfirst($obj->name).'</td>';
|
||||
print '<td>'.ucfirst($obj->firstname).'</td>';
|
||||
print '<td>'.$obj->code.'</td>';
|
||||
@ -122,6 +116,10 @@ if ($result)
|
||||
else print $langs->trans("InternalUser");
|
||||
print '</td>';
|
||||
print '<td width="100" align="center">'.dolibarr_print_date($obj->datec,"%d %b %Y").'</td>';
|
||||
|
||||
// Statut
|
||||
$userstatic->statut=$obj->statut;
|
||||
print '<td width="100" align="right">'.$userstatic->getLibStatut(5).'</td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user