Fixed & refactored status label

This commit is contained in:
William Mead 2024-11-16 23:34:10 +01:00
parent ee1b3df3f1
commit 4cab9e8a62
3 changed files with 11 additions and 9 deletions

View file

@ -701,6 +701,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
$taskstatic->duration_effective = $lines[$i]->duration_effective;
$taskstatic->budget_amount = $lines[$i]->budget_amount;
$taskstatic->billable = $lines[$i]->billable;
$taskstatic->status = $lines[$i]->status;
$taskstatic->fk_statut = $lines[$i]->fk_statut;
// Action column
@ -957,7 +958,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
// Status
if (count($arrayfields) > 0 && !empty($arrayfields['t.fk_statut']['checked'])) {
print '<td class="center">';
print $taskstatic->getLibStatut(5);
print $taskstatic->getLibStatut(4);
print '</td>';
}

View file

@ -2498,12 +2498,12 @@ class Task extends CommonObjectLine
$this->labelStatus[0] = 'Draft';
$this->labelStatus[1] = 'ToDo';
$this->labelStatus[2] = 'Running';
$this->labelStatus[3] = 'Finish';
$this->labelStatus[3] = 'Closed';
$this->labelStatus[4] = 'Transfered';
$this->labelStatusShort[0] = 'Draft';
$this->labelStatusShort[1] = 'ToDo';
$this->labelStatusShort[2] = 'Running';
$this->labelStatusShort[3] = 'Completed';
$this->labelStatusShort[3] = 'Closed';
$this->labelStatusShort[4] = 'Transfered';
if ($mode == 0) {
@ -2540,17 +2540,17 @@ class Task extends CommonObjectLine
}
} elseif ($mode == 4) {
if ($status == 0) {
return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut0').' '.$langs->trans($this->labelStatus[$status]);
return dolGetStatus($langs->trans($this->labelStatus[$status]), $langs->trans($this->labelStatusShort[$status]), '', 'status0', $mode);
} elseif ($status == 1) {
return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut1').' '.$langs->trans($this->labelStatus[$status]);
return dolGetStatus($langs->trans($this->labelStatus[$status]), $langs->trans($this->labelStatusShort[$status]), '', 'status1', $mode);
} elseif ($status == 2) {
return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut3').' '.$langs->trans($this->labelStatus[$status]);
return dolGetStatus($langs->trans($this->labelStatus[$status]), $langs->trans($this->labelStatusShort[$status]), '', 'status2', $mode);
} elseif ($status == 3) {
return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut6').' '.$langs->trans($this->labelStatus[$status]);
return dolGetStatus($langs->trans($this->labelStatus[$status]), $langs->trans($this->labelStatusShort[$status]), '', 'status3', $mode);
} elseif ($status == 4) {
return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut6').' '.$langs->trans($this->labelStatus[$status]);
return dolGetStatus($langs->trans($this->labelStatus[$status]), $langs->trans($this->labelStatusShort[$status]), '', 'status4', $mode);
} elseif ($status == 5) {
return img_picto($langs->trans($this->labelStatusShort[$status]), 'statut5').' '.$langs->trans($this->labelStatus[$status]);
return dolGetStatus($langs->trans($this->labelStatus[$status]), $langs->trans($this->labelStatusShort[$status]), '', 'status5', $mode);
}
} elseif ($mode == 5) {
/*if ($status==0) return $langs->trans($this->labelStatusShort[$status]).' '.img_picto($langs->trans($this->labelStatusShort[$status]),'statut0');

View file

@ -1091,6 +1091,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object-
}
if (!empty($arrayfields['t.fk_statut']['checked'])) {
print '<td class="liste_titre center">';
//TODO: add status filter
print '</td>';
}