diff --git a/include/mantis.class.php b/include/mantis.class.php index a21821486..a6a25b162 100755 --- a/include/mantis.class.php +++ b/include/mantis.class.php @@ -160,4 +160,41 @@ class mantis extends basis_db return true; } + + /** + * Projekte holen + */ + public function getProjects() + { + $params=array('username' => MANTIS_USERNAME, 'password' => MANTIS_PASSWORT); + $result = $this->soapClient->__soapCall('mc_projects_get_user_accessible',$params); + + foreach($result as $row) + { + $obj = new mantis(); + $obj->issue_project->name = $row->name; + $obj->issue_project->id = $row->id; + + $this->result[] = $obj; + } + return true; + } + + /** + * Kategorien holen + */ + public function getCategories($project_id) + { + $params=array('username' => MANTIS_USERNAME, 'password' => MANTIS_PASSWORT, 'project_id'=>$project_id); + $result = $this->soapClient->__soapCall('mc_project_get_categories',$params); + + foreach($result as $val) + { + $obj = new mantis(); + $obj->issue_category = $val; + + $this->result[] = $obj; + } + return true; + } } diff --git a/rdf/mantis_categories.rdf.php b/rdf/mantis_categories.rdf.php new file mode 100644 index 000000000..a8adf8f5d --- /dev/null +++ b/rdf/mantis_categories.rdf.php @@ -0,0 +1,44 @@ + + */ +require_once('../config/vilesci.config.inc.php'); +require_once('../include/rdf.class.php'); +require_once('../include/mantis.class.php'); + +if(!isset($_GET['project_id'])) + die('Missing Parameter: Project_id'); + +$project_id=$_GET['project_id']; + +$oRdf = new rdf('MANTIS_CATEGORIES','http://www.technikum-wien.at/mantis_categories'); +$oRdf->sendHeader(); + +$mantis = new mantis(); +$mantis->getCategories($project_id); + +foreach($mantis->result as $row) +{ + $i=$oRdf->newObjekt($row->issue_category); + $oRdf->obj[$i]->setAttribut('category',$row->issue_category,true); + + $oRdf->addSequence($row->issue_category); +} + +$oRdf->sendRdfText(); +?> diff --git a/rdf/mantis_projects.rdf.php b/rdf/mantis_projects.rdf.php new file mode 100644 index 000000000..d0f123583 --- /dev/null +++ b/rdf/mantis_projects.rdf.php @@ -0,0 +1,40 @@ + + */ +require_once('../config/vilesci.config.inc.php'); +require_once('../include/rdf.class.php'); +require_once('../include/mantis.class.php'); + +$oRdf = new rdf('MANTIS_PROJECT','http://www.technikum-wien.at/mantis_project'); +$oRdf->sendHeader(); + +$mantis = new mantis(); +$mantis->getProjects(); + +foreach($mantis->result as $row) +{ + $i=$oRdf->newObjekt($row->issue_project->id); + $oRdf->obj[$i]->setAttribut('id',$row->issue_project->id,true); + $oRdf->obj[$i]->setAttribut('name',$row->issue_project->name,true); + + $oRdf->addSequence($row->issue_project->id); +} + +$oRdf->sendRdfText(); +?>