5 * Copyright 2010-2011, Franck Villaume - Capgemini
6 * Copyright 2010, Antoine Mercadal - Capgemini
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.
31 echo '<form id="mainform" method="post" action="?type=group&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&view=roadmap">';
34 /* do not recreate $clientSOAP object if already created by other pages */
35 if (!isset($clientSOAP))
36 $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
38 $listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt']));
40 } catch (SoapFault $soapFault) {
41 echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
45 if (!isset($errorPage)) {
46 if (sizeof($listVersions)) {
47 echo '<div style="float: left;margin-right: 10px; width: 145px; height: 140px;">';
48 echo '<h4 style="border-bottom: 1px solid #DAE0EA">'._('Versions:').'</h4>';
49 echo '<select name="projectVersionId[]" id="projectVersionId" multiple style="width: 145px; height: 100px">';
50 foreach ($listVersions as $key => $version) {
51 echo '<option value="'.$version->id.'"';
52 if (isset($_POST['projectVersionId'])) {
53 $flipped_projectVersionId = array_flip($_POST['projectVersionId']);
54 if (isset($flipped_projectVersionId[$version->id])) {
55 echo 'selected="selected"';
58 echo '>'.$version->name;
59 if ($version->released) {
60 echo '(<i>'._('Release').'</i>)';
62 echo '(<i>'._('Milestone').'</i>)';
70 if ( sizeof($listChild)) {
71 // nous avons deja un bloc
73 foreach ($listChild as $key => $child) {
74 $listChildVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $child));
75 if (sizeof($listChildVersions)) {
76 $resultGroupNameFusionForge = db_query_params('select groups.group_name from groups,plugin_mantisbt where groups.group_id = plugin_mantisbt.id_group and plugin_mantisbt.id_mantisbt = $1',
78 $rowGroupNameFusionForge =& db_fetch_array($resultGroupNameFusionForge);
79 echo '<div id="childVersion'.$child.'" style="float: left;margin-right: 10px; width: 145px; height: 140px;">';
80 echo '<h4 style="border-bottom: 1px solid #DAE0EA; width: 145px;">'.$rowGroupNameFusionForge['group_name'].'</h4>';
81 echo '<select name="project'.$child.'VersionId[]" id="project'.$child.'VersionId" multiple style="width: 145px; height: 100px">';
82 foreach ( $listChildVersions as $key => $version ) {
83 echo '<option value="'.$version->id.'"';
84 if (isset($_POST['project'.$child.'VersionId'])) {
85 $flipped_projectVersionId = array_flip($_POST['project'.$child.'VersionId']);
86 if (isset($flipped_projectVersionId[$version->id])) {
87 echo 'selected="selected"';
90 echo '>'.$version->name;
91 if ( $version->released ) {
92 echo '(<i>'._('Release').'</i>)';
94 echo '(<i>'._('Milestone').'</i>)';
101 if ( $nbblock == 7 ) {
102 echo '<div style="clear:both; width:100%"></div>';
113 if (document.getElementById("projectVersionId"))
114 document.getElementById("projectVersionId").selectedIndex = -1;
116 if (sizeof($listChild)) {
117 foreach ($listChild as $key => $child) {
118 echo 'if (document.getElementById("project'.$child.'VersionId"))
119 document.getElementById("project'.$child.'VersionId").selectedIndex = -1;';
123 document.getElementById("mainform").submit();
127 echo '<br/><div style="clear:both;width:100%; text-align: right">'.
128 '<input type="button" value="'._('Clear filter').'" onclick="reinit();"/> '.
129 '<input type="submit" value="'._('Apply filter').'" /></div>';