require_once('plugins/MonthlyQuota.class.php');
$quota = new MonthlyQuota();
$month_quota = $quota->get($selected_date->mYear, $selected_date->mMonth);
require_once('plugins/MonthlyQuota.class.php');
$quota = new MonthlyQuota();
$month_quota = $quota->get($selected_date->mYear, $selected_date->mMonth);
$minutes_left = round(60*$month_quota) - ttTimeHelper::toMinutes($month_total);
$smarty->assign('month_total', $month_total);
$minutes_left = round(60*$month_quota) - ttTimeHelper::toMinutes($month_total);
$smarty->assign('month_total', $month_total);
$dayHeaders = ttWeekViewHelper::getDayHeadersForWeek($startDate->toString(DB_DATEFORMAT));
$lockedDays = ttWeekViewHelper::getLockedDaysForWeek($startDate->toString(DB_DATEFORMAT));
// Get already existing records.
$dayHeaders = ttWeekViewHelper::getDayHeadersForWeek($startDate->toString(DB_DATEFORMAT));
$lockedDays = ttWeekViewHelper::getLockedDaysForWeek($startDate->toString(DB_DATEFORMAT));
// Get already existing records.
-$records = ttWeekViewHelper::getRecordsForInterval($user->getActiveUser(), $startDate->toString(DB_DATEFORMAT), $endDate->toString(DB_DATEFORMAT));
+$records = ttWeekViewHelper::getRecordsForInterval($user->getUser(), $startDate->toString(DB_DATEFORMAT), $endDate->toString(DB_DATEFORMAT));
// Build data array for the table. Format is described in ttWeekViewHelper::getDataForWeekView function.
if ($records)
$dataArray = ttWeekViewHelper::getDataForWeekView($records, $dayHeaders);
// Build data array for the table. Format is described in ttWeekViewHelper::getDataForWeekView function.
if ($records)
$dataArray = ttWeekViewHelper::getDataForWeekView($records, $dayHeaders);
// Dropdown for clients in MODE_TIME. Use all active clients.
if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
// Dropdown for clients in MODE_TIME. Use all active clients.
if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'name'=>'client',
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'name'=>'client',
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
$projects_assigned_to_user[] = $project['id'];
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
$projects_assigned_to_user[] = $project['id'];
$result = ttWeekViewHelper::insertDurationFromWeekView($fields, $custom_fields, $err);
} elseif ($postedDuration == null || 0 == ttTimeHelper::toMinutes($postedDuration)) {
// Delete an already existing record here.
$result = ttWeekViewHelper::insertDurationFromWeekView($fields, $custom_fields, $err);
} elseif ($postedDuration == null || 0 == ttTimeHelper::toMinutes($postedDuration)) {
// Delete an already existing record here.
$smarty->assign('selected_date', $selected_date);
$smarty->assign('week_total', $week_total);
$smarty->assign('selected_date', $selected_date);
$smarty->assign('week_total', $week_total);