[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * $Id: history.php,v 1.13 2005/10/14 21:51:44 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/fourn/commande/history.php,v $ 21 */ 22 23 /** 24 \file htdocs/fourn/commande/history.php 25 \ingroup commande 26 \brief Fiche commande 27 \version $Revision: 1.13 $ 28 */ 29 30 require ("./pre.inc.php"); 31 32 $langs->load("orders"); 33 $langs->load("suppliers"); 34 $langs->load("companies"); 35 36 $user->getrights('fournisseur'); 37 38 if (!$user->rights->fournisseur->commande->lire) accessforbidden(); 39 40 41 /* *************************************************************************** */ 42 /* */ 43 /* Mode vue */ 44 /* */ 45 /* *************************************************************************** */ 46 47 if ($_GET["id"] > 0) 48 { 49 $soc = new Societe($db); 50 $commande = new CommandeFournisseur($db); 51 52 if ( $commande->fetch($_GET["id"]) == 0) 53 { 54 $soc->fetch($commande->soc_id); 55 56 $addons[0][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id; 57 $addons[0][1] = $soc->nom; 58 59 llxHeader('',$langs->trans("History"),"CommandeFournisseur",$addons); 60 61 $author = new User($db); 62 $author->id = $commande->user_author_id; 63 $author->fetch(); 64 65 $h = 0; 66 $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/fiche.php?id='.$commande->id; 67 $head[$h][1] = $langs->trans("OrderCard"); 68 $h++; 69 70 $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/note.php?id='.$commande->id; 71 $head[$h][1] = $langs->trans("Note"); 72 $h++; 73 74 $head[$h][0] = DOL_URL_ROOT.'/fourn/commande/history.php?id='.$commande->id; 75 $head[$h][1] = $langs->trans("OrderFollow"); 76 $a = $h; 77 78 $h++; 79 80 $title=$langs->trans("Order").": $commande->ref"; 81 dolibarr_fiche_head($head, $a, $title); 82 83 84 /* 85 * Commande 86 */ 87 88 print '<table class="border" width="100%">'; 89 print '<tr><td width="20%">'.$langs->trans("Supplier")."</td>"; 90 print '<td colspan="3">'; 91 print '<b><a href="'.DOL_URL_ROOT.'/fourn/fiche.php?socid='.$soc->id.'">'.img_object($langs->trans("ShowSupplier"),'company').' '.$soc->nom.'</a></b></td>'; 92 print '</tr>'; 93 94 print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'; 95 print '<img src="statut'.$commande->statut.'.png"> '; 96 print $commande->statuts[$commande->statut]; 97 print "</td></tr>"; 98 99 if ($commande->methode_commande_id > 0) 100 { 101 print '<tr><td>'.$langs->trans("Date").'</td>'; 102 print '<td colspan="2">'.dolibarr_print_date($commande->date_commande,"%A %d %B %Y")."</td>\n"; 103 print '<td width="50%"> '; 104 print "</td></tr>"; 105 } 106 107 print "</table>\n"; 108 print "<br>"; 109 110 /* 111 * Suivi historique 112 * Date - Statut - Auteur 113 */ 114 print '<table class="noborder" width="100%">'; 115 116 print '<tr class="liste_titre"><td>'.$langs->trans("Date").'</td>'; 117 print '<td>'.$langs->trans("Status").'</td><td>'.$langs->trans("Author").'</td>'; 118 print '</tr>'; 119 120 $sql = "SELECT l.fk_statut, ".$db->pdate("l.datelog") ."as dl, u.rowid, u.code, u.firstname, u.name"; 121 $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_log as l "; 122 $sql .= " , ".MAIN_DB_PREFIX."user as u "; 123 $sql .= " WHERE l.fk_commande = ".$commande->id." AND u.rowid = l.fk_user"; 124 $sql .= " ORDER BY l.rowid DESC"; 125 126 $resql = $db->query($sql); 127 if ($resql) 128 { 129 $num = $db->num_rows($resql); 130 $i = 0; 131 132 $var=True; 133 while ($i < $num) 134 { 135 $var=!$var; 136 137 $obj = $db->fetch_object($resql); 138 print "<tr $bc[$var]>"; 139 140 print '<td width="20%">'.dolibarr_print_date($obj->dl,"%a %d %b %Y %H:%M:%S")."</td>\n"; 141 142 print '<td width="100px"><img src="statut'.$obj->fk_statut.'.png"> '; 143 144 print $commande->statuts[$obj->fk_statut]."</td>\n"; 145 146 print '<td><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->rowid.'">'; 147 print img_object($langs->trans("ShowUser"),'user').' '.$obj->code.'</td>'; 148 print '</tr>'; 149 150 $i++; 151 } 152 $db->free($resql); 153 } 154 else 155 { 156 dolibarr_print_error($db); 157 } 158 print "</table>"; 159 160 print '</div>'; 161 } 162 else 163 { 164 /* Commande non trouvée */ 165 print "Commande inexistante ou accés refusé"; 166 } 167 } 168 169 $db->close(); 170 171 llxFooter('$Date: 2005/10/14 21:51:44 $ - $Revision: 1.13 $'); 172 ?>
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 |
![]() |