27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
39$langs->loadLangs(array(
'users',
'admin'));
41$action = (string)
GETPOST(
'action',
'aZ09');
42$cancel =
GETPOST(
'cancel',
'aZ09');
48if ($user->socid > 0) {
49 $socid = $user->socid;
51$feature2 = (($socid && $user->hasRight(
'user',
'self',
'creer')) ?
'' :
'user');
54$hookmanager->initHooks(array(
'usercard',
'globalcard'));
56$result =
restrictedArea($user,
'user', $id,
'user&user', $feature2);
62 $canedituser = (($user->id ==
$id) && $user->hasRight(
"user",
"self",
"write")) || (($user->id != $id) && $user->hasRight(
"user",
"user",
"write"));
70$parameters = array(
'id'=>$socid);
71$reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
77 if ($action ==
'update' && !$cancel && $canedituser) {
78 $edituser =
new User($db);
79 $edituser->fetch($id);
81 $edituser->clicktodial_url = (string)
GETPOST(
"url",
"alpha");
82 $edituser->clicktodial_login = (string)
GETPOST(
"login",
"alpha");
83 $edituser->clicktodial_password = (string)
GETPOST(
"password",
"alpha");
84 $edituser->clicktodial_poste = (string)
GETPOST(
"poste",
"alpha");
86 $result = $edituser->update_clicktodial();
102 $object->fetch($id,
'',
'', 1);
107 $title = $person_name.
" - ".$langs->trans(
'ClickToDial');
109 llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-user page-clicktodial');
113 $title = $langs->trans(
"User");
116 print
'<form action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'" method="post">';
117 print
'<input type="hidden" name="token" value="'.newToken().
'">';
118 print
'<input type="hidden" name="action" value="update">';
124 if ($user->hasRight(
'user',
'user',
'lire') || $user->admin) {
125 $linkback =
'<a href="'.DOL_URL_ROOT.
'/user/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
128 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/user/vcard.php?id='.
$object->id.
'&output=file&file='.urlencode(
dol_sanitizeFileName(
$object->getFullName($langs).
'.vcf')).
'" class="refid" rel="noopener">';
129 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
130 $morehtmlref .=
'</a>';
132 $urltovirtualcard =
'/user/virtualcard.php?id='.((int)
$object->id);
133 $morehtmlref .=
dolButtonToOpenUrlInDialogPopup(
'publicvirtualcard', $langs->transnoentitiesnoconv(
"PublicVirtualCardUrl").
' - '.
$object->getFullName($langs),
img_picto($langs->trans(
"PublicVirtualCardUrl"),
'card',
'class="valignmiddle marginleftonly paddingrightonly"'), $urltovirtualcard,
'',
'nohover');
135 dol_banner_tab(
$object,
'id', $linkback, $user->hasRight(
'user',
'user',
'lire') || $user->admin,
'rowid',
'ref', $morehtmlref);
137 print
'<div class="fichecenter">';
138 print
'<div class="underbanner clearboth"></div>';
141 if ($action ==
'edit') {
142 print
'<table class="border centpercent">';
145 print
'<tr><td class="titlefield fieldrequired">ClickToDial URL</td>';
146 print
'<td class="valeur">';
147 print
'<input name="url" value="'.(!empty(
$object->clicktodial_url) ?
$object->clicktodial_url :
'').
'" size="92">';
149 $langs->load(
"errors");
150 print
'<span class="error">'.$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"ClickToDial")).
'</span>';
152 print
'<br>'.$form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"KeepEmptyToUseDefault").
'</span>:<br>' .
getDolGlobalString(
'CLICKTODIAL_URL'), $langs->trans(
"ClickToDialUrlDesc"));
158 print
'<tr><td class="titlefield fieldrequired">ClickToDial '.$langs->trans(
"IdPhoneCaller").
'</td>';
159 print
'<td class="valeur">';
160 print
'<input name="poste" value="'.(!empty(
$object->clicktodial_poste) ?
$object->clicktodial_poste :
'').
'"></td>';
163 print
'<tr><td>ClickToDial '.$langs->trans(
"Login").
'</td>';
164 print
'<td class="valeur">';
165 print
'<input name="login" value="'.(!empty(
$object->clicktodial_login) ?
$object->clicktodial_login :
'').
'"></td>';
168 print
'<tr><td>ClickToDial '.$langs->trans(
"Password").
'</td>';
169 print
'<td class="valeur">';
170 print
'<input type="password" name="password" value="'.dol_escape_htmltag(empty(
$object->clicktodial_password) ?
'' :
$object->clicktodial_password).
'"></td>';
175 print
'<table class="border centpercent tableforfield">';
177 if (!empty($user->admin)) {
178 print
'<tr><td class="">ClickToDial URL</td>';
179 print
'<td class="valeur">';
183 if (!empty(
$object->clicktodial_url)) {
184 $url =
$object->clicktodial_url;
187 $langs->load(
"errors");
188 print
'<span class="error">'.$langs->trans(
"ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv(
"ClickToDial")).
'</span>';
190 print $form->textwithpicto((empty(
$object->clicktodial_url) ?
'<span class="opacitymedium">'.$langs->trans(
"DefaultLink").
':</span> ' :
'').$url, $langs->trans(
"ClickToDialUrlDesc"));
196 print
'<tr><td class="">ClickToDial '.$langs->trans(
"IdPhoneCaller").
'</td>';
197 print
'<td class="valeur">'.(!empty(
$object->clicktodial_poste) ?
$object->clicktodial_poste :
'').
'</td>';
200 print
'<tr><td>ClickToDial '.$langs->trans(
"Login").
'</td>';
201 print
'<td class="valeur">'.(!empty(
$object->clicktodial_login) ?
$object->clicktodial_login :
'').
'</td>';
204 print
'<tr><td>ClickToDial '.$langs->trans(
"Password").
'</td>';
205 print
'<td class="valeur">'.preg_replace(
'/./',
'*', (!empty(
$object->clicktodial_password) ?
$object->clicktodial_password :
'')).
'</a></td>';
213 if ($action ==
'edit') {
215 print
'<div class="center"><input class="button button-save" type="submit" value="'.$langs->trans(
"Save").
'">';
216 print
' ';
217 print
'<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
227 print
'<div class="tabsAction">';
229 if (!empty($user->admin) && $action !=
'edit') {
230 print
'<a class="butAction" href="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'&action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage Dolibarr users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled='', $morecss='classlink button bordertransp', $jsonopen='', $backtopagejsfields='', $accesskey='')
Return HTML code to output a button to open a dialog popup box.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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.