private function addProjects($projectsArray) { $addProject = new project(); foreach ($projectsArray->project as $project) { $name = $project->{'name'}; $desc = $name; $start = $project->{'created-on'}; //TODO das muss in nen loop mit assign, damit wirklich alle user assigned werden $uid = $project->{'participants'}->{'person'}; $user = $this->peopleHash["{$uid}"]; $status = 1; if ($project->{'status'} != "active") { $status = 0; } $project_id = $addProject->AddFromBasecamp($name, $desc, $start, $status); if ($project_id) { $addProject->assign($user, $project_id); if (isset($_SESSION["userid"])) { $addProject->assign($_SESSION["userid"], $project_id); } $milestonesHash = $this->addMilestones($project_id, $project->{'milestones'}); $this->addTasks($project_id, $milestonesHash, $project->{'todo-lists'}); $this->addMessages($project_id, $project->{'posts'}); ++$this->projectCount; } } }