X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/d74142948db5d27a3bf144a8ee485318cc1330c3..0f6454bb20d223018d0f969ab5e1d46f4ce14b96:/plugins/MonthlyQuota.class.php diff --git a/plugins/MonthlyQuota.class.php b/plugins/MonthlyQuota.class.php index 29d8cfb7..a1c1b5d0 100644 --- a/plugins/MonthlyQuota.class.php +++ b/plugins/MonthlyQuota.class.php @@ -84,6 +84,16 @@ class MonthlyQuota { return $numWorkdays * $user->getWorkdayMinutes(); } + // getUserQuota - obtains a quota for user for a single month. + // This quota is adjusted by quota_percent value for user. + public function getUserQuota($year, $month) { + global $user; + + $minutes = $this->getSingle($year, $month); + $userMinutes = (int) $minutes * $user->getQuotaPercent() / 100; + return $userMinutes; + } + // getMany - returns an array of quotas for a given year for group. private function getMany($year){ $sql = "select month, minutes from tt_monthly_quotas".