X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=quotas.php;h=b6d63fa3ec639939ede4bfff3d141bf6569da076;hb=HEAD;hp=1f376190ef6add417e57fa945f18afda2dedacb9;hpb=aa8ffdcec75ded579362d1274e985b4b35a9ac95;p=timetracker.git diff --git a/quotas.php b/quotas.php index 1f376190..b6d63fa3 100644 --- a/quotas.php +++ b/quotas.php @@ -74,12 +74,14 @@ $quota = new MonthlyQuota(); if ($request->isPost()){ // Validate user input. - if (false === ttTimeHelper::postedDurationToMinutes($request->getParameter('workdayHours'))) + $workdayMinutes = ttTimeHelper::postedDurationToMinutes($request->getParameter('workdayHours')); + if (false === $workdayMinutes || $workdayMinutes <= 0 ) $err->add($i18n->get('error.field'), $i18n->get('form.quota.workday_hours')); for ($i = 0; $i < count($months); $i++){ $val = $request->getParameter($months[$i]); - if (false === ttTimeHelper::postedDurationToMinutes($val, 44640/*24*60*31*/)) + $monthMinutes = ttTimeHelper::postedDurationToMinutes($val, 44640/*24*60*31*/); + if (false === $monthMinutes || $monthMinutes < 0) $err->add($i18n->get('error.field'), $months[$i]); } // Finished validating user input.