diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 59cb522d7d5..6a9b20fd45b 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -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 ''.$langs->trans("Type").''; print ''; $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 ''; print ''; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index e5bd8c0e8c0..8f0cb2862a7 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -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 diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index cf81d0a98fa..bb2b3c31bf0 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -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 ''.$userstatic->getNomUrl(-1, 'leave').''; print ''.$approbatorstatic->getNomUrl(-1).''; print ''; - 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 ''; print ''; $nbopenedday=num_open_day($infos_CP['date_debut_gmt'], $infos_CP['date_fin_gmt'], 0, 1, $infos_CP['halfday']); diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 69bd6b6a190..d67db73d437 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -117,7 +117,7 @@ foreach($cp->logs as $logs_CP) print ''.$user_update->getNomUrl(-1).''; print ''.$logs_CP['type_action'].''; print ''; - $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 ''; print ''.price2num($logs_CP['prev_solde'],5).' '.$langs->trans('days').''; diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 0ed06cceb40..316d1887858 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -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