Fix lang not defined
This commit is contained in:
parent
e885345ef7
commit
b3feb6b095
@ -1894,6 +1894,7 @@ class Contrat extends CommonObject
|
||||
public function LibStatut($status, $mode)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort))
|
||||
{
|
||||
|
||||
@ -1849,6 +1849,8 @@ class Task extends CommonObject
|
||||
public function LibStatut($status, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
// list of Statut of the task
|
||||
$this->statuts[0]='Draft';
|
||||
$this->statuts[1]='ToDo';
|
||||
@ -1861,8 +1863,6 @@ class Task extends CommonObject
|
||||
$this->statuts_short[3]='Completed';
|
||||
$this->statuts_short[4]='Transfered';
|
||||
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
return $langs->trans($this->statuts[$status]);
|
||||
|
||||
@ -633,39 +633,22 @@ class Hook extends CommonObject
|
||||
public function LibStatut($status, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (empty($this->labelStatus)) {
|
||||
global $langs;
|
||||
//$langs->load("zapier@zapier");
|
||||
$this->labelStatus[1] = $langs->trans('Enabled');
|
||||
$this->labelStatus[0] = $langs->trans('Disabled');
|
||||
}
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0) {
|
||||
return $this->labelStatus[$status];
|
||||
} elseif ($mode == 1) {
|
||||
return $this->labelStatus[$status];
|
||||
} elseif ($mode == 2) {
|
||||
if ($status == 1) {
|
||||
return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status];
|
||||
} elseif ($status == 0) {
|
||||
return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status];
|
||||
}
|
||||
} elseif ($mode == 3) {
|
||||
if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
} elseif ($mode == 4) {
|
||||
if ($status == 1) return img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status];
|
||||
elseif ($status == 0) return img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle').' '.$this->labelStatus[$status];
|
||||
} elseif ($mode == 5) {
|
||||
if ($status == 1) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
elseif ($status == 0) return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
} elseif ($mode == 6) {
|
||||
if ($status == 1) {
|
||||
return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut4', '', false, 0, 0, '', 'valignmiddle');
|
||||
} elseif ($status == 0) {
|
||||
return $this->labelStatus[$status].' '.img_picto($this->labelStatus[$status], 'statut5', '', false, 0, 0, '', 'valignmiddle');
|
||||
}
|
||||
}
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort))
|
||||
{
|
||||
global $langs;
|
||||
//$langs->load("mymodule");
|
||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Disabled');
|
||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled');
|
||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Disabled');
|
||||
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled');
|
||||
}
|
||||
|
||||
$statusType = 'status5';
|
||||
if ($status == self::STATUS_VALIDATED) $statusType = 'status4';
|
||||
|
||||
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user