[Fusionforge-commits] r12419 - in trunk/src/plugins/mantisbt/view: . admin

Franck VILLAUME nerville at fusionforge.org
Mon Feb 28 13:53:16 CET 2011


Author: nerville
Date: 2011-02-28 13:53:15 +0100 (Mon, 28 Feb 2011)
New Revision: 12419

Modified:
   trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php
   trunk/src/plugins/mantisbt/view/roadmap.php
Log:
fix soap call... missing in 1.2.x

Modified: trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php	2011-02-28 12:38:01 UTC (rev 12418)
+++ trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php	2011-02-28 12:53:15 UTC (rev 12419)
@@ -1,6 +1,8 @@
 <?php
 /*
- * Copyright 2010, Franck Villaume - Capgemini
+ * MantisBT plugin
+ *
+ * Copyright 2010-2011, Franck Villaume - Capgemini
  * http://fusionforge.org
  *
  * This file is part of FusionForge.
@@ -22,14 +24,18 @@
 
 /* main display */
 global $HTML;
-global $idProjetMantis;
+global $mantisbt;
+global $group_id;
+global $mantisbtConf;
+global $username;
+global $password;
 
 try {
 	/* do not recreate $clientSOAP object if already created by other pages */
 	if (!isset($clientSOAP))
-		$clientSOAP = new SoapClient(forge_get_config('server_url','mantisbt')."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+		$clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 
-	$stats = $clientSOAP->__soapCall('mc_project_get_statistiques', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis, "level" => 0));
+	$stats = $clientSOAP->__soapCall('mc_project_get_statistiques', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt'], "level" => 0));
 } catch (SoapFault $soapFault) {
 	echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
 	$errorPage = true;
@@ -37,30 +43,26 @@
 
 if (!isset($errorPage)){
 	$total = array('open' => 0, 'resolved' => 0, 'resolved' => 0, 'closed' => 0, 'total' => 0);
-	echo $HTML->boxTop("Répartition par état");
+	echo $HTML->boxTop(_('Tickets oer Status'));
 	echo	'<tr>';
-	echo		'<th class="InTextBrown">Projet</th>';
-	echo		'<th class="InTextBrown">Ouvert</th>';
-	echo		'<th class="InTextBrown">Résolu</th>';
-	echo		'<th class="InTextBrown">Fermé</th>';
-	echo		'<th class="InTextBrown">Total</th>';
+	echo		'<th class="InTextBrown">'._('Project').'</th>';
+	echo		'<th class="InTextBrown">'._('Open').'</th>';
+	echo		'<th class="InTextBrown">'._('Fixed').'</th>';
+	echo		'<th class="InTextBrown">'._('Closed').'</th>';
+	echo		'<th class="InTextBrown">'._('Total').'</th>';
 	echo	'</tr>';
-	$nbligne = 0;
+	$nbligne = 1;
 	foreach ($stats as $stat) {
 		$indentation = "";
 		for($i = 1; $i < $stat->project_level; $i++){
 			$indentation = $indentation .'  ';
 		}
-		if ( $nbligne % 2 == 0 ) {
-			echo	'<tr class="LignePaire">';
-		} else {
-			echo	'<tr class="LigneImpaire">';
-		}
+		echo '<tr '.$HTML->boxGetAltRowStyle($nbligne).'">';
 
 		if ($stat->project_level > 1){
-			echo sprintf('<td class="InTextBrown">%s >> <a class="DataLink" href="?type=group&id=%s&pluginname=mantisbt">%s</a></td>',$indentation,group_get_objectid_by_publicname($stat->project_name), $stat->project_name);
+			echo sprintf('<td class="InTextBrown">%s >> <a class="DataLink" href="?type=group&group_id=%s&pluginname=%s">%s</a></td>',$indentation,group_get_objectid_by_publicname($stat->project_name), $mantisbt->name, $stat->project_name);
 		}else{
-			echo sprintf('<td class="InTextBrown"><a class="DataLink" href="?type=group&id=%s&pluginname=mantisbt">%s</a></td>',group_get_objectid_by_publicname($stat->project_name), $stat->project_name);
+			echo sprintf('<td class="InTextBrown"><a class="DataLink" href="?type=group&group_id=%s&pluginname=%s">%s</a></td>',group_get_objectid_by_publicname($stat->project_name), $mantisbt->name, $stat->project_name);
 		}
 		echo		'<td class="InTextBrown">'.$stat->open.'</td>';
 		echo		'<td class="InTextBrown">'.$stat->resolved.'</td>';

Modified: trunk/src/plugins/mantisbt/view/roadmap.php
===================================================================
--- trunk/src/plugins/mantisbt/view/roadmap.php	2011-02-28 12:38:01 UTC (rev 12418)
+++ trunk/src/plugins/mantisbt/view/roadmap.php	2011-02-28 12:53:15 UTC (rev 12419)
@@ -112,7 +112,12 @@
 	}
 	if (isset($listPrintVersions) && !empty($listPrintVersions)) {
 		foreach ($listPrintVersions as $key => $version) {
-			$idsBug = $clientSOAP->__soapCall('mc_issue_get_list_by_project_for_specific_version', array("username" => $username, "password" => $password, "project" => $mantisbtConf['id_mantisbt'], "version" => $version->name ));
+			try {
+				$idsBug = $clientSOAP->__soapCall('mc_issue_get_list_by_project_for_specific_version', array("username" => $username, "password" => $password, "project" => $mantisbtConf['id_mantisbt'], "version" => $version->name ));
+			} catch (SoapFault $soapFault) {
+				echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
+				break;
+			}
 			echo	'<fieldset>';
 			$typeVersion = _('Milestone');
 			if ( $version->released ) {




More information about the Fusionforge-commits mailing list