[Fusionforge-commits] r12415 - in trunk/src/plugins/mantisbt: action view view/admin

Franck VILLAUME nerville at fusionforge.org
Mon Feb 28 12:00:42 CET 2011


Author: nerville
Date: 2011-02-28 12:00:40 +0100 (Mon, 28 Feb 2011)
New Revision: 12415

Modified:
   trunk/src/plugins/mantisbt/action/addVersion.php
   trunk/src/plugins/mantisbt/view/addOrEditNote.php
   trunk/src/plugins/mantisbt/view/admin/addCategory.php
   trunk/src/plugins/mantisbt/view/admin/addVersion.php
   trunk/src/plugins/mantisbt/view/admin/viewVersion.php
Log:
make it work ... numerous fix

Modified: trunk/src/plugins/mantisbt/action/addVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/action/addVersion.php	2011-02-28 10:00:13 UTC (rev 12414)
+++ trunk/src/plugins/mantisbt/action/addVersion.php	2011-02-28 11:00:40 UTC (rev 12415)
@@ -1,7 +1,10 @@
 <?php
 /*
- * Copyright 2010, Franck Villaume - Capgemini
+ * MantisBT plugin
  *
+ * Copyright 2010-2011, Franck Villaume - Capgemini
+ * http://fusionforge.org
+ *
  * This file is part of FusionForge.
  *
  * FusionForge is free software; you can redistribute it and/or modify
@@ -19,16 +22,24 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+global $mantisbt;
+global $mantisbtConf;
+global $username;
+global $password;
+global $group_id;
+
 /* addVersion action page */
 if (isset($_POST['version']) && !empty($_POST['version'])) {
 	$versionStruct = array();
 	$versionStruct['name'] = $_POST['version'];
-	$versionStruct['project_id'] = $idProjetMantis;
+	$versionStruct['project_id'] = $mantisbtConf['id_mantis'];
 	$versionStruct['released'] = '';
 	$versionStruct['description'] = '';
 	$versionStruct['date_order'] = '';
 	try {
-		$clientSOAP = new SoapClient(forge_get_config('server_url','mantisbt')."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+		if (!isset($clientSOAP))
+			$clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+
 		$clientSOAP->__soapCall('mc_project_version_add', array("username" => $username, "password" => $password, "version" => $versionStruct));
 		if (isset($_POST['transverse'])) {
 			$listChild = $clientSOAP->__soapCall('mc_project_get_all_subprojects', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
@@ -45,18 +56,18 @@
 						$clientSOAP->__soapCall('mc_project_version_add', array("username" => $username, "password" => $password, "version" => $versionStruct));
 					} catch (SoapFault $soapFault) {
 						$msg = _('Task failed:').' '.$versionStruct['name'].' '.$soapFault->faultstring;
-						session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&error_msg='.urlencode($msg));
+						session_redirect('plugins/mantisbt/?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&error_msg='.urlencode($msg));
 					}
 				}
 			}
 		}
 	} catch (SoapFault $soapFault) {
 		$msg = _('Task failed:').' '.$versionStruct['name'].' '.$soapFault->faultstring;
-		session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&error_msg='.urlencode($msg));
+		session_redirect('plugins/mantisbt/?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&error_msg='.urlencode($msg));
 	}
-	$feedback = _('Task succeeded');
-	session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&feedback='.urlencode($feedback));
+	$feedback = _('Task succeeded.');
+	session_redirect('plugins/mantisbt/?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&feedback='.urlencode($feedback));
 }
-$warning_msg = _('Missing version');
-session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&warning_msg='.urlencode($warning_msg));
+$warning_msg = _('Missing version.');
+session_redirect('plugins/mantisbt/?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&warning_msg='.urlencode($warning_msg));
 ?>

Modified: trunk/src/plugins/mantisbt/view/addOrEditNote.php
===================================================================
--- trunk/src/plugins/mantisbt/view/addOrEditNote.php	2011-02-28 10:00:13 UTC (rev 12414)
+++ trunk/src/plugins/mantisbt/view/addOrEditNote.php	2011-02-28 11:00:40 UTC (rev 12415)
@@ -63,7 +63,7 @@
 	echo 		'<form Method="POST" Action="?type='.$type.'&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&idBug='.$defect->id.'&idNote='.$idNote.'&action='.$actionform.'&view=viewIssue">';
 	echo				'<table class="innertabs">';
 	echo 					'<tr>';
