]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/ttTeamHelper.class.php
Further work on localization files in preparation for integrating paid status plugin...
[timetracker.git] / WEB-INF / lib / ttTeamHelper.class.php
index 92169eb265a014a40aab5858325b587d061611fd..69fcaa0f9317a8b99538c546053c27a51973cd86 100644 (file)
@@ -500,6 +500,9 @@ class ttTeamHelper {
 
   // getPredefinedExpenses - obtains predefined expenses for team.
   static function getPredefinedExpenses($team_id) {
+    global $user;
+    $replaceDecimalMark = ('.' != $user->decimal_mark);
+
     $mdb2 = getConnection();
 
     $result = array();
@@ -508,6 +511,8 @@ class ttTeamHelper {
     $result = array();
     if (!is_a($res, 'PEAR_Error')) {
       while ($val = $res->fetchRow()) {
+        if ($replaceDecimalMark)
+          $val['cost'] = str_replace('.', $user->decimal_mark, $val['cost']);
         $result[] = $val;
       }
       return $result;
@@ -805,13 +810,14 @@ class ttTeamHelper {
     return true;
   }
 
-  // The getInactiveTeams is a maintenance function that returns an array of inactive team ids (max 25).
+  // The getInactiveTeams is a maintenance function that returns an array of inactive team ids (max 100).
   static function getInactiveTeams() {
     $inactive_teams = array();
     $mdb2 = getConnection();
 
-    // Get all team ids for teams created or modified more than 1 year ago.
-    $ts = date('Y-m-d', strtotime('-1 year'));
+    // Get all team ids for teams created or modified more than 6 months ago.
+    // $ts = date('Y-m-d', strtotime('-1 year'));
+    $ts = date('Y-m-d', strtotime('-6 month'));
     $sql =  "select id from tt_teams where timestamp < '$ts' order by id";
     $res = $mdb2->query($sql);