X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=time.php;h=768a809da1ce0127dc013457da5bc5d44aaf30ef;hb=db9bfb69eeab1f5c75f65373c370990445014305;hp=33b57639a2eb6127801ecfcd03302e70d3cd0466;hpb=1c2cf98a7a062d53e6988f042da2530e1f5d172e;p=timetracker.git diff --git a/time.php b/time.php index 33b57639..768a809d 100644 --- a/time.php +++ b/time.php @@ -66,13 +66,13 @@ if ($user->isPluginEnabled('cf')) { if ($user->isPluginEnabled('mq')){ require_once('plugins/MonthlyQuota.class.php'); $quota = new MonthlyQuota(); - $monthlyQuota = $quota->get($selected_date->mYear, $selected_date->mMonth); + $month_quota = $quota->get($selected_date->mYear, $selected_date->mMonth); $month_total = ttTimeHelper::getTimeForMonth($user->getActiveUser(), $selected_date); - $minutesLeft = ttTimeHelper::toMinutes($monthlyQuota) - ttTimeHelper::toMinutes($month_total); + $minutes_left = ttTimeHelper::toMinutes($month_quota) - ttTimeHelper::toMinutes($month_total); $smarty->assign('month_total', $month_total); - $smarty->assign('over_quota', $minutesLeft < 0); - $smarty->assign('month_left', ttTimeHelper::fromMinutes($minutesLeft)); + $smarty->assign('over_quota', $minutes_left < 0); + $smarty->assign('quota_remaining', ttTimeHelper::toAbsDuration($minutes_left)); } // Initialize variables. @@ -232,10 +232,8 @@ if ($request->isPost()) { if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { if (!$cl_task) $err->add($i18n->getKey('error.task')); } - if (!$cl_duration) { - if ('0' == $cl_duration) - $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration')); - elseif ($cl_start || $cl_finish) { + if (strlen($cl_duration) == 0) { + if ($cl_start || $cl_finish) { if (!ttTimeHelper::isValidTime($cl_start)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.start')); if ($cl_finish) {