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 $bugfilter['_view_type'] = "advanced";
34 if (isset($_POST['sort'])) {
35 $bugfilter['sort'] = $_POST['sort'];
37 $bugfilter['sort'] = "last_updated";
39 if (isset($_POST['dir'])) {
40 $bugfilter['dir'] = $_POST['dir'];
42 $bugfilter['dir'] = "DESC";
44 echo '<form name="viewissues" id="mainform" method="post" action="?type='.$type.'&group_id='.$group_id.'&pluginname='.$mantisbt->name.'" >';
45 if (isset($_POST['sort'])) {
46 echo '<input type="hidden" name="sort" value="'.$_POST['sort'].'" />';
48 if (isset($_POST['dir'])) {
49 echo '<input type="hidden" name="dir" value="'.$_POST['dir'].'" />';
53 $listStatus = $clientSOAP->__soapCall('mc_enum_status', array("username" => $username, "password" => $password));
54 } catch (SoapFault $soapFault) {
55 echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
59 if (!isset($errorPage)) {
61 echo '<div style="float: left;margin-right: 10px; width: 160px">';
62 echo '<h4 style="border-bottom: 1px solid #DAE0EA">'. _('With Status:') .'</h4>';
64 echo '<select name="projectStatus[]" id="projectStatus" multiple size="'.sizeof($listStatus).'" style="width: 160px; height: 100px">';
65 foreach ($listStatus as $key => $status){
66 echo '<option value="'.$status->id.'"';
67 if (isset($_POST['projectStatus'])) {
68 $flipped_projectStatus = array_flip($_POST['projectStatus']);
69 if (isset($flipped_projectStatus[$status->id])) {
70 echo 'selected="selected"';
73 echo '>'.$status->name.'</option>';
78 if ($type == "group"){
79 $bugfilter['project_id'][] = $mantisbtConf['id_mantisbt'];
81 $listChild = $clientSOAP->__soapCall('mc_project_get_all_subprojects', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt']));
82 $mantisbtMembers = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt'], "access" => "ANYBODY"));
83 } catch (SoapFault $soapFault) {
84 echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
88 if (!isset($errorPage)) {
89 if (sizeof($listChild)) {
90 echo '<div style="float: left; margin-right: 10px; width: 160px">';
91 echo '<h4 style="border-bottom: 1px solid #DAE0EA">'. _('Include child projects:') .'</h4>';
93 echo '<select name="projectChildId[]" id="projectChildId" multiple style="width: 160px; height: 100px">';
94 foreach ($listChild as $key => $child) {
95 // on en profite pour récupérer tous les membres de tous les projets
96 $mantisbtMembersChild = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $child, "access" => "ANYBODY"));
97 foreach ($mantisbtMembersChild as $key => $mantisbtMemberChild) {
99 foreach ($mantisbtMembers as $key => $mantisbtMember) {
100 if ( $mantisbtMemberChild->id == $mantisbtMember->id )
104 $mantisbtMembers[] = $mantisbtMemberChild;
106 $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',
108 $rowGroupNameFusionForge = db_fetch_array($resultGroupNameFusionForge);
109 echo '<option value="'.$child.'"';
110 if (isset($_POST['projectChildId'])) {
111 $flipped_projectChildId = array_flip($_POST['projectChildId']);
112 if (isset($flipped_projectChildId[$child])) {
113 echo 'selected="selected"';
116 echo '>'.$rowGroupNameFusionForge['group_name'].'</option>';
121 echo '<div style="float: left; margin-right: 10px; width: 160px">';
122 echo '<h4 style="border-bottom: 1px solid #DAE0EA">'. _('Submitted by:') .'</h3>';
123 echo '<select name="projectReporters[]" id="projectReporters" multiple style="width: 160px; height: 100px">';
124 foreach ($mantisbtMembers as $key => $mantisbtMember) {
125 echo '<option value="'.$mantisbtMember->id.'"';
126 if (isset($_POST['projectReporters'])) {
127 $flipped_projectReporters = array_flip($_POST['projectReporters']);
128 if (isset($flipped_projectReporters[$mantisbtMember->id])) {
129 echo 'selected="selected"';
132 echo '>'.htmlspecialchars($mantisbtMember->name,ENT_QUOTES).'</option>';
137 echo '<div style="float: left; margin-right: 10px; width: 160px">';
138 echo '<h4 style="border-bottom: 1px solid #DAE0EA">'. _('Assigned to:') .'</h3>';
139 echo '<select name="projectFixers[]" id="projectFixers" multiple style="width: 160px; height: 100px">';
140 foreach ($mantisbtMembers as $key => $mantisbtMember) {
141 echo '<option value="'.$mantisbtMember->id.'"';
142 if (isset($_POST['projectFixers'])) {
143 $flipped_projectFixers = array_flip($_POST['projectFixers']);
144 if (isset($flipped_projectFixers[$mantisbtMember->id])) {
145 echo 'selected="selected"';
148 echo '>'.htmlspecialchars($mantisbtMember->name,ENT_QUOTES).'</option>';
153 if (isset($_POST['projectChildId'])) {
154 foreach ($_POST['projectChildId'] as $key => $child) {
155 $bugfilter['project_id'][] = $child;
159 if (isset($_POST['projectReporters'])) {
160 foreach ($_POST['projectReporters'] as $key => $projectReporter) {
161 $bugfilter['reporter_id'][] = $projectReporter;
165 if (isset($_POST['projectFixers'])) {
166 foreach ($_POST['projectFixers'] as $key => $projectFixer) {
167 $bugfilter['handler_id'][] = $projectFixer;
172 if (isset($_POST['projectStatus'])) {
173 foreach ($_POST['projectStatus'] as $key => $statusId) {
174 $bugfilter['show_status'][] = $statusId;
177 foreach ($listStatus as $key => $status){
178 if ( $status->id != 90 ) {
179 $bugfilter['show_status'][] = $status->id;
186 document.getElementById("projectStatus").selectedIndex = -1;
187 if (document.getElementById("projectChildId"))
188 document.getElementById("projectChildId").selectedIndex = -1;
189 if (document.getElementById("projectFixers"))
190 document.getElementById("projectFixers").selectedIndex = -1;
191 if (document.getElementById("projectReporters"))
192 document.getElementById("projectReporters").selectedIndex = -1;
193 document.getElementById("mainform").submit();
198 echo '<br/><div style="clear:both;width:100%; text-align: right">'.
199 '<input type="button" value="'._('Clear filter').'" onclick="reinit();"/> '.
200 '<input type="submit" value="'._('Apply filter').'" /></div>';