X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=time.php;h=7252f476ff1fd420e7e057c6b151ecb60e150f77;hb=dff61baa6b8f972c0a74119258b81e6884a9191f;hp=013f15ca69898c575062c2ac84010406ef2976c5;hpb=a079c840acbc147af950bff07ba7b7dac0de6131;p=timetracker.git diff --git a/time.php b/time.php index 013f15ca..7252f476 100644 --- a/time.php +++ b/time.php @@ -85,11 +85,17 @@ if ($user->isPluginEnabled('cf')) { if ($user->isPluginEnabled('mq')){ require_once('plugins/MonthlyQuota.class.php'); $quota = new MonthlyQuota(); - $month_quota_minutes = $quota->get($selected_date->mYear, $selected_date->mMonth); + $month_quota_minutes = $quota->getUserQuota($selected_date->mYear, $selected_date->mMonth); + $quota_minutes_from_1st = $quota->getUserQuotaFrom1st($selected_date); $month_total = ttTimeHelper::getTimeForMonth($selected_date); - $minutes_left = $month_quota_minutes - ttTimeHelper::toMinutes($month_total); + $month_total_minutes = ttTimeHelper::toMinutes($month_total); + $balance_left = $quota_minutes_from_1st - $month_total_minutes; + $minutes_left = $month_quota_minutes - $month_total_minutes; $smarty->assign('month_total', $month_total); + $smarty->assign('month_quota', ttTimeHelper::toAbsDuration($month_quota_minutes)); + $smarty->assign('over_balance', $balance_left < 0); + $smarty->assign('balance_remaining', ttTimeHelper::toAbsDuration($balance_left)); $smarty->assign('over_quota', $minutes_left < 0); $smarty->assign('quota_remaining', ttTimeHelper::toAbsDuration($minutes_left)); }