import('ttTeamHelper');
import('ttUserHelper');
+import('ttGroupHelper');
// Class ttProjectHelper is used to help with project related tasks.
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;
}
$last_id = $mdb2->lastInsertID('tt_projects', 'id');
// Bind the project to users.
- $active_users = ttTeamHelper::getActiveUsers(array('getAllFields'=>true));
+ $active_users = ttGroupHelper::getActiveUsers(array('getAllFields'=>true));
foreach ($active_users as $u) {
if(in_array($u['id'], $users)) {
$sql = "insert into tt_user_project_binds (project_id, user_id, group_id, org_id, status, rate) values(