26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
30 $langs->loadLangs(array(
'users',
'admin'));
32 $action = (string)
GETPOST(
'action',
'aZ09');
33 $id = (int)
GETPOST(
'id',
'int');
37 if ($user->socid > 0) {
38 $socid = $user->socid;
40 $feature2 = (($socid && $user->rights->user->self->creer) ?
'' :
'user');
42 $result =
restrictedArea($user,
'user', $id,
'user&user', $feature2);
45 $hookmanager->initHooks(array(
'usercard',
'globalcard'));
52 $parameters = array(
'id'=>$socid);
53 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
58 if (empty($reshook)) {
59 if ($action ==
'update' && !
GETPOST(
'cancel',
'alpha')) {
60 $edituser =
new User($db);
61 $edituser->fetch($id);
63 $edituser->clicktodial_url = (string)
GETPOST(
"url",
"alpha");
64 $edituser->clicktodial_login = (string)
GETPOST(
"login",
"alpha");
65 $edituser->clicktodial_password = (string)
GETPOST(
"password",
"alpha");
66 $edituser->clicktodial_poste = (string)
GETPOST(
"poste",
"alpha");
68 $result = $edituser->update_clicktodial();
82 $object =
new User($db);
83 $object->fetch($id,
'',
'', 1);
85 $object->fetch_clicktodial();
87 $person_name = !empty($object->firstname) ? $object->lastname.
", ".$object->firstname : $object->lastname;
88 $title = $person_name.
" - ".$langs->trans(
'ClickToDial');
94 $title = $langs->trans(
"User");
97 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'" method="post">';
98 print
'<input type="hidden" name="token" value="'.newToken().
'">';
99 print
'<input type="hidden" name="action" value="update">';
105 if ($user->rights->user->user->lire || $user->admin) {
106 $linkback =
'<a href="'.DOL_URL_ROOT.
'/user/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
109 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/user/vcard.php?id='.$object->id.
'" class="refid">';
110 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
111 $morehtmlref .=
'</a>';
113 dol_banner_tab($object,
'id', $linkback, $user->rights->user->user->lire || $user->admin,
'rowid',
'ref', $morehtmlref);
115 print
'<div class="fichecenter">';
116 print
'<div class="underbanner clearboth"></div>';
119 if ($action ==
'edit') {
120 print
'<table class="border centpercent">';
123 print
'<tr><td class="titlefield fieldrequired">ClickToDial URL</td>';
124 print
'<td class="valeur">';
125 print
'<input name="url" value="'.(!empty($object->clicktodial_url) ? $object->clicktodial_url :
'').
'" size="92">';
126 if (empty($conf->global->CLICKTODIAL_URL) && empty($object->clicktodial_url)) {
127 $langs->load(
"errors");
128 print
'<span class="error">'.$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"ClickToDial")).
'</span>';
130 print
'<br>'.$form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"KeepEmptyToUseDefault").
'</span>:<br>'.$conf->global->CLICKTODIAL_URL, $langs->trans(
"ClickToDialUrlDesc"));
136 print
'<tr><td class="titlefield fieldrequired">ClickToDial '.$langs->trans(
"IdPhoneCaller").
'</td>';
137 print
'<td class="valeur">';
138 print
'<input name="poste" value="'.(!empty($object->clicktodial_poste) ? $object->clicktodial_poste :
'').
'"></td>';
141 print
'<tr><td>ClickToDial '.$langs->trans(
"Login").
'</td>';
142 print
'<td class="valeur">';
143 print
'<input name="login" value="'.(!empty($object->clicktodial_login) ? $object->clicktodial_login :
'').
'"></td>';
146 print
'<tr><td>ClickToDial '.$langs->trans(
"Password").
'</td>';
147 print
'<td class="valeur">';
148 print
'<input type="password" name="password" value="'.dol_escape_htmltag(empty($object->clicktodial_password) ?
'' : $object->clicktodial_password).
'"></td>';
154 print
'<table class="border centpercent tableforfield">';
156 if (!empty($user->admin)) {
157 print
'<tr><td class="">ClickToDial URL</td>';
158 print
'<td class="valeur">';
159 if (!empty($conf->global->CLICKTODIAL_URL)) {
160 $url = $conf->global->CLICKTODIAL_URL;
162 if (!empty($object->clicktodial_url)) {
163 $url = $object->clicktodial_url;
166 $langs->load(
"errors");
167 print
'<span class="error">'.$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"ClickToDial")).
'</span>';
169 print
$form->textwithpicto((empty($object->clicktodial_url) ?
'<span class="opacitymedium">'.$langs->trans(
"DefaultLink").
':</span> ' :
'').$url, $langs->trans(
"ClickToDialUrlDesc"));
175 print
'<tr><td class="">ClickToDial '.$langs->trans(
"IdPhoneCaller").
'</td>';
176 print
'<td class="valeur">'.(!empty($object->clicktodial_poste) ? $object->clicktodial_poste :
'').
'</td>';
179 print
'<tr><td>ClickToDial '.$langs->trans(
"Login").
'</td>';
180 print
'<td class="valeur">'.(!empty($object->clicktodial_login) ? $object->clicktodial_login :
'').
'</td>';
183 print
'<tr><td>ClickToDial '.$langs->trans(
"Password").
'</td>';
184 print
'<td class="valeur">'.preg_replace(
'/./',
'*', (!empty($object->clicktodial_password) ? $object->clicktodial_password :
'')).
'</a></td>';
192 if ($action ==
'edit') {
194 print
'<div class="center"><input class="button button-save" type="submit" value="'.$langs->trans(
"Save").
'">';
195 print
' ';
196 print
'<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
206 print
'<div class="tabsAction">';
208 if (!empty($user->admin) && $action <>
'edit') {
209 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage Dolibarr users.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
user_prepare_head(User $object)
Prepare array with list of tabs.