26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30 $langs->load(
"admin");
34 $action =
GETPOST(
'action',
'aZ09');
36 if (!in_array(
'clicktodial', $conf->modules)) {
37 accessforbidden($langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Module58Name")));
45 if ($action ==
'setvalue' && $user->admin)
47 $result1 =
dolibarr_set_const($db,
"CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS",
GETPOST(
"CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS"),
'chaine', 0,
'', $conf->entity);
50 if ($result1 >= 0 && $result2 >= 0)
63 $form =
new Form($db);
65 $user->fetch_clicktodial();
67 $wikihelp =
'EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es';
70 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
73 print '<span class="opacitymedium">'.$langs->trans(
"ClickToDialDesc").
"</span><br>\n";
76 print '<form method="post" action="clicktodial.php">';
77 print '<input type="hidden" name="token" value="'.newToken().
'">';
78 print '<input type="hidden" name="action" value="setvalue">';
80 print '<div class="div-table-responsive-no-min">';
81 print '<table class="noborder centpercent">';
82 print '<tr class="liste_titre">';
83 print '<td>'.$langs->trans(
"Name").
'</td>';
84 print '<td>'.$langs->trans(
"Value").
'</td>';
88 print '<tr class="oddeven"><td>';
89 print $langs->trans(
"ClickToDialUseTelLink").
'</td><td>';
90 print $form->selectyesno(
"CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).
'<br>';
92 print $langs->trans(
"ClickToDialUseTelLinkDesc");
96 print '<tr class="oddeven"><td>';
97 print $langs->trans(
"DefaultLink").
'</td><td>';
98 print '<input class="quatrevingtpercent" type="text" id="CLICKTODIAL_URL" name="CLICKTODIAL_URL"'.($conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS ?
' disabled="disabled"' :
'').
' value="'.$conf->global->CLICKTODIAL_URL.
'"><br>';
101 print $langs->trans(
"ClickToDialUrlDesc").
'<br>';
102 print $langs->trans(
"Example").
':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';
115 print
'<div class="center"><br><input type="submit" class="button" value="'.$langs->trans(
"Modify").
'"></div>';
117 print
'</form><br><br>';
120 if (!empty($conf->global->CLICKTODIAL_URL))
122 $user->fetch_clicktodial();
124 $phonefortest = $mysoc->phone;
125 if (
GETPOST(
'phonefortest')) $phonefortest =
GETPOST(
'phonefortest');
127 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'">';
128 print
'<input type="hidden" name="token" value="'.newToken().
'">';
129 print $langs->trans(
"LinkToTestClickToDial", $user->login).
' : ';
130 print
'<input class="flat" type="text" name="phonefortest" value="'.dol_escape_htmltag($phonefortest).
'">';
131 print
'<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans(
"RefreshPhoneLink")).
'">';
135 if (preg_match(
'/__LOGIN__/', $conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete = 0;
136 if (preg_match(
'/__PASSWORD__/', $conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete = 0;
137 if (preg_match(
'/__PHONEFROM__/', $conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete = 0;
141 print $langs->trans(
"LinkToTest", $user->login).
': '.
dol_print_phone($phonefortest,
'', 0, 0,
'AC_TEL');
143 $langs->load(
"errors");
144 print
'<div class="warning">'.$langs->trans(
"WarningClickToDialUserSetupNotComplete").
'</div>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dolibarr_set_const($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dol_print_phone($phone, $countrycode= '', $cid=0, $socid=0, $addlink= '', $separ=" ", $withpicto= '', $titlealt= '', $adddivfloat=0)
Format phone numbers according to country.
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)) $wikihelp
View.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
ajax_autoselect($htmlname, $addlink= '')
Make content of an input box selected when we click into input field.
print
Draft customers invoices.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin= '1', $morecss= '', $textfordropdown= '')
Show information for admin users or standard users.