diff --git a/htdocs/telephonie/contrat/fiche.php b/htdocs/telephonie/contrat/fiche.php new file mode 100644 index 00000000000..8ef1b150015 --- /dev/null +++ b/htdocs/telephonie/contrat/fiche.php @@ -0,0 +1,814 @@ + + * + * 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"; +require_once DOL_DOCUMENT_ROOT."/lib/dolibarrmail.class.php"; + +$mesg = ''; + +$dt = time(); + +$h = strftime("%H",$dt); +$m = strftime("%M",$dt); +$s = strftime("%S",$dt); + +if ($_POST["action"] == 'add') +{ + $contrat = new TelephonieContrat($db); + + $contrat->client_comm = $_POST["client_comm"]; + $contrat->client = $_POST["client"]; + $contrat->client_facture = $_POST["client_facture"]; + $contrat->commercial_sign = $_POST["commercial_sign"]; + $contrat->note = $_POST["note"]; + + if ( $contrat->create($user) == 0) + { + Header("Location: fiche.php?id=".$contrat->id); + } + else + { + $_GET["action"] = 'create'; + } + +} + +if ($_POST["action"] == 'addcontact') +{ + $ligne = new LigneTel($db); + $ligne->id = $_GET["id"]; + + if ( $ligne->add_contact($_POST["contact_id"]) ) + { + Header("Location: fiche.php?id=".$ligne->id); + } + +} + +if ($_GET["action"] == 'delete') +{ + $contrat = new TelephonieContrat($db); + $contrat->id = $_GET["id"]; + + $contrat->delete() ; + Header("Location: index.php"); +} + + +if ($_GET["action"] == 'delcontact') +{ + $ligne = new LigneTel($db); + $ligne->id = $_GET["id"]; + + if ( $ligne->del_contact($_GET["contact_id"]) ) + { + Header("Location: fiche.php?id=".$ligne->id); + } +} + + +if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) +{ + $ligne = new LigneTel($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 Contrat"); + +if ($cancel == $langs->trans("Cancel")) +{ + $action = ''; +} + +/* + * Création en 2 étape + * + */ +if ($_GET["action"] == 'create') +{ + $form = new Form($db); + print_titre("Nouveau contrat"); + + if (is_object($ligne)) + { + // La création a échouée + print $ligne->error_message; + } + else + { + $ligne = new LigneTel($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]] = $row[1] . " (".$row[2].")"; + + $i++; + } + } + $db->free(); + } + $form->select_array("client_comm",$ff,$ligne->client_comm); + print '
 
'."\n"; + print '
'; +} +elseif ($_GET["action"] == 'create_line' && $_GET["client_comm"] > 0) +{ + $form = new Form($db); + print_titre("Nouveau contrat"); + + if (is_object($ligne)) + { + // La création a échouée + print $ligne->error_message; + } + else + { + $ligne = new LigneTel($db); + } + + $socc = new Societe($db); + + if ( $socc->fetch($_GET["client_comm"]) == 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 un contrat 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 ''; + + /* + * Commercial + */ + + print ''; + + print ''."\n"; + + print ''."\n"; + print '
Client'; + print $socc->nom; + print '
Code client'; + print $socc->code_client; + print '
Client (Agence/Filiale)'; + $ff = array(); + $sql = "SELECT idp, nom, ville FROM ".MAIN_DB_PREFIX."societe"; + $sql .= " WHERE client=1"; + $sql .= " AND (idp = $socc->id OR parent = $socc->id)"; + $sql .= " 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]] = $row[1] . " (".$row[2].")"; + $i++; + } + } + $db->free(); + } + else + { + print $sql; + } + $form->select_array("client",$ff,$ligne->client); + print '
Client à facturer'; + $ff = array(); + $sql = "SELECT idp, nom, ville FROM ".MAIN_DB_PREFIX."societe WHERE client=1"; + $sql .= " AND (idp = $socc->id OR parent = $socc->id)"; + $sql .= " 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]] = $row[1] . " (".$row[2].")"; + $i++; + } + } + $db->free(); + } + $form->select_array("client_facture",$ff,$ligne->client_facture); + print '
Commercial Signature'; + $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]] = $row[1] . " " . $row[2]; + $i++; + } + } + $db->free(); + + } + + $form->select_array("commercial_sign",$ff,$ligne->commercial); + + print '
Note'."\n"; + print '
 
'."\n"; + print '
'; + + } + + } + else + { + print "Erreur"; + } + +} +else +{ + if ($_GET["id"]) + { + if ($_GET["action"] <> 're-edit') + { + $contrat = new TelephonieContrat($db); + + if ($contrat->fetch($_GET["id"]) == 0) + { + $result = 1; + } + } + + if ( $result ) + { + if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') + { + + $h=0; + $head[$h][0] = DOL_URL_ROOT."/telephonie/contrat/fiche.php?id=".$contrat->id; + $head[$h][1] = $langs->trans("Contrat"); + $hselected = $h; + $h++; + + dolibarr_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref); + + print_fiche_titre('Fiche Contrat', $mesg); + + print ''; + + $client_comm = new Societe($db, $contrat->client_comm_id); + $client_comm->fetch($contrat->client_comm_id); + + print ''; + print ''; + + print ''; + + $client = new Societe($db, $contrat->client_id); + $client->fetch($contrat->client_id); + + print ''; + + $client_facture = new Societe($db); + $client_facture->fetch($contrat->client_facture_id); + + print ''; + + $commercial = new User($db, $contrat->commercial_sign_id); + $commercial->fetch(); + + print ''; + print ''; + + $commercial_suiv = new User($db, $contrat->commercial_suiv_id); + $commercial_suiv->fetch(); + + print ''; + print ''; + + + /* + print ''; + */ + + + /* Contacts + + $sql = "SELECT c.idp, c.name, c.firstname, c.email "; + $sql .= "FROM ".MAIN_DB_PREFIX."socpeople as c"; + $sql .= ",".MAIN_DB_PREFIX."telephonie_contact_facture as cf"; + $sql .= " WHERE c.idp = cf.fk_contact AND cf.fk_contrat = ".$contrat->id." ORDER BY name "; + 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 "
Référence'.$contrat->ref.'Facturé : '.$contrat->facturable.'
Client'; + print ''; + + print $client_comm->nom.''.$client_comm->code_client; + print '
Client (Agence/Filiale)'; + print $client->nom.'
'; + + print $client->cp . " " .$client->ville; + print '
Client Facturé'; + print $client_facture->nom.'
'; + print $client_facture->cp . " " .$client_facture->ville; + + print '
'; + + if ($contrat->mode_paiement == 'pre') + { + print 'RIB : '.$client_facture->display_rib(); + } + else + { + print 'Paiement par virement'; + } + + print '
Commercial Signature'.$commercial->fullname.'
Commercial Suivi'.$commercial_suiv->fullname.'
Statut'; + print ' '; + print $contrat->statuts[$contrat->statut]; + print '
Contact facture '.$i.''.$row[1] . " " . $row[2] . " <".$row[3].">

"; + /* Lignes */ + + print ''; + + $sql = "SELECT l.ligne, f.nom as fournisseur, l.statut, l.rowid, l.remise, ss.nom as agence"; + $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; + $sql .= " , ".MAIN_DB_PREFIX."societe as ss"; + $sql .= " , ".MAIN_DB_PREFIX."telephonie_fournisseur as f"; + $sql .= " WHERE l.fk_fournisseur = f.rowid"; + $sql .= " AND l.fk_soc = ss.idp "; + $sql .= " AND l.fk_contrat = ".$contrat->id; + + if ( $db->query( $sql) ) + { + $numlignes = $db->num_rows(); + if ( $numlignes > 0 ) + { + $i = 0; + + $ligne = new LigneTel($db); + + print ''; + + print "\n"; + + while ($i < $numlignes) + { + $obj = $db->fetch_object($i); + $var=!$var; + + print "\n"; + + print '\n"; + print '\n"; + + print '\n"; + print "\n"; + print "\n"; + $i++; + } + } + $db->free(); + + } + else + { + print $sql; + } + + print "
Ligne'; + print 'Agence/FilialeStatutRemise LMN'; + print 'Fournisseur
"; + + print ' '; + + print ''; + print img_file(); + + print ' '; + + print ''.dolibarr_print_phone($obj->ligne)."'.$obj->agence."'.$ligne->statuts[$obj->statut]."'.$obj->remise." %".$obj->fournisseur."
"; + } + + + /* + * Edition + * + * + * + */ + + if ($_GET["action"] == 'edit' || $action == 're-edit') + { + + $h=0; + $head[$h][0] = DOL_URL_ROOT."/telephonie/contrat/fiche.php?id=".$contrat->id; + $head[$h][1] = $langs->trans("Contrat"); + $hselected = $h; + $h++; + + dolibarr_fiche_head($head, $hselected, 'Contrat : '.$contrat->ref); + + print_fiche_titre('Edition du contrat', $mesg); + + print "
id\" method=\"post\">\n"; + print ''; + + print ''; + + print ''; + print ''; + + $client_comm = new Societe($db, $contrat->client_comm_id); + $client_comm->fetch($contrat->client_comm_id); + + print ''; + + + print ''; + + print ''; + + /* + * Commercial + */ + + $commercial = new User($db, $contrat->commercial_sign_id); + $commercial->fetch(); + + print ''; + print ''; + + print "\n".''; + + /* + * + * + */ + print '"; + + print ''; + print '
Référence'.$contrat->ref.'Facturé : '.$contrat->facturable.'
Client'; + print ''; + + print $client_comm->nom.''.$client_comm->code_client; + print '
Client (Agence/Filiale)'; + print '
Client à facturer'."\n"; + print '
Commercial Signature'.$commercial->fullname.'
Commercial Suivi'; + print '
Note'; + print '
'; + print 'Annuler
'."\n"; + print '
'."\n"; + + } + + /* + * Contact + * + * + */ + if ($_GET["action"] == 'contact') + { + print_fiche_titre('Ajouter un contact', $mesg); + + print "
id\" method=\"post\">\n"; + print ''; + + print ''; + + + $sql = "SELECT c.idp, c.name, c.firstname, c.email "; + $sql .= "FROM ".MAIN_DB_PREFIX."socpeople as c"; + $sql .= ",".MAIN_DB_PREFIX."telephonie_contact_facture as cf"; + $sql .= " WHERE c.idp = cf.fk_contact AND cf.fk_ligne = ".$ligne->id." ORDER BY name "; + 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; + } + + + print ''; + + print ''; + print '
Contact facture '.$i.''.$row[1] . " " . $row[2] . " <".$row[3].">"; + print ''; + print ''; + print img_delete(); + print "
Contact'; + + $sql = "SELECT idp, name, firstname, email FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$ligne->client_facture_id." ORDER BY name "; + if ( $db->query( $sql) ) + { + print ''; + } + else + { + print $sql; + } + + print '

