From 3da8f8364042cac7601b559354a8f10dee43c380 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 10 Jul 2007 14:09:18 +0000 Subject: [PATCH] Synchor --- htdocs/telephonie/adsl/index.php | 7 +------ htdocs/telephonie/adsl/ligneadsl.class.php | 18 +++++++++--------- htdocs/telephonie/adsl/pre.inc.php | 7 +++++-- htdocs/telephonie/config/xdsl.php | 13 +++++++++++++ 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/htdocs/telephonie/adsl/index.php b/htdocs/telephonie/adsl/index.php index 9b035678b1d..076d1f17aaa 100644 --- a/htdocs/telephonie/adsl/index.php +++ b/htdocs/telephonie/adsl/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2007 Rodolphe Quiedeville * * 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 @@ -23,9 +23,6 @@ require("./pre.inc.php"); if (!$user->rights->telephonie->adsl->lire) accessforbidden(); -$page = $_GET["page"]; -$sortorder = $_GET["sortorder"]; - llxHeader('','Telephonie'); /* @@ -40,8 +37,6 @@ if ($user->societe_id > 0) /* * Mode Liste * - * - * */ print ''; diff --git a/htdocs/telephonie/adsl/ligneadsl.class.php b/htdocs/telephonie/adsl/ligneadsl.class.php index 922ecf9aca3..7b7f0214a2d 100644 --- a/htdocs/telephonie/adsl/ligneadsl.class.php +++ b/htdocs/telephonie/adsl/ligneadsl.class.php @@ -63,7 +63,6 @@ class LigneAdsl { */ function update($user) { - $sql = "UPDATE ".MAIN_DB_PREFIX."telephonie_societe_ligne"; $sql .= " SET "; $sql .= " fk_client_comm = $this->client_comm, "; @@ -98,9 +97,9 @@ class LigneAdsl { if (strlen(trim($this->numero)) == 10) { $sql = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_adsl_ligne"; - $sql .= " (fk_client, fk_client_install, fk_client_facture, numero_ligne, fk_type, fk_fournisseur, note, fk_commercial, statut, fk_user_creat)"; + $sql .= " (fk_client, fk_client_install, fk_client_facture, fk_contrat, numero_ligne, fk_type, fk_fournisseur, note, fk_commercial, statut, fk_user_creat)"; $sql .= " VALUES ("; - $sql .= " $this->client,$this->client_install,$this->client_facture,'$this->numero',$this->type,$this->fournisseur, '$this->note',$this->commercial, -1,$user->id)"; + $sql .= " $this->client,$this->client_install,$this->client_facture,'$this->contrat','$this->numero',$this->type,$this->fournisseur, '$this->note',$this->commercial, -1,$user->id)"; $resql = $this->db->query($sql); @@ -174,7 +173,7 @@ class LigneAdsl { function fetch($ligne, $id = 0) { $sql = "SELECT l.rowid, l.fk_client, l.fk_client_install, l.fk_client_facture, l.fk_fournisseur, l.numero_ligne, l.note, l.statut, l.fk_commercial"; - $sql .= ", l.ip, l.login, l.password, l.prix"; + $sql .= ", l.ip, l.login, l.password, l.prix, l.fk_contrat"; $sql .= " , t.intitule AS type"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_adsl_ligne as l"; $sql .= " , ".MAIN_DB_PREFIX."telephonie_adsl_type as t"; @@ -188,12 +187,12 @@ class LigneAdsl { { $sql .= " AND l.numero_ligne = ".$ligne; } - - if ($this->db->query($sql)) + $resql = $this->db->query($sql); + if ($resql) { - if ($this->db->num_rows()) + if ($this->db->num_rows($resql)) { - $obj = $this->db->fetch_object(); + $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; $this->socid = $obj->fk_soc; @@ -204,6 +203,7 @@ class LigneAdsl { $this->client_facture_id = $obj->fk_client_facture; $this->fournisseur_id = $obj->fk_fournisseur; $this->commercial_id = $obj->fk_commercial; + $this->contrat_id = $obj->fk_contrat; $this->type = $obj->type; $this->prix = $obj->prix; $this->statut = $obj->statut; @@ -221,7 +221,7 @@ class LigneAdsl { $result = -2; } - $this->db->free(); + $this->db->free($resql); } else { diff --git a/htdocs/telephonie/adsl/pre.inc.php b/htdocs/telephonie/adsl/pre.inc.php index ac8d3dbd178..8c7fb942252 100644 --- a/htdocs/telephonie/adsl/pre.inc.php +++ b/htdocs/telephonie/adsl/pre.inc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2007 Rodolphe Quiedeville * * 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 @@ -34,7 +34,7 @@ function llxHeader($head = "", $title="") { $menu = new Menu(); - $menu->add(DOL_URL_ROOT."/telephonie/adsl/index.php", "ADSL"); + $menu->add(DOL_URL_ROOT."/telephonie/adsl/index.php", "Liens xDSL"); $menu->add_submenu(DOL_URL_ROOT."/telephonie/adsl/liste.php", "Liste"); @@ -42,6 +42,9 @@ function llxHeader($head = "", $title="") { $menu->add(DOL_URL_ROOT."/telephonie/index.php", "Telephonie"); + if ($user->rights->telephonie->configurer) + $menu->add(DOL_URL_ROOT."/telephonie/config/", "Configuration"); + left_menu($menu->liste); } diff --git a/htdocs/telephonie/config/xdsl.php b/htdocs/telephonie/config/xdsl.php index e20c64e08d5..31a3822f877 100644 --- a/htdocs/telephonie/config/xdsl.php +++ b/htdocs/telephonie/config/xdsl.php @@ -31,6 +31,8 @@ require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.class.php'); require_once(DOL_DOCUMENT_ROOT.'/telephonie/adsl/fournisseurxdsl.class.php'); $langs->load("admin"); +$langs->load("suppliers"); +$langs->load("products"); if (!$user->admin) accessforbidden(); @@ -59,6 +61,17 @@ if ($_GET["action"] == "switch") */ llxHeader('','Téléphonie - Configuration - Liens xDSL'); +$h=0; +$head[$h][0] = DOL_URL_ROOT."/telephonie/config/xdsl.php"; +$head[$h][1] = $langs->trans("Suppliers"); +$hselected = $h; +$h++; + +$head[$h][0] = DOL_URL_ROOT."/telephonie/config/xdsl_product.php"; +$head[$h][1] = $langs->trans("Products"); +$h++; + + dolibarr_fiche_head($head, $hselected, "Configuration des liens xDSL"); print_titre("Fournisseurs");