[Fusionforge-commits] r12448 - in trunk/src/plugins/mantisbt: common view/admin

Franck VILLAUME nerville at fusionforge.org
Mon Feb 28 23:20:59 CET 2011


Author: nerville
Date: 2011-02-28 23:20:58 +0100 (Mon, 28 Feb 2011)
New Revision: 12448

Modified:
   trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php
   trunk/src/plugins/mantisbt/view/admin/viewVersion.php
Log:
support init with already created project

Modified: trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php
===================================================================
--- trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php	2011-02-28 22:03:51 UTC (rev 12447)
+++ trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php	2011-02-28 22:20:58 UTC (rev 12448)
@@ -286,7 +286,6 @@
 	 * @return	boolean	created or not
 	 */
 	function isProjectMantisCreated($idProjet){
-
 		$resIdProjetMantis = db_query_params('SELECT id_mantisbt FROM plugin_mantisbt WHERE id_group = $1',
 					array($idProjet));
 		if (!$resIdProjetMantis)
@@ -647,6 +646,30 @@
 
 		return true;
 	}
+
+	/**
+	 * getProjectMantisByName - find the project to link with
+	 *
+	 * @param	array	configuration array
+	 * @return	int	the mantisbt id
+	 */
+	function getProjectMantisByName($group_id, $confArr) {
+		$groupObject = group_get_object($group_id);
+		try {
+			$clientSOAP = new SoapClient($confArr['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+			$mantisbtProjectArr = $clientSOAP->__soapCall('mc_projects_get_user_accessible', array("username" => $confArr['soap_user'], "password" => $confArr['soap_password']));
+		} catch (SoapFault $soapFault) {
+			$groupObject->setError('getProjectMantisByName::Error: ' . $soapFault->faultstring);
+			return false;
+		}
+		foreach ($mantisbtProjectArr as $mantisbtProject) {
+			if ($mantisbtProject->name == $confArr['mantisbtname']) {
+				return $mantisbtProject->id;
+			}
+		}
+		$groupObject->setError('getProjectMantisByName::Error: mantisbt project not found');
+		return false;
+	}
 }
 // Local Variables:
 // mode: php

Modified: trunk/src/plugins/mantisbt/view/admin/viewVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/viewVersion.php	2011-02-28 22:03:51 UTC (rev 12447)
+++ trunk/src/plugins/mantisbt/view/admin/viewVersion.php	2011-02-28 22:20:58 UTC (rev 12448)
@@ -57,7 +57,8 @@
 		foreach ($listVersions as $key => $version){
 			echo '<tr '.$HTML->boxGetAltRowStyle($i).'">';
 			echo '<td>'.$version->name.'</td>';
-			echo '<td>'.$version->description.'</td>';
+			(isset($version->description))? $description_value = $version->description : $description_value = '';
+			echo '<td>'.$description_value.'</td>';
 			echo '<td>'.strftime("%d/%m/%Y",strtotime($version->date_order)).'</td>';
 			/* est-ce une version release ? */
 			if ( $version->released ) {




More information about the Fusionforge-commits mailing list