Contact auquel est envoyé la facture par email

 '; + if ($num > 0) + { + print ''; + } + print 'Annuler
'; + print '
'; + + } + + /* + * + * + * + */ + + print ''; + + } + } + else + { + print "Error"; + } +} + +/* ************************************************************************** */ +/* */ +/* Barre d'action */ +/* */ +/* ************************************************************************** */ + +print "\n
\n
\n"; + +if ($_GET["action"] == '') +{ + + if ($user->rights->telephonie->ligne->creer) + { + print 'Nouvelle ligne'; + } + + print "id\">".$langs->trans("Contact").""; + + print "id\">".$langs->trans("Edit").""; + + if ($user->rights->telephonie->ligne->creer && $numlignes == 0) + { + print "id\">".$langs->trans("Delete").""; + } + + +} + +print "
"; + + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/telephonie/contrat/index.php b/htdocs/telephonie/contrat/index.php new file mode 100644 index 00000000000..7c9b150f0e3 --- /dev/null +++ b/htdocs/telephonie/contrat/index.php @@ -0,0 +1,174 @@ + + * + * 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 - Contrats'); + +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + $action = ''; + $socidp = $user->societe_id; +} + +/* + * Mode Liste + * + * + * + */ + +print ''; + +print ''; + + +print ''; + + +print '
'; + +print '
'; +print ''; +print ''; +print "\n"; +print ""; +print ''; +print '
Recherche contrat
Numéro
'; + +print '
'; + + +$sql = "SELECT distinct statut, count(*) as cc"; +$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat as l"; +$sql .= " GROUP BY statut"; + +if ($db->query($sql)) +{ + $num = $db->num_rows(); + $i = 0; + $ligne = new LigneTel($db); + + print ''; + print ''; + print "\n"; + $var=True; + + while ($i < $num) + { + $obj = $db->fetch_object(); + + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + + $values[$obj->statut] = $obj->cc; + $i++; + } + print "
ContratsNb
Contrats ".$statut."".$obj->cc."
"; + $db->free(); +} +else +{ + print $db->error() . ' ' . $sql; +} + +print '
'; + + +print '
'; + +$sql = "SELECT c.ref, c.rowid, s.idp as socidp, sf.idp as sfidp, sf.nom as nom_facture,s.nom"; +$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; +$sql .= " , ".MAIN_DB_PREFIX."telephonie_contrat as c"; +$sql .= " , ".MAIN_DB_PREFIX."societe as sf"; + +$sql .= " WHERE c.fk_client_comm = s.idp"; +$sql .= " AND c.fk_soc = sf.idp"; +$sql .= " ORDER BY date_creat DESC LIMIT 10"; + +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows(); + $i = 0; + + print"\n\n"; + print ''; + print ''; + + print ''; + print ''; + print ''; + print "\n"; + + $var=True; + + $ligne = new LigneTel($db); + + while ($i < min($num,$conf->liste_limit)) + { + $obj = $db->fetch_object($i); + $var=!$var; + + print "\n"; + + print ''; + print ''; + + print "\n"; + $i++; + } + print "
RéférenceClient (Agence/Filiale)Client facturé
"; + + print ''; + print img_file(); + print ' '; + + print ''.$obj->ref."'.stripslashes($obj->nom).''.stripslashes($obj->nom_facture).'
"; + $db->free(); +} +else +{ + print $db->error() . ' ' . $sql; +} + + + +print '
'; + + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/telephonie/contrat/liste.php b/htdocs/telephonie/contrat/liste.php new file mode 100644 index 00000000000..1b7fb227925 --- /dev/null +++ b/htdocs/telephonie/contrat/liste.php @@ -0,0 +1,176 @@ + + * + * 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 - Contrats - Liste'); +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + $action = ''; + $socidp = $user->societe_id; +} + +if ($sortorder == "") { + $sortorder="ASC"; +} +if ($sortfield == "") { + $sortfield="c.statut"; +} + +/* + * Recherche + * + * + */ + +if ($page == -1) { $page = 0 ; } + +$offset = $conf->liste_limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + +/* + * Mode Liste + * + * + * + */ +$sql = "SELECT c.rowid, c.ref, s.idp as socidp, sf.idp as sfidp, sf.nom as nom_facture,s.nom"; +$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; +$sql .= " , ".MAIN_DB_PREFIX."telephonie_contrat as c"; +$sql .= " , ".MAIN_DB_PREFIX."societe as sf"; + +$sql .= " WHERE c.fk_client_comm = s.idp"; +$sql .= " AND c.fk_soc = sf.idp"; + + +if ($_GET["search_ligne"]) +{ + $sel =urldecode($_GET["search_ligne"]); + $sel = ereg_replace("\.","",$sel); + $sel = ereg_replace(" ","",$sel); + $sql .= " AND l.ligne LIKE '%".$sel."%'"; +} + +if ($_GET["search_client"]) +{ + $sel =urldecode($_GET["search_client"]); + $sql .= " AND s.nom LIKE '%".$sel."%'"; +} + +if ($_GET["search_client_facture"]) +{ + $sel =urldecode($_GET["search_client_facture"]); + $sql .= " AND sf.nom LIKE '%".$sel."%'"; +} + +if (strlen($_GET["statut"])) +{ + $sql .= " AND l.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("Contrats", $page, "liste.php", $urladd, $sortfield, $sortorder, '', $num); + print"\n\n"; + print ''; + print ''; + + print_liste_field_titre("Ref","liste.php","c.ref"); + print_liste_field_titre("Client (Agence/Filiale)","liste.php","s.nom"); + + print ''; + print ''; + + print_liste_field_titre("Remise LMN","liste.php","l.remise","","",' align="center"'); + + print "\n"; + + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + + + print ''; + + + print ''; + print ''; + + + $var=True; + + $ligne = new LigneTel($db); + + while ($i < min($num,$conf->liste_limit)) + { + $obj = $db->fetch_object($i); + $var=!$var; + + print "\n"; + + print ''; + print ''; + + print '\n"; + + print '\n"; + + print "\n"; + $i++; + } + print "
Client facturéStatut
 
"; + + print ''; + print img_file(); + print ' '; + + print ''.$obj->ref."'.stripslashes($obj->nom).''.stripslashes($obj->nom_facture).''.$ligne->statuts[$obj->statut]."'.$obj->remise." %
"; + $db->free(); +} +else +{ + print $db->error() . ' ' . $sql; +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/telephonie/contrat/pre.inc.php b/htdocs/telephonie/contrat/pre.inc.php new file mode 100644 index 00000000000..79534436af1 --- /dev/null +++ b/htdocs/telephonie/contrat/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/telephonie.contrat.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(DOL_URL_ROOT."/telephonie/tarifs/", "Tarifs"); + + $menu->add(DOL_URL_ROOT."/telephonie/client/index.php", "Clients"); + + $menu->add(DOL_URL_ROOT."/telephonie/contrat/", "Contrats"); + + $menu->add_submenu(DOL_URL_ROOT."/telephonie/contrat/liste.php", "Liste"); + + if ($user->rights->telephonie->ligne->creer) + $menu->add_submenu(DOL_URL_ROOT."/telephonie/contrat/fiche.php?action=create", "Nouveau contrat"); + + + $menu->add(DOL_URL_ROOT."/telephonie/ligne/index.php", "Lignes"); + + $menu->add(DOL_URL_ROOT."/telephonie/ligne/commande/", "Commandes"); + + $menu->add(DOL_URL_ROOT."/telephonie/facture/", "Factures"); + + $menu->add(DOL_URL_ROOT."/telephonie/stats/", "Statistiques"); + + $menu->add(DOL_URL_ROOT."/telephonie/statca/", "Chiffre d'affaire"); + + left_menu($menu->liste); +} + +?>