Add status filter into user list
This commit is contained in:
parent
a2368daa57
commit
00064ed500
@ -41,6 +41,8 @@ if ($user->societe_id > 0)
|
||||
|
||||
$sall=GETPOST('sall','alpha');
|
||||
$search_user=GETPOST('search_user','alpha');
|
||||
$search_statut=GETPOST('search_statut','alpha');
|
||||
if ($search_statut=='') $search_statut=1; // always display activ customer first
|
||||
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
@ -55,6 +57,7 @@ if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$userstatic=new User($db);
|
||||
$companystatic = new Societe($db);
|
||||
$form = new Form($db);
|
||||
|
||||
|
||||
/*
|
||||
@ -86,6 +89,10 @@ if (! empty($search_user))
|
||||
{
|
||||
$sql.= " AND (u.login LIKE '%".$db->escape($search_user)."%' OR u.lastname LIKE '%".$db->escape($search_user)."%' OR u.firstname LIKE '%".$db->escape($search_user)."%')";
|
||||
}
|
||||
if ($search_statut!='')
|
||||
{
|
||||
$sql.= " AND (u.statut=".$search_statut.")";
|
||||
}
|
||||
if ($sall) $sql.= " AND (u.login LIKE '%".$db->escape($sall)."%' OR u.lastname LIKE '%".$db->escape($sall)."%' OR u.firstname LIKE '%".$db->escape($sall)."%' OR u.email LIKE '%".$db->escape($sall)."%' OR u.note LIKE '%".$db->escape($sall)."%')";
|
||||
$sql.=$db->order($sortfield,$sortorder);
|
||||
|
||||
@ -95,6 +102,8 @@ if ($result)
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
|
||||
$param="search_user=$search_user&sall=$sall";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -104,7 +113,22 @@ if ($result)
|
||||
print_liste_field_titre($langs->trans("Company"),"index.php","u.fk_societe",$param,"","",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("DateCreation"),"index.php","u.datec",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("LastConnexion"),"index.php","u.datelastlogin",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),"index.php","u.statut",$param,"",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("Status"),"index.php","u.statut",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
print '<td width="1%"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
//SearchBar
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="6"> </td>';
|
||||
|
||||
print '<td>';
|
||||
print $form->selectarray('search_statut', array('0'=>$langs->trans('Disabled'),'1'=>$langs->trans('Enabled')),$search_statut);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input class="liste_titre" type="image" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
@ -168,11 +192,13 @@ if ($result)
|
||||
|
||||
// Statut
|
||||
$userstatic->statut=$obj->statut;
|
||||
print '<td width="100" align="right">'.$userstatic->getLibStatut(5).'</td>';
|
||||
print '<td width="100" align="center">'.$userstatic->getLibStatut(5).'</td>';
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
print "</table>";
|
||||
print "</form>\n";
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user