X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=mobile%2Ftimer.php;h=6851052f03f9b70ce9df5c9fa23891f69d74ff41;hb=7916f561fed6b50348f144fc411ca82ee9bd5ebb;hp=d2d3a8df7df2adbc3bb6c1b9da73e9b4951089ed;hpb=19f245ff861895c99c3f04fbc53404564bb44267;p=timetracker.git diff --git a/mobile/timer.php b/mobile/timer.php index d2d3a8df..6851052f 100644 --- a/mobile/timer.php +++ b/mobile/timer.php @@ -35,7 +35,7 @@ import('ttTimeHelper'); import('DateAndTime'); // Access check. -if (!ttAccessCheck(right_data_entry)) { +if (!ttAccessAllowed('track_own_time')) { header('Location: access_denied.php'); exit(); } @@ -61,7 +61,7 @@ if ($user->isPluginEnabled('cf')) { $cl_start = trim($request->getParameter('browser_time')); $cl_finish = trim($request->getParameter('browser_time')); // Custom field. -$cl_cf_1 = trim($request->getParameter('cf_1', ($request->getMethod()=='POST'? null : @$_SESSION['cf_1']))); +$cl_cf_1 = trim($request->getParameter('cf_1', ($request->isPost() ? null : @$_SESSION['cf_1']))); $_SESSION['cf_1'] = $cl_cf_1; $cl_billable = 1; if ($user->isPluginEnabled('iv')) { @@ -84,7 +84,7 @@ $uncompleted = ttTimeHelper::getUncompleted($user->getActiveUser()); $enable_controls = ($uncompleted == null); // Elements of timeRecordForm. -$form = new Form('timerRecordForm'); +$form = new Form('timeRecordForm'); // Dropdown for clients in MODE_TIME. Use all active clients. if (MODE_TIME == $user->tracking_mode && $user->isPluginEnabled('cl')) { @@ -155,7 +155,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { 'empty'=>array(''=>$i18n->getKey('dropdown.select')))); } if ($user->isPluginEnabled('iv')) - $form->addInput(array('type'=>'checkbox','name'=>'billable','data'=>1,'value'=>$cl_billable,'enable'=>$enable_controls)); + $form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable,'enable'=>$enable_controls)); $form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on button click. $form->addInput(array('type'=>'hidden','name'=>'browser_time','value'=>'')); // User current time, which gets filled in on button click. $enable_start = $uncompleted ? false : true; @@ -200,7 +200,7 @@ if ($request->isPost()) { // Finished validating user input. // Prohibit creating entries in future. - if (defined('FUTURE_ENTRIES') && !isTrue(FUTURE_ENTRIES)) { + if (!$user->future_entries) { $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null)); if ($selected_date->after($browser_today)) $err->add($i18n->getKey('error.future_date'));