New: ClickToDial setup is easier

This commit is contained in:
Laurent Destailleur 2013-03-31 04:03:08 +02:00
parent dca3179bfe
commit 294a085047
8 changed files with 55 additions and 16 deletions

View File

@ -69,7 +69,7 @@ print '<input type="hidden" name="action" value="setvalue">';
$var=true;
print '<table class="nobordernopadding" width="100%">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="120">'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
@ -83,19 +83,38 @@ print $langs->trans("ClickToDialUrlDesc").'<br>';
print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';
print '</td></tr>';
print '<tr><td colspan="3" align="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
print '</table></form>';
print '</table>';
/*if (! empty($conf->global->CLICKTODIAL_URL))
{
print $langs->trans("Test");
// Add a phone number to test
}
*/
print '<center><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></center>';
print '</form>';
if (! empty($conf->global->CLICKTODIAL_URL))
{
$user->fetch_clicktodial();
print $langs->trans("LinkToTestClickToDial").' : ';
$setupcomplete=1;
if (preg_match('/__LOGIN__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0;
if (preg_match('/__PASSWORD__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0;
if (preg_match('/__PHONEFROM__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0;
if ($setupcomplete)
{
print dol_print_phone($mysoc->phone, '', 0, 0, 'AC_TEL');
}
else
{
$langs->load("errors");
print '<div class="warning">'.$langs->trans("WarningClickToDialUserSetupNotComplete").'</div>';
}
}
dol_htmloutput_mesg($mesg);
$db->close();
llxFooter();
?>
?>

View File

@ -1155,17 +1155,18 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid=
* @param string $country Country code to use for formatting
* @param int $cid Id of contact if known
* @param int $socid Id of third party if known
* @param int $addlink 0=no link to create action
* @param string $separ separation between numbers for a better visibility example : xx.xx.xx.xx.xx
* @param int $addlink ''=no link to create action, 'AC_TEL'=add link to clicktodial (if module enabled) and add link to create event (if conf->global->AGENDA_ADDACTIONFORPHONE set)
* @param string $separ Separation between numbers for a better visibility example : xx.xx.xx.xx.xx
* @return string Formated phone number
*/
function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ="&nbsp;")
function dol_print_phone($phone,$country='',$cid=0,$socid=0,$addlink='',$separ="&nbsp;")
{
global $conf,$user,$langs;
global $conf,$user,$langs,$mysoc;
// Clean phone parameter
$phone = preg_replace("/[\s.-]/","",trim($phone));
if (empty($phone)) { return ''; }
if (empty($country)) $country=$mysoc->country_code;
$newphone=$phone;
if (strtoupper($country) == "FR")

View File

@ -361,6 +361,7 @@ LibraryToBuildPDF=Library used to build PDF
WarningUsingFPDF=Warning: Your <b>conf.php</b> contains directive <b>dolibarr_pdf_force_fpdf=1</b>. This means you use the FPDF library to generate PDF files. This library is old and does not support a lot of features (Unicode, image transparency, cyrillic, arab and asiatic languages, ...), so you may experience errors during PDF generation.<br>To solve this and have a full support of PDF generation, please download <a href="http://www.tcpdf.org/" target="_blank">TCPDF library</a>, then comment or remove the line <b>$dolibarr_pdf_force_fpdf=1</b>, and add instead <b>$dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir'</b>
LocalTaxDesc=Some countries apply 2 or 3 taxes on each invoice line. If this is the case, choose type for second and third tax and its rate. Possible type are:<br>1 : local tax apply on products and services without vat (vat is not applied on local tax)<br>2 : local tax apply on products and services before vat (vat is calculated on amount + localtax)<br>3 : local tax apply on products without vat (vat is not applied on local tax)<br>4 : local tax apply on products before vat (vat is calculated on amount + localtax)<br>5 : local tax apply on services without vat (vat is not applied on local tax)<br>6 : local tax apply on services before vat (vat is calculated on amount + localtax)
SMS=SMS
LinkToTestClickToDial=Link to test the ClickToDial
# Modules
Module0Name=Users & groups

View File

@ -132,4 +132,5 @@ WarningNoDocumentModelActivated=No model, for document generation, has been acti
WarningLockFileDoesNotExists=Warning, once setup is finished, you must disable install/migrate tools by adding a file <b>install.lock</b> into directory <b>%s</b>. Missing this file is a security hole.
WarningUntilDirRemoved=All security warnings (visible by admin users only) will remain active as long as the vulnerability is present (or that constant MAIN_REMOVE_INSTALL_WARNING is added in Setup->Other setup).
WarningCloseAlways=Warning, closing is done even if amount differs between source and target elements. Enable this feature with caution.
WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box.
WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box.
WarningClickToDialUserSetupNotComplete=Setup of ClickToDial information for your user are not complete (see tab ClickToDial onto your user card).

View File

@ -360,6 +360,7 @@ WarningUsingFPDF=Attention: Votre fichier <b>conf.php</b> contient la directive
LocalTaxDesc=Certains pays appliquent 2 voir 3 taux sur chaque ligne de facture. Si c'est le cas, choisissez le type du deuxième et troisième taux et sa valeur. Les types possibles sont:<br>1 : taxe locale sur les produits et services hors tva (la tva n'est pas appliquée sur la taxe locale)<br>2 : taxe locale sur les produits et services avant tva (la tva est appliquée sur le montant + la taxe locale)<br>3 : taxe locale uniquement sur les produits hors tva (la tva n'est pas appliquée sur la taxe locale)<br>4 : taxe locale uniquement sur les produits avant tva (la tva est appliquée sur le montant + la taxe locale)<br>5 : taxe locale uniquement sur les services hors tva (la tva n'est pas appliquée sur la taxe locale)<br>6 : taxe locale uniquement sur les service avant tva (la tva est appliquée sur le montant + la taxe locale)
SuhosinSessionEncrypt=Stockage des sessions encryptés par Suhosin
SMS=SMS
LinkToTestClickToDial=Lien pour tester le ClickToDial
# Modules= undefined
Module0Name= Utilisateurs & groupes

View File

@ -133,4 +133,5 @@ WarningNoDocumentModelActivated=Aucun modèle, pour la génération de document,
WarningLockFileDoesNotExists=Attention, une fois l'installation terminée, les outils d'installation/migration doivent être désactivés en ajoutant un fichier <b>install.lock</b> dans le répertoire <b>%s</b>. L'absence de ce fichier représente une faille de sécurité.
WarningUntilDirRemoved=Les alertes de sécurité sont visibles par les administrateurs uniquement et resteront actives tant que la vulnérabilité sera avérée (ou que la constante MAIN_REMOVE_INSTALL_WARNING aura été définie dans Configuration->Divers)
WarningCloseAlways=Attention, la fermeture se fait même lorsque le montant diffère. N'activez cette fonctionnalité qu'en connaissance de cause.
WarningUsingThisBoxSlowDown=Attention, l'utilisation de cette boite provoque de sérieux ralentissement des pages affichant cette boite.
WarningUsingThisBoxSlowDown=Attention, l'utilisation de cette boite provoque de sérieux ralentissement des pages affichant cette boite.
WarningClickToDialUserSetupNotComplete=La configuration ClickToDial pour votre compte utilisateur n'est pas complète (voir l'onglet ClickToDial sur votre fiche utilisateur)

View File

@ -81,6 +81,10 @@ class User extends CommonObject
var $phenix_pass;
var $phenix_pass_crypted;
var $clicktodial_login;
var $clicktodial_password;
var $clicktodial_poste;
var $datelastlogin;
var $datepreviouslogin;
var $statut;

11
scripts/clicktodial/linphone.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
#---------------------------------------------------------
# Script to launch LinPhone softphone.
# This script can be used to setup a ClickToDial system
# when using LinPhone soft phone.
# More information on http://wiki.dolibarr.org/index.php/Module_ClickToDial_En
#---------------------------------------------------------
echo Launch Linphone $1 $2
param=`echo $1 | sed -s 's/^sip:[\/]*//' `
/usr/bin/linphone-3 -c $param