X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=time.php;h=b6bb000e68c0d10e9bd9106e7ad1b159dc5bf14d;hb=ad98b13400fdc2fa2299a22c9bd54c4cd27960c3;hp=25cee96cc1844191761848f19f7a676842412748;hpb=a84f7509ea5462f08ca01c5435e0217045391a45;p=timetracker.git diff --git a/time.php b/time.php index 25cee96c..b6bb000e 100644 --- a/time.php +++ b/time.php @@ -66,9 +66,9 @@ if ($user->isPluginEnabled('cf')) { if ($user->isPluginEnabled('mq')){ require_once('plugins/MonthlyQuota.class.php'); $quota = new MonthlyQuota(); - $month_quota = $quota->get($selected_date->mYear, $selected_date->mMonth); + $month_quota_minutes = $quota->get($selected_date->mYear, $selected_date->mMonth); $month_total = ttTimeHelper::getTimeForMonth($user->getActiveUser(), $selected_date); - $minutes_left = round(60*$month_quota) - ttTimeHelper::toMinutes($month_total); + $minutes_left = $month_quota_minutes - ttTimeHelper::toMinutes($month_total); $smarty->assign('month_total', $month_total); $smarty->assign('over_quota', $minutes_left < 0); @@ -187,7 +187,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type)) { $form->addInput(array('type'=>'text','name'=>'start','value'=>$cl_start,'onchange'=>"formDisable('start');")); $form->addInput(array('type'=>'text','name'=>'finish','value'=>$cl_finish,'onchange'=>"formDisable('finish');")); - if (!$user->canManageTeam() && defined('READONLY_START_FINISH') && isTrue(READONLY_START_FINISH)) { + if ($user->punch_mode && !in_array('override_punch_mode', $user->rights_array)) { // Make the start and finish fields read-only. $form->getElement('start')->setEnabled(false); $form->getElement('finish')->setEnabled(false); @@ -253,14 +253,14 @@ if ($request->isPost()) { $err->add($i18n->getKey('error.empty'), $i18n->getKey('label.duration')); } } else { - if (!ttTimeHelper::isValidDuration($cl_duration)) + if (false === ttTimeHelper::postedDurationToMinutes($cl_duration)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration')); } if (!ttValidString($cl_note, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.note')); // 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'));