New: Show user status in user lists.
This commit is contained in:
parent
b90f539243
commit
b8c4359961
@ -5,6 +5,7 @@ $Id$
|
||||
|
||||
***** ChangeLog for 3.1 compared to 3.0 *****
|
||||
For users:
|
||||
- New: Status is visible into user list.
|
||||
- New: Support BSB code for bank account in australia.
|
||||
- New: Can set date of payment for autocreate invoice/payment when
|
||||
creating a foundation subscription.
|
||||
|
||||
@ -1591,9 +1591,9 @@ class User extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne le libelle du statut d'un user (actif, inactif)
|
||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
||||
* \return string Libelle
|
||||
* Retourne le libelle du statut d'un user (actif, inactif)
|
||||
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
||||
* @return string Label of status
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
@ -1601,10 +1601,10 @@ class User extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libelle d'un statut donne
|
||||
* \param statut Id statut
|
||||
* \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* \return string Libelle du statut
|
||||
* Renvoi le libelle d'un statut donne
|
||||
* @param statut Id statut
|
||||
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
|
||||
@ -220,7 +220,7 @@ if ($_POST["action"] == 'update')
|
||||
llxHeader('',$langs->trans("GroupCard"));
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
$fuserstatic = new User($db);
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
@ -377,7 +377,7 @@ else
|
||||
|
||||
if (!empty($idList))
|
||||
{
|
||||
$sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.admin";
|
||||
$sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.admin, u.statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
$sql.= " AND u.rowid NOT IN (".$idList.")";
|
||||
@ -404,7 +404,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.admin";
|
||||
$sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.admin, u.statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
|
||||
$sql.= " ORDER BY u.name";
|
||||
@ -450,7 +450,7 @@ else
|
||||
/*
|
||||
* Membres du groupe
|
||||
*/
|
||||
$sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.admin, u.entity";
|
||||
$sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.admin, u.entity, u.statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
|
||||
$sql.= " WHERE ug.fk_user = u.rowid";
|
||||
@ -468,8 +468,10 @@ else
|
||||
print '<td class="liste_titre" width="25%">'.$langs->trans("Login").'</td>';
|
||||
print '<td class="liste_titre" width="25%">'.$langs->trans("Lastname").'</td>';
|
||||
print '<td class="liste_titre" width="25%">'.$langs->trans("Firstname").'</td>';
|
||||
print '<td class="liste_titre" align="right">'.$langs->trans("Status").'</td>';
|
||||
print '<td> </td>';
|
||||
print "<td> </td></tr>\n";
|
||||
print "<td> </td>";
|
||||
print "</tr>\n";
|
||||
if ($num) {
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
@ -491,11 +493,13 @@ else
|
||||
print '</td>';
|
||||
print '<td>'.ucfirst(stripslashes($obj->name)).'</td>';
|
||||
print '<td>'.ucfirst(stripslashes($obj->firstname)).'</td>';
|
||||
print '<td> </td><td>';
|
||||
|
||||
$fuserstatic->id=$obj->id;
|
||||
$fuserstatic->statut=$obj->statut;
|
||||
print '<td align="right">'.$fuserstatic->getLibStatut(5).'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="right">';
|
||||
if ($user->admin)
|
||||
{
|
||||
|
||||
print '<a href="fiche.php?id='.$group->id.'&action=removeuser&user='.$obj->rowid.'">';
|
||||
print img_delete($langs->trans("RemoveFromGroup"));
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -25,10 +25,11 @@
|
||||
|
||||
require("../main.inc.php");
|
||||
|
||||
if (! $user->rights->user->user->lire && !$user->admin)
|
||||
if (! $user->rights->user->user->lire && ! $user->admin)
|
||||
{
|
||||
// Redirection vers la page de l'utilisateur
|
||||
Header("Location: fiche.php?id=".$user->id);
|
||||
exit;
|
||||
}
|
||||
|
||||
$langs->load("users");
|
||||
@ -44,6 +45,8 @@ $socid=0;
|
||||
if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||
|
||||
$companystatic = new Societe($db);
|
||||
$fuserstatic = new User($db);
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -90,12 +93,11 @@ print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
|
||||
|
||||
|
||||
/*
|
||||
* Derniers utilisateurs crees
|
||||
* Last created users
|
||||
*/
|
||||
$max=10;
|
||||
|
||||
$sql = "SELECT u.rowid, u.name, u.firstname, u.admin, u.login, u.fk_societe, u.datec,";
|
||||
$sql.= " u.entity, u.ldap_sid,";
|
||||
$sql = "SELECT u.rowid, u.name, u.firstname, u.admin, u.login, u.fk_societe, u.datec, u.statut, u.entity, u.ldap_sid,";
|
||||
$sql.= " s.nom, s.canvas";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid";
|
||||
@ -109,7 +111,7 @@ if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("LastUsersCreated",min($num,$max)).'</td></tr>';
|
||||
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("LastUsersCreated",min($num,$max)).'</td></tr>';
|
||||
$var = true;
|
||||
$i = 0;
|
||||
|
||||
@ -145,6 +147,12 @@ if ($resql)
|
||||
else print $langs->trans("InternalUser");
|
||||
print '</td>';
|
||||
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'dayhour').'</td>';
|
||||
print '<td align="right">';
|
||||
$fuserstatic->id=$obj->id;
|
||||
$fuserstatic->statut=$obj->statut;
|
||||
print $fuserstatic->getLibStatut(3);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
@ -164,13 +172,13 @@ else
|
||||
if ($canreadperms)
|
||||
{
|
||||
$max=5;
|
||||
|
||||
|
||||
$sql = "SELECT g.rowid, g.nom, g.note, g.entity, g.datec";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g";
|
||||
$sql.= " WHERE g.entity IN (0,".$conf->entity.")";
|
||||
$sql.= $db->order("g.datec","DESC");
|
||||
$sql.= $db->plimit($max);
|
||||
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -179,12 +187,12 @@ if ($canreadperms)
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("LastGroupsCreated",($num ? $num : $max)).'</td></tr>';
|
||||
$var = true;
|
||||
$i = 0;
|
||||
|
||||
|
||||
while ($i < $num && (! $max || $i < $max))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/user/group/fiche.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowGroup"),"group").' '.$obj->nom.'</a>';
|
||||
if (!$obj->entity)
|
||||
@ -197,7 +205,7 @@ if ($canreadperms)
|
||||
$i++;
|
||||
}
|
||||
print "</table><br>";
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user