-	echo						'<td class="FullBox" ><textarea name="edit_texte_note" style="width:99%;" rows=12>'.$noteEdit->text.'</textarea></td>';
+	echo						'<td class="FullBox" ><textarea name="edit_texte_note" style="width:99%;" rows=12>'.(isset($noteEdit->text))? '' : $noteEdit->text.'</textarea></td>';
 	echo 					'</tr>';
 	echo				'</table>';
 	echo 				'<input type=button onclick="this.form.submit();this.disabled=true;" value="'.$labelButtonSubmit.'">';

Modified: trunk/src/plugins/mantisbt/view/admin/addCategory.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/addCategory.php	2011-02-28 10:00:13 UTC (rev 12414)
+++ trunk/src/plugins/mantisbt/view/admin/addCategory.php	2011-02-28 11:00:40 UTC (rev 12415)
@@ -30,7 +30,7 @@
 echo '<form method="POST" name="addCategory" action="index.php?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&action=addCategory">';
 echo '<table><tr>';
 echo $HTML->boxTop(_('Add a new category'));
-echo '<td><input name="nameCategory" type="text"></input></td>';
+echo '<td><label>'._('Name').'<input name="nameCategory" type="text"></input></td>';
 echo '<td>';
 echo '<input type="submit" value="'. _('Add') .'" />';
 echo '</td>';

Modified: trunk/src/plugins/mantisbt/view/admin/addVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/addVersion.php	2011-02-28 10:00:13 UTC (rev 12414)
+++ trunk/src/plugins/mantisbt/view/admin/addVersion.php	2011-02-28 11:00:40 UTC (rev 12415)
@@ -33,12 +33,16 @@
 echo '<table><tr>';
 echo $HTML->boxTop(_('Add a new version'));
 echo '<td>';
-echo '<input name="version" type="text" size="10" />';
+echo '<label>'._('Name').'</label><input name="version" type="text" size="10" />';
 if ($group->usesPlugin('projects_hierarchy')) {
 	echo '<input name="transverse" type="checkbox" value="1" >'. _('Cross version (son included)') .'</input>';
 }
 echo '</td>';
+echo '</tr><tr>';
 echo '<td>';
+echo '<label>'._('Description').'</label><input name="description" type="text" size="20" />';
+echo '</td>';
+echo '<td>';
 echo '<input type="submit" value="'. _('Add') .'" />';
 echo '</td>';
 echo $HTML->boxBottom();

Modified: trunk/src/plugins/mantisbt/view/admin/viewVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/viewVersion.php	2011-02-28 10:00:13 UTC (rev 12414)
+++ trunk/src/plugins/mantisbt/view/admin/viewVersion.php	2011-02-28 11:00:40 UTC (rev 12415)
@@ -46,18 +46,16 @@
 		echo '<table class="innertabs">';
 		echo	'<tr>';
 		echo		'<td class="FullBoxTitle">'._('Version').'</td>';
+		echo		'<td class="FullBoxTitle">'._('Description').'</td>';
 		echo		'<td class="FullBoxTitle">'._('Target Date').'</td>';
 		echo		'<td class="FullBoxTitle">'._('Type').'</td>';
 		echo 		'<td class="FullBoxTitle">'._('Action').'</td>';
 		echo	'</tr>';
 		$i = 0;
 		foreach ($listVersions as $key => $version){
-			if ( $i % 2 == 0 ) {
-				echo '<tr class="LignePaire">';
-			} else {
-				echo '<tr class="LigneImpaire">';
-			}
+			echo '<tr '.$HTML->boxGetAltRowStyle($i).'">';
 			echo '<td class="InText">'.$version->name.'</td>';
+			echo '<td class="InText">'.$version->description.'</td>';
 			echo '<td class="InText">'.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