X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=plugins%2FMonthlyQuota.class.php;h=a42b78242f18798bbcbefe408b126363be45f563;hb=e1703495130c8ed88fe210f50a2a6b453b3c566b;hp=4e5b8dcad599f167592b61f6748febfa89cb6cc6;hpb=a02116087a4ceb41287639d8e7fd79e65b8e257e;p=timetracker.git diff --git a/plugins/MonthlyQuota.class.php b/plugins/MonthlyQuota.class.php index 4e5b8dca..a42b7824 100644 --- a/plugins/MonthlyQuota.class.php +++ b/plugins/MonthlyQuota.class.php @@ -60,19 +60,6 @@ class MonthlyQuota { return $this->getSingle($year, $month); } - // getWorkdayHours - obtains workday_hours value for a team from the database. - public function getWorkdayHours(){ - $teamId = $this->team_id; - $sql = "SELECT workday_hours FROM tt_teams where id = $teamId"; - $reader = $this->db->query($sql); - if (is_a($reader, 'PEAR_Error')) { - return false; - } - - $row = $reader->fetchRow(); - return $row['workday_hours']; - } - // getSingle - obtains a quota for a single month. private function getSingle($year, $month) { $teamId = $this->team_id; @@ -88,7 +75,8 @@ class MonthlyQuota { // If we did not find a record, return a calculated monthly quota. $numWorkdays = $this->getNumWorkdays($month, $year); - return $numWorkdays * $this->getWorkdayHours(); + global $user; + return $numWorkdays * $user->workday_hours; } // getMany - returns an array of quotas for a given year for team.