Refactored Account::LibStatut function
This commit is contained in:
parent
4f569279d6
commit
08d27b7148
@ -939,46 +939,32 @@ class Account extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Libelle du statut
|
* @return string Libelle du statut
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut,$mode=0)
|
public function LibStatut($statut, $mode = 0)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load('banks');
|
$langs->load('banks');
|
||||||
|
|
||||||
if ($statut == self::STATUS_OPEN) {
|
if ($statut == self::STATUS_OPEN) {
|
||||||
$label = $langs->trans("StatusAccountOpened");
|
$label = $langs->trans("StatusAccountOpened");
|
||||||
} else {
|
$picto = img_picto($label, 'statut4');
|
||||||
$label = $langs->trans("StatusAccountClosed");
|
} else {
|
||||||
}
|
$label = $langs->trans("StatusAccountClosed");
|
||||||
|
$picto = img_picto($label, 'statut5');
|
||||||
|
}
|
||||||
|
|
||||||
if ($mode == 2) {
|
if ($mode == 2) {
|
||||||
if ($statut == self::STATUS_OPEN) {
|
return $picto.' '.$label;
|
||||||
return img_picto($label, 'statut4').' '.$label;
|
} elseif ($mode == 3) {
|
||||||
} elseif ($statut == self::STATUS_CLOSED) {
|
return $picto;
|
||||||
return img_picto($label, 'statut5').' '.$label;
|
} elseif ($mode == 4) {
|
||||||
}
|
return $picto.' '.$label;
|
||||||
} elseif ($mode == 3) {
|
} elseif ($mode == 5) {
|
||||||
if ($statut == self::STATUS_OPEN) {
|
return $label.' '.$picto;
|
||||||
return img_picto($label, 'statut4');
|
}
|
||||||
} elseif ($statut == self::STATUS_CLOSED) {
|
|
||||||
return img_picto($label, 'statut5');
|
|
||||||
}
|
|
||||||
} elseif ($mode == 4) {
|
|
||||||
if ($statut == self::STATUS_OPEN) {
|
|
||||||
return img_picto($label, 'statut4').' '.$label;
|
|
||||||
} elseif ($statut == self::STATUS_CLOSED) {
|
|
||||||
return img_picto($label, 'statut5').' '.$label;
|
|
||||||
}
|
|
||||||
} elseif ($mode == 5) {
|
|
||||||
if ($statut == self::STATUS_OPEN) {
|
|
||||||
return $label.' '.img_picto($label, 'statut4');
|
|
||||||
} elseif ($statut == self::STATUS_CLOSED) {
|
|
||||||
return $label.' '.img_picto($label, 'statut5');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//There is no short mode for this label
|
//There is no short mode for this label
|
||||||
return $label;
|
return $label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user