X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=WEB-INF%2Flib%2FttProjectHelper.class.php;h=b5fb74dc0e68ec5c528258dd8deed45574829389;hb=03e3d32869aa0791e1d841be69cf5c0c84a5450f;hp=2a439dd9fda52b0409be76d2b6210666fef0bf2d;hpb=7797eda9fb04c217a813db88e00bb9ee541eabbb;p=timetracker.git diff --git a/WEB-INF/lib/ttProjectHelper.class.php b/WEB-INF/lib/ttProjectHelper.class.php index 2a439dd9..b5fb74dc 100644 --- a/WEB-INF/lib/ttProjectHelper.class.php +++ b/WEB-INF/lib/ttProjectHelper.class.php @@ -183,6 +183,12 @@ class ttProjectHelper { if (is_a($affected, 'PEAR_Error')) return false; + // Delete client binds to this project. + $sql = "delete from tt_client_project_binds where project_id = $id and group_id = $group_id and org_id = $org_id"; + $affected = $mdb2->exec($sql); + if (is_a($affected, 'PEAR_Error')) + return false; + return true; } @@ -206,12 +212,8 @@ class ttProjectHelper { $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; - - $last_id = 0; - $sql = "select last_insert_id() as last_insert_id"; - $res = $mdb2->query($sql); - $val = $res->fetchRow(); - $last_id = $val['last_insert_id']; + + $last_id = $mdb2->lastInsertID('tt_projects', 'id'); // Bind the project to users. $active_users = ttTeamHelper::getActiveUsers(array('getAllFields'=>true));