projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implemented configurable holidays.
[timetracker.git]
/
week.php
diff --git
a/week.php
b/week.php
index
289d951
..
05d3992
100644
(file)
--- a/
week.php
+++ b/
week.php
@@
-32,7
+32,6
@@
import('form.DefaultCellRenderer');
import('form.Table');
import('form.TextField');
import('ttUserHelper');
import('form.Table');
import('form.TextField');
import('ttUserHelper');
-import('ttTeamHelper');
import('ttGroupHelper');
import('ttWeekViewHelper');
import('ttClientHelper');
import('ttGroupHelper');
import('ttWeekViewHelper');
import('ttClientHelper');
@@
-58,6
+57,9
@@
if (!$user->behalf_id && !$user->can('track_own_time') && !$user->adjustBehalfId
}
// End of access checks.
}
// End of access checks.
+$showClient = $user->isPluginEnabled('cl');
+$showFiles = $user->isPluginEnabled('at');
+
// Initialize and store date in session.
$cl_date = $request->getParameter('date', @$_SESSION['date']);
$selected_date = new DateAndTime(DB_DATEFORMAT, $cl_date);
// Initialize and store date in session.
$cl_date = $request->getParameter('date', @$_SESSION['date']);
$selected_date = new DateAndTime(DB_DATEFORMAT, $cl_date);
@@
-92,9
+94,9
@@
if ($user->isPluginEnabled('cf')) {
if ($user->isPluginEnabled('mq')){
require_once('plugins/MonthlyQuota.class.php');
$quota = new MonthlyQuota();
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);
$smarty->assign('month_total', $month_total);
$smarty->assign('over_quota', $minutes_left < 0);
@@
-129,7
+131,7
@@
$_SESSION['note'] = $cl_note;
$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->getUser(), $startDate->toString(DB_DATEFORMAT), $endDate->toString(DB_DATEFORMAT)
);
+$records = ttWeekViewHelper::getRecordsForInterval($
startDate->toString(DB_DATEFORMAT), $endDate->toString(DB_DATEFORMAT), $showFiles
);
// 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);
@@
-299,7
+301,7
@@
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t
}
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
}
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
- $task_list = tt
TeamHelper::getActiveTasks($user->group_id
);
+ $task_list = tt
GroupHelper::getActiveTasks(
);
$form->addInput(array('type'=>'combobox',
'name'=>'task',
'style'=>'width: 250px;',
$form->addInput(array('type'=>'combobox',
'name'=>'task',
'style'=>'width: 250px;',
@@
-347,7
+349,7
@@
if ($request->isPost()) {
}
}
if ($newEntryPosted) {
}
}
if ($newEntryPosted) {
- if ($user->isPluginEnabled('cl') && $user->is
PluginEnabled('cm
') && !$cl_client)
+ if ($user->isPluginEnabled('cl') && $user->is
OptionEnabled('client_required
') && !$cl_client)
$err->add($i18n->get('error.client'));
if ($custom_fields) {
if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->get('error.field'), $custom_fields->fields[0]['label']);
$err->add($i18n->get('error.client'));
if ($custom_fields) {
if (!ttValidString($cl_cf_1, !$custom_fields->fields[0]['required'])) $err->add($i18n->get('error.field'), $custom_fields->fields[0]['label']);
@@
-495,7
+497,7
@@
if ($request->isPost()) {
}
} // isPost
}
} // 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);
$smarty->assign('selected_date', $selected_date);
$smarty->assign('week_total', $week_total);
@@
-507,7
+509,9
@@
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="fillDropdowns()"');
$smarty->assign('timestring', $startDate->toString($user->date_format).' - '.$endDate->toString($user->date_format));
$smarty->assign('time_records', $records);
$smarty->assign('onload', 'onLoad="fillDropdowns()"');
$smarty->assign('timestring', $startDate->toString($user->date_format).' - '.$endDate->toString($user->date_format));
$smarty->assign('time_records', $records);
-
-$smarty->assign('title', $i18n->get('title.time'));
+$smarty->assign('show_navigation', !$user->getConfigOption('menu_week'));
+$smarty->assign('show_client', $showClient);
+$smarty->assign('show_files', $showFiles);
+$smarty->assign('title', $i18n->get('menu.week'));
$smarty->assign('content_page_name', 'week.tpl');
$smarty->display('index.tpl');
$smarty->assign('content_page_name', 'week.tpl');
$smarty->display('index.tpl');