5 * Copyright 2010-2011, Franck Villaume - Capgemini
6 * Copyright 2012,2014,2016, 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 $arrVersions = $clientSOAP->__soapCall('mc_project_get_versions', array('username' => $username, 'password' => $password, 'project_id' => $mantisbtConf['id_mantisbt']));
40 } catch (SoapFault $soapFault) {
41 echo $HTML->warning_msg(_('Technical error occurs during data retrieving')._(': ').$soapFault->faultstring);
45 // select the right version until the soap call is ported.
46 $detailVersion = array();
47 foreach ($arrVersions as $key => $currentVersion) {
48 if ($currentVersion->id == $idVersion) {
49 $detailVersion = $currentVersion;
53 if (!isset($errorPage)){
54 echo $HTML->boxTop(_('Version Detail'));
55 echo $HTML->openForm(array('method' => 'post', 'action' => '/plugins/'.$mantisbt->name.'/?type=admin&group_id='.$group_id.'&action=updateVersion'));
56 $titleArr = array(_('Version'), _('Description'), _('Target Date'), _('Type'));
57 echo $HTML->listTableTop($titleArr);
59 echo '<td><input type="text" name="version_name" value="'.htmlspecialchars($detailVersion->name,ENT_QUOTES).'" /></td>';
60 (isset($detailVersion->description)) ? $description_value = htmlspecialchars($detailVersion->description,ENT_QUOTES) : $description_value = '';
61 echo '<td><input type="text" name="version_description" value="'.$description_value.'" /></td>';
62 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>';
64 echo '<select name="version_release">';
65 if ($detailVersion->released) {
66 echo '<option value="1" selected>'._('Release').'</option>';
67 echo '<option value="0" >'._('Milestone').'</option>';
69 echo '<option value="1" >'._('Release').'</option>';
70 echo '<option value="0" selected>'._('Milestone').'</option>';
75 echo $HTML->listTableBottom();
76 // need to be implemented
77 // if ($group->usesPlugin('projects-hierarchy')) {
78 // echo '<input type="checkbox" name="transverse" value="1">'._('Cross version (son included)').'</input>';
80 echo '<input type="hidden" name="version_id" value="'.$idVersion.'" />';
81 echo '<input type="hidden" name="version_old_name" value="'.$detailVersion->name.'" />';
83 echo '<input type="submit" value="'. _('Update') .'" />';
84 echo $HTML->closeForm();
85 echo $HTML->boxBottom();
87 echo $HTML->openForm(array('method' => 'post', 'action' => '/plugins/'.$mantisbt->name.'/?type=admin&group_id='.$group_id.'&action=deleteVersion'));
88 echo '<input type="hidden" name="deleteVersion" value="'.$idVersion.'" />';
89 echo '<input type="submit" value="'. _('Delete') .'" />';
90 echo $HTML->closeForm();