[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 * $Id: infoc.php,v 1.8 2005/09/12 13:46:15 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/ligne/infoc.php,v $ 20 * 21 */ 22 23 /** \file htdocs/telephonie/ligne/infoc.php 24 \ingroup telephonie 25 \brief Lignes telephonie 26 \version $Revision: 1.8 $ 27 */ 28 29 require ("./pre.inc.php"); 30 31 $mesg = ''; 32 33 if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel") && $user->rights->telephonie->ligne->creer) 34 { 35 $ligne = new LigneTel($db); 36 $ligne->id = $_GET["id"]; 37 38 $ligne->code_analytique = $_POST["code_ana"]; 39 40 if ( $ligne->update_infoc($user) ) 41 42 { 43 $action = ''; 44 $mesg = 'Fiche mise à jour'; 45 Header("Location: infoc.php?id=".$ligne->id); 46 } 47 else 48 { 49 $action = 're-edit'; 50 $mesg = 'Fiche non mise à jour !' . "<br>" . $entrepot->mesg_error; 51 } 52 } 53 54 55 llxHeader("","","Fiche Ligne"); 56 57 if ($cancel == $langs->trans("Cancel")) 58 { 59 $action = ''; 60 } 61 /* 62 * Affichage 63 * 64 */ 65 66 67 if ($_GET["id"] or $_GET["numero"]) 68 { 69 if ($_GET["action"] <> 're-edit') 70 { 71 $ligne = new LigneTel($db); 72 if ($_GET["id"]) 73 { 74 $result = $ligne->fetch_by_id($_GET["id"]); 75 } 76 if ($_GET["numero"]) 77 { 78 $result = $ligne->fetch($_GET["numero"]); 79 } 80 } 81 82 if ($result == 1) 83 { 84 $client_comm = new Societe($db); 85 $client_comm->fetch($ligne->client_comm_id, $user); 86 } 87 88 if (!$client_comm->perm_read) 89 { 90 print "Lecture non authorisée"; 91 } 92 93 94 if ($result == 1 && $client_comm->perm_read) 95 { 96 if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') 97 { 98 99 $h=0; 100 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/fiche.php?id=".$ligne->id; 101 $head[$h][1] = $langs->trans("Ligne"); 102 $h++; 103 104 if ($user->rights->telephonie->facture->lire) 105 { 106 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/factures.php?id=".$ligne->id; 107 $head[$h][1] = $langs->trans('Factures'); 108 $h++; 109 } 110 111 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/infoc.php?id=".$ligne->id; 112 $head[$h][1] = $langs->trans('Infos'); 113 $hselected = $h; 114 $h++; 115 116 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/history.php?id=".$ligne->id; 117 $head[$h][1] = $langs->trans('Historique'); 118 $h++; 119 120 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/conso.php?id=".$ligne->id; 121 $head[$h][1] = $langs->trans('Conso'); 122 $h++; 123 124 $head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/stat.php?id=".$ligne->id; 125 $head[$h][1] = $langs->trans('Stats'); 126 $h++; 127 128 dolibarr_fiche_head($head, $hselected, 'Ligne : '.$ligne->numero); 129 130 print_fiche_titre('Informations complémentaires', $mesg); 131 132 print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; 133 134 print '<tr><td width="20%">Numéro</td><td>'.dolibarr_print_phone($ligne->numero).'</td>'; 135 print '<td>Facturée : '.$ligne->facturable.'</td></tr>'; 136 137 $client = new Societe($db, $ligne->client_id); 138 $client->fetch($ligne->client_id); 139 140 print '<tr><td width="20%">Client</td><td colspan="2">'.$client->nom.'</td></tr>'; 141 142 $client_facture = new Societe($db); 143 $client_facture->fetch($ligne->client_facture_id); 144 145 146 print '<tr><td width="20%">Remise LMN</td><td colspan="2">'.$ligne->remise.' %</td></tr>'; 147 148 $cuser = new User($db, $ligne->user_creat); 149 if ($ligne->user_creat) 150 { 151 $cuser->fetch(); 152 } 153 154 print '<tr><td width="20%">Ligne créée par</td><td colspan="2">'.$cuser->fullname.'</td></tr>'; 155 156 157 print '<tr><td width="20%">Code analytique</td><td colspan="2">'.$ligne->code_analytique.' </td></tr>'; 158 159 print '<tr><td width="20%">Modèle de facture utilisé</td><td colspan="2">'.$ligne->pdfdetail.'</td></tr>'; 160 161 162 print "</table>"; 163 } 164 165 166 if ($_GET["action"] == 'edit' || $action == 're-edit') 167 { 168 print_fiche_titre('Edition des informations complémentaires de la ligne', $mesg); 169 170 print "<form action=\"infoc.php?id=$ligne->id\" method=\"post\">\n"; 171 print '<input type="hidden" name="action" value="update">'; 172 173 print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; 174 175 print '<tr><td width="20%">Numéro</td><td>'.$ligne->numero.'</td></tr>'; 176 177 $client = new Societe($db, $ligne->client_id); 178 $client->fetch($ligne->client_id); 179 180 print '<tr><td width="20%">Client</td><td colspan="2">'.$client->nom; 181 print '</td></tr>'; 182 183 print '<tr><td width="20%">Remise LMN</td><td>'.$ligne->remise.' %</td></tr>'; 184 185 print '<tr><td width="20%">Code Analytique</td><td><input name="code_ana" size="13" maxlength="12" value="'.$ligne->code_analytique.'"> </td></tr>'; 186 187 print '<tr><td> </td><td><input type="submit" value="Mettre à jour">'; 188 print '<a href="infoc.php?id='.$ligne->id.'">Annuler</a></td></tr>'; 189 print '</table>'; 190 print '</form>'; 191 } 192 193 /* 194 * 195 * 196 * 197 */ 198 199 print '</div>'; 200 201 /* ************************************************************************** */ 202 /* */ 203 /* Barre d'action */ 204 /* */ 205 /* ************************************************************************** */ 206 207 print "<br><div class=\"tabsAction\">\n"; 208 209 if ($_GET["action"] == '') 210 { 211 print "<a class=\"tabAction\" href=\"infoc.php?action=edit&id=$ligne->id\">".$langs->trans("Edit")."</a>"; 212 } 213 214 print "</div>"; 215 } 216 217 } 218 else 219 { 220 print "Error"; 221 } 222 223 $db->close(); 224 225 llxFooter("<em>Dernière modification $Date: 2005/09/12 13:46:15 $ révision $Revision: 1.8 $</em>"); 226 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |