[Fusionforge-commits] r12417 - trunk/src/plugins/mantisbt/view/admin
Franck VILLAUME
nerville at fusionforge.org
Mon Feb 28 13:23:12 CET 2011
Author: nerville
Date: 2011-02-28 13:23:10 +0100 (Mon, 28 Feb 2011)
New Revision: 12417
Modified:
trunk/src/plugins/mantisbt/view/admin/editVersion.php
Log:
fix view edit version
Modified: trunk/src/plugins/mantisbt/view/admin/editVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/editVersion.php 2011-02-28 12:00:37 UTC (rev 12416)
+++ trunk/src/plugins/mantisbt/view/admin/editVersion.php 2011-02-28 12:23:10 UTC (rev 12417)
@@ -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.
@@ -20,44 +22,61 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* main display */
global $HTML;
+global $mantisbt;
+global $mantisbtConf;
+global $username;
+global $password;
+global $group_id;
+global $group;
$idVersion=getIntFromRequest('idVersion');
try {
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));
- $detailVersion = $clientSOAP->__soapCall('mc_project_get_version_details', array("username" => $username, "password" => $password, "version_id" => $idVersion));
+ // 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']));
} catch (SoapFault $soapFault) {
echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
$errorPage = true;
}
+// select the right version until the soap call is ported.
+$detailVersion = array();
+foreach ($arrVersions as $key => $currentVersion) {
+ if ($currentVersion->id == $idVersion) {
+ $detailVersion = $currentVersion;
+ }
+}
+
if (!isset($errorPage)){
echo $HTML->boxTop(_('Version Detail'));
- echo '<form method="POST" name="updateVersion'.$detailVersion->id.'" action="index.php?type=admin&id='.$id.'&pluginname=mantisbt&action=updateVersion">';
+ echo '<form method="POST" action="?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&action=updateVersion">';
echo '<table class="innertabs">';
echo '<thead>';
echo '<tr>';
- echo '<th class="FullBoxTitle">Version</th>';
- echo '<th class="FullBoxTitle">Date Livraison</th>';
- echo '<th class="FullBoxTitle">Type</th>';
+ echo '<th>'._('Version').'</th>';
+ echo '<th>'._('Description').'</th>';
+ echo '<th>'._('Target date').'</th>';
+ echo '<th>'._('Type').'</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
echo '<tr>';
echo '<td><input type="text" name="version_name" value="'.htmlspecialchars($detailVersion->name,ENT_QUOTES).'" /></td>';
+ echo '<td><input type="text" name="version_name" value="'.htmlspecialchars($detailVersion->description,ENT_QUOTES).'" /></td>';
echo '<td><input type="text" name="version_date_order" size="32" value="'.strftime("%d/%m/%Y",strtotime($detailVersion->date_order)).'" />(format : DD/MM/YYYY)</td>';
echo '<td>';
echo '<select name="version_release">';
- if ( $detailVersion->released ) {
- echo '<option value="1" selected>Release</option>';
- echo '<option value="0" >Milestone</option>';
+ if ($detailVersion->released) {
+ echo '<option value="1" selected>'._('Release').'</option>';
+ echo '<option value="0" >'._('Milestone').'</option>';
} else {
- echo '<option value="1" >Release</option>';
- echo '<option value="0" selected>Milestone</option>';
+ echo '<option value="1" >'._('Release').'</option>';
+ echo '<option value="0" selected>'._('Milestone').'</option>';
}
echo '</select>';
echo '</td>';
@@ -65,17 +84,17 @@
echo '</tbody>';
echo '</table>';
if ($group->usesPlugin('projects_hierarchy')) {
- echo '<input type="checkbox" name="transverse" value="1">mise à jour transverse (fils inclus)</input>';
+ echo '<input type="checkbox" name="transverse" value="1">'._('Cross version (son included)').'</input>';
}
- echo '<input type="hidden" name="version_id" value="'.$detailVersion->id.'"></input>';
+ echo '<input type="hidden" name="version_id" value="'.$idVersion.'"></input>';
echo '<input type="hidden" name="version_old_name" value="'.$detailVersion->name.'"></input>';
echo '<br/>';
echo '<input type="submit" value="'. _('Add') .'" />';
echo '</form>';
echo $HTML->boxBottom();
- echo '<form method="POST" name="deleteVersion'.$detailVersion->id.'" action="index.php?type=admin&id='.$id.'&pluginname=mantisbt&action=deleteVersion">';
- echo '<input type="hidden" name="deleteVersion" value="'.$detailVersion->id.'"></input>';
+ 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 '<input type="submit" value="'. _('Delete') .'" />';
echo '</form>';
}
More information about the Fusionforge-commits
mailing list