diff --git a/htdocs/telephonie/fournisseurtel.class.php b/htdocs/telephonie/fournisseurtel.class.php
new file mode 100644
index 00000000000..be0227c27b3
--- /dev/null
+++ b/htdocs/telephonie/fournisseurtel.class.php
@@ -0,0 +1,70 @@
+
+ *
+ * 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$
+ *
+ */
+
+class FournisseurTelephonie {
+ var $db;
+
+ var $id;
+
+ function FournisseurTelephonie($DB, $id=0)
+ {
+ $this->db = $DB;
+ $this->id = $id;
+ return 1;
+ }
+ /*
+ *
+ *
+ */
+ function fetch()
+ {
+ $sql = "SELECT f.rowid, f.nom, f.email_commande, f.commande_active";
+ $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_fournisseur as f";
+ $sql .= " WHERE f.rowid = ".$this->id;
+
+ if ($this->db->query($sql))
+ {
+ if ($this->db->num_rows())
+ {
+ $obj = $this->db->fetch_object(0);
+
+
+ $this->email_commande = $obj->email_commande;
+ $this->commande_enable = $obj->commande_active;
+
+ return 0;
+ }
+ else
+ {
+ dolibarr_syslog("FournisseurTelephonie::Fetch Erreur id=".$this->id);
+ return -1;
+ }
+ }
+ else
+ {
+ dolibarr_syslog("FournisseurTelephonie::Fetch Erreur SQL id=".$this->id);
+ return -2;
+ }
+ }
+}
+
+?>
diff --git a/htdocs/telephonie/ligne/commande/archives.php b/htdocs/telephonie/ligne/commande/archives.php
new file mode 100644
index 00000000000..4c06ceca1f1
--- /dev/null
+++ b/htdocs/telephonie/ligne/commande/archives.php
@@ -0,0 +1,119 @@
+
+ *
+ * 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$
+ *
+ */
+require("./pre.inc.php");
+
+$page = $_GET["page"];
+$sortorder = $_GET["sortorder"];
+$sortfield = $_GET["sortfield"];
+
+if ($_GET["action"] == "create")
+{
+ $ct = new CommandeTableur($db, $user);
+ $ct->create();
+}
+
+llxHeader("","Telephonie - Commande - Archives");
+
+/*
+ * Sécurité accés client
+ */
+if ($user->societe_id > 0)
+{
+ $action = '';
+ $socidp = $user->societe_id;
+}
+
+/* ***************************************** */
+
+$sql = "SELECT c.filename, u.name, u.firstname, f.nom,".$db->pdate("c.datec"). " as datec";
+$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_commande as c";
+$sql .= " , ".MAIN_DB_PREFIX."telephonie_fournisseur as f";
+$sql .= " ,".MAIN_DB_PREFIX."user as u";
+$sql .= " WHERE c.fk_user_creat = u.rowid AND c.fk_fournisseur = f.rowid";
+
+if ($_GET["search_ligne"])
+{
+ $sql .= " AND l.ligne LIKE '%".$_GET["search_ligne"]."%'";
+}
+
+$sql .= " ORDER BY c.datec DESC";//$sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
+
+$result = $db->query($sql);
+if ($result)
+{
+ $num = $db->num_rows();
+ $i = 0;
+
+ print_barre_liste("Commandes archives", $page, "liste.php", "", $sortfield, $sortorder, '', $num);
+
+ print '
';
+
+
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/telephonie/ligne/commande/liste.php b/htdocs/telephonie/ligne/commande/liste.php
new file mode 100644
index 00000000000..14d365bfe23
--- /dev/null
+++ b/htdocs/telephonie/ligne/commande/liste.php
@@ -0,0 +1,189 @@
+
+ *
+ * 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$
+ *
+ */
+require("./pre.inc.php");
+
+
+$page = $_GET["page"];
+$sortorder = $_GET["sortorder"];
+$sortfield = $_GET["sortfield"];
+
+
+
+if ($_GET["action"] == "commande" && $user->rights->telephonie->ligne_commander)
+{
+ $ltel = new LigneTel($db);
+ $ltel->id = $_GET["lid"];
+ $ltel->set_statut($user, $_GET["statut"]);
+
+ Header("Location: liste.php");
+}
+
+
+llxHeader("","Telephonie - Ligne - Commande");
+
+/*
+ * Sécurité accés client
+ */
+if ($user->societe_id > 0)
+{
+ $action = '';
+ $socidp = $user->societe_id;
+}
+
+if ($sortorder == "") {
+ $sortorder="DESC";
+}
+if ($sortfield == "") {
+ $sortfield="l.statut";
+}
+
+/*
+ * Recherche
+ *
+ *
+ */
+if ($mode == 'search') {
+ if ($mode-search == 'soc') {
+ $sql = "SELECT s.idp FROM ".MAIN_DB_PREFIX."societe as s ";
+ $sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'";
+ }
+
+ if ( $db->query($sql) ) {
+ if ( $db->num_rows() == 1) {
+ $obj = $db->fetch_object(0);
+ $socid = $obj->idp;
+ }
+ $db->free();
+ }
+}
+
+if ($page == -1) { $page = 0 ; }
+
+$offset = $conf->liste_limit * $page ;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+
+/*
+ * Mode Liste
+ *
+ *
+ *
+ */
+
+$sql = "SELECT sf.idp as sfidp, sf.nom as sfnom, s.idp as socidp, s.nom, l.ligne, f.nom as fournisseur, l.statut, l.rowid, f.rowid as fournid, l.mode_paiement";
+$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
+$sql .= " , ".MAIN_DB_PREFIX."telephonie_fournisseur as f";
+$sql .= " , ".MAIN_DB_PREFIX."societe as sf";
+$sql .= " WHERE l.fk_soc = s.idp AND l.fk_fournisseur = f.rowid AND l.statut IN (-1,1,4) ";
+$sql .= " AND l.fk_soc_facture = sf.idp";
+$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
+
+$result = $db->query($sql);
+if ($result)
+{
+ $num = $db->num_rows();
+ $i = 0;
+
+ print_barre_liste("Commande", $page, "liste.php", "", $sortfield, $sortorder, '', $num);
+
+ print '
";
+ $db->free();
+}
+else
+{
+ print $db->error() . ' ' . $sql;
+}
+
+$db->close();
+
+llxFooter("Dernière modification $Date$ révision $Revision$");
+?>
diff --git a/htdocs/telephonie/ligne/commande/pre.inc.php b/htdocs/telephonie/ligne/commande/pre.inc.php
new file mode 100644
index 00000000000..09af5f15f76
--- /dev/null
+++ b/htdocs/telephonie/ligne/commande/pre.inc.php
@@ -0,0 +1,69 @@
+
+ *
+ * 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$
+ *
+ */
+require("../../../main.inc.php");
+require(DOL_DOCUMENT_ROOT."/telephonie/lignetel.class.php");
+require(DOL_DOCUMENT_ROOT."/telephonie/fournisseurtel.class.php");
+require(DOL_DOCUMENT_ROOT."/telephonie/ligne/commande/commandetableur.class.php");
+
+$user->getrights('telephonie');
+
+function llxHeader($head = "", $title="") {
+ global $user, $conf;
+
+ /*
+ *
+ *
+ */
+ top_menu($head, $title);
+
+ $menu = new Menu();
+
+ $menu->add(DOL_URL_ROOT."/telephonie/index.php", "Telephonie");
+
+ $menu->add(DOL_URL_ROOT."/telephonie/simulation/fiche.php", "Simulation");
+ $menu->add_submenu(DOL_URL_ROOT."/telephonie/simulation/fiche.php?action=create", "Nouvelle");
+
+ $menu->add(DOL_URL_ROOT."/telephonie/tarifs/", "Tarifs");
+ $menu->add(DOL_URL_ROOT."/telephonie/client/index.php", "Clients");
+ $menu->add(DOL_URL_ROOT."/telephonie/ligne/index.php", "Lignes");
+
+ $menu->add(DOL_URL_ROOT."/telephonie/ligne/commande/", "Commandes");
+ $menu->add_submenu(DOL_URL_ROOT."/telephonie/ligne/commande/liste.php", "Lignes");
+
+ if ($user->rights->telephonie->ligne_commander)
+ {
+ $menu->add_submenu(DOL_URL_ROOT."/telephonie/ligne/commande/fiche.php", "Nouvelle");
+ }
+
+ $menu->add_submenu(DOL_URL_ROOT."/telephonie/ligne/commande/archives.php", "Archives");
+
+ $menu->add(DOL_URL_ROOT."/telephonie/facture/", "Factures");
+
+ $menu->add(DOL_URL_ROOT."/telephonie/stats/", "Statistiques");
+
+ $menu->add(DOL_URL_ROOT."/telephonie/fournisseurs.php", "Fournisseurs");
+
+
+ left_menu($menu->liste);
+}
+
+?>
diff --git a/htdocs/telephonie/ligne/conso.php b/htdocs/telephonie/ligne/conso.php
new file mode 100644
index 00000000000..4af8e5f0be5
--- /dev/null
+++ b/htdocs/telephonie/ligne/conso.php
@@ -0,0 +1,170 @@
+
+ *
+ * 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$
+ *
+ */
+
+require("./pre.inc.php");
+
+$mesg = '';
+
+llxHeader("","","Fiche Ligne");
+
+
+
+ if ($_GET["id"] or $_GET["numero"])
+ {
+ if ($_GET["action"] <> 're-edit')
+ {
+ $ligne = new LigneTel($db);
+ if ($_GET["id"])
+ {
+ $result = $ligne->fetch_by_id($_GET["id"]);
+ }
+ if ($_GET["numero"])
+ {
+ $result = $ligne->fetch($_GET["numero"]);
+ }
+ }
+
+ if ( $result )
+ {
+ if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit')
+ {
+
+ $h=0;
+ $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/fiche.php?id=".$ligne->id;
+ $head[$h][1] = $langs->trans("Ligne");
+ $h++;
+
+ $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/infoc.php?id=".$ligne->id;
+ $head[$h][1] = $langs->trans('Infos');
+ $h++;
+
+ $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/history.php?id=".$ligne->id;
+ $head[$h][1] = $langs->trans('Historique');
+ $h++;
+
+ $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/conso.php?id=".$ligne->id;
+ $head[$h][1] = $langs->trans('Conso');
+ $hselected = $h;
+ $h++;
+
+ $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/stat.php?id=".$ligne->id;
+ $head[$h][1] = $langs->trans('Stats');
+ $h++;
+
+ dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero);
+
+ print_fiche_titre('Fiche Ligne', $mesg);
+
+ print '