[Fusionforge-commits] FusionForge branch master updated. d7ba933cf65935327a6af698ed8eb23433bec916

Franck Villaume nerville at fusionforge.org
Tue Sep 16 19:19:27 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  d7ba933cf65935327a6af698ed8eb23433bec916 (commit)
      from  ae92df919755ed58ed37a23e3ca10ade513945de (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d7ba933cf65935327a6af698ed8eb23433bec916
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Tue Sep 16 19:16:46 2014 +0200

    plugin mantisbt: cleanup html, remove some useless vars.

diff --git a/src/plugins/mantisbt/view/admin/editVersion.php b/src/plugins/mantisbt/view/admin/editVersion.php
index e96f09f..83a461c 100644
--- a/src/plugins/mantisbt/view/admin/editVersion.php
+++ b/src/plugins/mantisbt/view/admin/editVersion.php
@@ -3,7 +3,7 @@
  * MantisBT plugin
  *
  * Copyright 2010-2011, Franck Villaume - Capgemini
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012,2014, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -34,13 +34,11 @@ $idVersion=getIntFromRequest('idVersion');
 
 try {
 	if (!isset($clientSOAP))
-		$clientSOAP = new SoapClient($mantisbtConf['url']."/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));
 
-	// currently this soap call is not included in mantisbt 1.2.x
-	//$detailVersion = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "version_id" => $idVersion));
-	$arrVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt']));
+	$arrVersions = $clientSOAP->__soapCall('mc_project_get_versions', array('username' => $username, 'password' => $password, 'project_id' => $mantisbtConf['id_mantisbt']));
 } catch (SoapFault $soapFault) {
-	echo $HTML->warning_msg(_('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring);
+	echo $HTML->warning_msg(_('Technical error occurs during data retrieving')._(': ').$soapFault->faultstring);
 	$errorPage = true;
 }
 
@@ -54,17 +52,9 @@ foreach ($arrVersions as $key => $currentVersion) {
 
 if (!isset($errorPage)){
 	echo $HTML->boxTop(_('Version Detail'));
-	echo '<form method="POST" action="?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&action=updateVersion">';
-	echo '<table>';
-	echo	'<thead>';
-	echo	'<tr>';
-	echo		'<th>'._('Version').'</th>';
-	echo		'<th>'._('Description').'</th>';
-	echo		'<th>'._('Target Date').'</th>';
-	echo		'<th>'._('Type').'</th>';
-	echo	'</tr>';
-	echo	'</thead>';
-	echo	'<tbody>';
+	echo $HTML->openForm(array('method' => 'post', 'action' => util_make_uri('/plugins/'.$mantisbt->name.'/?type=admin&group_id='.$group_id.'&action=updateVersion')));
+	$titleArr = array(_('Version'), _('Description'), _('Target Date'), _('Type'));
+	echo $HTML->listTableTop($titleArr);
 	echo	'<tr>';
 	echo		'<td><input type="text" name="version_name" value="'.htmlspecialchars($detailVersion->name,ENT_QUOTES).'" /></td>';
 	(isset($detailVersion->description)) ? $description_value = htmlspecialchars($detailVersion->description,ENT_QUOTES) : $description_value = '';
@@ -82,21 +72,20 @@ if (!isset($errorPage)){
 	echo			'</select>';
 	echo		'</td>';
 	echo	'</tr>';
-	echo	'</tbody>';
-	echo '</table>';
+	echo $HTML->listTableBottom();
 // need to be implemented
 // 	if ($group->usesPlugin('projects-hierarchy')) {
 // 		echo '<input type="checkbox" name="transverse" value="1">'._('Cross version (son included)').'</input>';
 // 	}
-	echo '<input type="hidden" name="version_id" value="'.$idVersion.'"></input>';
-	echo '<input type="hidden" name="version_old_name" value="'.$detailVersion->name.'"></input>';
+	echo '<input type="hidden" name="version_id" value="'.$idVersion.'" />';
+	echo '<input type="hidden" name="version_old_name" value="'.$detailVersion->name.'" />';
 	echo '<br/>';
 	echo '<input type="submit" value="'. _('Update') .'" />';
-	echo '</form>';
+	echo $HTML->closeForm();
 	echo $HTML->boxBottom();
 
-	echo '<form method="POST" action="?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&action=deleteVersion">';
-	echo '<input type="hidden" name="deleteVersion" value="'.$idVersion.'"></input>';
+	echo $HTML->openForm(array('method' => 'post', 'action' => util_make_uri('/plugins/'.$mantisbt->name.'/?type=admin&group_id='.$group_id.'&action=deleteVersion')));
+	echo '<input type="hidden" name="deleteVersion" value="'.$idVersion.'" />';
 	echo '<input type="submit" value="'. _('Delete') .'" />';
-	echo '</form>';
+	echo $HTML->closeForm();
 }
diff --git a/src/plugins/mantisbt/view/admin/viewVersion.php b/src/plugins/mantisbt/view/admin/viewVersion.php
index febe223..6c4702f 100644
--- a/src/plugins/mantisbt/view/admin/viewVersion.php
+++ b/src/plugins/mantisbt/view/admin/viewVersion.php
@@ -3,6 +3,7 @@
  * MantisBT plugin
  *
  * Copyright 2010-2011, Franck Villaume - Capgemini
+ * Copyright 2014, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -33,45 +34,34 @@ global $password;
 try {
 	/* do not recreate $clientSOAP object if already created by other pages */
 	if (!isset($clientSOAP))
-		$clientSOAP = new SoapClient($mantisbtConf['url']."/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));
 
-	$listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt']));
+	$listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array('username' => $username, 'password' => $password, 'project_id' => $mantisbtConf['id_mantisbt']));
 } catch  (SoapFault $soapFault) {
-	echo $HTML->warning_msg(_('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring);
+	echo $HTML->warning_msg(_('Technical error occurs during data retrieving')._(': ').$soapFault->faultstring);
 	$errorPage = true;
 }
 
 if (!isset($errorPage)){
 	echo $HTML->boxTop(_('Manage versions'));
 	if (sizeof($listVersions)) {
-		echo '<table>';
-		echo	'<tr>';
-		echo		'<td>'._('Version').'</td>';
-		echo		'<td>'._('Description').'</td>';
-		echo		'<td>'._('Target Date').'</td>';
-		echo		'<td>'._('Type').'</td>';
-		echo 		'<td>'._('Action').'</td>';
-		echo	'</tr>';
-		$i = 1;
+		$titleArr = array(_('Version'), _('Description'), _('Target Date'), _('Type'), _('Actions'));
+		echo $HTML->listTableTop($titleArr);
 		foreach ($listVersions as $key => $version){
-			echo '<tr '.$HTML->boxGetAltRowStyle($i).'>';
-			echo '<td>'.$version->name.'</td>';
+			$cells = array();
+			$cells[][] = $version->name;
 			(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 ? */
+			$cells[][] = $description_value;
+			$cells[][] = strftime(_("%d/%m/%Y"),strtotime($version->date_order));
 			if ( $version->released ) {
-				echo '<td>Release</td>';
-			/* juste une milestone alors */
+				$cells[][] = _('Release');
 			} else {
-				echo '<td>Milestone</td>';
+				$cells[][] = _('Milestone');
 			}
-			echo '<td>';
-			echo util_make_link('/plugins/'.$mantisbt->name.'/?type=admin&group_id='.$group_id.'&view=editVersion&idVersion='.$version->id, _('Update'));
-			echo '</td></tr>';
-			$i++;
+			$cells[][] = util_make_link('/plugins/'.$mantisbt->name.'/?type=admin&group_id='.$group_id.'&view=editVersion&idVersion='.$version->id, _('Update'));
+			echo $HTML->multiTableRow(array('class' => $HTML->boxGetAltRowStyle($key, true)), $cells);
 		}
-		echo '</table>';
+		echo $HTML->listTableBottom();
 	} else {
 		echo $HTML->warning_msg(_('No versions'));
 	}

-----------------------------------------------------------------------

Summary of changes:
 src/plugins/mantisbt/view/admin/editVersion.php |   39 ++++++++--------------
 src/plugins/mantisbt/view/admin/viewVersion.php |   40 +++++++++--------------
 2 files changed, 29 insertions(+), 50 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list