X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/a02116087a4ceb41287639d8e7fd79e65b8e257e..f2870ac71e6ea7272c9ed93d82f401e2d5344697:/plugins/MonthlyQuota.class.php 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.