Skip to content

Commit

Permalink
Fix project libStatus to use new dolGetStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
atm-john committed Oct 3, 2019
1 parent aa484d4 commit edc4dc3
Showing 1 changed file with 16 additions and 37 deletions.
53 changes: 16 additions & 37 deletions htdocs/projet/class/project.class.php
Expand Up @@ -942,48 +942,27 @@ public function getLibStatut($mode = 0)
/**
* Renvoi status label for a status
*
* @param int $statut id statut
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @param int $status id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label
*/
public function LibStatut($statut, $mode = 0)
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;

if ($mode == 0) {
return $langs->trans($this->statuts_long[$statut]);
} elseif ($mode == 1) {
return $langs->trans($this->statuts_short[$statut]);
} elseif ($mode == 2) {
if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_short[$statut]);
elseif ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_short[$statut]);
} elseif ($mode == 3) {
if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0');
elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4');
elseif ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6');
} elseif ($mode == 4) {
if ($statut == 0)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_long[$statut]);
elseif ($statut == 1)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_long[$statut]);
if ($statut == 2)
return img_picto($langs->trans($this->statuts_long[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_long[$statut]);
} elseif ($mode == 5) {
if ($statut == 0)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut0');
elseif ($statut == 1)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut4');
elseif ($statut == 2)
return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_long[$statut]), 'statut6');

$statustrans = array(
0 => 'status0',
1 => 'status4',
2 => 'status6',
);

$statusClass = 'status0';
if(!empty($statustrans[$status])){
$statusClass = $statustrans[$status];
}

return dolGetStatus($this->statuts_long[$status], $this->statuts_short[$status], '', $statusClass, $mode);

}

/**
Expand Down

0 comments on commit edc4dc3

Please sign in to comment.