X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/8fc038ec7505483c193e290423623b6a66ee3797..1cfc9f9452a2e397fca1886825fff29fad409e5c:/WEB-INF/lib/ttUserHelper.class.php diff --git a/WEB-INF/lib/ttUserHelper.class.php b/WEB-INF/lib/ttUserHelper.class.php index bd5e46b8..222cfdaa 100644 --- a/WEB-INF/lib/ttUserHelper.class.php +++ b/WEB-INF/lib/ttUserHelper.class.php @@ -229,8 +229,14 @@ class ttUserHelper { if (is_a($affected, 'PEAR_Error')) die ($affected->getMessage()); } else { // Record does not exist. Insert it. - ttUserHelper::insertBind($user_id, $project_id, $rate, 1); - } + ttUserHelper::insertBind(array( + 'user_id' => $user_id, + 'project_id' => $project_id, + 'group_id' => $user->getActiveGroup(), + 'org_id' => $user->org_id, + 'rate' => $rate, + 'status' => ACTIVE)); + } } } } @@ -309,20 +315,7 @@ class ttUserHelper { } // insertBind - inserts a user to project bind into tt_user_project_binds table. - static function insertBind($user_id, $project_id, $rate, $status) { - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getActiveGroup(); - $org_id = $user->org_id; - $sql = "insert into tt_user_project_binds (user_id, project_id, group_id, org_id, rate, status)". - " values($user_id, $project_id, $group_id, $org_id, ".$mdb2->quote($rate).", $status)"; - $affected = $mdb2->exec($sql); - return (!is_a($affected, 'PEAR_Error')); - } - - // insertBind2 - inserts a user to project bind into tt_user_project_binds table. - static function insertBind2($fields) { + static function insertBind($fields) { global $user; $mdb2 = getConnection();