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.
32 /* do not recreate $clientSOAP object if already created by other pages */
33 if (!isset($clientSOAP))
34 $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
36 $listChild = $clientSOAP->__soapCall('mc_project_get_all_subprojects', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt']));
38 } catch (SoapFault $soapFault) {
39 echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
43 if (!isset($errorPage)) {
46 <script type="text/javascript">
47 jQuery(document).ready(function() {
50 foreach ($listChild as $key => $child) {
51 if ( isset($_POST['project'.$child.'VersionId'])) {
55 if ( isset($_POST['projectVersionId']) ) {
60 jQuery("#expandable_filter").hide();
66 <p class="notice_title" onclick='jQuery("#expandable_filter").slideToggle(300)'><?php echo _('Display filter rules') ?></p>
68 <div id='expandable_filter' class="notice_content" style='clear: both'>
70 include 'mantisbt/controler/filter_roadmap.php';
75 if (!isset($_POST['projectVersionId'])) {
76 if (isset($listVersions) && !empty($listVersions)) {
77 $listPrintVersions = $listVersions;
80 $flipped_projectVersionId = array_flip($_POST['projectVersionId']);
81 foreach ($listVersions as $key => $version) {
82 if (isset($flipped_projectVersionId[$version->id])) {
83 $listPrintVersions[] = $version;
87 if (isset($listPrintVersions) && !empty($listPrintVersions)) {
88 foreach ($listPrintVersions as $key => $version) {
90 $idsBug = $clientSOAP->__soapCall('mc_issue_get_list_by_project_for_specific_version', array("username" => $username, "password" => $password, "project" => $mantisbtConf['id_mantisbt'], "version" => $version->name ));
91 } catch (SoapFault $soapFault) {
92 echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
96 $typeVersion = _('Milestone');
97 if ( $version->released ) {
98 $typeVersion = _('Release');
100 echo _('Version:').' '.$version->name.' (<i>'.strftime("%d/%m/%Y",strtotime($version->date_order)).'</i> '.$typeVersion.') - <i>'.count($idsBug).' ticket(s)</i>';
102 foreach ( $idsBug as $key => $idBug ) {
103 $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
104 if ( !array_key_exists('handler', $defect) || !array_key_exists('name', $defect->handler) ) {
105 $defect_handler_name = _('no-handler');
107 $defect_handler_name = $defect->handler->name;
110 if ( $defect->status->id >= 80 ) {
113 echo '<a href="?type=group&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&idBug='.$defect->id.'&view=viewIssue">'.$defect->id.'</a>: '.$defect->summary.' ('.$defect->resolution->name.') - ('.$defect_handler_name.')';
114 if ( $defect->status->id >= 80 ) {
123 if (sizeof($listChild)) {
124 foreach ($listChild as $key => $child) {
125 if (isset($_POST['project'.$child.'VersionId'])) {
126 $resultGroupNameFusionForge = db_query_params('select groups.group_name, groups.group_id from groups,plugin_mantisbt
127 where groups.group_id = plugin_mantisbt.id_group and plugin_mantisbt.id_mantisbt = $1',
129 $rowGroupNameFusionForge = db_fetch_array($resultGroupNameFusionForge);
130 echo $HTML->boxTop('<a style="color:white;" href="?type=group&group_id='.$rowGroupNameFusionForge['group_id'].'&pluginname='.$mantisbt->name.'">'.$rowGroupNameFusionForge['group_name'].'</a>');
132 $listChildVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $child));
133 if (!empty($listChildVersions)){
134 $flipped_projectChildVersionId = array_flip($_POST['project'.$child.'VersionId']);
135 $listChildPrintVersions = array();
136 foreach ($listChildVersions as $key => $childVersion) {
137 if (isset($flipped_projectChildVersionId[$childVersion->id])) {
138 $listChildPrintVersions[] = $childVersion;
141 if (isset($listChildPrintVersions) && !empty($listChildPrintVersions)) {
142 foreach ($listChildPrintVersions as $key => $childprintversion){
144 $idsBug = $clientSOAP->__soapCall('mc_issue_get_list_by_project_for_specific_version', array("username" => $username, "password" => $password, "project" => $child, "version" => $childprintversion->name ));
145 $typeVersion = _('Milestone');
146 if ( $childprintversion->released == 1 ) {
147 $typeVersion = _('Release');
149 echo _('Version:').' '.$childprintversion->name.' (<i>'.strftime("%d/%m/%Y",strtotime($childprintversion->date_order)).'</i> '.$typeVersion.') - <i>'.count($idsBug).'</i>';
151 foreach ( $idsBug as $key => $idBug ) {
152 $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
153 if ( !array_key_exists('handler', $defect) || !array_key_exists('name', $defect->handler) ) {
154 $defect_handler_name = _('no-handler');
156 $defect_handler_name = $defect->handler->name;
159 if ( $defect->status->id >= 80 ) {
162 echo '<a href="?type=group&group_id='.$rowGroupNameFusionForge['group_id'].'&pluginname='.$mantisbt->name.'&idBug='.$defect->id.'&view=viewIssue">'.$defect->id.'</a>: '.$defect->summary.' ('.$defect->resolution->name.') - ('.$defect_handler_name.')';
163 if ( $defect->status->id >= 80 ) {
174 echo $HTML->boxBottom();
179 echo '<p class="warning">'._('No versions to display').'</p>';