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.
25 /* update a version action page */
32 $version_id = getIntFromRequest('version_id');
34 $version_data = array();
35 $version_data['released'] = getIntFromRequest('version_release');
36 $version_data['project_id'] = $mantisbtConf['id_mantisbt'];
37 $version_data['name'] = getStringFromRequest('version_name');
38 $version_data['description'] = getStringFromRequest('version_description');
39 list($day, $month, $year) = split('[/.-]', getStringFromRequest('version_date_order'));
40 $version_data['date_order'] = $month."/".$day."/".$year;
43 $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
44 $clientSOAP->__soapCall('mc_project_version_update', array("username" => $username, "password" => $password, "version_id" => $version_id, "version" => $version_data));
45 // need to be implemented using projects-hierarchy plugin
46 // if (isset($_POST['transverse'])) {
47 // $listChild = $clientSOAP->__soapCall('mc_project_get_all_subprojects', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
48 // foreach ($listChild as $key => $child) {
49 // $listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $child));
50 // foreach ($listVersions as $key => $version) {
51 // if ($version->name == getStringFromRequest('version_old_name'))
52 // $child_version_id = $version->id;
54 // $version_data['project_id'] = $child;
55 // $clientSOAP->__soapCall('mc_project_version_update', array("username" => $username, "password" => $password, "version_id" => $child_version_id, "version" => $version_data));
58 } catch (SoapFault $soapFault) {
59 $error_msg = _('Task failed')._(': ').$version_data['name'].' '.$soapFault->faultstring;
60 session_redirect('plugins/mantisbt/?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&error_msg='.urlencode($error_msg));
62 $feedback = _('Task succeeded.');
63 session_redirect('plugins/mantisbt/?type=admin&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&feedback='.urlencode($feedback));