From 78c1e8dfbe3d1961f1f4b6c1bb5cd9fb1018de3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 08:25:58 +0100 Subject: [PATCH 1/2] Update define_holiday.php --- htdocs/holiday/define_holiday.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 9add71da395..ec2b12f9bf5 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -173,6 +173,10 @@ llxHeader('', $langs->trans('CPTitreMenu')); $typeleaves=$holiday->getTypes(1, 1); +$result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. +if ($result < 0) { + setEventMessages($holiday->error, $holiday->errors, 'errors'); +} print '
'; @@ -189,14 +193,12 @@ print load_fiche_titre($langs->trans('MenuConfCP'), '', 'title_hrm.png'); print '
'.$langs->trans('LastUpdateCP').': '."\n"; $lastUpdate = $holiday->getConfCP('lastUpdate'); -if ($lastUpdate) -{ - $monthLastUpdate = $lastUpdate[4].$lastUpdate[5]; - $yearLastUpdate = $lastUpdate[0].$lastUpdate[1].$lastUpdate[2].$lastUpdate[3]; - print ''.dol_print_date($db->jdate($holiday->getConfCP('lastUpdate')), 'dayhour', 'tzuser').''; - print '
'.$langs->trans("MonthOfLastMonthlyUpdate").': '.$yearLastUpdate.'-'.$monthLastUpdate.''."\n"; +if ($lastUpdate) { + print ''.dol_print_date($db->jdate($lastUpdate), 'dayhour').''; + print '
'.$langs->trans("MonthOfLastMonthlyUpdate").': '.$langs->trans('Month'.substr($lastUpdate, 4, 2)).' '.substr($lastUpdate, 0, 4).''."\n"; +} else { + print $langs->trans('None'); } -else print $langs->trans('None'); print "

\n"; $result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. From 7bd88f33a05903e158ee83c7ff64e3062414ac08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 Nov 2019 22:22:07 +0100 Subject: [PATCH 2/2] Update define_holiday.php --- htdocs/holiday/define_holiday.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index ec2b12f9bf5..c5ab5e0e5ec 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -201,11 +201,6 @@ if ($lastUpdate) { } print "
\n"; -$result = $holiday->updateBalance(); // Create users into table holiday if they don't exists. TODO Remove this whif we use field into table user. -if ($result < 0) -{ - setEventMessages($holiday->error, $holiday->errors, 'errors'); -} $filters = '';