From fafa7f18b1f6f0050a3605480f546daa2d24741c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 15 Sep 2018 22:24:57 +0200 Subject: [PATCH] reduce complexity libstatut fournisseur.commande;class.php --- .../class/fournisseur.commande.class.php | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 0ef569f3304..dae79f4426e 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -650,46 +650,46 @@ class CommandeFournisseur extends CommonOrder { return $langs->trans($this->statuts[$statut]); } - if ($mode == 1) + elseif ($mode == 1) { return $langs->trans($this->statutshort[$statut]); } - if ($mode == 2) + elseif ($mode == 2) { return $langs->trans($this->statuts[$statut]); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut0'); - if ($statut==1) return img_picto($langs->trans($this->statuts[$statut]),'statut1'); - if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut3'); - if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut3'); - if ($statut==4) return img_picto($langs->trans($this->statuts[$statut]),'statut3'); - if ($statut==5) return img_picto($langs->trans($this->statuts[$statut]),'statut6'); - if ($statut==6 || $statut==7) return img_picto($langs->trans($this->statuts[$statut]),'statut5'); - if ($statut==9) return img_picto($langs->trans($this->statuts[$statut]),'statut5'); + elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]),'statut1'); + elseif ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut3'); + elseif ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut3'); + elseif ($statut==4) return img_picto($langs->trans($this->statuts[$statut]),'statut3'); + elseif ($statut==5) return img_picto($langs->trans($this->statuts[$statut]),'statut6'); + elseif ($statut==6 || $statut==7) return img_picto($langs->trans($this->statuts[$statut]),'statut5'); + elseif ($statut==9) return img_picto($langs->trans($this->statuts[$statut]),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); - if ($statut==1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); - if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); - if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); - if ($statut==4) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); - if ($statut==5) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); - if ($statut==6 || $statut==7) return img_picto($langs->trans($this->statuts[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); - if ($statut==9) return img_picto($langs->trans($this->statuts[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); + elseif ($statut==1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); + elseif ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); + elseif ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); + elseif ($statut==4) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); + elseif ($statut==5) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); + elseif ($statut==6 || $statut==7) return img_picto($langs->trans($this->statuts[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); + elseif ($statut==9) return img_picto($langs->trans($this->statuts[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]).($billedtext?' - '.$billedtext:''); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut==0) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut0'); - if ($statut==1) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1'); - if ($statut==2) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut3'); - if ($statut==3) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut3'); - if ($statut==4) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut3'); - if ($statut==5) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut6'); - if ($statut==6 || $statut==7) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut5'); - if ($statut==9) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut5'); + elseif ($statut==1) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1'); + elseif ($statut==2) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut3'); + elseif ($statut==3) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut3'); + elseif ($statut==4) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut3'); + elseif ($statut==5) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut6'); + elseif ($statut==6 || $statut==7) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut5'); + elseif ($statut==9) return ''.$langs->trans($this->statutshort[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut5'); } }