diff --git a/htdocs/telephonie/ligne/infoc.php b/htdocs/telephonie/ligne/infoc.php index 4d14598f8c5..e70471c290c 100644 --- a/htdocs/telephonie/ligne/infoc.php +++ b/htdocs/telephonie/ligne/infoc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2005 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 @@ -62,335 +62,150 @@ if ($cancel == $langs->trans("Cancel")) * Affichage * */ -/* - * Création - * - */ -if ($_GET["action"] == 'create') + +if ($_GET["id"] or $_GET["numero"]) { - $ligne = new LigneTel($db); - print "
\n"; - print ''; - print ''."\n"; - print_titre("Nouvelle ligne"); - - print ''; - - print ''; - - print ''; - - print ''; - - print ''; - - /* - * Commercial - */ - - print ''; - - /* - * Concurrents - */ - - print ''; - - - print ''; - print '"; - - print ''; - print '
Numéro
Client'; - print '
Client à facturer'; - print '
Fournisseur'; - print '
Commercial'; - print '
Fournisseur précédent'; - print '
Remise %
Note'; - print '
 
'; - print '
'; -} -else -{ - if ($_GET["id"] or $_GET["numero"]) - { - if ($_GET["action"] <> 're-edit') + if ( $result ) + { + if ($_GET["action"] <> 'edit' && $_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'); - $hselected = $h; - $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'); - $h++; - - dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero); - - print_fiche_titre('Informations complémentaires', $mesg); - - print ''; - - print ''; - print ''; - - $client = new Societe($db, $ligne->client_id); - $client->fetch($ligne->client_id); - - print ''; - - $client_facture = new Societe($db); - $client_facture->fetch($ligne->client_facture_id); - - print ''; - - print ''; - - print ''; - - - - - print "
Numéro'.dolibarr_print_phone($ligne->numero).'Facturée : '.$ligne->facturable.'
Client'.$client->nom.'
Client Facturé'; - print $client_facture->nom.''; - - print ''; - - if ($ligne->mode_paiement == 'pre') - { - print 'RIB : '.$client_facture->display_rib(); - } - else - { - print 'Paiement par virement'; - } - - print '
Remise LMN'.$ligne->remise.' %
Code analytique'.$ligne->code_analytique.' 
"; - } - } - - - if ($_GET["action"] == 'edit' || $action == 're-edit') - { - print_fiche_titre('Edition des informations complémentaires de la ligne', $mesg); - - print "
id\" method=\"post\">\n"; - print ''; - + + $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/factures.php?id=".$ligne->id; + $head[$h][1] = $langs->trans('Factures'); + $h++; + + $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/infoc.php?id=".$ligne->id; + $head[$h][1] = $langs->trans('Infos'); + $hselected = $h; + $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'); + $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('Informations complémentaires', $mesg); + print ''; - - print ''; - + + print ''; + print ''; + $client = new Societe($db, $ligne->client_id); $client->fetch($ligne->client_id); - print ''; + + $client_facture = new Societe($db); + $client_facture->fetch($ligne->client_facture_id); + + print ''; - - print ''; - print ''; + print ''; + + $cuser = new User($db, $ligne->user_creat); + if ($ligne->user_creat) + { + $cuser->fetch(); + } + + print ''; + - print ''; - print '
Numéro'.$ligne->numero.'
Numéro'.dolibarr_print_phone($ligne->numero).'Facturée : '.$ligne->facturable.'
Client'.$client->nom; + print '
Client'.$client->nom.'
Client Facturé'; + print $client_facture->nom.''; + + print ''; + + if ($ligne->mode_paiement == 'pre') + { + print 'RIB : '.$client_facture->display_rib(); + } + else + { + print 'Paiement par virement'; + } + print '
Remise LMN'.$ligne->remise.' %
Code Analytique 
Remise LMN'.$ligne->remise.' %
Ligne créée par'.$cuser->fullname.'
 '; - print 'Annuler
'; - print '
'; + print 'Code analytique'.$ligne->code_analytique.' '; + + + + + print ""; } - - /* - * - * - * - */ - } - else + + if ($_GET["action"] == 'edit' || $action == 're-edit') { - print "Error"; + print_fiche_titre('Edition des informations complémentaires de la ligne', $mesg); + + print "
id\" method=\"post\">\n"; + print ''; + + print ''; + + print ''; + + $client = new Societe($db, $ligne->client_id); + $client->fetch($ligne->client_id); + + print ''; + + print ''; + + print ''; + + print ''; + print '
Numéro'.$ligne->numero.'
Client'.$client->nom; + print '
Remise LMN'.$ligne->remise.' %
Code Analytique 
 '; + print 'Annuler
'; + print '
'; } + + /* + * + * + * + */ + } +else +{ + print "Error"; +} + print ''; -if ( $user->rights->telephonie->ligne_activer && $ligne->statut == 2) -{ - $form = new Form($db); - - print '
'; - - print '
'; - print ''; - print ''; - print ''; - print '
Activer'; - print '
Date'; - print $form->select_date(); - print '
'; - - print '
'; - - - print '
'; - print ''; - print ''; - print ''; - print '
Refuser'; - print '
Date'; - print $form->select_date(); - print '
'; - - print '
'; -} - -if ( $user->rights->telephonie->ligne_activer && $ligne->statut == 5) -{ - /** - * Résiliation demandée - */ - $form = new Form($db); - - print '
'; - - print '
'; - print ''; - print ''; - print ''; - print '
Confirmation de la résiliation'; - print '
Date'; - print $form->select_date(); - print '
'; - - print '
'; - - print ' 
'; -} - - /* ************************************************************************** */ /* */ /* Barre d'action */