From 67ee443b34403ed101056922680136d782ae429a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Feb 2018 14:53:19 +0100 Subject: [PATCH] Fix can set holiday remaining to 0 --- htdocs/holiday/define_holiday.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 66e490ae420..87cb1920394 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -116,7 +116,7 @@ if (empty($reshook)) $userValue = $_POST['nb_holiday_'.$val['rowid']]; $userValue = $userValue[$userID]; - if (!empty($userValue)) + if (!empty($userValue) || (string) $userValue == '0') { $userValue = price2num($userValue,5); } else { @@ -172,11 +172,14 @@ $userstatic=new User($db); llxHeader('', $langs->trans('CPTitreMenu')); +$typeleaves=$holiday->getTypes(1,1); + + print '
'; if ($optioncss != '') print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -210,10 +213,8 @@ if (is_numeric($listUsers) && $listUsers < 0) setEventMessages($holiday->error, $holiday->errors, 'errors'); } -$var=true; $i = 0; -$typeleaves=$holiday->getTypes(1,1); if (count($typeleaves) == 0) { @@ -234,8 +235,6 @@ else $userchilds=$user->getAllChildIds(); } - print ''; - $moreforfilter=''; print '
';