diff --git a/content/projekt/mantisdetail.overlay.xul.php b/content/projekt/mantisdetail.overlay.xul.php
index 9a907ffae..52d5c2c4a 100755
--- a/content/projekt/mantisdetail.overlay.xul.php
+++ b/content/projekt/mantisdetail.overlay.xul.php
@@ -106,7 +106,11 @@ echo '';
-
+
+
+
+
+
diff --git a/content/projekt/projekttask.overlay.js.php b/content/projekt/projekttask.overlay.js.php
index e431f7c35..e299660e5 100755
--- a/content/projekt/projekttask.overlay.js.php
+++ b/content/projekt/projekttask.overlay.js.php
@@ -551,6 +551,7 @@ function onselectProjekttask()
var issue_projection_name=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#issue_projection_name" ));
var issue_eta_id=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#issue_eta_id" ));
var issue_eta_name=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#issue_eta_name" ));
+ var issue_tags_name=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#issue_tags_name" ));
var issue_resolution_id=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#issue_resolution_id" ));
var issue_resolution_name=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#issue_resolution_name" ));
var issue_due_date=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#issue_due_date" ));
@@ -592,6 +593,7 @@ function onselectProjekttask()
document.getElementById('textbox-projekttask-mantis-issue_due_date').value=issue_due_date;
document.getElementById('textbox-projekttask-mantis-issue_steps_to_reproduce').value=issue_steps_to_reproduce;
document.getElementById('textbox-projekttask-mantis-issue_additional_information').value=issue_additional_information;
+ document.getElementById('textbox-projekttask-mantis-issue_tags').value=issue_tags_name;
}
}
@@ -676,7 +678,8 @@ function saveProjekttaskMantis()
var issue_due_date=document.getElementById('textbox-projekttask-mantis-issue_due_date').value;
var issue_steps_to_reproduce=document.getElementById('textbox-projekttask-mantis-issue_steps_to_reproduce').value;
var issue_additional_information=document.getElementById('textbox-projekttask-mantis-issue_additional_information').value;
-
+ var issue_tags = document.getElementById('textbox-projekttask-mantis-issue_tags').value;
+
var soapBody = new SOAPObject("saveMantis");
soapBody.appendChild(new SOAPObject("projekttask_id")).val(projekttask_id);
soapBody.appendChild(new SOAPObject("mantis_id")).val(mantis_id);
@@ -716,6 +719,20 @@ function saveProjekttaskMantis()
SOAPClient.Proxy="soap/projekttask.soap.php?"+gettimestamp();
SOAPClient.SendRequest(sr, clb_saveProjekttaskMantis);
+
+ // Tags speichern
+ if(mantis_id != '')
+ {
+ var soapBody = new SOAPObject("saveTagsForIssue");
+ soapBody.appendChild(new SOAPObject("mantis_id")).val(mantis_id);
+ soapBody.appendChild(new SOAPObject("issue_tags")).val(issue_tags);
+
+ var sr = new SOAPRequest("saveTagsForIssue",soapBody);
+
+ SOAPClient.Proxy="soap/projekttask.soap.php?"+gettimestamp();
+ SOAPClient.SendRequest(sr, clb_saveProjekttaskMantis);
+ }
+
}
// ****
diff --git a/include/mantis.class.php b/include/mantis.class.php
index 595892295..98aba2dff 100755
--- a/include/mantis.class.php
+++ b/include/mantis.class.php
@@ -52,6 +52,7 @@ class mantis extends basis_db
public $issue_due_date;
public $issue_steps_to_reproduce;
public $issue_additional_information;
+ public $issue_tags;
public $soapClient;
public $errormsg;
@@ -80,6 +81,51 @@ class mantis extends basis_db
}
}
+
+ /**
+ *
+ * @param type $issue_tags
+ * @return type
+ */
+ public function setTags($issue_tags)
+ {
+
+ $tags = array();
+ $tags_array = explode(',', $issue_tags);
+
+ // Hole alle Tags
+ $params_tags=array('username' => MANTIS_USERNAME, 'password' => MANTIS_PASSWORT, 'page_number'=>1, 'per_page'=>20);
+ $result_tags = $this->soapClient->__soapCall('mc_tag_get_all',$params_tags);
+
+
+ $test = array();
+ $test = $result_tags->results;
+
+
+ foreach($tags_array as $t)
+ {
+ $tags_help = new stdClass();
+ $tags_help->name = trim($t);
+
+ foreach($result_tags->results as $rt)
+ {
+
+ if($rt->name == $tags_help->name)
+ {
+ $tags_help->id = $rt->id;
+ }
+
+ }
+ //$tags_help->id = 10;
+ $tags[] = $tags_help;
+ }
+
+ $params=array('username' => MANTIS_USERNAME, 'password' => MANTIS_PASSWORT,'issue_id' =>$this->issue_id, $tags);
+ $result = $this->soapClient->__soapCall('mc_issue_set_tags',$params);
+ return $result;
+ }
+
+
/**
* Ticket Update
*/
@@ -169,6 +215,21 @@ class mantis extends basis_db
$this->issue_resolution = new stdclass();
$this->issue_resolution->id = $result->resolution->id;
$this->issue_resolution->name = $result->resolution->name;
+ $this->issue_tags = new stdclass();
+ $anzTags = count($result->tags);
+ $i = 1;
+ foreach($result->tags as $r)
+ {
+ if($i == $anzTags)
+ $this->issue_tags->name.= $r->name;
+ else
+ $this->issue_tags->name.=$r->name.',';
+
+ $i++;
+ }
+ if($anzTags == 0)
+ $this->issue_tags->name = '';
+
$this->issue_description = $result->description;
//$this->issue_attachments = $result->attachments;
$this->issue_due_date = $result->due_date;
@@ -239,4 +300,4 @@ class mantis extends basis_db
return false;
}
}
-}
+}
\ No newline at end of file
diff --git a/rdf/mantis.rdf.php b/rdf/mantis.rdf.php
index a7079746f..d5e0dc2a0 100755
--- a/rdf/mantis.rdf.php
+++ b/rdf/mantis.rdf.php
@@ -79,6 +79,7 @@ $mantis->getIssue($issue_id);
issue_projection->name; ?>]]>
issue_eta->id; ?>]]>
issue_eta->name; ?>]]>
+ issue_tags->name; ?>]]>
issue_resolution->id; ?>]]>
issue_resolution->name; ?>]]>
issue_due_date; ?>]]>
diff --git a/soap/projekttask.soap.php b/soap/projekttask.soap.php
index 4594268c2..b951569ce 100644
--- a/soap/projekttask.soap.php
+++ b/soap/projekttask.soap.php
@@ -39,6 +39,7 @@ $SOAPServer->addFunction("deleteProjekttask");
$SOAPServer->addFunction("saveMantis");
$SOAPServer->addFunction("setErledigt");
$SOAPServer->addFunction("changeProjektPhase");
+$SOAPServer->addFunction("saveTagsForIssue");
$SOAPServer->handle();
// WSDL Chache auf aus
@@ -205,6 +206,26 @@ function saveMantis($projekttask_id, $mantis_id, $issue_summary, $issue_descript
}
}
+/**
+ * Setzt Tags für einen Eintrag
+ * @param type $mantis_id
+ * @param type $issue_tags
+ * @return string|\SoapFault
+ */
+function saveTagsForIssue($mantis_id, $issue_tags)
+{
+ //get_uid();
+ $mantis = new mantis();
+
+ $mantis->issue_id = $mantis_id;
+
+ if($mantis->setTags($issue_tags))
+ return 'ok';
+ else
+ return new SoapFault("Server", $mantis->errormsg);
+}
+
+
/**
*
* Setzt den Erledigt Status
diff --git a/soap/projekttask.wsdl.php b/soap/projekttask.wsdl.php
index 125c9fae2..76eb56ab7 100644
--- a/soap/projekttask.wsdl.php
+++ b/soap/projekttask.wsdl.php
@@ -46,7 +46,15 @@ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
-
+
+
+
+
+
+
+
+
+
@@ -122,6 +130,10 @@ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+
+
+
+
@@ -166,6 +178,15 @@ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+
+
+ " />
+
+
+
+
+
+
" />