Added import timestamp and IP for team import operation.
[timetracker.git] / WEB-INF / lib / ttTeamHelper.class.php
index fb74d8e..2aff793 100644 (file)
@@ -756,6 +756,7 @@ class ttTeamHelper {
   // The insert function creates a new team.
   static function insert($fields) {
 
+    global $user;
     $mdb2 = getConnection();
 
     // Start with team name and currency.
@@ -838,6 +839,9 @@ class ttTeamHelper {
       $values .= ', '.$mdb2->quote($fields['config']);
     }
 
+    $columns .= ', created, created_ip, created_by';
+    $values .= ', now(), '.$mdb2->quote($_SERVER['REMOTE_ADDR']).', '.$mdb2->quote($user->id);
+
     $sql = "insert into tt_teams ($columns) values($values)";
     $affected = $mdb2->exec($sql);