From 145236024dee84f194c41dda7fce87bec49ff27f Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 23 Mar 2005 15:40:31 +0000 Subject: [PATCH] Nouveau fichier --- htdocs/telephonie/adsl/fiche.php | 724 ++++++++++++++++++++++++++++ htdocs/telephonie/adsl/history.php | 137 ++++++ htdocs/telephonie/adsl/index.php | 121 +++++ htdocs/telephonie/adsl/liste.php | 165 +++++++ htdocs/telephonie/adsl/pre.inc.php | 48 ++ htdocs/telephonie/adsl/statut-1.png | Bin 0 -> 198 bytes htdocs/telephonie/adsl/statut1.png | Bin 0 -> 197 bytes htdocs/telephonie/adsl/statut2.png | Bin 0 -> 191 bytes htdocs/telephonie/adsl/statut3.png | Bin 0 -> 227 bytes htdocs/telephonie/adsl/statut4.png | Bin 0 -> 193 bytes htdocs/telephonie/adsl/statut5.png | Bin 0 -> 198 bytes htdocs/telephonie/adsl/statut6.png | Bin 0 -> 198 bytes htdocs/telephonie/adsl/statut7.png | Bin 0 -> 193 bytes htdocs/telephonie/adsl/statut8.png | Bin 0 -> 209 bytes 14 files changed, 1195 insertions(+) create mode 100644 htdocs/telephonie/adsl/fiche.php create mode 100644 htdocs/telephonie/adsl/history.php create mode 100644 htdocs/telephonie/adsl/index.php create mode 100644 htdocs/telephonie/adsl/liste.php create mode 100644 htdocs/telephonie/adsl/pre.inc.php create mode 100644 htdocs/telephonie/adsl/statut-1.png create mode 100644 htdocs/telephonie/adsl/statut1.png create mode 100644 htdocs/telephonie/adsl/statut2.png create mode 100644 htdocs/telephonie/adsl/statut3.png create mode 100644 htdocs/telephonie/adsl/statut4.png create mode 100644 htdocs/telephonie/adsl/statut5.png create mode 100644 htdocs/telephonie/adsl/statut6.png create mode 100644 htdocs/telephonie/adsl/statut7.png create mode 100644 htdocs/telephonie/adsl/statut8.png diff --git a/htdocs/telephonie/adsl/fiche.php b/htdocs/telephonie/adsl/fiche.php new file mode 100644 index 00000000000..03220bef875 --- /dev/null +++ b/htdocs/telephonie/adsl/fiche.php @@ -0,0 +1,724 @@ + + * + * 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 = ''; + +$dt = time(); + +$h = strftime("%H",$dt); +$m = strftime("%M",$dt); +$s = strftime("%S",$dt); + +if ($_POST["action"] == 'add') +{ + $ligne = new LigneAdsl($db); + + $ligne->numero = $_POST["numero"]; + $ligne->client = $_POST["client"]; + $ligne->client_install = $_POST["client_install"]; + $ligne->client_facture = $_POST["client_facture"]; + $ligne->fournisseur = $_POST["fournisseur"]; + $ligne->commercial = $_POST["commercial"]; + $ligne->type = $_POST["type"]; + $ligne->note = $_POST["note"]; + + if ( $ligne->create($user) == 0) + { + Header("Location: fiche.php?id=".$ligne->id); + } + else + { + $_GET["action"] = 'create_line'; + $_GET["client"] = $_POST["client"]; + } + +} + +if ($_GET["action"] == 'delete' && $user->rights->telephonie->adsl->creer) +{ + $ligne = new LigneAdsl($db); + + if ( $ligne->delete($_GET["id"]) == 0) + { + Header("Location: liste.php"); + } + +} + +if ($_GET["action"] == 'ordertech') +{ + $ligne = new LigneAdsl($db); + $ligne->fetch_by_id($_GET["id"]); + + if ( $ligne->set_statut($user, 1) == 0) + { + Header("Location: fiche.php?id=".$ligne->id); + } + +} + +if ($_GET["action"] == 'cancelordertech') +{ + $ligne = new LigneAdsl($db); + $ligne->fetch_by_id($_GET["id"]); + + if ( $ligne->set_statut($user, -1) == 0) + { + Header("Location: fiche.php?id=".$ligne->id); + } + +} + +if ($_GET["action"] == 'refuse') +{ + $ligne = new LigneAdsl($db); + $ligne->fetch_by_id($_GET["id"]); + + $datea = $db->idate(mktime($h, $m , $s, + $_POST["remonth"], + $_POST["reday"], + $_POST["reyear"])); + + if ( $ligne->set_statut($user, 7, $datea, $_POST["commentaire"]) == 0) + { + Header("Location: fiche.php?id=".$ligne->id); + } + +} + +if ($_GET["action"] == 'resilier') +{ + $ligne = new LigneAdsl($db); + $ligne->fetch_by_id($_GET["id"]); + + if ( $ligne->set_statut($user, 4) == 0) + { + Header("Location: fiche.php?id=".$ligne->id); + } +} + +if ($_GET["action"] == 'annuleresilier') +{ + $ligne = new LigneAdsl($db); + $ligne->fetch_by_id($_GET["id"]); + + if ( $ligne->set_statut($user, 3) == 0) + { + Header("Location: fiche.php?id=".$ligne->id); + } +} + +if ($_GET["action"] == 'commandefourn' && $user->rights->telephonie->adsl->commander) +{ + $ligne = new LigneAdsl($db); + $ligne->fetch_by_id($_GET["id"]); + + $datea = $db->idate(mktime($h, $m , $s, + $_POST["remonth"], + $_POST["reday"], + $_POST["reyear"])); + + if ( $ligne->set_statut($user, 2, $datea, $_POST["commentaire"]) == 0) + { + Header("Location: fiche.php?id=".$ligne->id); + } +} + +if ($_GET["action"] == 'activefourn' && $user->rights->telephonie->adsl->gerer) +{ + $ligne = new LigneAdsl($db); + $ligne->fetch_by_id($_GET["id"]); + + $datea = $db->idate(mktime($h, $m , $s, + $_POST["remonth"], + $_POST["reday"], + $_POST["reyear"])); + + $ligne->update_info($_POST["ip"], $_POST["login"], $_POST["password"]); + + + if ( $ligne->set_statut($user, 3, $datea, $_POST["commentaire"]) == 0) + { + Header("Location: fiche.php?id=".$ligne->id); + } +} + +if ($_GET["action"] == 'livraison' && $user->rights->telephonie->adsl->gerer) +{ + $ligne = new LigneAdsl($db); + $ligne->fetch_by_id($_GET["id"]); + + $datea = $db->idate(mktime($h, $m , $s, + $_POST["remonth"], + $_POST["reday"], + $_POST["reyear"])); + + if ( $ligne->set_statut($user, 4, $datea, $_POST["commentaire"]) == 0) + { + Header("Location: fiche.php?id=".$ligne->id); + } +} + +if ($_GET["action"] == 'acommander') +{ + $ligne = new LigneAdsl($db); + $ligne->fetch_by_id($_GET["id"]); + + if ( $ligne->set_statut($user, 1, '', $_POST["commentaire"]) == 0) + { + Header("Location: fiche.php?id=".$ligne->id); + } +} + + +if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) +{ + $ligne = new LigneAdsl($db); + $ligne->id = $_GET["id"]; + + $ligne->numero = $_POST["numero"]; + $ligne->client_comm = $_POST["client_comm"]; + $ligne->client = $_POST["client"]; + $ligne->client_facture = $_POST["client_facture"]; + $ligne->fournisseur = $_POST["fournisseur"]; + $ligne->commercial = $_POST["commercial"]; + $ligne->concurrent = $_POST["concurrent"]; + $ligne->remise = $_POST["remise"]; + $ligne->note = $_POST["note"]; + + if ( $ligne->update($user) ) + + { + $action = ''; + $mesg = 'Fiche mise à jour'; + } + else + { + $action = 're-edit'; + $mesg = 'Fiche non mise à jour !' . "
" . $entrepot->mesg_error; + } +} + + +llxHeader("","","Fiche Liaison"); + +if ($cancel == $langs->trans("Cancel")) +{ + $action = ''; +} + +/* + * Création en 2 étape + * + */ +if ($_GET["action"] == 'create') +{ + $form = new Form($db); + print_titre("Nouvelle liaison ADSL"); + + if (is_object($ligne)) + { + // La création a échouée + print $ligne->error_message; + } + else + { + $ligne = new LigneAdsl($db); + } + + print '
'; + print ''; + + print ''; + + print ''; + + print ''."\n"; + print '
Client'; + $ff = array(); + $sql = "SELECT idp, nom, ville FROM ".MAIN_DB_PREFIX."societe WHERE client=1 ORDER BY nom "; + if ( $db->query( $sql) ) + { + $num = $db->num_rows(); + if ( $num > 0 ) + { + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row($i); + $ff[$row[0]] = stripslashes($row[1]) . " (".$row[2].")"; + + $i++; + } + } + $db->free(); + } + $form->select_array("client",$ff,$ligne->client_comm); + print '
 
'."\n"; + print '
'; +} +elseif ($_GET["action"] == 'create_line' && $_GET["client"] > 0) +{ + $form = new Form($db); + print_titre("Nouvelle liaison ADSL"); + + if (is_object($ligne)) + { + // La création a échouée + print '
'.$ligne->error_message.'
'; + } + else + { + $ligne = new LigneAdsl($db); + $ligne->client_install_id = $_GET["client"]; + $ligne->client_facture_id = $_GET["client"]; + } + + $socc = new Societe($db); + if ( $socc->fetch($_GET["client"]) == 1) + { + + if (strlen($socc->code_client) == 0) + { + print ''; + print ''; + + print ''; + print '
Client'; + print ''.$socc->nom.''; + print '
Code client'; + print $socc->code_client; + print '


'; + print 'Impossible de créer une ligne pour cette société, vous devez au préalablement lui affecter un code client.'; + } + elseif (strlen($socc->code_client) > 0 && $socc->check_codeclient() <> 0) + { + print ''; + print ''; + + print ''; + print '
Client'; + print ''.$socc->nom.''; + print '
Code client'; + print $socc->code_client; + print '


'; + print 'Le code client de cette société est incorrect, vous devez lui affecter un code client correct.'; + } + else + { + print "
\n"; + print ''; + print ''."\n"; + + print ''; + print ''; + + print ''; + + + print ''; + + print '"; + + print ''; + + /* + * Type + */ + + print ''; + + + /* + * Fournisseur + */ + + print ''; + + /* + * Commercial + */ + + print ''; + + print ''."\n"; + + print ''."\n"; + print '
Client'; + print $socc->nom; + print '
Code client'; + print $socc->code_client; + print '
Numéro de la ligne téléphonique
Client (Agence/Filiale)'; + $ff = array(); + $sql = "SELECT idp, nom, ville FROM ".MAIN_DB_PREFIX."societe WHERE client=1 ORDER BY nom "; + if ( $db->query( $sql) ) + { + $num = $db->num_rows(); + if ( $num > 0 ) + { + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row(); + $ff[$row[0]] = stripslashes($row[1]) . " (".$row[2].")"; + $i++; + } + } + $db->free(); + } + $form->select_array("client_install",$ff,$ligne->client_install_id); + print " (Correspond à l'adresse d'installation)
Client à facturer'; + $ff = array(); + $sql = "SELECT idp, nom, ville FROM ".MAIN_DB_PREFIX."societe WHERE client=1 ORDER BY nom "; + if ( $db->query( $sql) ) + { + $num = $db->num_rows(); + if ( $num > 0 ) + { + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row(); + $ff[$row[0]] = stripslashes($row[1]) . " (".$row[2].")"; + $i++; + } + } + $db->free(); + } + $form->select_array("client_facture",$ff,$ligne->client_facture_id); + print '
Débit de la ligne'; + $ff = array(); + $sql = "SELECT rowid, intitule FROM ".MAIN_DB_PREFIX."telephonie_adsl_type WHERE commande_active = 1 ORDER BY intitule "; + if ( $db->query( $sql) ) + { + $num = $db->num_rows(); + if ( $num > 0 ) + { + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row(); + $ff[$row[0]] = $row[1]; + $i++; + } + } + $db->free(); + + } + $form->select_array("type",$ff,$ligne->type); + print '
Fournisseur'; + $ff = array(); + $sql = "SELECT f.idp, f.nom FROM ".MAIN_DB_PREFIX."societe as f"; + $sql .= " , ".MAIN_DB_PREFIX."telephonie_adsl_fournisseur as fa"; + $sql .= " WHERE fa.commande_active = 1 AND fa.fk_soc = f.idp ORDER BY f.nom "; + if ( $db->query( $sql) ) + { + $num = $db->num_rows(); + if ( $num > 0 ) + { + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row(); + $ff[$row[0]] = stripslashes($row[1]); + $i++; + } + } + $db->free(); + + } + else + { + print $db->error(); + } + $form->select_array("fournisseur",$ff,$ligne->fournisseur); + print '
Commercial'; + $ff = array(); + $sql = "SELECT rowid, name, firstname FROM ".MAIN_DB_PREFIX."user ORDER BY name "; + if ( $db->query( $sql) ) + { + $num = $db->num_rows(); + if ( $num > 0 ) + { + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row($i); + $ff[$row[0]] = stripslashes($row[1]) . " " . stripslashes($row[2]); + $i++; + } + } + $db->free(); + + } + + $form->select_array("commercial",$ff,$ligne->commercial); + + print '
Note'."\n"; + print '
 
'."\n"; + print '
'; + + } + + } + else + { + print "Erreur"; + } +} +else +{ + if ($_GET["id"] or $_GET["numero"]) + { + if ($_GET["action"] <> 're-edit') + { + $ligne = new LigneAdsl($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/adsl/fiche.php?id=".$ligne->id; + $head[$h][1] = $langs->trans("Liaison ADSL"); + $hselected = $h; + $h++; + + $head[$h][0] = DOL_URL_ROOT."/telephonie/adsl/history.php?id=".$ligne->id; + $head[$h][1] = $langs->trans('Historique'); + $h++; + + dolibarr_fiche_head($head, $hselected, 'Liaison ADSL : '.$ligne->numero); + + print_fiche_titre('Fiche Liaison ADSL', $mesg); + + print ''; + + $client = new Societe($db, $ligne->client_id); + $client->fetch($ligne->client_id); + + print ''; + + print ''; + print ''; + + print ''; + + $client_install = new Societe($db, $ligne->client_install_id); + $client_install->fetch($ligne->client_install_id); + + print ''; + + $client_facture = new Societe($db); + $client_facture->fetch($ligne->client_facture_id); + + print ''; + + $commercial = new User($db, $ligne->commercial_id); + $commercial->fetch(); + + print ''; + print ''; + + + if ( $user->rights->telephonie->adsl->gerer) + { + print ''; + print ''; + print ''; + } + + print ''; + + + + print "
Client'; + print ''; + + print $client->nom.''.$client->code_client; + print '
Numéro'.dolibarr_print_phone($ligne->numero).' 
Débit de la liaison'.$ligne->type.'
Client (Agence/Filiale)'; + print $client_install->nom.'
'; + + print $client_install->cp . " " .$client_install->ville; + print '
Client Facturé'; + print $client_facture->nom.'
'; + print $client_facture->cp . " " .$client_facture->ville; + + print '
'; + + if ($ligne->mode_paiement == 'pre') + { + print 'RIB : '.$client_facture->display_rib(); + } + else + { + print 'Paiement par virement'; + } + + print '
Commercial'.$commercial->fullname.'
IP'.$ligne->ip.'
Login'.$ligne->login.'
Password'.$ligne->password.'
Statut'; + print ' '; + print $ligne->statuts[$ligne->statut]; + print '
"; + } + + print ''; + + } + } + else + { + print "Error"; + } +} + + +if ( $user->rights->telephonie->adsl->commander && $ligne->statut == 1) +{ + /** + * + */ + $form = new Form($db); + + print '
'; + + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
Commande chez le fournisseur'; + print '
Date de la commande'; + print $form->select_date(); + print '
Commentaire
'; + + print '
'; + + print ' 
'; +} + +if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 2) +{ + /** + * + */ + $form = new Form($db); + + print '
'; + + print '
'; + print ''; + print ''; + + print ''; + + print ''; + print ''; + print ''; + + print ''; + + print '
Activée chez le fournisseur'; + print "
Date de l'activation"; + print $form->select_date(); + print '
Commentaire
Adresse IP affectée
Login
Password
'; + + print '
'; + + print ' 
'; +} + +if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 3) +{ + /** + * + */ + $form = new Form($db); + + print '
'; + + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
Livrée au client'; + print "
Date de la livraison client"; + print $form->select_date(); + print '
Commentaire
'; + print '
'; + print ' 
'; +} + + +/* ************************************************************************** */ +/* */ +/* Barre d'action */ +/* */ +/* ************************************************************************** */ + +print "\n
\n
\n"; + +if ($_GET["action"] == '') +{ + + if ( $user->rights->telephonie->adsl->requete && $ligne->statut == -1) + { + print "id\">".$langs->trans("Commander").""; + } + + if ( $user->rights->telephonie->adsl->requete && $ligne->statut == 1) + { + print "id\">".$langs->trans("Annuler la commande").""; + + } + + if ( $user->rights->telephonie->adsl->creer && $ligne->statut == -1) + { + print "id\">".$langs->trans("Delete").""; + + } +} + +print "
"; + + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/telephonie/adsl/history.php b/htdocs/telephonie/adsl/history.php new file mode 100644 index 00000000000..f206d66060b --- /dev/null +++ b/htdocs/telephonie/adsl/history.php @@ -0,0 +1,137 @@ + + * + * 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("","","Historique Liaison ADSL"); + +/* + * Affichage + * + */ + +if ($_GET["id"]) +{ + if ($_GET["action"] <> 're-edit') + { + $ligne = new LigneADSL($db); + + $result = $ligne->fetch_by_id($_GET["id"]); + } + + if ( $result ) + { + $h=0; + $head[$h][0] = DOL_URL_ROOT."/telephonie/adsl/fiche.php?id=".$ligne->id; + $head[$h][1] = $langs->trans("Liaison ADSL"); + $h++; + + $head[$h][0] = DOL_URL_ROOT."/telephonie/adsl/history.php?id=".$ligne->id; + $head[$h][1] = $langs->trans('Historique'); + $hselected = $h; + $h++; + + dolibarr_fiche_head($head, $hselected, 'Liaison ADSL : '.$ligne->numero); + + print ''; + + print ''; + + + $client = new Societe($db, $ligne->client_id); + $client->fetch($ligne->client_id); + + print ''; + + print ''; + + /* Contacts */ + + $sql = "SELECT ".$db->pdate("l.tms").", l.statut, l.fk_user, u.name, u.firstname, l.comment"; + $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_adsl_ligne_statut as l"; + $sql .= ",".MAIN_DB_PREFIX."user as u"; + $sql .= " WHERE u.rowid = l.fk_user AND l.fk_ligne = ".$ligne->id; + $sql .= " ORDER BY l.tms DESC "; + if ( $db->query( $sql) ) + { + $num = $db->num_rows(); + if ( $num > 0 ) + { + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row($i); + + print ''; + + print '"; + $i++; + } + } + $db->free(); + } + else + { + print $sql; + } + + /* Fin Contacts */ + + print "
Numéro'.dolibarr_print_phone($ligne->numero).'
Client'.$client->nom.'
Statut'; + print ' '; + print $ligne->statuts[$ligne->statut]; + print '
'.strftime("%a %d %B %Y %H:%M:%S",$row[0]).' '; + print $ligne->statuts[$row[1]]; + if ($row[5]) + { + print '
'.$row[5]; + } + + print '
'.$row[4] . " " . $row[3] . "
"; + } + + /* + * + * + * + */ + +} +else +{ + print "Error"; +} + + +/* ************************************************************************** */ +/* */ +/* Barre d'action */ +/* */ +/* ************************************************************************** */ + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/telephonie/adsl/index.php b/htdocs/telephonie/adsl/index.php new file mode 100644 index 00000000000..e22a725bb57 --- /dev/null +++ b/htdocs/telephonie/adsl/index.php @@ -0,0 +1,121 @@ + + * + * 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"]; + +if (!$user->rights->telephonie->lire) + accessforbidden(); + +llxHeader('','Telephonie'); + +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + $action = ''; + $socidp = $user->societe_id; +} + +/* + * Mode Liste + * + * + * + */ + +print ''; + +print ''; + +print '
'; + +print '
'; +print ''; +print ''; +print "\n"; +print ""; +print ''; +print '
Recherche ligne
Numéro
'; + +print '
'; + + +$sql = "SELECT distinct statut, count(*) as cc"; +$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_adsl_ligne as l"; +$sql .= " GROUP BY statut"; + +if ($db->query($sql)) +{ + $num = $db->num_rows(); + $i = 0; + $ligne = new LigneAdsl($db); + + print ''; + print ''; + print "\n"; + $var=True; + + while ($i < min($num,$conf->liste_limit)) + { + $obj = $db->fetch_object(); + $values[$obj->statut] = $obj->cc; + $i++; + } + + foreach ($ligne->statuts as $key => $statut) + { + $var=!$var; + print ""; + print "\n"; + print "\n"; + print ''; + print "\n"; + } + + print "
Liaisons StatutsNb 
".$statut."".$values[$key]."
"; + $db->free(); +} +else +{ + print $db->error() . ' ' . $sql; +} + +print '
'; + +/* + * + * + */ + +print '
'; + +print '
'; + + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/telephonie/adsl/liste.php b/htdocs/telephonie/adsl/liste.php new file mode 100644 index 00000000000..08c293fc35e --- /dev/null +++ b/htdocs/telephonie/adsl/liste.php @@ -0,0 +1,165 @@ + + * + * 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"]; + +llxHeader('','Telephonie - Ligne - Liste'); +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + $action = ''; + $socidp = $user->societe_id; +} + +if ($sortorder == "") { + $sortorder="ASC"; +} +if ($sortfield == "") { + $sortfield="s.nom"; +} + +/* + * Recherche + * + * + */ + +if ($page == -1) { $page = 0 ; } + +$offset = $conf->liste_limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + +/* + * Mode Liste + * + * + * + */ + +$sql = "SELECT la.rowid, fk_client, s.nom as nom, la.numero_ligne, la.statut, t.intitule"; +$sql .= " , s.idp"; +$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_adsl_ligne as la"; +$sql .= " , ".MAIN_DB_PREFIX."societe as s"; +$sql .= " , ".MAIN_DB_PREFIX."telephonie_adsl_type as t"; +$sql .= " WHERE la.fk_client = s.idp"; +$sql .= " AND t.rowid = la.fk_type"; + +if ($_GET["search_ligne"]) +{ + $sel =urldecode($_GET["search_ligne"]); + $sel = ereg_replace("\.","",$sel); + $sel = ereg_replace(" ","",$sel); + $sql .= " AND la.numero_ligne LIKE '%".$sel."%'"; +} + +if ($_GET["search_client"]) +{ + $sel =urldecode($_GET["search_client"]); + $sql .= " AND s.nom LIKE '%".$sel."%'"; +} + +if (strlen($_GET["statut"])) +{ + $sql .= " AND la.statut = ".$_GET["statut"]; +} + +$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); + +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows(); + $i = 0; + + $urladd= "&statut=".$_GET["statut"]; + + print_barre_liste("Liaisons ADSL", $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num); + print"\n\n"; + print ''; + print ''; + + print_liste_field_titre("Ligne","liste.php","l.ligne"); + print_liste_field_titre("Client","liste.php","s.nom"); + + print ''; + print ''; + + print "\n"; + + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + + + $var=True; + + $ligne = new LigneAdsl($db); + + while ($i < min($num,$conf->liste_limit)) + { + $obj = $db->fetch_object($i); + $var=!$var; + + print "\n"; + + print ''; + print ''; + + print '\n"; + + print "\n"; + $i++; + } + print "
TypeStatut
 
