2
0
forked from Wavyzz/dolibarr

NEW Use an ajax call for the clicktodial feature instead of href link.

This commit is contained in:
Laurent Destailleur
2021-08-04 20:07:12 +02:00
parent 0de10cea39
commit 76038e692d
4 changed files with 122 additions and 89 deletions

View File

@@ -3054,11 +3054,18 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
'__PASS__'=>$clicktodial_password);
$url = make_substitutions($url, $substitarray);
$newphonesav = $newphone;
$newphone = '<a href="'.$url.'"';
if (!empty($conf->global->CLICKTODIAL_FORCENEWTARGET)) {
$newphone .= ' target="_blank"';
if (empty($conf->global->CLICKTODIAL_DO_NOT_USE_AJAX_CALL)) {
// Default and recommended: New method using ajax without submiting a page making a javascript history.go(-1) back
$newphone = '<a href="'.$url.'" class="cssforclicktodial"'; // Call of ajax is handled by the lib_foot.js.php on class 'cssforclicktodial'
$newphone .= '>'.$newphonesav.'</a>';
} else {
// Old method
$newphone = '<a href="'.$url.'"';
if (!empty($conf->global->CLICKTODIAL_FORCENEWTARGET)) {
$newphone .= ' target="_blank"';
}
$newphone .= '>'.$newphonesav.'</a>';
}
$newphone .= '>'.$newphonesav.'</a>';
}
//if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)