From 1a028f4691354c52f345187ce7928c2ba19cc12d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Jul 2005 21:40:28 +0000 Subject: [PATCH] On affiche le statut court des factures sur les listes de factures. --- htdocs/facture.class.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 7d2b11770a8..770c2d3c43c 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -1191,24 +1191,29 @@ class Facture } /** - * \brief Renvoi le libellé long d'un statut donn - * \param paye etat paye - * \param statut id statut - * \return string Libellé long du statut - */ - function LibStatut($paye,$statut) + * \brief Renvoi le libellé d'un statut donn + * \param paye Etat paye + * \param statut Id statut + * \param mode 0=libellé long, 1=libellé court + * \return string Libellé du statut + */ + function LibStatut($paye,$statut,$mode=0) { global $langs; $langs->load("bills"); + + $prefix=""; + if ($mode == 1) $prefix="Short"; + if (! $paye) { - if ($statut == 0) return $langs->trans("BillStatusDraft"); - if ($statut == 3) return $langs->trans("BillStatusCanceled"); - return $langs->trans("BillStatusValidated"); + if ($statut == 0) return $langs->trans("Bill${prefix}StatusDraft"); + if ($statut == 3) return $langs->trans("Bill${prefix}StatusCanceled"); + return $langs->trans("Bill${prefix}StatusValidated"); } else { - return $langs->trans("BillStatusPayed"); + return $langs->trans("Bill${prefix}StatusPayed"); } }