Fix: optimize code
This commit is contained in:
parent
ea94610492
commit
832b78911c
@ -627,51 +627,51 @@ class ActionComm extends CommonObject
|
|||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
{
|
{
|
||||||
if ($percent==-1 && ! $hidenastatus) return $langs->trans('StatusNotApplicable');
|
if ($percent==-1 && ! $hidenastatus) return $langs->trans('StatusNotApplicable');
|
||||||
if ($percent==0) return $langs->trans('StatusActionToDo').' (0%)';
|
else if ($percent==0) return $langs->trans('StatusActionToDo').' (0%)';
|
||||||
if ($percent > 0 && $percent < 100) return $langs->trans('StatusActionInProcess').' ('.$percent.'%)';
|
else if ($percent > 0 && $percent < 100) return $langs->trans('StatusActionInProcess').' ('.$percent.'%)';
|
||||||
if ($percent >= 100) return $langs->trans('StatusActionDone').' (100%)';
|
else if ($percent >= 100) return $langs->trans('StatusActionDone').' (100%)';
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
else if ($mode == 1)
|
||||||
{
|
{
|
||||||
if ($percent==-1 && ! $hidenastatus) return $langs->trans('StatusNotApplicable');
|
if ($percent==-1 && ! $hidenastatus) return $langs->trans('StatusNotApplicable');
|
||||||
if ($percent==0) return $langs->trans('StatusActionToDo');
|
else if ($percent==0) return $langs->trans('StatusActionToDo');
|
||||||
if ($percent > 0 && $percent < 100) return $percent.'%';
|
else if ($percent > 0 && $percent < 100) return $percent.'%';
|
||||||
if ($percent >= 100) return $langs->trans('StatusActionDone');
|
else if ($percent >= 100) return $langs->trans('StatusActionDone');
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
else if ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9').' '.$langs->trans('StatusNotApplicable');
|
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9').' '.$langs->trans('StatusNotApplicable');
|
||||||
if ($percent==0) return img_picto($langs->trans('StatusActionToDo'),'statut1').' '.$langs->trans('StatusActionToDo');
|
else if ($percent==0) return img_picto($langs->trans('StatusActionToDo'),'statut1').' '.$langs->trans('StatusActionToDo');
|
||||||
if ($percent > 0 && $percent < 100) return img_picto($langs->trans('StatusActionInProcess'),'statut3').' '. $percent.'%';
|
else if ($percent > 0 && $percent < 100) return img_picto($langs->trans('StatusActionInProcess'),'statut3').' '. $percent.'%';
|
||||||
if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6').' '.$langs->trans('StatusActionDone');
|
else if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6').' '.$langs->trans('StatusActionDone');
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
else if ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans("Status").': '.$langs->trans('StatusNotApplicable'),'statut9');
|
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans("Status").': '.$langs->trans('StatusNotApplicable'),'statut9');
|
||||||
if ($percent==0) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionToDo').' (0%)','statut1');
|
else if ($percent==0) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionToDo').' (0%)','statut1');
|
||||||
if ($percent > 0 && $percent < 100) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionInProcess').' ('.$percent.'%)','statut3');
|
else if ($percent > 0 && $percent < 100) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionInProcess').' ('.$percent.'%)','statut3');
|
||||||
if ($percent >= 100) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionDone').' (100%)','statut6');
|
else if ($percent >= 100) return img_picto($langs->trans("Status").': '.$langs->trans('StatusActionDone').' (100%)','statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
else if ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9').' '.$langs->trans('StatusNotApplicable');
|
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9').' '.$langs->trans('StatusNotApplicable');
|
||||||
if ($percent==0) return img_picto($langs->trans('StatusActionToDo'),'statut1').' '.$langs->trans('StatusActionToDo').' (0%)';
|
else if ($percent==0) return img_picto($langs->trans('StatusActionToDo'),'statut1').' '.$langs->trans('StatusActionToDo').' (0%)';
|
||||||
if ($percent > 0 && $percent < 100) return img_picto($langs->trans('StatusActionInProcess'),'statut3').' '.$langs->trans('StatusActionInProcess').' ('.$percent.'%)';;
|
else if ($percent > 0 && $percent < 100) return img_picto($langs->trans('StatusActionInProcess'),'statut3').' '.$langs->trans('StatusActionInProcess').' ('.$percent.'%)';
|
||||||
if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6').' '.$langs->trans('StatusActionDone').' (100%)';
|
else if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6').' '.$langs->trans('StatusActionDone').' (100%)';
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
else if ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9');
|
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9');
|
||||||
if ($percent==0) return '0% '.img_picto($langs->trans('StatusActionToDo'),'statut1');
|
else if ($percent==0) return '0% '.img_picto($langs->trans('StatusActionToDo'),'statut1');
|
||||||
if ($percent > 0 && $percent < 100) return $percent.'% '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3');
|
else if ($percent > 0 && $percent < 100) return $percent.'% '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3');
|
||||||
if ($percent >= 100) return $langs->trans('StatusActionDone').' '.img_picto($langs->trans('StatusActionDone'),'statut6');
|
else if ($percent >= 100) return $langs->trans('StatusActionDone').' '.img_picto($langs->trans('StatusActionDone'),'statut6');
|
||||||
}
|
}
|
||||||
if ($mode == 6)
|
else if ($mode == 6)
|
||||||
{
|
{
|
||||||
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9');
|
if ($percent==-1 && ! $hidenastatus) return img_picto($langs->trans('StatusNotApplicable'),'statut9');
|
||||||
if ($percent==0) return '0% '.img_picto($langs->trans('StatusActionToDo'),'statut1');
|
else if ($percent==0) return '0% '.img_picto($langs->trans('StatusActionToDo'),'statut1');
|
||||||
if ($percent > 0 && $percent < 100) return $percent.'% '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3');
|
else if ($percent > 0 && $percent < 100) return $percent.'% '.img_picto($langs->trans('StatusActionInProcess').' - '.$percent.'%','statut3');
|
||||||
if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6');
|
else if ($percent >= 100) return img_picto($langs->trans('StatusActionDone'),'statut6');
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user