Mantis Schnittstellen

This commit is contained in:
Andreas Österreicher
2011-11-16 09:20:54 +00:00
parent d5b210f377
commit 944ccd610f
3 changed files with 121 additions and 0 deletions
+37
View File
@@ -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;
}
}
+44
View File
@@ -0,0 +1,44 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Österreicher <andreas.oesterreicher@technikum-wien.at>
*/
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();
?>
+40
View File
@@ -0,0 +1,40 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Österreicher <andreas.oesterreicher@technikum-wien.at>
*/
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();
?>