Delete the name of user who are disable in the creation of events

This commit is contained in:
lalaina rasamoelina 2013-07-22 11:17:45 +02:00
parent 8bae6a774d
commit 4ecc9b30a9
2 changed files with 22 additions and 5 deletions

View File

@ -1096,7 +1096,7 @@ class Form
$out='';
// On recherche les utilisateurs
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.login, u.admin, u.entity";
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
$sql.= ", e.label";
@ -1142,7 +1142,7 @@ class Form
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$userstatic->id=$obj->rowid;
$userstatic->lastname=$obj->lastname;
$userstatic->firstname=$obj->firstname;
@ -1164,6 +1164,14 @@ class Form
}
$out.= $userstatic->getFullName($langs, 0, 0, $maxlength);
if ($obj->statut == 1)
{
$out.=" (".$langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4').")";
}
else
{
$out.=" (".$langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5').")";
}
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
@ -1174,6 +1182,7 @@ class Form
//if ($obj->admin) $out.= ' *';
if (! empty($conf->global->MAIN_SHOW_LOGIN)) $out.= ' ('.$obj->login.')';
$out.= '</option>';
$i++;
}
}

View File

@ -351,14 +351,15 @@ class FormOther
*/
function select_salesrepresentatives($selected,$htmlname,$user)
{
global $conf;
global $conf,$langs;
$langs->load('users');
// Select each sales and print them in a select input
$moreforfilter ='<select class="flat" name="'.$htmlname.'">';
$moreforfilter.='<option value="">&nbsp;</option>';
// Get list of users allowed to be viewed
$sql_usr = "SELECT u.rowid, u.lastname as name, u.firstname, u.login";
$sql_usr = "SELECT u.rowid, u.lastname as name, u.statut, u.firstname, u.login";
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql_usr.= " WHERE u.entity IN (0,".$conf->entity.")";
if (empty($user->rights->user->user->lire)) $sql_usr.=" AND u.fk_societe = ".($user->societe_id?$user->societe_id:0);
@ -384,7 +385,14 @@ class FormOther
if ($obj_usr->rowid == $selected) $moreforfilter.=' selected="selected"';
$moreforfilter.='>';
$moreforfilter.=$obj_usr->firstname." ".$obj_usr->name." (".$obj_usr->login.')';
if ($obj_usr->statut == 1)
{
$moreforfilter.=$obj_usr->firstname." ".$obj_usr->name." (".$obj_usr->login.')'." ". img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
}
else
{
$moreforfilter.=$obj_usr->firstname." ".$obj_usr->name." (".$obj_usr->login.')'." ". img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
}
$moreforfilter.='</option>';
}
$this->db->free($resql_usr);