Fix: Hide button if no permission

This commit is contained in:
Laurent Destailleur 2011-08-29 17:20:50 +00:00
parent 66a47485c9
commit 754977767c

View File

@ -1363,17 +1363,20 @@ if ($rowid && $action != 'edit')
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrUser");
print '</td>';
if ($_GET['action'] != 'editlogin' && $user->rights->adherent->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlogin&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'),1).'</a></td>';
if ($_GET['action'] != 'editlogin' && $user->rights->adherent->creer)
{
print '<td align="right">';
if ($user->rights->user->user->creer)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=editlogin&amp;rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'),1).'</a>';
}
print '</td>';
}
print '</tr></table>';
print '</td><td colspan="2" class="valeur">';
if ($_GET['action'] == 'editlogin')
{
/*$include=array();
if (empty($user->rights->user->user->creer)) // If can edit only itself user, we can link to itself only
{
$include=array($object->user_id,$user->id);
}*/
print $html->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
print $html->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid','');
}
else
{