New banner tab is available on all tab of user object
This commit is contained in:
parent
b24d609ecc
commit
3bb8eac92b
@ -73,49 +73,24 @@ llxHeader("","ClickToDial");
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch($id);
|
||||
$fuser->fetch_clicktodial();
|
||||
$object = new User($db);
|
||||
$object->fetch($id);
|
||||
$object->fetch_clicktodial();
|
||||
|
||||
|
||||
/*
|
||||
* Affichage onglets
|
||||
*/
|
||||
$head = user_prepare_head($fuser);
|
||||
$head = user_prepare_head($object);
|
||||
|
||||
$title = $langs->trans("User");
|
||||
dol_fiche_head($head, 'clicktodial', $title, 0, 'user');
|
||||
|
||||
/*
|
||||
* Fiche en mode visu
|
||||
*/
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="2">';
|
||||
print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Name
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Lastname").'</td>';
|
||||
print '<td colspan="2">'.$fuser->lastname.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Firstname
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Firstname").'</td>';
|
||||
print '<td colspan="2">'.$fuser->firstname.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table>\n";
|
||||
print "<br>\n";
|
||||
|
||||
// Edit mode
|
||||
dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
// Edit mode
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$fuser->id.'" method="post">';
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<table class="border" width="100%">';
|
||||
@ -124,8 +99,8 @@ if ($id > 0)
|
||||
{
|
||||
print '<tr><td width="25%" valign="top">ClickToDial URL</td>';
|
||||
print '<td class="valeur">';
|
||||
print '<input name="url" value="'.(! empty($fuser->clicktodial_url)?$fuser->clicktodial_url:'').'" size="92">';
|
||||
if (empty($conf->global->CLICKTODIAL_URL) && empty($fuser->clicktodial_url))
|
||||
print '<input name="url" value="'.(! empty($object->clicktodial_url)?$object->clicktodial_url:'').'" size="92">';
|
||||
if (empty($conf->global->CLICKTODIAL_URL) && empty($object->clicktodial_url))
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<font class="error">'.$langs->trans("ErrorModuleSetupNotComplete").'</font>';
|
||||
@ -138,19 +113,19 @@ if ($id > 0)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr><td width="25%" valign="top">ClickToDial '.$langs->trans("IdPhoneCaller").'</td>';
|
||||
print '<tr><td class="titlefield">ClickToDial '.$langs->trans("IdPhoneCaller").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print '<input name="poste" value="'.(! empty($fuser->clicktodial_poste)?$fuser->clicktodial_poste:'').'"></td>';
|
||||
print '<input name="poste" value="'.(! empty($object->clicktodial_poste)?$object->clicktodial_poste:'').'"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr><td width="25%" valign="top">ClickToDial '.$langs->trans("Login").'</td>';
|
||||
print '<tr><td>ClickToDial '.$langs->trans("Login").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print '<input name="login" value="'.(! empty($fuser->clicktodial_login)?$fuser->clicktodial_login:'').'"></td>';
|
||||
print '<input name="login" value="'.(! empty($object->clicktodial_login)?$object->clicktodial_login:'').'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td width="25%" valign="top">ClickToDial '.$langs->trans("Password").'</td>';
|
||||
print '<tr><td>ClickToDial '.$langs->trans("Password").'</td>';
|
||||
print '<td class="valeur">';
|
||||
print '<input name="password" value="'.(! empty($fuser->clicktodial_password)?$fuser->clicktodial_password:'').'"></td>';
|
||||
print '<input name="password" value="'.(! empty($object->clicktodial_password)?$object->clicktodial_password:'').'"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '</table>';
|
||||
@ -169,10 +144,10 @@ if ($id > 0)
|
||||
|
||||
if (! empty($user->admin))
|
||||
{
|
||||
print "<tr>".'<td width="25%" valign="top">ClickToDial URL</td>';
|
||||
print '<tr><td class="titlefield fieldrequired">ClickToDial URL</td>';
|
||||
print '<td class="valeur">';
|
||||
$url=$conf->global->CLICKTODIAL_URL;
|
||||
if (! empty($fuser->clicktodial_url)) $url=$fuser->clicktodial_url;
|
||||
if (! empty($object->clicktodial_url)) $url=$object->clicktodial_url;
|
||||
if (empty($url))
|
||||
{
|
||||
$langs->load("errors");
|
||||
@ -180,28 +155,29 @@ if ($id > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print $form->textwithpicto((empty($fuser->clicktodial_url)?$langs->trans("DefaultLink").': ':'').$url,$langs->trans("ClickToDialUrlDesc"));
|
||||
print $form->textwithpicto((empty($object->clicktodial_url)?$langs->trans("DefaultLink").': ':'').$url,$langs->trans("ClickToDialUrlDesc"));
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr><td width="25%" valign="top" class="fieldrequired">ClickToDial '.$langs->trans("IdPhoneCaller").'</td>';
|
||||
print '<td class="valeur">'.(! empty($fuser->clicktodial_poste)?$fuser->clicktodial_poste:'').'</td>';
|
||||
print '<tr><td class="titlefield fieldrequired">ClickToDial '.$langs->trans("IdPhoneCaller").'</td>';
|
||||
print '<td class="valeur">'.(! empty($object->clicktodial_poste)?$object->clicktodial_poste:'').'</td>';
|
||||
print "</tr>";
|
||||
|
||||
print '<tr><td width="25%" valign="top">ClickToDial '.$langs->trans("Login").'</td>';
|
||||
print '<td class="valeur">'.(! empty($fuser->clicktodial_login)?$fuser->clicktodial_login:'').'</td>';
|
||||
print '<tr><td>ClickToDial '.$langs->trans("Login").'</td>';
|
||||
print '<td class="valeur">'.(! empty($object->clicktodial_login)?$object->clicktodial_login:'').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td width="25%" valign="top">ClickToDial '.$langs->trans("Password").'</td>';
|
||||
print '<td class="valeur">'.preg_replace('/./','*',(! empty($fuser->clicktodial_password)?$fuser->clicktodial_password:'')).'</a></td>';
|
||||
print '<tr><td>ClickToDial '.$langs->trans("Password").'</td>';
|
||||
print '<td class="valeur">'.preg_replace('/./','*',(! empty($object->clicktodial_password)?$object->clicktodial_password:'')).'</a></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table>\n";
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
* Barre d'actions
|
||||
@ -210,11 +186,10 @@ if ($id > 0)
|
||||
|
||||
if (! empty($user->admin) && $action <> 'edit')
|
||||
{
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$fuser->id.'&action=edit">'.$langs->trans("Modify").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
print "<br>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -89,27 +89,14 @@ $head = user_prepare_head($object);
|
||||
$title = $langs->trans("User");
|
||||
dol_fiche_head($head, 'ldap', $title, 0, 'user');
|
||||
|
||||
dol_banner_tab($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
|
||||
print '<td>';
|
||||
print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Lastname").'</td>';
|
||||
print '<td>'.$object->lastname.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Firstname
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Firstname").'</td>';
|
||||
print '<td>'.$object->firstname.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Login
|
||||
print '<tr><td width="25%" valign="top">'.$langs->trans("Login").'</td>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
|
||||
if ($object->ldap_sid)
|
||||
{
|
||||
print '<td class="warning">'.$langs->trans("LoginAccountDisableInDolibarr").'</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user