/** Assign all author author */ public function AssignAllAuthors($buildid, $beginUTCTime, $currentUTCTime) { include_once 'models/dailyupdate.php'; if (!isset($this->ProjectId) || $this->ProjectId < 1) { echo 'CoverageFile2User:AssignLastAuthor: ProjectId not set'; return false; } if ($buildid == 0) { echo 'CoverageFile2User:AssignLastAuthor: buildid not valid'; return false; } // Find the files associated with the build $Coverage = new Coverage(); $Coverage->BuildId = $buildid; $fileIds = $Coverage->GetFiles(); foreach ($fileIds as $fileid) { $CoverageFile = new CoverageFile(); $CoverageFile->Id = $fileid; $fullpath = $CoverageFile->GetPath(); $DailyUpdate = new DailyUpdate(); $DailyUpdate->ProjectId = $this->ProjectId; $userids = $DailyUpdate->GetAuthors($fullpath); foreach ($userids as $userid) { $this->FullPath = $fullpath; $this->UserId = $userid; $this->Insert(); } } return true; }
} $xml .= "</build>"; } // For now take the first one if ($buildid > 0) { // Find the files associated with the build $Coverage = new Coverage(); $Coverage->BuildId = $buildid; $fileIds = $Coverage->GetFiles(); $row = "0"; sort($fileIds); foreach ($fileIds as $fileid) { $CoverageFile = new CoverageFile(); $CoverageFile->Id = $fileid; $xml .= "<file>"; $CoverageFile2User->FullPath = $CoverageFile->GetPath(); $xml .= add_XML_value("fullpath", $CoverageFile->GetPath()); $xml .= add_XML_value("id", $CoverageFile2User->GetId()); $xml .= add_XML_value("fileid", $fileid); $row = $row == 0 ? 1 : 0; $xml .= add_XML_value("row", $row); // Get the authors $CoverageFile2User->FullPath = $CoverageFile->GetPath(); $authorids = $CoverageFile2User->GetAuthors(); foreach ($authorids as $authorid) { $xml .= "<author>"; $User = new User(); $User->Id = $authorid; $xml .= add_XML_value("name", $User->GetName()); $xml .= add_XML_value("id", $authorid); $xml .= "</author>";