clicktodial.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.org>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * \file htdocs/admin/clicktodial.php
  20. * \ingroup clicktodial
  21. * \brief Page to setup module clicktodial
  22. */
  23. require("../main.inc.php");
  24. require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
  25. $langs->load("admin");
  26. if (!$user->admin)
  27. accessforbidden();
  28. if ($_POST["action"] == 'setvalue' && $user->admin)
  29. {
  30. $result=dolibarr_set_const($db, "CLICKTODIAL_URL",$_POST["url"],'chaine',0,'',$conf->entity);
  31. if ($result >= 0)
  32. {
  33. $mesg='<div class="ok">'.$langs->trans("RecordModifiedSuccessfully").'</div>';
  34. }
  35. else
  36. {
  37. dol_print_error($db);
  38. }
  39. }
  40. /*
  41. *
  42. *
  43. */
  44. $wikihelp='EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es';
  45. llxHeader('',$langs->trans("ClickToDialSetup"),$wikihelp);
  46. $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
  47. print_fiche_titre($langs->trans("ClickToDialSetup"),$linkback,'setup');
  48. print $langs->trans("ClickToDialDesc")."<br>\n";
  49. if ($mesg) print '<br>'.$mesg;
  50. print '<br>';
  51. print '<form method="post" action="clicktodial.php">';
  52. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  53. print '<input type="hidden" name="action" value="setvalue">';
  54. $var=true;
  55. print '<table class="nobordernopadding" width="100%">';
  56. print '<tr class="liste_titre">';
  57. print '<td width="120">'.$langs->trans("Name").'</td>';
  58. print '<td>'.$langs->trans("Value").'</td>';
  59. print "</tr>\n";
  60. $var=!$var;
  61. print '<tr '.$bc[$var].'><td valign="top">';
  62. print $langs->trans("URL").'</td><td>';
  63. print '<input size="92" type="text" name="url" value="'.$conf->global->CLICKTODIAL_URL.'"><br>';
  64. print '<br>';
  65. print $langs->trans("ClickToDialUrlDesc").'<br>';
  66. print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';
  67. print '</td></tr>';
  68. print '<tr><td colspan="3" align="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
  69. print '</table></form>';
  70. /*if (! empty($conf->global->CLICKTODIAL_URL))
  71. {
  72. print $langs->trans("Test");
  73. // Add a phone number to test
  74. }
  75. */
  76. $db->close();
  77. llxFooter();
  78. ?>