5 * Copyright 2010-2011, Franck Villaume - Capgemini
6 * Copyright 2012, Franck Villaume - TrivialDev
7 * http://fusionforge.org
9 * This file is part of FusionForge. FusionForge is free software;
10 * you can redistribute it and/or modify it under the terms of the
11 * GNU General Public License as published by the Free Software
12 * Foundation; either version 2 of the Licence, or (at your option)
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 $idVersion=getIntFromRequest('idVersion');
36 if (!isset($clientSOAP))
37 $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
39 // currently this soap call is not included in mantisbt 1.2.x
40 //$detailVersion = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "version_id" => $idVersion));
41 $arrVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt']));
42 } catch (SoapFault $soapFault) {
43 echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
47 // select the right version until the soap call is ported.
48 $detailVersion = array();
49 foreach ($arrVersions as $key => $currentVersion) {
50 if ($currentVersion->id == $idVersion) {
51 $detailVersion = $currentVersion;
55 if (!isset($errorPage)){
56 echo $HTML->boxTop(_('Version Detail'));
57 echo '<form method="POST" action="?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&action=updateVersion">';
61 echo '<th>'._('Version').'</th>';
62 echo '<th>'._('Description').'</th>';
63 echo '<th>'._('Target date').'</th>';
64 echo '<th>'._('Type').'</th>';
69 echo '<td><input type="text" name="version_name" value="'.htmlspecialchars($detailVersion->name,ENT_QUOTES).'" /></td>';
70 (isset($detailVersion->description)) ? $description_value = htmlspecialchars($detailVersion->description,ENT_QUOTES) : $description_value = '';
71 echo '<td><input type="text" name="version_description" value="'.$description_value.'" /></td>';
72 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>';
74 echo '<select name="version_release">';
75 if ($detailVersion->released) {
76 echo '<option value="1" selected>'._('Release').'</option>';
77 echo '<option value="0" >'._('Milestone').'</option>';
79 echo '<option value="1" >'._('Release').'</option>';
80 echo '<option value="0" selected>'._('Milestone').'</option>';
87 // need to be implemented
88 // if ($group->usesPlugin('projects-hierarchy')) {
89 // echo '<input type="checkbox" name="transverse" value="1">'._('Cross version (son included)').'</input>';
91 echo '<input type="hidden" name="version_id" value="'.$idVersion.'"></input>';
92 echo '<input type="hidden" name="version_old_name" value="'.$detailVersion->name.'"></input>';
94 echo '<input type="submit" value="'. _('Update') .'" />';
96 echo $HTML->boxBottom();
98 echo '<form method="POST" action="?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&action=deleteVersion">';
99 echo '<input type="hidden" name="deleteVersion" value="'.$idVersion.'"></input>';
100 echo '<input type="submit" value="'. _('Delete') .'" />';