* SOAP Tracker Include - this file contains wrapper functions for the SOAP interface
*
* Copyright 2004 (c) GForge, LLC
+ * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
* http://gforge.org
*
- * This file is part of FusionForge.
- *
- * FusionForge 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 file is part of FusionForge. FusionForge 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 Licence, or (at your option)
+ * any later version.
*
* FusionForge 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 FusionForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 US
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once $gfcommon.'include/Error.class.php';
$uri,
$uri.'#getArtifactTypes','rpc','encoded'
);
-//
-// Artifact Extra Fields
+//
+// Artifact Extra Fields
// By remo on 08-Mar-2005
$server->wsdl->addComplexType(
//
function &getArtifactTypes($session_ser,$group_id) {
continue_session($session_ser);
- $grp =& group_get_object($group_id);
+ $grp = group_get_object($group_id);
if (!$grp || !is_object($grp)) {
return new soap_fault ('','getArtifactTypes','Could Not Get Project','Could Not Get Project');
} elseif ($grp->isError()) {
$efields=$extra_fields[$eky];
$efid = $efields['extra_field_id'];
$data = $efields['field_data'];
-
+
// if the extra field is of type CHECKBOX or MULTISELECT we must
// convert the value passed by the user from a comma separated list
// of ids to an array
if (array_key_exists($efid, $extra_field_info)) {
if ($extra_field_info[$efid]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX ||
$extra_field_info[$efid]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_MULTISELECT) {
- $data = split(",", $data);
+ $data = explode(',', $data);
}
}
-
+
$fieldsdata[$efid]=$data;
}
}
$priority,$assigned_to,$summary,$details,$extra_fields) {
continue_session($session_ser);
- $grp =& group_get_object($group_id);
+ $grp = group_get_object($group_id);
if (!$grp || !is_object($grp)) {
return new soap_fault ('','addArtifact','Could Not Get Project','Could Not Get Project');
} elseif ($grp->isError()) {
} elseif ($a->isError()) {
return new soap_fault ('','addArtifact',$a->getErrorMessage(),$a->getErrorMessage());
}
-
+
$aef = $a->ArtifactType->getExtraFields();
$extra_flds=arrangeExtraFields($extra_fields,$aef);
if (!$a->create($summary,$details,$assigned_to,$priority,$extra_flds)) {
function &updateArtifact($session_ser,$group_id,$group_artifact_id,$artifact_id,$status_id,
$priority,$assigned_to,$summary,$details,$new_artifact_type_id,$extra_fields_data) {
continue_session($session_ser);
- $grp =& group_get_object($group_id);
+ $grp = group_get_object($group_id);
if (!$grp || !is_object($grp)) {
return new soap_fault ('','updateArtifact','Could Not Get Project','Could Not Get Project');
} elseif ($grp->isError()) {
//
function &getArtifactTechnicians($session_ser,$group_id,$group_artifact_id) {
continue_session($session_ser);
- $grp =& group_get_object($group_id);
+ $grp = group_get_object($group_id);
if (!$grp || !is_object($grp)) {
return new soap_fault ('','getArtifactTechnicians','Could Not Get Project','Could Not Get Project');
} elseif ($grp->isError()) {
//
function &getArtifacts($session_ser,$group_id,$group_artifact_id,$assigned_to,$status) {
continue_session($session_ser);
- $grp =& group_get_object($group_id);
+ $grp = group_get_object($group_id);
if (!$grp || !is_object($grp)) {
return new soap_fault ('','getArtifacts','Could Not Get Project','Could Not Get Project');
} elseif ($grp->isError()) {
} else {
$set = false;
}
-
+
$af->setup(0,'','',0,$set,$assigned_to,$status);
$artifacts = $af->getArtifacts();
if ($artifacts === false) {
return new soap_fault ('','getArtifacts',$af->getErrorMessage(),$af->getErrorMessage());
}
- return artifacts_to_soap($artifacts);
+ return util_strip_unprintable(artifacts_to_soap($artifacts));
}
//
function &getArtifactFiles($session_ser,$group_id,$group_artifact_id,$artifact_id) {
continue_session($session_ser);
- $grp =& group_get_object($group_id);
+ $grp = group_get_object($group_id);
if (!$grp || !is_object($grp)) {
return new soap_fault ('','getArtifactFiles','Could Not Get Project','Could Not Get Project');
} elseif ($grp->isError()) {
} elseif ($a->isError()) {
return new soap_fault ('','getArtifactFiles',$a->getErrorMessage(),$a->getErrorMessage());
}
-
+
$files_arr = $a->getFiles();
$return = artifactfiles_to_soap($files_arr);
function getArtifactFileData($session_ser,$group_id,$group_artifact_id,$artifact_id,$file_id) {
continue_session($session_ser);
- $grp =& group_get_object($group_id);
+ $grp = group_get_object($group_id);
if (!$grp || !is_object($grp)) {
return new soap_fault ('','getArtifactFileData','Could Not Get Project','Could Not Get Project');
} elseif ($grp->isError()) {
} elseif ($a->isError()) {
return new soap_fault ('','getArtifactFileData',$a->getErrorMessage(),$a->getErrorMessage());
}
-
+
$af=new ArtifactFile($a,$file_id);
if (!$af || !is_object($af)) {
return new soap_fault ('','getArtifactFileData','ArtifactFile Could Not Be Created','ArtifactFile Could Not Be Created');
} else if ($af->isError()) {
return new soap_fault ('','getArtifactFileData',$af->getErrorMessage(),$af->getErrorMessage());
- }
-
+ }
+
//send file encoded in base64
return base64_encode($af->getData());
}
//
//
// addArtifactFile
-//
+//
/*
'session_ser'=>'xsd:string',
*/
function addArtifactFile($session_ser,$group_id,$group_artifact_id,$artifact_id,$base64_contents,$description,$filename,$filetype) {
continue_session($session_ser);
-
- $grp =& group_get_object($group_id);
+
+ $grp = group_get_object($group_id);
if (!$grp || !is_object($grp)) {
return new soap_fault ('','addArtifactFile','Could Not Get Project','Could Not Get Project');
} elseif ($grp->isError()) {
} elseif ($a->isError()) {
return new soap_fault ('','addArtifactFile',$a->getErrorMessage(),$a->getErrorMessage());
}
-
+
$af = new ArtifactFile($a);
if (!$af || !is_object($af)) {
return new soap_fault ('','addArtifactFile','Could Not Create ArtifactFile object','Could Not Create ArtifactFile object');
$bin_data = base64_decode($base64_contents);
$filesize = strlen($bin_data);
-
+
$res = $af->create($filename,$filetype,$filesize,$bin_data,$description);
-
+
if (!$res) {
return new soap_fault ('','addArtifactFile',$af->getErrorMessage(),$af->getErrorMessage());
}
-
+
return $res;
}
//
function &getArtifactMessages($session_ser,$group_id,$group_artifact_id,$artifact_id) {
continue_session($session_ser);
- $grp =& group_get_object($group_id);
+ $grp = group_get_object($group_id);
if (!$grp || !is_object($grp)) {
return new soap_fault ('','getArtifactMessages','Could Not Get Project','Could Not Get Project');
} elseif ($grp->isError()) {
//
function &addArtifactMessage($session_ser,$group_id,$group_artifact_id,$artifact_id,$body) {
continue_session($session_ser);
- $grp =& group_get_object($group_id);
+ $grp = group_get_object($group_id);
if (!$grp || !is_object($grp)) {
return new soap_fault ('','addArtifactMessage','Could Not Get Project','Could Not Get Project');
} elseif ($grp->isError()) {
function artifactGetChangeLog($session_ser, $group_id, $group_artifact_id, $artifact_id) {
continue_session($session_ser);
- $grp =& group_get_object($group_id);
+ $grp = group_get_object($group_id);
if (!$grp || !is_object($grp)) {
return new soap_fault ('','artifactGetChangeLog','Could Not Get Project','Could Not Get Project');
} elseif ($grp->isError()) {
return new soap_fault ('','artifactGetChangeLog',$grp->getErrorMessage(),$grp->getErrorMessage());
}
-
+
$at = new ArtifactType($grp,$group_artifact_id);
if (!$at || !is_object($at)) {
return new soap_fault ('','artifactGetChangeLog','Could Not Get ArtifactType','Could Not Get ArtifactType');
} elseif ($artifact->isError()) {
return new soap_fault ('','artifactGetChangeLog',$artifact->getErrorMessage(),$artifact->getErrorMessage());
}
-
+
// note that Artifact::getHistory returns a DB result handler
$result = $artifact->getHistory();
return artifact_history_to_soap($result, $at);
$old_value = $entry["old_value"];
$date = $entry["entrydate"];
$user_name = $entry["user_name"];
-
+
if ($field_name == 'status_id') {
$old_value = $artifactType->getStatusName($old_value);
} else if ($field_name == 'assigned_to') {
} else if ($field == 'close_date') {
$old_value = date(_('Y-m-d H:i'), $old_value);
}
-
+
//$date = date(_('Y-m-d H:i'), $date);
-
+
$result[] = array(
"field_name" => $field_name,
"old_value" => $old_value,
"user_name" => $user_name
);
}
-
+
return $result;
}
?>