From 83d3ee45ee16ee4fa39cde5819f3b6d7c2875a58 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 14 Dec 2014 14:44:28 +0100 Subject: [PATCH] Update fichinter.class.php simplify the libstatut management and allow enhancing mode --- htdocs/fichinter/class/fichinter.class.php | 37 ++++++++-------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index bc12821530f..ccec1075ca8 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -79,6 +79,9 @@ class Fichinter extends CommonObject $this->statuts_short[0]='Draft'; $this->statuts_short[1]='Validated'; $this->statuts_short[2]='StatusInterInvoiced'; + $this->statuts_logo[0]='statut0'; + $this->statuts_logo[1]='statut4'; + $this->statuts_logo[2]='statut6'; } @@ -508,37 +511,23 @@ class Fichinter extends CommonObject global $langs; if ($mode == 0) - { return $langs->trans($this->statuts[$statut]); - } + if ($mode == 1) - { return $langs->trans($this->statuts_short[$statut]); - } + if ($mode == 2) - { - if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); - } + return img_picto($langs->trans($this->statuts_short[$statut]), $this->statuts_logo[$statut]).' '.$langs->trans($this->statuts_short[$statut]); + if ($mode == 3) - { - if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); - if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - } + return img_picto($langs->trans($this->statuts_short[$statut]), $this->statuts_logo[$statut]); + if ($mode == 4) - { - if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); - if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); - } + return img_picto($langs->trans($this->statuts_short[$statut]),$this->statuts_logo[$statut]).' '.$langs->trans($this->statuts[$statut]); + if ($mode == 5) - { - if ($statut==0) return ''.$langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); - if ($statut==1) return ''.$langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); - if ($statut==2) return ''.$langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - } + return ''.$langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),$this->statuts_logo[$statut]); + } /**