X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=time.php;h=b926e2243fb34d244149c334c9313687fd91b2b7;hb=cd5e077ecb497431decde4835138b877d63b261c;hp=9a34d30df05f51b43eb8b16fd6f48381a400afd9;hpb=11441db31dcbed7b2070e800bcb1b0e6547b86bd;p=timetracker.git diff --git a/time.php b/time.php index 9a34d30d..b926e224 100644 --- a/time.php +++ b/time.php @@ -66,12 +66,13 @@ if ($user->isPluginEnabled('cf')) { if ($user->isPluginEnabled('mq')){ require_once('plugins/MonthlyQuota.class.php'); $quota = new MonthlyQuota(); - $monthlyQuota = $quota->get($selected_date->mYear, $selected_date->mMonth); + $month_quota = $quota->get($selected_date->mYear, $selected_date->mMonth); $month_total = ttTimeHelper::getTimeForMonth($user->getActiveUser(), $selected_date); - $minutesLeft = ttTimeHelper::toMinutes($monthlyQuota) - ttTimeHelper::toMinutes($month_total); + $minutes_left = ttTimeHelper::toMinutes($month_quota) - ttTimeHelper::toMinutes($month_total); $smarty->assign('month_total', $month_total); - $smarty->assign('month_left', ttTimeHelper::fromMinutes($minutesLeft)); + $smarty->assign('over_quota', $minutes_left < 0); + $smarty->assign('quota_remaining', ttTimeHelper::toAbsDuration($minutes_left)); } // Initialize variables. @@ -189,12 +190,14 @@ if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type } if (!$user->canManageTeam() && defined('READONLY_START_FINISH') && isTrue(READONLY_START_FINISH)) { // Make the start and finish fields read-only. - $form->getElement('start')->setEnable(false); - $form->getElement('finish')->setEnable(false); + $form->getElement('start')->setEnabled(false); + $form->getElement('finish')->setEnabled(false); } if ((TYPE_DURATION == $user->record_type) || (TYPE_ALL == $user->record_type)) $form->addInput(array('type'=>'text','name'=>'duration','value'=>$cl_duration,'onchange'=>"formDisable('duration');")); -$form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 600px; height: 40px;','value'=>$cl_note)); +if (!defined('NOTE_INPUT_HEIGHT')) + define('NOTE_INPUT_HEIGHT', 40); +$form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 600px; height:'.NOTE_INPUT_HEIGHT.'px;','value'=>$cl_note)); $form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); // calendar if ($user->isPluginEnabled('iv')) $form->addInput(array('type'=>'checkbox','name'=>'billable','data'=>1,'value'=>$cl_billable)); @@ -228,13 +231,8 @@ if ($request->isPost()) { if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { if (!$cl_project) $err->add($i18n->getKey('error.project')); } - if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) { - if (!$cl_task) $err->add($i18n->getKey('error.task')); - } - if (!$cl_duration) { - if ('0' == $cl_duration) - $err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration')); - elseif ($cl_start || $cl_finish) { + if (strlen($cl_duration) == 0) { + if ($cl_start || $cl_finish) { if (!ttTimeHelper::isValidTime($cl_start)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.start')); if ($cl_finish) {