This commit is contained in:
Rodolphe Quiedeville 2007-07-10 14:09:18 +00:00
parent 9c27705ba6
commit 3da8f83640
4 changed files with 28 additions and 17 deletions

View File

@ -1,5 +1,5 @@
<?PHP
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2004-2007 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
@ -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 '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';

View File

@ -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
{

View File

@ -1,5 +1,5 @@
<?PHP
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2005-2007 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
@ -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);
}

View File

@ -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");