forked from Wavyzz/dolibarr
FIX translation of holiday types
This commit is contained in:
@@ -858,7 +858,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
|
||||
$arraytypeleaves=array();
|
||||
foreach($typeleaves as $key => $val)
|
||||
{
|
||||
$labeltoshow = $val['label'];
|
||||
$labeltoshow = ($langs->trans($val['code'])!=$val['code'] ? $langs->trans($val['code']) : $val['label']);
|
||||
$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')':'');
|
||||
$arraytypeleaves[$val['rowid']]=$labeltoshow;
|
||||
}
|
||||
@@ -1076,7 +1076,8 @@ else
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td>';
|
||||
$typeleaves=$object->getTypes(1,-1);
|
||||
print empty($typeleaves[$object->fk_type]['label']) ? $langs->trans("TypeWasDisabledOrRemoved",$object->fk_type) : $typeleaves[$object->fk_type]['label'];
|
||||
$labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code'])!=$typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']);
|
||||
print empty($labeltoshow) ? $langs->trans("TypeWasDisabledOrRemoved",$object->fk_type) : $labeltoshow;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@@ -286,7 +286,8 @@ else
|
||||
{
|
||||
foreach($typeleaves as $key => $val)
|
||||
{
|
||||
print_liste_field_titre($val['label'], $_SERVER["PHP_SELF"], '', '', '', 'align="center"');
|
||||
$labeltype = ($langs->trans($val['code'])!=$val['code']) ? $langs->trans($val['code']) : $langs->trans($val['label']);
|
||||
print_liste_field_titre($labeltype, $_SERVER["PHP_SELF"], '', '', '', 'align="center"');
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -423,7 +423,7 @@ $typeleaves=$holidaystatic->getTypes(1,-1);
|
||||
$arraytypeleaves=array();
|
||||
foreach($typeleaves as $key => $val)
|
||||
{
|
||||
$labeltoshow = $val['label'];
|
||||
$labeltoshow = ($langs->trans($val['code'])!=$val['code'] ? $langs->trans($val['code']) : $val['label']);
|
||||
//$labeltoshow .= ($val['delay'] > 0 ? ' ('.$langs->trans("NoticePeriod").': '.$val['delay'].' '.$langs->trans("days").')':'');
|
||||
$arraytypeleaves[$val['rowid']]=$labeltoshow;
|
||||
}
|
||||
@@ -516,7 +516,8 @@ if (! empty($holiday->holiday))
|
||||
print '<td>'.$userstatic->getNomUrl(-1, 'leave').'</td>';
|
||||
print '<td>'.$approbatorstatic->getNomUrl(-1).'</td>';
|
||||
print '<td>';
|
||||
print empty($typeleaves[$infos_CP['fk_type']]['label']) ? $langs->trans("TypeWasDisabledOrRemoved",$infos_CP['fk_type']) : $typeleaves[$infos_CP['fk_type']]['label'];
|
||||
$labeltypeleavetoshow = ($langs->trans($typeleaves[$infos_CP['fk_type']]['code'])!=$typeleaves[$infos_CP['fk_type']]['code'] ? $langs->trans($typeleaves[$infos_CP['fk_type']]['code']) : $typeleaves[$infos_CP['fk_type']]['label']);
|
||||
print empty($typeleaves[$infos_CP['fk_type']]['label']) ? $langs->trans("TypeWasDisabledOrRemoved",$infos_CP['fk_type']) : $labeltypeleavetoshow;
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
$nbopenedday=num_open_day($infos_CP['date_debut_gmt'], $infos_CP['date_fin_gmt'], 0, 1, $infos_CP['halfday']);
|
||||
|
||||
@@ -117,7 +117,7 @@ foreach($cp->logs as $logs_CP)
|
||||
print '<td>'.$user_update->getNomUrl(-1).'</td>';
|
||||
print '<td>'.$logs_CP['type_action'].'</td>';
|
||||
print '<td>';
|
||||
$label=$alltypeleaves[$logs_CP['fk_type']]['label'];
|
||||
$label = (($alltypeleaves[$logs_CP['fk_type']]['code'] && $langs->trans($alltypeleaves[$logs_CP['fk_type']]['code'])!=$alltypeleaves[$logs_CP['fk_type']]['code']) ? $langs->trans($alltypeleaves[$logs_CP['fk_type']]['code']) : $alltypeleaves[$logs_CP['fk_type']]['label']);
|
||||
print $label?$label:$logs_CP['fk_type'];
|
||||
print '</td>';
|
||||
print '<td style="text-align: right;">'.price2num($logs_CP['prev_solde'],5).' '.$langs->trans('days').'</td>';
|
||||
|
||||
@@ -81,7 +81,10 @@ EmployeeFirstname=Employee first name
|
||||
TypeWasDisabledOrRemoved=Leave type (id %s) was disabled or removed
|
||||
LastHolidays=Latest %s leave requests
|
||||
AllHolidays=All leave requests
|
||||
|
||||
LEAVE_PAID=Paid vacationxx
|
||||
LEAVE_SICK=Sick leave
|
||||
LEAVE_OTHER=Other leave
|
||||
LEAVE_PAID_FR=Paid vacation
|
||||
## Configuration du Module ##
|
||||
LastUpdateCP=Latest automatic update of leaves allocation
|
||||
MonthOfLastMonthlyUpdate=Month of latest automatic update of leaves allocation
|
||||
|
||||
Reference in New Issue
Block a user