import('form.Table');
import('form.TextField');
import('ttUserHelper');
-import('ttTeamHelper');
+import('ttGroupHelper');
import('ttWeekViewHelper');
import('ttClientHelper');
import('ttTimeHelper');
// Use custom fields plugin if it is enabled.
if ($user->isPluginEnabled('cf')) {
require_once('plugins/CustomFields.class.php');
- $custom_fields = new CustomFields($user->group_id);
+ $custom_fields = new CustomFields();
$smarty->assign('custom_fields', $custom_fields);
}
if ($user->isPluginEnabled('mq')){
require_once('plugins/MonthlyQuota.class.php');
$quota = new MonthlyQuota();
- $month_quota = $quota->get($selected_date->mYear, $selected_date->mMonth);
- $month_total = ttTimeHelper::getTimeForMonth($user->getUser(), $selected_date);
- $minutes_left = round(60*$month_quota) - ttTimeHelper::toMinutes($month_total);
+ $month_quota_minutes = $quota->getUserQuota($selected_date->mYear, $selected_date->mMonth);
+ $month_total = ttTimeHelper::getTimeForMonth($selected_date);
+ $minutes_left = $month_quota_minutes - ttTimeHelper::toMinutes($month_total);
$smarty->assign('month_total', $month_total);
$smarty->assign('over_quota', $minutes_left < 0);
// Dropdown for clients in MODE_TIME. Use all active clients.
if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) {
- $active_clients = ttTeamHelper::getActiveClients($user->group_id, true);
+ $active_clients = ttGroupHelper::getActiveClients(true);
$form->addInput(array('type'=>'combobox',
'onchange'=>'fillProjectDropdown(this.value);',
'name'=>'client',
// Dropdown for clients if the clients plugin is enabled.
if ($user->isPluginEnabled('cl')) {
- $active_clients = ttTeamHelper::getActiveClients($user->group_id, true);
+ $active_clients = ttGroupHelper::getActiveClients(true);
// We need an array of assigned project ids to do some trimming.
foreach($project_list as $project)
$projects_assigned_to_user[] = $project['id'];
}
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- $task_list = ttTeamHelper::getActiveTasks($user->group_id);
+ $task_list = ttGroupHelper::getActiveTasks();
$form->addInput(array('type'=>'combobox',
'name'=>'task',
'style'=>'width: 250px;',
}
} // isPost
-$week_total = ttTimeHelper::getTimeForWeek($user->getUser(), $selected_date);
+$week_total = ttTimeHelper::getTimeForWeek($selected_date);
$smarty->assign('selected_date', $selected_date);
$smarty->assign('week_total', $week_total);