Some further refactoring in form classes.
[timetracker.git] / quotas.php
index 1dfa06f..d846ae2 100644 (file)
@@ -32,7 +32,7 @@ import('form.Form');
 import('ttTeamHelper');
 
 // Access check.
-if (!ttAccessCheck(right_manage_team)) {
+if (!ttAccessCheck(right_manage_team) || !$user->isPluginEnabled('mq')) {
   header('Location: access_denied.php');
   exit();
 }
@@ -97,7 +97,7 @@ if ($request->isPost()){
 $monthsData = $quota->get($selectedYear);
 
 $form = new Form('monthlyQuotasForm');
-$form->addInput(array('type'=>'text', 'name'=>'workdayHours', 'value'=>$quota->getWorkdayHours(), 'style'=>'width:50px'));
+$form->addInput(array('type'=>'text', 'name'=>'workdayHours', 'value'=>$user->workday_hours, 'style'=>'width:50px'));
 $form->addInput(array('type'=>'combobox','name'=>'year','data'=>$years,'datakeys'=>array('id','name'),'value'=>$selectedYear,'onchange'=>'yearChange(this.value);'));
 for ($i=0; $i < count($months); $i++) { 
   $value = "";