2005-01-14 15:08:01 +01:00
|
|
|
<?php
|
2006-02-20 23:32:07 +01:00
|
|
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2011-03-05 19:29:02 +01:00
|
|
|
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
|
2011-09-06 12:52:42 +02:00
|
|
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
2005-01-14 15:08:01 +01:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2011-08-01 00:21:57 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2005-01-14 15:08:01 +01:00
|
|
|
*/
|
2010-03-24 14:12:34 +01:00
|
|
|
|
|
|
|
|
/**
|
2010-03-01 10:20:41 +01:00
|
|
|
* \file htdocs/admin/clicktodial.php
|
|
|
|
|
* \ingroup clicktodial
|
2011-03-05 19:29:02 +01:00
|
|
|
* \brief Page to setup module clicktodial
|
2010-03-01 10:20:41 +01:00
|
|
|
*/
|
2005-01-14 15:08:01 +01:00
|
|
|
|
2010-03-01 10:20:41 +01:00
|
|
|
require("../main.inc.php");
|
2008-02-01 01:09:23 +01:00
|
|
|
require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
2005-01-14 15:08:01 +01:00
|
|
|
|
|
|
|
|
$langs->load("admin");
|
|
|
|
|
|
|
|
|
|
if (!$user->admin)
|
|
|
|
|
accessforbidden();
|
|
|
|
|
|
2011-09-06 12:52:42 +02:00
|
|
|
$action = getpost("action");
|
2005-01-14 15:08:01 +01:00
|
|
|
|
2011-09-06 12:52:42 +02:00
|
|
|
/*
|
|
|
|
|
* Actions
|
|
|
|
|
*/
|
|
|
|
|
if ($action == 'setvalue' && $user->admin)
|
2005-01-14 15:08:01 +01:00
|
|
|
{
|
2011-09-06 12:52:42 +02:00
|
|
|
$result=dolibarr_set_const($db, "CLICKTODIAL_URL",GETPOST("url"),'chaine',0,'',$conf->entity);
|
2006-02-20 23:32:07 +01:00
|
|
|
if ($result >= 0)
|
|
|
|
|
{
|
2011-09-06 12:52:42 +02:00
|
|
|
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
|
2006-02-20 23:32:07 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2011-09-06 12:52:42 +02:00
|
|
|
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
|
2005-01-14 15:08:01 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2011-09-06 12:52:42 +02:00
|
|
|
* View
|
2005-01-14 15:08:01 +01:00
|
|
|
*/
|
|
|
|
|
|
2010-03-24 14:12:34 +01:00
|
|
|
$wikihelp='EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es';
|
2010-05-26 13:42:29 +02:00
|
|
|
llxHeader('',$langs->trans("ClickToDialSetup"),$wikihelp);
|
2006-02-20 23:32:07 +01:00
|
|
|
|
2008-01-26 16:10:18 +01:00
|
|
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
|
|
|
|
print_fiche_titre($langs->trans("ClickToDialSetup"),$linkback,'setup');
|
2005-01-14 15:08:01 +01:00
|
|
|
|
2008-05-19 03:43:52 +02:00
|
|
|
print $langs->trans("ClickToDialDesc")."<br>\n";
|
|
|
|
|
|
2005-01-14 22:09:22 +01:00
|
|
|
print '<br>';
|
2005-01-14 15:08:01 +01:00
|
|
|
print '<form method="post" action="clicktodial.php">';
|
2009-05-17 10:01:54 +02:00
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
2005-01-14 15:08:01 +01:00
|
|
|
print '<input type="hidden" name="action" value="setvalue">';
|
2006-02-20 23:32:07 +01:00
|
|
|
|
|
|
|
|
$var=true;
|
|
|
|
|
|
2009-10-14 13:04:09 +02:00
|
|
|
print '<table class="nobordernopadding" width="100%">';
|
2005-01-14 22:09:22 +01:00
|
|
|
print '<tr class="liste_titre">';
|
2011-03-05 19:29:02 +01:00
|
|
|
print '<td width="120">'.$langs->trans("Name").'</td>';
|
|
|
|
|
print '<td>'.$langs->trans("Value").'</td>';
|
2005-01-14 15:08:01 +01:00
|
|
|
print "</tr>\n";
|
2006-02-20 23:32:07 +01:00
|
|
|
$var=!$var;
|
2011-03-05 19:29:02 +01:00
|
|
|
print '<tr '.$bc[$var].'><td valign="top">';
|
2005-01-14 22:09:22 +01:00
|
|
|
print $langs->trans("URL").'</td><td>';
|
2011-03-05 19:29:02 +01:00
|
|
|
print '<input size="92" type="text" name="url" value="'.$conf->global->CLICKTODIAL_URL.'"><br>';
|
|
|
|
|
print '<br>';
|
2008-11-01 01:16:34 +01:00
|
|
|
print $langs->trans("ClickToDialUrlDesc").'<br>';
|
2010-11-07 12:27:22 +01:00
|
|
|
print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';
|
2005-01-14 15:08:01 +01:00
|
|
|
print '</td></tr>';
|
|
|
|
|
|
2010-07-28 23:12:30 +02:00
|
|
|
print '<tr><td colspan="3" align="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
|
2005-01-14 15:08:01 +01:00
|
|
|
print '</table></form>';
|
|
|
|
|
|
2010-07-28 23:12:30 +02:00
|
|
|
/*if (! empty($conf->global->CLICKTODIAL_URL))
|
|
|
|
|
{
|
|
|
|
|
print $langs->trans("Test");
|
|
|
|
|
// Add a phone number to test
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
2011-09-06 12:52:42 +02:00
|
|
|
dol_htmloutput_mesg($mesg);
|
|
|
|
|
|
2005-01-14 15:08:01 +01:00
|
|
|
$db->close();
|
|
|
|
|
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2005-01-14 15:08:01 +01:00
|
|
|
?>
|