"; + + print ' '; + + print ''; + print img_file(); + print ' '; + + print ''.dolibarr_print_phone($obj->numero_ligne)."'.img_object($langs->trans("Fiche Compta"),"bill")." "; + + print ' '.$obj->nom.''.$obj->intitule.''.$ligne->statuts[$obj->statut]."
"; + $db->free(); +} +else +{ + print $db->error() . ' ' . $sql; +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/telephonie/adsl/pre.inc.php b/htdocs/telephonie/adsl/pre.inc.php new file mode 100644 index 00000000000..ac8d3dbd178 --- /dev/null +++ b/htdocs/telephonie/adsl/pre.inc.php @@ -0,0 +1,48 @@ + + * + * 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/adsl/ligneadsl.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/adsl/index.php", "ADSL"); + + $menu->add_submenu(DOL_URL_ROOT."/telephonie/adsl/liste.php", "Liste"); + + $menu->add_submenu(DOL_URL_ROOT."/telephonie/adsl/fiche.php?action=create", "Nouvelle liaison"); + + $menu->add(DOL_URL_ROOT."/telephonie/index.php", "Telephonie"); + + left_menu($menu->liste); +} + +?> diff --git a/htdocs/telephonie/adsl/statut-1.png b/htdocs/telephonie/adsl/statut-1.png new file mode 100644 index 0000000000000000000000000000000000000000..7a8fb19836863bc7b7f7eee1f809db6adf2fc626 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&kwj^(N7l!`~4GjPP3v~Pgif|Tq zL>2>eTxVe5JHn{gn6eot$X?><>&kwGi=9VV&|ki)3@9X9;u=xnoS&PUnpeW$T$Gwv zlA5AWo>`Ki5R#Fq;O^-g@IFN~52#Sf)5S5Q;#P7>Lc)*p4onG&2|&jG`4+Z4Jv}@= lJSt6ryv@$c$}2sY87}9risv)*uLbI2@O1TaS?83{1OPk+H@pA< literal 0 HcmV?d00001 diff --git a/htdocs/telephonie/adsl/statut1.png b/htdocs/telephonie/adsl/statut1.png new file mode 100644 index 0000000000000000000000000000000000000000..134f1b74b305154a2e4ab14812c4ffa37f6c9035 GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&kwj^(N7l!{JxM1({$v_d#0*}aI zppNSd417lz6&q7F0|nVjJbhi+uW+$)vg%Z1?^gy2$(FcAlsM<-=BDPAFgO>bCYGe8 zD3oWGWGIAWq$;?3`UbpDQOyG?)bw<545_%4oRX06bCYGe8 zD3oWGWGIAWq$;?3`UbpDQOyG?boX>|4AD40^^!Fog8~Q3#mL8h*Y~t`9@9@?J}Rxn zD$yDKo5Ms+V9JHa%MspezYn(kKghbjnSCF-d<`34TrbP0l+XkKI)Fr2 literal 0 HcmV?d00001 diff --git a/htdocs/telephonie/adsl/statut4.png b/htdocs/telephonie/adsl/statut4.png new file mode 100644 index 0000000000000000000000000000000000000000..15bb595ba2f9b103432645fc2c6305dc570ebe3c GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&kwj^(N7l!{JxM1({$v_d#0*}aI zppNSd417lz6&q7F0|nVjJbhi+uW+$)GD}u8-Dv{~$(FcAlsM<-=BDPAFgO>bCYGe8 zD3oWGWGIAWq$;?3`UbpDQOyG?RP}Um45_%4oRX06bCYGe8 zD3oWGWGIAWq$;?3`UbpDQOyG?)bez345_%4oRX06gTe~DWM4f+%-8K literal 0 HcmV?d00001 diff --git a/htdocs/telephonie/adsl/statut7.png b/htdocs/telephonie/adsl/statut7.png new file mode 100644 index 0000000000000000000000000000000000000000..4d8f59be1c226e76c2ddc5a89f5bde2f7de5da8e GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&kwj^(N7l!{JxM1({$v_d#0*}aI zppNSd417lz6&q7F0|nVjJbhi+uW+&RC~7F_O!xy7k}YwKC~?lu%}vcKVQ?-=O)N=G zQ7F$W$xsN%NL6t6^bL5QqM8R(sOstB7*cU7IVBZOB%3JUOAoFUl*+*Fxn1%h!w7D+FqJxR0yKO#>Rh;OXk;vd$@?2>{d!Kmh;% literal 0 HcmV?d00001