From 90e40450b2414f3577e63a4fcd34be427c5bb786 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 27 Jan 2005 16:31:55 +0000 Subject: [PATCH] Modification de l'affichage des boutons --- htdocs/telephonie/ligne/fiche.php | 179 ++++++++++++------------------ 1 file changed, 73 insertions(+), 106 deletions(-) diff --git a/htdocs/telephonie/ligne/fiche.php b/htdocs/telephonie/ligne/fiche.php index 2c39da23ebc..6f0cbf5cebe 100644 --- a/htdocs/telephonie/ligne/fiche.php +++ b/htdocs/telephonie/ligne/fiche.php @@ -35,16 +35,17 @@ $s = strftime("%S",$dt); if ($_POST["action"] == 'add') { $ligne = new LigneTel($db); - $ligne->contrat = $_POST["contrat"]; - $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"]; + $ligne->contrat = $_POST["contrat"]; + $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_sign = $_POST["commercial_sign"]; + $ligne->commercial_suiv = $_POST["commercial_suiv"]; + $ligne->concurrent = $_POST["concurrent"]; + $ligne->remise = $_POST["remise"]; + $ligne->note = $_POST["note"]; if ( $ligne->create($user) == 0) { @@ -217,13 +218,8 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) $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) ) @@ -355,8 +351,13 @@ elseif ($_GET["action"] == 'create' && $_GET["contratid"] > 0) print ''; print ''."\n"; print ''."\n"; + print ''."\n"; + print ''."\n"; print ''; + + print ''; + print ''; @@ -411,70 +412,42 @@ elseif ($_GET["action"] == 'create' && $_GET["contratid"] > 0) print ''; /* - * Commercial + * Concurrents */ - print ''; - } - - $form->select_array("commercial",$ff,$ligne->commercial); - - print ''; - - /* - * Concurrents - */ - - print ''."\n"; + + print ''."\n"; + + print ''."\n"; + print '
Contrat'.$contrat->ref_url.'
Client'; print $socc->nom; 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 ) + print '
Fournisseur précédent'; + $ff = array(); + $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."telephonie_concurrents ORDER BY rowid "; + if ( $db->query( $sql) ) { - $i = 0; - while ($i < $num) + $num = $db->num_rows(); + if ( $num > 0 ) { - $row = $db->fetch_row($i); - $ff[$row[0]] = $row[1] . " " . $row[2]; - $i++; + $i = 0; + while ($i < $num) + { + $row = $db->fetch_row($i); + $ff[$row[0]] = $row[1]; + $i++; + } } + $db->free(); + } - $db->free(); + $form->select_array("concurrent",$ff,$ligne->concurrent); + print '
Fournisseur précédent'; - $ff = array(); - $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."telephonie_concurrents ORDER BY rowid "; - 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]; - $i++; - } - } - $db->free(); + print '
Remise LMN %
Note'."\n"; + print '
 
'."\n"; + print ''; - } - $form->select_array("concurrent",$ff,$ligne->concurrent); - print ''; - - print 'Remise LMN %'."\n"; - - print 'Note'."\n"; - print ''."\n"; - - print ' '."\n"; - print ''."\n"; - print ''; - } } @@ -624,11 +597,26 @@ else print 'Remise LMN'.$ligne->remise.' %'; print 'historique'; - $commercial = new User($db, $ligne->commercial_id); - $commercial->fetch(); + $commercial_suiv = new User($db, $ligne->commercial_suiv_id); + $commercial_suiv->fetch(); print 'Commercial'; - print ''.$commercial->fullname.''; + print ''.$commercial_suiv->fullname.''; + print 'Signé par : '; + + + if ($ligne->commercial_suiv_id <> $ligne->commercial_sign_id) + { + $commercial_sign = new User($db, $ligne->commercial_sign_id); + $commercial_sign->fetch(); + + print $commercial_sign->fullname.''; + } + else + { + print $commercial_suiv->fullname.''; + } + print 'Concurrent précédent'; print ''.$ligne->print_concurrent_nom().''; @@ -676,7 +664,12 @@ else } /* Fin Contacts */ - + if ($ligne->note) + { + print 'Note'."\n"; + print nl2br($ligne->note); + print ''."\n"; + } print "
"; @@ -835,36 +828,6 @@ else print ''; - print "\n".'Commercial'; - print ''; - - /* * Commercial */ @@ -906,6 +869,7 @@ else print 'Note'; print '"; print ''; @@ -1126,7 +1090,10 @@ if ($_GET["action"] == '') print "id\">".$langs->trans("Contact").""; } - print "id\">".$langs->trans("Changer la remise").""; + if ( $user->rights->telephonie->ligne_activer && $ligne->statut < 4) + { + print "id\">".$langs->trans("Changer la remise").""; + } if ( $user->rights->telephonie->ligne_activer && $ligne->statut == -1) {