From 7f829e376070a7ab1f80e0f7987f7caddca043ca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 6 May 2006 16:02:18 +0000 Subject: [PATCH] Uniformisation du code des commandes fournisseurs. Affichage du picto sur le statut --- htdocs/fourn/commande/index.php | 4 ++-- htdocs/fourn/commande/liste.php | 14 +++++++++++--- htdocs/fourn/fournisseur.commande.class.php | 9 ++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 6e86b4cd7d2..1b01bb725ac 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 Laurent Destailleur * * 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 ""; print ''.$commande->statuts[$row[1]].''; print ''.$row[0].''; - print 'Statut'; + print ''.$commande->LibStatut($row[1],3).''; print "\n"; $i++; diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index bfb810cafb4..3008cb04e16 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 Laurent Destailleur * * 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 .= ' ('.$fourn->nom.')'; } +/* + * 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 "\n"; print ''; @@ -148,7 +156,7 @@ if ($resql) print ''; // Statut - print ''; + print ''.$commandestatic->LibStatut($obj->fk_statut,5).''; print "\n"; $i++; diff --git a/htdocs/fourn/fournisseur.commande.class.php b/htdocs/fourn/fournisseur.commande.class.php index 99422628266..9a2b3b6bf3c 100644 --- a/htdocs/fourn/fournisseur.commande.class.php +++ b/htdocs/fourn/fournisseur.commande.class.php @@ -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) {