| [ 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: fiche.php,v 1.3 2005/08/19 14:15:36 rodolphe Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/adsl/fiche.php,v $ 20 * 21 */ 22 23 require ("./pre.inc.php"); 24 25 if (!$user->rights->telephonie->adsl->lire) accessforbidden(); 26 27 $mesg = ''; 28 29 $dt = time(); 30 31 $h = strftime("%H",$dt); 32 $m = strftime("%M",$dt); 33 $s = strftime("%S",$dt); 34 35 if ($_POST["action"] == 'add') 36 { 37 $ligne = new LigneAdsl($db); 38 39 $ligne->numero = $_POST["numero"]; 40 $ligne->client = $_POST["client"]; 41 $ligne->client_install = $_POST["client_install"]; 42 $ligne->client_facture = $_POST["client_facture"]; 43 $ligne->fournisseur = $_POST["fournisseur"]; 44 $ligne->commercial = $_POST["commercial"]; 45 $ligne->type = $_POST["type"]; 46 $ligne->note = $_POST["note"]; 47 48 if ( $ligne->create($user) == 0) 49 { 50 Header("Location: fiche.php?id=".$ligne->id); 51 } 52 else 53 { 54 $_GET["action"] = 'create_line'; 55 $_GET["client"] = $_POST["client"]; 56 } 57 58 } 59 60 if ($_GET["action"] == 'delete' && $user->rights->telephonie->adsl->creer) 61 { 62 $ligne = new LigneAdsl($db); 63 64 if ( $ligne->delete($_GET["id"]) == 0) 65 { 66 Header("Location: liste.php"); 67 } 68 69 } 70 71 if ($_GET["action"] == 'ordertech') 72 { 73 $ligne = new LigneAdsl($db); 74 $ligne->fetch_by_id($_GET["id"]); 75 76 if ( $ligne->set_statut($user, 1) == 0) 77 { 78 Header("Location: fiche.php?id=".$ligne->id); 79 } 80 81 } 82 83 if ($_GET["action"] == 'cancelordertech') 84 { 85 $ligne = new LigneAdsl($db); 86 $ligne->fetch_by_id($_GET["id"]); 87 88 if ( $ligne->set_statut($user, -1) == 0) 89 { 90 Header("Location: fiche.php?id=".$ligne->id); 91 } 92 93 } 94 95 if ($_GET["action"] == 'refuse') 96 { 97 $ligne = new LigneAdsl($db); 98 $ligne->fetch_by_id($_GET["id"]); 99 100 $datea = $db->idate(mktime($h, $m , $s, 101 $_POST["remonth"], 102 $_POST["reday"], 103 $_POST["reyear"])); 104 105 if ( $ligne->set_statut($user, 7, $datea, $_POST["commentaire"]) == 0) 106 { 107 Header("Location: fiche.php?id=".$ligne->id); 108 } 109 110 } 111 112 if ($_GET["action"] == 'resilier') 113 { 114 $ligne = new LigneAdsl($db); 115 $ligne->fetch_by_id($_GET["id"]); 116 117 $datea = $db->idate(mktime($h, $m , $s, 118 $_POST["remonth"], 119 $_POST["reday"], 120 $_POST["reyear"])); 121 122 if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 4) 123 { 124 if ( $ligne->set_statut($user, 5, $datea, $_POST["commentaire"]) == 0) 125 { 126 Header("Location: fiche.php?id=".$ligne->id); 127 } 128 } 129 else 130 { 131 Header("Location: fiche.php?id=".$ligne->id); 132 } 133 } 134 135 if ($_GET["action"] == 'annuleresilier') 136 { 137 $ligne = new LigneAdsl($db); 138 $ligne->fetch_by_id($_GET["id"]); 139 140 if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 5) 141 { 142 if ( $ligne->set_statut($user, 4) == 0) 143 { 144 Header("Location: fiche.php?id=".$ligne->id); 145 } 146 } 147 else 148 { 149 Header("Location: fiche.php?id=".$ligne->id); 150 } 151 } 152 153 if ($_GET["action"] == 'resilierfourn') 154 { 155 $ligne = new LigneAdsl($db); 156 $ligne->fetch_by_id($_GET["id"]); 157 158 $datea = $db->idate(mktime($h, $m , $s, 159 $_POST["remonth"], 160 $_POST["reday"], 161 $_POST["reyear"])); 162 163 if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 5) 164 { 165 if ( $ligne->set_statut($user, 6, $datea, $_POST["commentaire"]) == 0) 166 { 167 Header("Location: fiche.php?id=".$ligne->id); 168 } 169 } 170 else 171 { 172 Header("Location: fiche.php?id=".$ligne->id); 173 } 174 } 175 176 if ($_GET["action"] == 'acquitresilierfourn') 177 { 178 $ligne = new LigneAdsl($db); 179 $ligne->fetch_by_id($_GET["id"]); 180 181 $datea = $db->idate(mktime($h, $m , $s, 182 $_POST["remonth"], 183 $_POST["reday"], 184 $_POST["reyear"])); 185 186 if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 6) 187 { 188 if ( $ligne->set_statut($user, 7, $datea, $_POST["commentaire"]) == 0) 189 { 190 Header("Location: fiche.php?id=".$ligne->id); 191 } 192 } 193 else 194 { 195 Header("Location: fiche.php?id=".$ligne->id); 196 } 197 } 198 199 if ($_GET["action"] == 'commandefourn' && $user->rights->telephonie->adsl->commander) 200 { 201 $ligne = new LigneAdsl($db); 202 $ligne->fetch_by_id($_GET["id"]); 203 204 $datea = $db->idate(mktime($h, $m , $s, 205 $_POST["remonth"], 206 $_POST["reday"], 207 $_POST["reyear"])); 208 209 if ( $ligne->set_statut($user, 2, $datea, $_POST["commentaire"]) == 0) 210 { 211 Header("Location: fiche.php?id=".$ligne->id); 212 } 213 } 214 215 if ($_GET["action"] == 'activefourn' && $user->rights->telephonie->adsl->gerer) 216 { 217 $ligne = new LigneAdsl($db); 218 $ligne->fetch_by_id($_GET["id"]); 219 220 $datea = $db->idate(mktime($h, $m , $s, 221 $_POST["remonth"], 222 $_POST["reday"], 223 $_POST["reyear"])); 224 225 $ligne->update_info($_POST["ip"], $_POST["login"], $_POST["password"]); 226 227 228 if ( $ligne->set_statut($user, 3, $datea, $_POST["commentaire"]) == 0) 229 { 230 Header("Location: fiche.php?id=".$ligne->id); 231 } 232 } 233 234 if ($_GET["action"] == 'livraison' && $user->rights->telephonie->adsl->gerer) 235 { 236 $ligne = new LigneAdsl($db); 237 $ligne->fetch_by_id($_GET["id"]); 238 239 $datea = $db->idate(mktime($h, $m , $s, 240 $_POST["remonth"], 241 $_POST["reday"], 242 $_POST["reyear"])); 243 244 if ( $ligne->set_statut($user, 4, $datea, $_POST["commentaire"]) == 0) 245 { 246 Header("Location: fiche.php?id=".$ligne->id); 247 } 248 } 249 250 if ($_GET["action"] == 'acommander') 251 { 252 $ligne = new LigneAdsl($db); 253 $ligne->fetch_by_id($_GET["id"]); 254 255 if ( $ligne->set_statut($user, 1, '', $_POST["commentaire"]) == 0) 256 { 257 Header("Location: fiche.php?id=".$ligne->id); 258 } 259 } 260 261 262 if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel")) 263 { 264 $ligne = new LigneAdsl($db); 265 $ligne->id = $_GET["id"]; 266 267 $ligne->numero = $_POST["numero"]; 268 $ligne->client_comm = $_POST["client_comm"]; 269 $ligne->client = $_POST["client"]; 270 $ligne->client_facture = $_POST["client_facture"]; 271 $ligne->fournisseur = $_POST["fournisseur"]; 272 $ligne->commercial = $_POST["commercial"]; 273 $ligne->concurrent = $_POST["concurrent"]; 274 $ligne->remise = $_POST["remise"]; 275 $ligne->note = $_POST["note"]; 276 277 if ( $ligne->update($user) ) 278 279 { 280 $action = ''; 281 $mesg = 'Fiche mise à jour'; 282 } 283 else 284 { 285 $action = 're-edit'; 286 $mesg = 'Fiche non mise à jour !' . "<br>" . $entrepot->mesg_error; 287 } 288 } 289 290 291 llxHeader("","","Fiche Liaison"); 292 293 if ($cancel == $langs->trans("Cancel")) 294 { 295 $action = ''; 296 } 297 298 /* 299 * Création en 2 étape 300 * 301 */ 302 if ($_GET["action"] == 'create') 303 { 304 $form = new Form($db); 305 print_titre("Nouvelle liaison ADSL"); 306 307 if (is_object($ligne)) 308 { 309 // La création a échouée 310 print $ligne->error_message; 311 } 312 else 313 { 314 $ligne = new LigneAdsl($db); 315 } 316 317 print '<form action="fiche.php" method="GET">'; 318 print '<input type="hidden" name="action" value="create_line">'; 319 320 print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; 321 322 print '<tr><td width="20%">Client</td><td >'; 323 $ff = array(); 324 $sql = "SELECT idp, nom, ville FROM ".MAIN_DB_PREFIX."societe WHERE client=1 ORDER BY nom "; 325 if ( $db->query( $sql) ) 326 { 327 $num = $db->num_rows(); 328 if ( $num > 0 ) 329 { 330 $i = 0; 331 while ($i < $num) 332 { 333 $row = $db->fetch_row($i); 334 $ff[$row[0]] = stripslashes($row[1]) . " (".$row[2].")"; 335 336 $i++; 337 } 338 } 339 $db->free(); 340 } 341 $form->select_array("client",$ff,$ligne->client_comm); 342 print '</td></tr>'; 343 344 print '<tr><td> </td><td><input type="submit" value="Créer"></td></tr>'."\n"; 345 print '</table>'."\n"; 346 print '</form>'; 347 } 348 elseif ($_GET["action"] == 'create_line' && $_GET["client"] > 0) 349 { 350 $form = new Form($db); 351 print_titre("Nouvelle liaison ADSL"); 352 353 if (is_object($ligne)) 354 { 355 // La création a échouée 356 print '<div class="errormessage">'.$ligne->error_message.'</div>'; 357 } 358 else 359 { 360 $ligne = new LigneAdsl($db); 361 $ligne->client_install_id = $_GET["client"]; 362 $ligne->client_facture_id = $_GET["client"]; 363 } 364 365 $socc = new Societe($db); 366 if ( $socc->fetch($_GET["client"]) == 1) 367 { 368 369 if (strlen($socc->code_client) == 0) 370 { 371 print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; 372 print '<tr><td width="20%">Client</td><td >'; 373 print '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$socc->id.'">'.$socc->nom.'</a>'; 374 print '</td></tr>'; 375 376 print '<tr><td width="20%">Code client</td><td >'; 377 print $socc->code_client; 378 print '</td></tr>'; 379 print '</table><br /><br />'; 380 print 'Impossible de créer une ligne pour cette société, vous devez au préalablement lui affecter un code client.'; 381 } 382 elseif (strlen($socc->code_client) > 0 && $socc->check_codeclient() <> 0) 383 { 384 print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; 385 print '<tr><td width="20%">Client</td><td >'; 386 print '<a href="'.DOL_URL_ROOT.'/soc.php?socid='.$socc->id.'">'.$socc->nom.'</a>'; 387 print '</td></tr>'; 388 389 print '<tr><td width="20%">Code client</td><td >'; 390 print $socc->code_client; 391 print '</td></tr>'; 392 print '</table><br /><br />'; 393 print 'Le code client de cette société est incorrect, vous devez lui affecter un code client correct.'; 394 } 395 else 396 { 397 print "<form action=\"fiche.php\" method=\"post\">\n"; 398 print '<input type="hidden" name="action" value="add">'; 399 print '<input type="hidden" name="client" value="'.$socc->id.'">'."\n"; 400 401 print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; 402 print '<tr><td width="20%">Client</td><td >'; 403 print $socc->nom; 404 print '</td></tr>'; 405 406 print '<tr><td width="20%">Code client</td><td >'; 407 print $socc->code_client; 408 print '</td></tr>'; 409 410 411 print '<tr><td width="20%">Numéro de la ligne téléphonique</td><td><input name="numero" size="12" value="'.$ligne->numero.'"></td></tr>'; 412 413 print '<tr><td width="20%">Client (Agence/Filiale)</td><td >'; 414 $ff = array(); 415 $sql = "SELECT idp, nom, ville FROM ".MAIN_DB_PREFIX."societe WHERE client=1 ORDER BY nom "; 416 if ( $db->query( $sql) ) 417 { 418 $num = $db->num_rows(); 419 if ( $num > 0 ) 420 { 421 $i = 0; 422 while ($i < $num) 423 { 424 $row = $db->fetch_row(); 425 $ff[$row[0]] = stripslashes($row[1]) . " (".$row[2].")"; 426 $i++; 427 } 428 } 429 $db->free(); 430 } 431 $form->select_array("client_install",$ff,$ligne->client_install_id); 432 print " (Correspond à l'adresse d'installation)</td></tr>"; 433 434 print '<tr><td width="20%">Client à facturer</td><td >'; 435 $ff = array(); 436 $sql = "SELECT idp, nom, ville FROM ".MAIN_DB_PREFIX."societe WHERE client=1 ORDER BY nom "; 437 if ( $db->query( $sql) ) 438 { 439 $num = $db->num_rows(); 440 if ( $num > 0 ) 441 { 442 $i = 0; 443 while ($i < $num) 444 { 445 $row = $db->fetch_row(); 446 $ff[$row[0]] = stripslashes($row[1]) . " (".$row[2].")"; 447 $i++; 448 } 449 } 450 $db->free(); 451 } 452 $form->select_array("client_facture",$ff,$ligne->client_facture_id); 453 print '</td></tr>'; 454 455 /* 456 * Type 457 */ 458 459 print '<tr><td width="20%">Débit de la ligne</td><td >'; 460 $ff = array(); 461 $sql = "SELECT rowid, intitule FROM ".MAIN_DB_PREFIX."telephonie_adsl_type WHERE commande_active = 1 ORDER BY intitule "; 462 if ( $db->query( $sql) ) 463 { 464 $num = $db->num_rows(); 465 if ( $num > 0 ) 466 { 467 $i = 0; 468 while ($i < $num) 469 { 470 $row = $db->fetch_row(); 471 $ff[$row[0]] = $row[1]; 472 $i++; 473 } 474 } 475 $db->free(); 476 477 } 478 $form->select_array("type",$ff,$ligne->type); 479 print '</td></tr>'; 480 481 482 /* 483 * Fournisseur 484 */ 485 486 print '<tr><td width="20%">Fournisseur</td><td >'; 487 $ff = array(); 488 $sql = "SELECT f.idp, f.nom FROM ".MAIN_DB_PREFIX."societe as f"; 489 $sql .= " , ".MAIN_DB_PREFIX."telephonie_adsl_fournisseur as fa"; 490 $sql .= " WHERE fa.commande_active = 1 AND fa.fk_soc = f.idp ORDER BY f.nom "; 491 if ( $db->query( $sql) ) 492 { 493 $num = $db->num_rows(); 494 if ( $num > 0 ) 495 { 496 $i = 0; 497 while ($i < $num) 498 { 499 $row = $db->fetch_row(); 500 $ff[$row[0]] = stripslashes($row[1]); 501 $i++; 502 } 503 } 504 $db->free(); 505 506 } 507 else 508 { 509 print $db->error(); 510 } 511 $form->select_array("fournisseur",$ff,$ligne->fournisseur); 512 print '</td></tr>'; 513 514 /* 515 * Commercial 516 */ 517 518 print '<tr><td width="20%">Commercial</td><td >'; 519 $ff = array(); 520 $sql = "SELECT rowid, name, firstname FROM ".MAIN_DB_PREFIX."user ORDER BY name "; 521 if ( $db->query( $sql) ) 522 { 523 $num = $db->num_rows(); 524 if ( $num > 0 ) 525 { 526 $i = 0; 527 while ($i < $num) 528 { 529 $row = $db->fetch_row($i); 530 $ff[$row[0]] = stripslashes($row[1]) . " " . stripslashes($row[2]); 531 $i++; 532 } 533 } 534 $db->free(); 535 536 } 537 538 $form->select_array("commercial",$ff,$ligne->commercial); 539 540 print '</td></tr>'; 541 542 print '<tr><td width="20%" valign="top">Note</td><td>'."\n"; 543 print '<textarea name="note" rows="4" cols="50">'."\n"; 544 print stripslashes($ligne->note); 545 print '</textarea></td></tr>'."\n"; 546 547 print '<tr><td> </td><td><input type="submit" value="Créer"></td></tr>'."\n"; 548 print '</table>'."\n"; 549 print '</form>'; 550 551 } 552 553 } 554 else 555 { 556 print "Erreur"; 557 } 558 } 559 else 560 { 561 if ($_GET["id"] or $_GET["numero"]) 562 { 563 if ($_GET["action"] <> 're-edit') 564 { 565 $ligne = new LigneAdsl($db); 566 if ($_GET["id"]) 567 { 568 $result = $ligne->fetch_by_id($_GET["id"]); 569 } 570 if ($_GET["numero"]) 571 { 572 $result = $ligne->fetch($_GET["numero"]); 573 } 574 } 575 576 if ( $result ) 577 { 578 if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') 579 { 580 581 $h=0; 582 $head[$h][0] = DOL_URL_ROOT."/telephonie/adsl/fiche.php?id=".$ligne->id; 583 $head[$h][1] = $langs->trans("Liaison ADSL"); 584 $hselected = $h; 585 $h++; 586 587 $head[$h][0] = DOL_URL_ROOT."/telephonie/adsl/history.php?id=".$ligne->id; 588 $head[$h][1] = $langs->trans('Historique'); 589 $h++; 590 591 dolibarr_fiche_head($head, $hselected, 'Liaison ADSL : '.$ligne->numero); 592 593 print_fiche_titre('Fiche Liaison ADSL', $mesg); 594 595 print '<table class="border" width="100%" cellspacing="0" cellpadding="4">'; 596 597 $client = new Societe($db, $ligne->client_id); 598 $client->fetch($ligne->client_id); 599 600 print '<tr><td width="20%">Client</td><td>'; 601 print '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$client->id.'">'; 602 603 print $client->nom.'</a></td><td>'.$client->code_client; 604 print '</td></tr>'; 605 606 print '<tr><td width="20%">Numéro</td><td>'.dolibarr_print_phone($ligne->numero).'</td>'; 607 print '<td> </td></tr>'; 608 609 print '<tr><td width="20%">Débit de la liaison</td><td colspan="2">'.$ligne->type.'</td></tr>'; 610 611 $client_install = new Societe($db, $ligne->client_install_id); 612 $client_install->fetch($ligne->client_install_id); 613 614 print '<tr><td width="20%">Client (Agence/Filiale)</td><td colspan="2">'; 615 print $client_install->nom.'<br />'; 616 617 print $client_install->cp . " " .$client_install->ville; 618 print '</td></tr>'; 619 620 $client_facture = new Societe($db); 621 $client_facture->fetch($ligne->client_facture_id); 622 623 print '<tr><td width="20%">Client Facturé</td><td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='; 624 print $client_facture->id.'">'; 625 print $client_facture->nom.'</a><br />'; 626 print $client_facture->cp . " " .$client_facture->ville; 627 628 print '</td><td>'; 629 630 if ($ligne->mode_paiement == 'pre') 631 { 632 print 'RIB : '.$client_facture->display_rib(); 633 } 634 else 635 { 636 print 'Paiement par virement'; 637 } 638 639 print '</td></tr>'; 640 641 $commercial = new User($db, $ligne->commercial_id); 642 $commercial->fetch(); 643 644 print '<tr><td width="20%">Commercial</td>'; 645 print '<td colspan="2">'.$commercial->fullname.'</td></tr>'; 646 647 648 if ( $user->rights->telephonie->adsl->gerer) 649 { 650 print '<tr><td width="20%">IP</td><td colspan="2">'.$ligne->ip.'</td></tr>'; 651 print '<tr><td width="20%">Login</td><td colspan="2">'.$ligne->login.'</td></tr>'; 652 print '<tr><td width="20%">Password</td><td colspan="2">'.$ligne->password.'</td></tr>'; 653 } 654 655 print '<tr><td width="20%">Statut</td><td colspan="2">'; 656 print '<img src="./statut'.$ligne->statut.'.png"> '; 657 print $ligne->statuts[$ligne->statut]; 658 print '</td></tr>'; 659 660 661 662 print "</table>"; 663 } 664 665 print '</div>'; 666 667 } 668 } 669 else 670 { 671 print "Error"; 672 } 673 } 674 675 $form = new Form($db); 676 677 if ( $user->rights->telephonie->adsl->commander && $ligne->statut == 1) 678 { 679 /** 680 * 681 */ 682 683 print '<table class="noborder" cellpadding="2" cellspacing="0" width="100%"><tr><td>'; 684 685 print '<form action="fiche.php?id='.$ligne->id.'&action=commandefourn" method="POST">'; 686 print '<table class="noborder" cellpadding="2" cellspacing="0">'; 687 print '<tr class="liste_titre"><td colspan="2">Commande chez le fournisseur</td><td>'; 688 print '<tr><td>Date de la commande</td><td>'; 689 print $form->select_date(); 690 print '</td>'; 691 print '<td colspan="2"><input type="submit" name="Commander"></td></tr>'; 692 print '<tr><td colspan="3">Commentaire <input size="30" type="text" name="commentaire"></td></tr>'; 693 print '</table>'; 694 695 print '</form></td><td>'; 696 697 print ' </td></tr></table>'; 698 } 699 700 if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 2) 701 { 702 /** 703 * 704 */ 705 706 print '<table class="noborder" cellpadding="2" cellspacing="0" width="100%"><tr><td>'; 707 708 print '<form action="fiche.php?id='.$ligne->id.'&action=activefourn" method="POST">'; 709 print '<table class="noborder" cellpadding="2" cellspacing="0">'; 710 print '<tr class="liste_titre"><td colspan="2">Activée chez le fournisseur</td><td>'; 711 print "<tr><td>Date de l'activation</td><td>"; 712 print $form->select_date(); 713 print '</td></tr>'; 714 715 print '<tr><td>Commentaire</td><td><input size="30" type="text" name="commentaire"></td></tr>'; 716 717 print '<tr><td>Adresse IP affectée</td><td><input size="30" type="text" name="ip"></td></tr>'; 718 print '<tr><td>Login</td><td><input size="30" type="text" name="login"></td></tr>'; 719 print '<tr><td>Password</td><td><input size="30" type="text" name="password"></td></tr>'; 720 721 print '<tr><td colspan="2"><input type="submit" name="Commander"></td></tr>'; 722 723 print '</table>'; 724 725 print '</form></td><td>'; 726 727 print ' </td></tr></table>'; 728 } 729 730 if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 3) 731 { 732 /** 733 * 734 */ 735 736 print '<table class="noborder" cellpadding="2" cellspacing="0" width="100%"><tr><td>'; 737 738 print '<form action="fiche.php?id='.$ligne->id.'&action=livraison" method="POST">'; 739 print '<table class="noborder" cellpadding="2" cellspacing="0">'; 740 print '<tr class="liste_titre"><td colspan="2">Livrée au client</td><td>'; 741 print "<tr><td>Date de la livraison client</td><td>"; 742 print $form->select_date(); 743 print '</td>'; 744 print '<td colspan="2"><input type="submit" name="Commander"></td></tr>'; 745 print '<tr><td colspan="3">Commentaire <input size="30" type="text" name="commentaire"></td></tr>'; 746 print '</table>'; 747 print '</form></td><td>'; 748 print ' </td></tr></table>'; 749 } 750 751 if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 4) 752 { 753 print '<table class="noborder" cellpadding="2" cellspacing="0" width="100%"><tr><td>'; 754 print '<form action="fiche.php?id='.$ligne->id.'&action=resilier" method="POST">'; 755 print '<table class="noborder" cellpadding="4" cellspacing="0">'; 756 print '<tr class="liste_titre"><td colspan="2">A résilier</td><td>'; 757 print '<tr class="pair"><td>Date de résiliation demandée</td><td>'; 758 print $form->select_date(); 759 print '</td></tr>'; 760 print '<tr class="pair"><td>Commentaire</td><td><input size="30" type="text" name="commentaire"></td></tr>'; 761 print '<tr class="pair"><td colspan="2" align="center"><input type="submit" name="Commander"></td></tr>'; 762 print '</table></form></td><td>'; 763 print ' </td></tr></table>'; 764 } 765 766 if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 5) 767 { 768 print '<table class="noborder" cellpadding="2" cellspacing="0" width="100%"><tr><td>'; 769 print '<form action="fiche.php?id='.$ligne->id.'&action=resilierfourn" method="POST">'; 770 print '<table class="noborder" cellpadding="4" cellspacing="0">'; 771 print '<tr class="liste_titre"><td colspan="2">Demande de résiliatin fournisseur</td><td>'; 772 print '<tr class="pair"><td>Date de la demande de résiliation</td><td>'; 773 print $form->select_date(); 774 print '</td></tr>'; 775 print '<tr class="pair"><td>Commentaire</td><td><input size="30" type="text" name="commentaire"></td></tr>'; 776 print '<tr class="pair"><td colspan="2" align="center"><input type="submit" name="Commander"></td></tr>'; 777 print '</table></form></td><td>'; 778 print ' </td></tr></table>'; 779 } 780 781 if ( $user->rights->telephonie->adsl->gerer && $ligne->statut == 6) 782 { 783 print '<table class="noborder" cellpadding="2" cellspacing="0" width="100%"><tr><td>'; 784 print '<form action="fiche.php?id='.$ligne->id.'&action=acquitresilierfourn" method="POST">'; 785 print '<table class="noborder" cellpadding="4" cellspacing="0">'; 786 print '<tr class="liste_titre"><td colspan="2">Confirmation de résiliatin fournisseur</td><td>'; 787 print '<tr class="pair"><td>Date de la confirmation de résiliation</td><td>'; 788 print $form->select_date(); 789 print '</td></tr>'; 790 print '<tr class="pair"><td>Commentaire</td><td><input size="30" type="text" name="commentaire"></td></tr>'; 791 print '<tr class="pair"><td colspan="2" align="center"><input type="submit" name="Commander"></td></tr>'; 792 print '</table></form></td><td>'; 793 print ' </td></tr></table>'; 794 } 795 796 /* ************************************************************************** */ 797 /* */ 798 /* Barre d'action */ 799 /* */ 800 /* ************************************************************************** */ 801 802 print "\n<br>\n<div class=\"tabsAction\">\n"; 803 804 if ($_GET["action"] == '') 805 { 806 807 if ( $user->rights->telephonie->adsl->requete && $ligne->statut == -1) 808 { 809 print "<a class=\"tabAction\" href=\"fiche.php?action=ordertech&id=$ligne->id\">".$langs->trans("Commander")."</a>"; 810 } 811 812 if ( $user->rights->telephonie->adsl->requete && $ligne->statut == 1) 813 { 814 print "<a class=\"tabAction\" href=\"fiche.php?action=cancelordertech&id=$ligne->id\">".$langs->trans("Annuler la commande")."</a>"; 815 816 } 817 818 if ( $user->rights->telephonie->adsl->requete && $ligne->statut == 5) 819 { 820 print "<a class=\"tabAction\" href=\"fiche.php?action=annuleresilier&id=$ligne->id\">".$langs->trans("Annuler la demande de résiliation")."</a>"; 821 822 } 823 824 if ( $user->rights->telephonie->adsl->creer && $ligne->statut == -1) 825 { 826 print "<a class=\"tabAction\" href=\"fiche.php?action=delete&id=$ligne->id\">".$langs->trans("Delete")."</a>"; 827 828 } 829 } 830 831 print "</div>"; 832 833 834 835 $db->close(); 836 837 llxFooter("<em>Dernière modification $Date: 2005/08/19 14:15:36 $ révision $Revision: 1.3 $</em>"); 838 ?>
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 |
|