NEW Disabled users are striked.

This commit is contained in:
Laurent Destailleur 2016-03-03 20:19:40 +01:00
parent 40144eee8d
commit 974879ea9d
6 changed files with 32 additions and 7 deletions

View File

@ -1662,7 +1662,7 @@ class Societe extends CommonObject
$reparray=array();
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.email";
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.email, u.statut, u.entity";
$sql.= " FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc, ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE u.rowid = sc.fk_user AND sc.fk_soc =".$this->id;
$sql.= " AND entity in (0, ".$conf->entity.")";
@ -1679,6 +1679,8 @@ class Societe extends CommonObject
$reparray[$i]['lastname']=$obj->lastname;
$reparray[$i]['firstname']=$obj->firstname;
$reparray[$i]['email']=$obj->email;
$reparray[$i]['statut']=$obj->statut;
$reparray[$i]['entity']=$obj->entity;
$i++;
}
return $reparray;

View File

@ -141,7 +141,7 @@ if ($socid)
print '<tr><td>'.$langs->trans("SalesRepresentatives").'</td>';
print '<td colspan="3">';
$sql = "SELECT u.rowid, u.lastname, u.firstname";
$sql = "SELECT u.rowid, u.login, u.fk_soc, u.lastname, u.firstname, u.statut, u.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
$sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE sc.fk_soc =".$object->id;
@ -154,6 +154,8 @@ if ($socid)
$num = $db->num_rows($resql);
$i = 0;
$tmpuser = new User($db);
while ($i < $num)
{
$obj = $db->fetch_object($resql);
@ -165,10 +167,20 @@ if ($socid)
null; // actions in normal case
}
print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->rowid.'">';
$tmpuser->id = $obj->rowid;
$tmpuser->firstname = $obj->firstname;
$tmpuser->lastname = $obj->lastname;
$tmpuser->statut = $obj->statut;
$tmpuser->login = $obj->login;
$tmpuser->entity = $obj->entity;
$tmpuser->societe_id = $obj->fk_soc;
print $tmpuser->getNomUrl(1);
/*print '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->rowid.'">';
print img_object($langs->trans("ShowUser"),"user").' ';
print dolGetFirstLastname($obj->firstname, $obj->lastname)."\n";
print '</a>&nbsp;';
print '</a>';*/
print '&nbsp;';
if ($user->rights->societe->creer)
{
print '<a href="commerciaux.php?socid='.$_GET["socid"].'&amp;delcommid='.$obj->rowid.'">';
@ -205,7 +217,7 @@ if ($socid)
$langs->load("users");
$title=$langs->trans("ListOfUsers");
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.login";
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.login, u.statut";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE u.entity IN (0,".$conf->entity.")";
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut<>0 ";
@ -224,6 +236,7 @@ if ($socid)
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Login").'</td>';
print '<td>'.$langs->trans("Status").'</td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
@ -238,7 +251,9 @@ if ($socid)
print img_object($langs->trans("ShowUser"),"user").' ';
print dolGetFirstLastname($obj->firstname, $obj->lastname)."\n";
print '</a>';
print '</td><td>'.$obj->login.'</td>';
print '</td>';
print '<td>'.$obj->login.'</td>';
print '<td>'.User::LibStatut($obj->statut,0).'</td>';
print '<td><a href="commerciaux.php?socid='.$_GET["socid"].'&amp;commid='.$obj->rowid.'">'.$langs->trans("Add").'</a></td>';
print '</tr>'."\n";

View File

@ -29,6 +29,7 @@
$userstatic->id=$val['id'];
$userstatic->lastname=$val['lastname'];
$userstatic->firstname=$val['firstname'];
$userstatic->statut=$val['statut'];
print $userstatic->getNomUrl(1);
$i++;
if ($i < $nbofsalesrepresentative) print ', ';

View File

@ -526,6 +526,9 @@ div.myavailability {
.selectlimit {
margin-right: 10px !important;
}
.strikefordisabled {
text-decoration: line-through;
}
/* ============================================================================== */
/* Styles to hide objects */

View File

@ -514,6 +514,10 @@ div.myavailability {
.selectlimit {
margin-right: 10px !important;
}
.strikefordisabled {
text-decoration: line-through;
}
/* ============================================================================== */
/* Styles to hide objects */

View File

@ -2015,7 +2015,7 @@ class User extends CommonObject
}
if (abs($withpictoimg) != 2)
{
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='<div class="inline-block valignmiddle'.($morecss?' usertext'.$morecss:'').'">';
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='<div class="inline-block valignmiddle'.($this->statut?'':' strikefordisabled').($morecss?' usertext'.$morecss:'').'">';
if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen);
else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen);
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='</div>';