25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
29 $langs->loadLangs(array(
'users',
'admin'));
31 $action = (string)
GETPOST(
'action',
'aZ09');
32 $id = (int)
GETPOST(
'id',
'int');
36 if ($user->socid > 0) $socid = $user->socid;
37 $feature2 = (($socid && $user->rights->user->self->creer) ?
'' :
'user');
39 $result =
restrictedArea($user,
'user', $id,
'user&user', $feature2);
42 $hookmanager->initHooks(array(
'usercard',
'globalcard'));
48 $parameters = array(
'id'=>$socid);
49 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
50 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
52 if (empty($reshook)) {
53 if ($action ==
'update' && !
GETPOST(
'cancel',
'alpha')) {
54 $edituser =
new User($db);
55 $edituser->fetch($id);
57 $edituser->clicktodial_url = (string)
GETPOST(
"url",
"alpha");
58 $edituser->clicktodial_login = (string)
GETPOST(
"login",
"alpha");
59 $edituser->clicktodial_password = (string)
GETPOST(
"password",
"alpha");
60 $edituser->clicktodial_poste = (string)
GETPOST(
"poste",
"alpha");
62 $result = $edituser->update_clicktodial();
74 $form =
new Form($db);
81 $object =
new User($db);
82 $object->fetch($id,
'',
'', 1);
84 $object->fetch_clicktodial();
89 $title = $langs->trans(
"User");
92 print '<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'" method="post">';
93 print '<input type="hidden" name="token" value="'.newToken().
'">';
94 print '<input type="hidden" name="action" value="update">';
100 if ($user->rights->user->user->lire || $user->admin) {
101 $linkback =
'<a href="'.DOL_URL_ROOT.
'/user/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
104 dol_banner_tab($object,
'id', $linkback, $user->rights->user->user->lire || $user->admin);
106 print '<div class="fichecenter">';
107 print '<div class="underbanner clearboth"></div>';
110 if ($action ==
'edit')
112 print '<table class="border centpercent">';
116 print '<tr><td class="titlefield fieldrequired">ClickToDial URL</td>';
117 print '<td class="valeur">';
118 print '<input name="url" value="'.(!empty($object->clicktodial_url) ? $object->clicktodial_url :
'').
'" size="92">';
119 if (empty($conf->global->CLICKTODIAL_URL) && empty($object->clicktodial_url))
121 $langs->load(
"errors");
122 print '<font class="error">'.$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"ClickToDial")).
'</font>';
124 print ' '.$form->textwithpicto($langs->trans(
"KeepEmptyToUseDefault").
': '.$conf->global->CLICKTODIAL_URL, $langs->trans(
"ClickToDialUrlDesc"));
130 print '<tr><td class="titlefield fieldrequired">ClickToDial '.$langs->trans(
"IdPhoneCaller").
'</td>';
131 print '<td class="valeur">';
132 print '<input name="poste" value="'.(!empty($object->clicktodial_poste) ? $object->clicktodial_poste :
'').
'"></td>';
135 print
'<tr><td>ClickToDial '.$langs->trans(
"Login").
'</td>';
136 print
'<td class="valeur">';
137 print
'<input name="login" value="'.(!empty($object->clicktodial_login) ? $object->clicktodial_login :
'').
'"></td>';
140 print
'<tr><td>ClickToDial '.$langs->trans(
"Password").
'</td>';
141 print
'<td class="valeur">';
142 print
'<input type="password" name="password" value="'.(!empty($object->clicktodial_password) ? $object->clicktodial_password :
'').
'"></td>';
148 print
'<table class="border centpercent tableforfield">';
150 if (!empty($user->admin))
152 print
'<tr><td class="titlefield">ClickToDial URL</td>';
153 print
'<td class="valeur">';
154 $url = $conf->global->CLICKTODIAL_URL;
155 if (!empty($object->clicktodial_url)) $url = $object->clicktodial_url;
158 $langs->load(
"errors");
159 print
'<font class="error">'.$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"ClickToDial")).
'</font>';
161 print $form->textwithpicto((empty($object->clicktodial_url) ?
'<span class="opacitymedium">'.$langs->trans(
"DefaultLink").
':</span> ' :
'').$url, $langs->trans(
"ClickToDialUrlDesc"));
167 print
'<tr><td class="titlefield">ClickToDial '.$langs->trans(
"IdPhoneCaller").
'</td>';
168 print
'<td class="valeur">'.(!empty($object->clicktodial_poste) ? $object->clicktodial_poste :
'').
'</td>';
171 print
'<tr><td>ClickToDial '.$langs->trans(
"Login").
'</td>';
172 print
'<td class="valeur">'.(!empty($object->clicktodial_login) ? $object->clicktodial_login :
'').
'</td>';
175 print
'<tr><td>ClickToDial '.$langs->trans(
"Password").
'</td>';
176 print
'<td class="valeur">'.preg_replace(
'/./',
'*', (!empty($object->clicktodial_password) ? $object->clicktodial_password :
'')).
'</a></td>';
184 if ($action ==
'edit')
187 print
'<div class="center"><input class="button button-save" type="submit" value="'.$langs->trans(
"Save").
'">';
188 print
'   ';
189 print
'<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
199 print
'<div class="tabsAction">';
201 if (!empty($user->admin) && $action <>
'edit')
203 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=edit">'.$langs->trans(
"Modify").
'</a>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
user_prepare_head($object)
Prepare array with list of tabs.
Class to manage Dolibarr users.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.