Nouveau fichier

This commit is contained in:
Rodolphe Quiedeville 2005-01-14 14:08:01 +00:00
parent 38cdcec4a5
commit 61fe969a82
3 changed files with 381 additions and 0 deletions

View File

@ -0,0 +1,91 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
*
* 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
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/
/*! \file htdocs/admin/ldap.php
\ingroup ldap
\brief Page d'administration/configuration du module Ldap
\version $Revision$
*/
require("./pre.inc.php");
$langs->load("admin");
if (!$user->admin)
accessforbidden();
if ($_POST["action"] == 'setvalue' && $user->admin)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'CLICKTODIAL_URL'";
$db->query($sql);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible)";
$sql .= " VALUES ('CLICKTODIAL_URL','".$_POST["url"]."',0)";
if ($db->query($sql))
{
Header("Location: clicktodial.php");
}
else
{
print $db->error();
}
}
llxHeader();
/*
*
*
*/
print_titre("Configuration du click to dial");
print '<form method="post" action="clicktodial.php">';
print '<input type="hidden" name="action" value="setvalue">';
print '<table class="border" cellpadding="4" cellspacing="0">';
print '<TR class="liste_titre">';
print '<td>Nom</td>';
print '<td>Nouvelle Valeur</td><td>Valeur actuelle</td>';
print "</tr>\n";
print '<tr><td>';
print 'URL</td><td>';
print '<input size="25" type="text" name="url" value="'.CLICKTODIAL_URL.'">';
print '</td><td>';
print CLICKTODIAL_URL;
print '</td></tr>';
print '<tr><td colspan="3" align="center"><input type="submit" value="changer"></td></tr>';
print '</table></form>';
/*
*
*
*/
$db->close();
llxFooter();
?>

View File

@ -0,0 +1,101 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*/
/*! \defgroup telephonie Module Click to Dial
\brief Module pour gérer l'appel automatique
*/
/*!
\file htdocs/includes/modules/modClickToDial.class.php
\ingroup telephonie
*/
include_once "DolibarrModules.class.php";
/*!
\class modClickToDial
\brief Classe de description et activation du module de Click to Dial
*/
class modClickToDial extends DolibarrModules
{
/**
* \brief Constructeur. Definit les noms, constantes et boites
* \param DB handler d'accès base
*/
function modClickToDial($DB)
{
$this->db = $DB ;
$this->numero = 58 ;
$this->family = "technic";
$this->name = "ClickToDial";
$this->description = "Gestion du click to dial(experimental)";
$this->const_name = "MAIN_MODULE_CLICKTODIAL";
$this->const_config = MAIN_MODULE_CLICKTODIAL;
$this->special = 1;
// Dir
$this->dirs = array();
// Dépendances
$this->depends = array();
$this->requiredby = array();
// Config pages
$this->config_page_url = "clicktodial.php";
// Constantes
$this->const = array();
// Boites
$this->boxes = array();
// Permissions
$this->rights = array();
$this->rights_class = 'clicktodial';
}
/**
* \brief Fonction appelée lors de l'activation du module. Insère en base les constantes, boites, permissions du module.
* Définit également les répertoires de données à créer pour ce module.
*/
function init()
{
global $conf;
return $this->_init($sql);
}
/**
* \brief Fonction appelée lors de la désactivation d'un module.
* Supprime de la base les constantes, boites et permissions du module.
*/
function remove()
{
$sql = array();
return $this->_remove($sql);
}
}
?>

189
htdocs/user/clicktodial.php Normal file
View File

