From: Nik Okuntseff Date: Mon, 18 Jul 2016 18:16:52 +0000 (+0000) Subject: Merge branch 'taskChanges' of https://github.com/avidenic/timetracker into avidenic... X-Git-Tag: timetracker_1.19-1~1700^2 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/commitdiff_plain/ba0b5f34efabfeded3112115086eaa9d00f2a345?ds=sidebyside;hp=-c Merge branch 'taskChanges' of https://github.com/avidenic/timetracker into avidenic-taskChanges Conflicts: .gitignore WEB-INF/config.php.dist --- ba0b5f34efabfeded3112115086eaa9d00f2a345 diff --combined WEB-INF/config.php.dist index 5afca00d,5f7cf253..cc3d0cd7 --- a/WEB-INF/config.php.dist +++ b/WEB-INF/config.php.dist @@@ -215,6 -215,5 +215,9 @@@ define('AUTH_MODULE', 'db') // define('AUTH_DEBUG', false); // Note: enabling AUTH_DEBUG breaks redirects as debug output is printed before setting redirect header. Do not enable on production systems. +// team manager can set monthly quota for years between these values: +define('MONTHLY_QUOTA_YEARS_START', 2010); // if nothing is specified, it falls back to 2010 +define('MONTHLY_QUOTA_YEARS_END', 2031); // if nothing is specified it falls back to 2030 ++ + // note input height in time.php -define('NOTE_INPUT_HEIGHT', '40'); ++define('NOTE_INPUT_HEIGHT', '40'); diff --combined time.php index 9a34d30d,e0efafa9..4042d7c5 --- a/time.php +++ b/time.php @@@ -63,17 -63,6 +63,17 @@@ if ($user->isPluginEnabled('cf')) $smarty->assign('custom_fields', $custom_fields); } +if ($user->isPluginEnabled('mq')){ + require_once('plugins/MonthlyQuota.class.php'); + $quota = new MonthlyQuota(); + $monthlyQuota = $quota->get($selected_date->mYear, $selected_date->mMonth); + $month_total = ttTimeHelper::getTimeForMonth($user->getActiveUser(), $selected_date); + $minutesLeft = ttTimeHelper::toMinutes($monthlyQuota) - ttTimeHelper::toMinutes($month_total); + + $smarty->assign('month_total', $month_total); + $smarty->assign('month_left', ttTimeHelper::fromMinutes($minutesLeft)); +} + // Initialize variables. $cl_start = trim($request->getParameter('start')); $cl_finish = trim($request->getParameter('finish')); @@@ -194,7 -183,7 +194,7 @@@ if (!$user->canManageTeam() && defined( } 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)); + $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));