X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/7c7f99a838bd065066e0439bc1ea61014571b182..8e24e2719b8ddaa77a3a9287cba2899e4ff3ca9e:/WEB-INF/lib/ttTeamHelper.class.php diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index b27e04d1..3dba92af 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -498,6 +498,23 @@ class ttTeamHelper { return false; } + // getPredefinedExpenses - obtains predefined expenses for team. + static function getPredefinedExpenses($team_id) { + $mdb2 = getConnection(); + + $result = array(); + $sql = "select id, name, cost from tt_predefined_expenses where team_id = $team_id"; + $res = $mdb2->query($sql); + $result = array(); + if (!is_a($res, 'PEAR_Error')) { + while ($val = $res->fetchRow()) { + $result[] = $val; + } + return $result; + } + return false; + } + // getNotifications - obtains notification descriptions for team. static function getNotifications($team_id) { $mdb2 = getConnection(); @@ -517,7 +534,7 @@ class ttTeamHelper { return false; } - // getNotifications - obtains monthly quotas for team. + // getMonthlyQuotas - obtains monthly quotas for team. static function getMonthlyQuotas($team_id) { $mdb2 = getConnection(); @@ -737,9 +754,6 @@ class ttTeamHelper { // The update function updates team information. static function update($team_id, $fields) { - // We'll require team name to be always set. - if (!isset($fields['name']) || $fields['name'] == "") return false; - $mdb2 = getConnection(); $name_part = 'name = '.$mdb2->quote($fields['name']); $currency_part = '';