projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added a delete form for predefined expenses.
[timetracker.git]
/
mobile
/
timer.php
diff --git
a/mobile/timer.php
b/mobile/timer.php
index
949d585
..
8a82bb6
100644
(file)
--- a/
mobile/timer.php
+++ b/
mobile/timer.php
@@
-51,7
+51,7
@@
$_SESSION['date'] = $cl_date;
// TODO: for time page we may limit the day to today only.
// Use custom fields plugin if it is enabled.
// TODO: for time page we may limit the day to today only.
// Use custom fields plugin if it is enabled.
-if (
in_array('cf', explode(',', $user->plugins)
)) {
+if (
$user->isPluginEnabled('cf'
)) {
require_once('../plugins/CustomFields.class.php');
$custom_fields = new CustomFields($user->team_id);
$smarty->assign('custom_fields', $custom_fields);
require_once('../plugins/CustomFields.class.php');
$custom_fields = new CustomFields($user->team_id);
$smarty->assign('custom_fields', $custom_fields);
@@
-84,7
+84,7
@@
$uncompleted = ttTimeHelper::getUncompleted($user->getActiveUser());
$enable_controls = ($uncompleted == null);
// Elements of timeRecordForm.
$enable_controls = ($uncompleted == null);
// Elements of timeRecordForm.
-$form = new Form('time
r
RecordForm');
+$form = new Form('timeRecordForm');
// 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')) {
@@
-179,14
+179,6
@@
if ($custom_fields && $custom_fields->fields[0]) {
}
}
}
}
-// Determine lock date. Time entries earlier than lock date cannot be created or modified.
-$lock_interval = $user->lock_interval;
-$lockdate = 0;
-if ($lock_interval > 0) {
- $lockdate = new DateAndTime();
- $lockdate->decDay($lock_interval);
-}
-
// Submit.
if ($request->isPost()) {
if ($request->getParameter('btn_start')) {
// Submit.
if ($request->isPost()) {
if ($request->getParameter('btn_start')) {
@@
-215,8
+207,8
@@
if ($request->isPost()) {
}
// Prohibit creating time entries in locked interval.
}
// Prohibit creating time entries in locked interval.
- if
($lockdate && $selected_date->before($lock
date))
- $err->add($i18n->getKey('error.
period
_locked'));
+ if
($user->isDateLocked($selected_
date))
+ $err->add($i18n->getKey('error.
range
_locked'));
// Prohibit creating another uncompleted record.
if ($err->no() && $uncompleted) {
// Prohibit creating another uncompleted record.
if ($err->no() && $uncompleted) {