Uniformisation du code des commandes fournisseurs.

Affichage du picto sur le statut
This commit is contained in:
Laurent Destailleur 2006-05-06 16:02:18 +00:00
parent 8fb8f068bd
commit 7f829e3760
3 changed files with 21 additions and 6 deletions

View File

@ -1,6 +1,6 @@
<?PHP
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -76,7 +76,7 @@ if ($resql)
print "<tr $bc[$var]>";
print '<td>'.$commande->statuts[$row[1]].'</td>';
print '<td align="center">'.$row[0].'</td>';
print '<td align="center"><a href="liste.php?statut='.$row[1].'"><img src="statut'.$row[1].'.png" border="0" alt="Statut"></a></td>';
print '<td align="center"><a href="liste.php?statut='.$row[1].'">'.$commande->LibStatut($row[1],3).'</a></td>';
print "</tr>\n";
$i++;

View File

@ -1,6 +1,6 @@
<?PHP
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -52,8 +52,14 @@ if ($socid > 0)
$title .= ' (<a href="liste.php">'.$fourn->nom.'</a>)';
}
/*
* Affichage
*/
llxHeader('',$title);
$commandestatic=new Commande($db);
if ($sortorder == "") $sortorder="DESC";
if ($sortfield == "") $sortfield="cf.date_creation";
@ -95,6 +101,7 @@ $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
@ -106,7 +113,8 @@ if ($resql)
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"cf.ref");
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom");
print_liste_field_titre($langs->trans("OrderDate"),$_SERVER["PHP_SELF"],"dc","","",'align="center"');
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cf.fk_statut","","",'align="center"');
// print_liste_field_titre($langs->trans("OrderDateApproved"),$_SERVER["PHP_SELF"],"dc","","",'align="center"');
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cf.fk_statut","","",'align="right"');
print "</tr>\n";
print '<tr class="liste_titre">';
@ -148,7 +156,7 @@ if ($resql)
print '</td>';
// Statut
print '<td align="center"><img src="statut'.$obj->fk_statut.'.png"></td>';
print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,5).'</td>';
print "</tr>\n";
$i++;

View File

@ -310,7 +310,14 @@ class CommandeFournisseur extends Commande
}
if ($mode == 3)
{
return $this->statuts[$statut];
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0');
if ($statut==1) return img_picto($langs->trans('StatusOrderValidated'),'statut1');
if ($statut==2) return img_picto($langs->trans('StatusOrderApproved'),'statut3');
if ($statut==3) return img_picto($langs->trans('StatusOrderOnProcess'),'statut3');
if ($statut==4) return img_picto($langs->trans('StatusOrderReceivedPartially'),'statut3');
if ($statut==5) return img_picto($langs->trans('StatusOrderProcessed'),'statut6');
if ($statut==6) return img_picto($langs->trans('StatusOrderCanceled'),'statut5');
if ($statut==9) return img_picto($langs->trans('StatusOrderRefused'),'statut5');
}
if ($mode == 4)
{