From a2ae8d4821c546f0d957669ba51b08e726b2c142 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 May 2006 20:34:25 +0000 Subject: [PATCH] Look: Ajout picto statut sur fiches interventions --- htdocs/fichinter/fiche.php | 2 +- htdocs/fichinter/fichinter.class.php | 37 +++++++++++++++++++++++++--- htdocs/fichinter/index.php | 8 +++--- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index c73c1de8ba5..8375f7ff1ae 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -318,7 +318,7 @@ if ($_GET["id"] && $_GET["action"] != 'edit') $fichinter->fetch_projet(); print ''.$langs->trans("Project").''.$fichinter->projet.''; } - print ''.$langs->trans("Status").''.$fichinter->getLibStatut().''; + print ''.$langs->trans("Status").''.$fichinter->getLibStatut(4).''; print ''.$langs->trans("Description").''; print ''; diff --git a/htdocs/fichinter/fichinter.class.php b/htdocs/fichinter/fichinter.class.php index dfc27d05bfa..5faa3aab440 100644 --- a/htdocs/fichinter/fichinter.class.php +++ b/htdocs/fichinter/fichinter.class.php @@ -62,6 +62,8 @@ class Fichinter // Statut 0=brouillon, 1=validé $this->statuts[0]=$langs->trans("Draft"); $this->statuts[1]=$langs->trans("Validated"); + $this->statuts_short[0]=$langs->trans("Draft"); + $this->statuts_short[1]=$langs->trans("Validated"); } @@ -294,9 +296,9 @@ class Fichinter * \brief Retourne le libellé du statut de l'intervantion * \return string Libellé */ - function getLibStatut() + function getLibStatut($mode=0) { - return $this->LibStatut($this->statut); + return $this->LibStatut($this->statut,$mode); } /** @@ -304,9 +306,36 @@ class Fichinter * \param statut id statut * \return string Libellé */ - function LibStatut($statut) + function LibStatut($statut,$mode=0) { - return $this->statuts[$statut]; + if ($mode == 0) + { + return $this->statuts[$statut]; + } + if ($mode == 1) + { + return $this->statuts_short[$statut]; + } + if ($mode == 2) + { + if ($statut==0) return img_picto($this->statuts_short[$statut],'statut0').' '.$this->statuts_short[$statut]; + if ($statut==1) return img_picto($this->statuts_short[$statut],'statut1').' '.$this->statuts_short[$statut]; + } + if ($mode == 3) + { + if ($statut==0) return img_picto($this->statuts_short[$statut],'statut0'); + if ($statut==1) return img_picto($this->statuts_short[$statut],'statut1'); + } + if ($mode == 4) + { + if ($statut==0) return img_picto($this->statuts_short[$statut],'statut0').' '.$this->statuts[$statut]; + if ($statut==1) return img_picto($this->statuts_short[$statut],'statut1').' '.$this->statuts[$statut]; + } + if ($mode == 5) + { + if ($statut==0) return $this->statuts_short[$statut].' '.img_picto($this->statuts_short[$statut],'statut0'); + if ($statut==1) return $this->statuts_short[$statut].' '.img_picto($this->statuts_short[$statut],'statut1'); + } } } ?> \ No newline at end of file diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 6be3b0df43e..8f0001c5a03 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/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 @@ -65,7 +65,7 @@ if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.idp = s if ($socid > 0) { - $sql .= " AND s.idp = " . $socid; + $sql .= " AND s.idp = " . $socid; } $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit + 1 ,$offset); @@ -86,7 +86,7 @@ if ($result) print ''.$langs->trans("Description").''; print_liste_field_titre($langs->trans("Date"),"index.php","f.datei","","&socid=$socid",'align="center"',$sortfield); print ''.$langs->trans("Duration").''; - print ''.$langs->trans("Status").''; + print ''.$langs->trans("Status").''; print "\n"; $var=True; $total = 0; @@ -100,7 +100,7 @@ if ($result) print ''.nl2br($objp->note).''; print ''.dolibarr_print_date($objp->dp)."\n"; print ''.price($objp->duree).''; - print ''.$fichinter_static->LibStatut($objp->fk_statut).''; + print ''.$fichinter_static->LibStatut($objp->fk_statut,5).''; print "\n"; $total += $objp->duree;