@ -0,0 +1,189 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*/
/*!
\file htdocs/user/clicktodial.php
\brief Gestion des infos de click to dial
\version $Revision$
*/
require("./pre.inc.php");
require_once DOL_DOCUMENT_ROOT."/bookmark4u.class.php";
$langs->load("users");
$form = new Form($db);
if ($_POST["action"] == 'update')
{
$edituser = new User($db, $_GET["id"]);
$edituser->clicktodial_login = $_POST["login"];
$edituser->clicktodial_password = $_POST["password"];
$edituser->clicktodial_poste = $_POST["poste"];
$edituser->update_clicktodial();
Header("Location: clicktodial.php?id=".$_GET["id"]);
}
llxHeader("","Addon Utilisateur");
/* ************************************************************************** */
/* */
/* Nouvel utilisateur */
/* */
/* ************************************************************************** */
if ($_GET["id"])
{
$fuser = new User($db, $_GET["id"]);
$fuser->fetch();
$fuser->fetch_clicktodial();
$bk4u = new Bookmark4u($db);
$bk4u->get_bk4u_uid($fuser);
/*
* Affichage onglets
*/
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/user/fiche.php?id='.$fuser->id;
$head[$h][1] = $langs->trans("UserCard");
if ($_GET["action"] != 'perms') { $hselected=$h; }
$h++;
if ($user->admin)
{
$head[$h][0] = DOL_URL_ROOT.'/user/fiche.php?action=perms&amp;id='.$fuser->id;
$head[$h][1] = $langs->trans("Permissions");
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/user/addon.php?id='.$fuser->id;
$head[$h][1] = $langs->trans("Addons");
$h++;
$head[$h][0] = DOL_URL_ROOT.'/user/clicktodial.php?id='.$fuser->id;
$head[$h][1] = $langs->trans("ClickToDial");
$hselected=$h;
$h++;
dolibarr_fiche_head($head, $hselected, $fuser->fullname);
/*
* Fiche en mode visu
*/
print '<table class="border" width="100%">';
print "<tr>".'<td width="25%" valign="top">'.$langs->trans("LastName").'</td>';
print '<td width="25%" class="valeur">'.$fuser->nom.'</td>';
print '<td width="25%" valign="top">'.$langs->trans("FirstName").'</td>';
print '<td width="25%" class="valeur">'.$fuser->prenom.'</td>';
print "</tr>\n";
print "<tr>".'<td width="25%" valign="top">'.$langs->trans("Login").'</td>';
print '<td width="25%" class="valeur">'.$fuser->login.'</td>';
print '<td width="25%" valign="top">'.$langs->trans("EMail").'</td>';
print '<td width="25%" class="valeur"><a href="mailto:'.$fuser->email.'">'.$fuser->email.'</a></td>';
print "</tr>\n";
print "</table>\n";
print "<br>\n";
if ($_GET["action"] == 'edit')
{
print '<form action="clicktodial.php?id='.$_GET["id"].'" method="post">';
print '<input type="hidden" name="action" value="update"></td>';
print '<table class="border" width="100%">';
print "<tr>".'<td width="25%" valign="top">'.$langs->trans("Login").'</td>';
print '<td width="25%" class="valeur">';
print '<input name="login" value="'.$fuser->clicktodial_login.'"></td>';
print '<td width="25%" valign="top">'.$langs->trans("Password").'</td>';
print '<td width="25%" class="valeur">';
print '<input name="password" value="'.$fuser->clicktodial_password.'"></td>';
print "</tr>\n";
print "<tr>".'<td width="25%" valign="top">Poste</td>';
print '<td width="25%" class="valeur">';
print '<input name="poste" value="'.$fuser->clicktodial_poste.'"></td>';
print '<td width="25%" valign="top">&nbsp;</td>';
print '<td width="25%" valign="top">&nbsp;</td>';
print "</tr>\n";
print '</table><input type="submit"</form>';
}
else
{
print '<table class="border" width="100%">';
print "<tr>".'<td width="25%" valign="top">'.$langs->trans("Login").'</td>';
print '<td width="25%" class="valeur">'.$fuser->clicktodial_login.'</td>';
print '<td width="25%" valign="top">'.$langs->trans("Password").'</td>';
print '<td width="25%" class="valeur">XXXXXX</a></td>';
print "</tr>\n";
print "<tr>".'<td width="25%" valign="top">Poste</td>';
print '<td width="25%" class="valeur">'.$fuser->clicktodial_poste.'</td>';
print '<td width="25%" valign="top">&nbsp;</td>';
print '<td width="25%" valign="top">&nbsp;</td>';
print "</tr></table>\n";
}
print "<br>\n";
print "</div>\n";
/*
* Barre d'actions
*
*/
print '<div class="tabsAction">';
if ($user->admin && $_GET["action"] <> 'edit')
{
print '<a class="tabAction" href="clicktodial.php?id='.$fuser->id.'&amp;action=edit">'.$langs->trans("Edit").'</a>';
}
if ($user->admin && $_GET["action"] == 'edit')
{
print '<a class="tabAction" href="clicktodial.php?id='.$fuser->id.'">'.$langs->trans("Cancel").'</a>';
}
print "</div>\n";
print "<br>\n";
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>