From 6d896a8558a16a34b5ca3ed86e49d53a4107a5e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 15 Apr 2013 00:53:06 +0200 Subject: [PATCH] Improved holidays module translations --- htdocs/holiday/class/holiday.class.php | 4 +-- htdocs/holiday/define_holiday.php | 6 ++-- htdocs/holiday/fiche.php | 42 +++++++++++++------------- htdocs/langs/en_US/holiday.lang | 3 ++ htdocs/langs/es_ES/holiday.lang | 5 ++- htdocs/langs/fr_FR/holiday.lang | 3 ++ 6 files changed, 36 insertions(+), 27 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 34b26421a08..924d6eb1c4e 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -859,7 +859,7 @@ class Holiday extends CommonObject */ function updateSoldeCP($userID='',$nbHoliday='') { - global $user; + global $user, $langs; if (empty($userID) && empty($nbHoliday)) { @@ -897,7 +897,7 @@ class Holiday extends CommonObject $new_solde = $now_holiday + $this->getConfCP('nbHolidayEveryMonth'); // On ajoute la modification dans le LOG - $this->addLogCP($user->id,$users[$i]['rowid'],'Event : Mise à jour mensuelle',$new_solde); + $this->addLogCP($user->id,$users[$i]['rowid'], $langs->trans('Event').': '.$langs->trans('HolidaysMonthlyAssignment'),$new_solde); $i++; } diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index a4fcfe98201..3d43d8e375e 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -67,7 +67,7 @@ if ($action == 'update' && isset($_POST['update_cp'])) } // On ajoute la modification dans le LOG - $holiday->addLogCP($user->id,$userID,'Event : Manual update',$userValue); + $holiday->addLogCP($user->id,$userID, $langs->trans('Event').': '.$langs->trans('ManualUpdate'),$userValue); // Mise à jour des congés de l'utilisateur $holiday->updateSoldeCP($userID,$userValue); @@ -100,7 +100,7 @@ elseif($action == 'add_event') $new_holiday = $nb_holiday + $add_holiday; // On ajoute la modification dans le LOG - $holiday->addLogCP($user->id,$userCP,'Event : '.$holiday->getNameEventCp($event),$new_holiday); + $holiday->addLogCP($user->id,$userCP, $langs->trans('Event').': '.$holiday->getNameEventCp($event),$new_holiday); $holiday->updateSoldeCP($userCP,$new_holiday); @@ -158,7 +158,7 @@ foreach($listUsers as $users) print ''; print ''; print ''; - print ' jours'."\n"; + print ' '.$langs->trans('days').''."\n"; print ''."\n"; print ''; diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index e4ffc4007fb..e7626506dde 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -52,7 +52,7 @@ $now=dol_now(); // Si création de la demande if ($action == 'create') { - $cp = new Holiday($db); + $cp = new Holiday($db); // Si pas le droit de créer une demande if(!$user->rights->holiday->write) @@ -63,12 +63,12 @@ if ($action == 'create') $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year')); $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year')); - $starthalfday=GETPOST('starthalfday'); + $starthalfday=GETPOST('starthalfday'); $endhalfday=GETPOST('endhalfday'); $halfday=0; if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2; else if ($starthalfday == 'afternoon') $halfday=-1; - else if ($endhalfday == 'morning') $halfday=1; + else if ($endhalfday == 'morning') $halfday=1; $valideur = GETPOST('valideur'); $description = trim(GETPOST('description')); @@ -144,14 +144,14 @@ if ($action == 'create') if ($action == 'update') { - $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year')); - $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year')); - $starthalfday=GETPOST('starthalfday'); - $endhalfday=GETPOST('endhalfday'); - $halfday=0; - if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2; - else if ($starthalfday == 'afternoon') $halfday=-1; - else if ($endhalfday == 'morning') $halfday=1; + $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year')); + $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year')); + $starthalfday=GETPOST('starthalfday'); + $endhalfday=GETPOST('endhalfday'); + $halfday=0; + if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2; + else if ($starthalfday == 'afternoon') $halfday=-1; + else if ($endhalfday == 'morning') $halfday=1; // Si pas le droit de modifier une demande if(!$user->rights->holiday->write) @@ -375,7 +375,7 @@ if($action == 'confirm_valid') $newSolde = $soldeActuel - ($nbJour*$cp->getConfCP('nbHolidayDeducted')); // On ajoute la modification dans le LOG - $cp->addLogCP($userID,$cp->fk_user,'Event : '.$langs->transnoentitiesnoconv("Holiday"),$newSolde); + $cp->addLogCP($userID,$cp->fk_user, $langs->trans('Event').': '.$langs->transnoentitiesnoconv("Holidays"),$newSolde); // Mise à jour du solde $cp->updateSoldeCP($cp->fk_user,$newSolde); @@ -575,9 +575,9 @@ if ($action == 'confirm_cancel' && $_GET['confirm'] == 'yes') */ $form = new Form($db); -$cp = new Holiday($db); +$cp = new Holiday($db); -$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon")); +$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon")); llxHeader(array(),$langs->trans('CPTitreMenu')); @@ -859,12 +859,12 @@ else print ''; print ''.$langs->trans("Ref").''; print ''; - print $form->showrefnav($cp, 'id', $linkback, 1, 'rowid', 'ref'); + print $form->showrefnav($cp, 'id', $linkback, 1, 'rowid', 'ref'); print ''; print ''; $starthalfday=($cp->halfday == -1 || $cp->halfday == 2)?'afternoon':'morning'; - $endhalfday=($cp->halfday == 1 || $cp->halfday == 2)?'morning':'afternoon'; + $endhalfday=($cp->halfday == 1 || $cp->halfday == 2)?'morning':'afternoon'; if(!$edit) { print ''; @@ -890,7 +890,7 @@ else print ''; print ''.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')'; print ''.dol_print_date($cp->date_fin,'day'); - print '     '; + print '     '; print $langs->trans($listhalfday[$endhalfday]); print ''; print ''; @@ -1026,10 +1026,10 @@ else { print ''.$langs->trans("Validate").''; } - if($user->rights->holiday->delete && $cp->statut == 1) - { - print ''.$langs->trans("DeleteCP").''; - } + if($user->rights->holiday->delete && $cp->statut == 1) + { + print ''.$langs->trans("DeleteCP").''; + } // Si le statut est en attente de validation et que le valideur est connecté if ($userID == $cp->fk_validator && $cp->statut == 2) diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index abf2b1dc514..67adb36dfeb 100755 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -1,6 +1,7 @@ # Dolibarr language file - en_US - holiday CHARSET= UTF-8 +Holidays=Holidays CPTitreMenu=Holidays MenuReportMonth=Monthly statement MenuAddCP=Apply for holidays @@ -86,6 +87,8 @@ UserName=Name Employee=Employee FirstDayOfHoliday=First day of holiday LastDayOfHoliday=Last day of holiday +HolidaysMonthlyUpdate=Monthly update +ManualUpdate=Manual update ## Configuration du Module ## ConfCP=Configuration of holidays module diff --git a/htdocs/langs/es_ES/holiday.lang b/htdocs/langs/es_ES/holiday.lang index 55e56fb9d0a..ebf1a0457d9 100644 --- a/htdocs/langs/es_ES/holiday.lang +++ b/htdocs/langs/es_ES/holiday.lang @@ -1,6 +1,7 @@ # Dolibarr language file - es_ES - holiday CHARSET= UTF-8 +Holidays=Vacaciones CPTitreMenu=Vacaciones MenuReportMonth=Estado mensual MenuAddCP=Nueva petición @@ -88,6 +89,8 @@ FirstDayOfHoliday=Primer día libre LastDayOfHoliday=Último día libre Morning=Mañana Afternoon=Tarde +HolidaysMonthlyUpdate=Actualización mensual +ManualUpdate=Actualización manual ## Configuration du Module ## ConfCP=Configuración del módulo Vacaciones @@ -99,7 +102,7 @@ LastUpdateCP=Última actualización automática de vacaciones UpdateConfCPOK=Actualización efectuada correctamente. ErrorUpdateConfCP=Se ha producido un error durante la actualización, vuélvalo a intentar. AddCPforUsers=Añada los saldos de vacaciones de los usuarios haciendo clic aquí. -DelayForSubmitCP=La fecha límite para solicitar vacaciones +DelayForSubmitCP=Antelación mínima para solicitar vacaciones AlertValidatorDelayCP=Advertir al usuario validador si la petición no respeta el límite previsto AlertValidorSoldeCP=Advertir al usuario validador si el usuario pide vacaciones superiores a su saldo nbUserCP=Número de usuarios tomados en cuenta en el módulo vacaciones diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index ad8ebd7fcf1..c01d84218bf 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -1,6 +1,7 @@ # Dolibarr language file - fr_FR - holiday CHARSET= UTF-8 +Holidays=Congés CPTitreMenu=Congés MenuReportMonth=Etat mensuel MenuAddCP=Nouvelle demande @@ -86,6 +87,8 @@ UserName=Nom Prénom Employee=Salarié FirstDayOfHoliday=Premier jour de congès LastDayOfHoliday=Dernier jour de congès +HolidaysMonthlyUpdate=Mise à jour mensuelle +ManualUpdate=Mise à jour manuelle ## Configuration du Module ## ConfCP=Configuration du module Congés