+$config = new ttConfigHelper($user->getConfig());
+$showNoteColumn = !$config->getDefinedValue('time_note_on_separate_row');
+$showNoteRow = $config->getDefinedValue('time_note_on_separate_row');
+if ($showNoteRow) {
+ // Determine column span for note field.
+ $colspan = 0;
+ if ($showClient) $colspan++;
+ if ($user->isPluginEnabled('cf')) $colspan++;
+ if ($showProject) $colspan++;
+ if ($showTask) $colspan++;
+ if ($showStart) $colspan++;
+ if ($showFinish) $colspan++;
+ $colspan++; // There is always a duration.
+ if ($showFiles) $colspan++;
+ $colspan++; // There is always an edit column.
+ // $colspan++; // There is always a delete column.
+ // $colspan--; // Remove one column for label.
+ $smarty->assign('colspan', $colspan);
+}
+
+if ($user->isPluginEnabled('mq')){
+ require_once('plugins/MonthlyQuota.class.php');
+ $quota = new MonthlyQuota();
+ $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);
+ $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));
+}
+