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 //validate function : to be sure needed informations are set before submit
34 <script language="javacript" type="text/javascript">
36 if ( document.issue.resume.value.length == 0 ) {
37 alert ("champ Résumé obligatoire");
38 } elseif ( document.issue.description.value.length == 0 ) {
39 alert ("champ Description obligatoire");
41 document.issue.submit();
42 document.issue.submitbutton.disabled="true";
49 /* do not recreate $clientSOAP object if already created by other pages */
50 if (!isset($clientSOAP))
51 $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
53 $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
54 $listCategories = $clientSOAP->__soapCall('mc_project_get_categories', array("username" => $username, "password" => $password, "project_id" => $defect->project->id));
55 $listSeverities = $clientSOAP->__soapCall('mc_enum_severities', array("username" => $username, "password" => $password));
56 $listReproducibilities = $clientSOAP->__soapCall('mc_enum_reproducibilities', array("username" => $username, "password" => $password));
57 $listReporters = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $defect->project->id, "acces" => 10));
58 $listDevelopers = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $defect->project->id, "acces" => 25));
59 $listPriorities = $clientSOAP->__soapCall('mc_enum_priorities', array("username" => $username, "password" => $password));
60 $listResolutions= $clientSOAP->__soapCall('mc_enum_resolutions', array("username" => $username, "password" => $password));
61 $listStatus= $clientSOAP->__soapCall('mc_enum_status', array("username" => $username, "password" => $password));
62 $listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $defect->project->id));
63 $listVersionsMilestone = $clientSOAP->__soapCall('mc_project_get_unreleased_versions', array("username" => $username, "password" => $password, "project_id" => $defect->project->id));
64 } catch (SoapFault $soapFault) {
65 echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
69 if (!isset($errorPage)){
70 global $additional_value; //retrieve from viewIssue.php
71 global $category_value;
72 global $severity_value;
73 global $reproducibility_value;
74 global $reporter_value;
75 global $handler_value;
76 global $priority_value;
77 global $resolution_value;
79 global $version_value;
82 global $additional_value;
84 $boxTitle = _('Edit Ticket: ').sprintf($format,$defect->id);
85 echo '<form name="issue" Method="POST" Action="?type='.$type.'&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&idBug='.$defect->id.'&action=updateIssue&view=viewIssue">';
88 echo '<td width="20%">'._('Category').'</td>';
89 echo '<td width="20%">'._('Severity').'</td>';
90 echo '<td width="20%">'._('Reproducibility').'</td>';
91 echo '<td width="20%">'._('Submit Date').'</td>';
92 echo '<td width="20%">'._('Update Date').'</td>';
96 echo '<select name="categorie">';
97 echo '<option></option>';
98 echo '<option selected>'. $category_value .'</option>';
99 foreach ($listCategories as $key => $category){
100 echo '<option>'.$category.'</option>';
105 echo '<select name="severite">';
106 echo '<option selected>'. $severity_value .'</option>';
107 foreach ($listSeverities as $key => $severity){
108 echo '<option>'.$severity->name.'</option>';
113 echo '<select name="reproductibilite">';
114 echo '<option selected>'. $reproducibility_value .'</option>';
115 foreach ($listReproducibilities as $key => $reproducibility){
116 echo '<option>'.$reproducibility->name.'</option>';
120 // TODO a revoir le problème des dates
121 date_default_timezone_set("UTC");
122 echo '<td>'.date("Y-m-d G:i",strtotime($defect->date_submitted)).'</td>';
123 echo '<td>'.date("Y-m-d G:i",strtotime($defect->last_updated)).'</td>';
126 echo '<td>'._('Reporter').'</td>';
127 echo '<td>'._('Assigned to').'</td>';
128 echo '<td>'._('Priority').'</td>';
129 echo '<td>'._('Resolution').'</td>';
130 echo '<td>'._('Status').'</td>';
134 echo '<select name="reporter">';
135 echo '<option selected>'. $reporter_value.'</option>';
136 foreach ($listReporters as $key => $user){
137 echo '<option>'.$user->name.'</option>';
142 echo '<select name="handler">';
143 echo '<option selected>'. $handler_value .'</option>';
144 echo '<option></option>';
145 foreach ($listDevelopers as $key => $user){
146 echo '<option>'.$user->name.'</option>';
151 echo '<select name="priorite">';
152 echo '<option selected>'. $priority_value .'</option>';
153 foreach ($listPriorities as $key => $priority){
154 echo '<option>'.$priority->name.'</option>';
159 echo '<select name="resolution">';
160 echo '<option selected>'. $resolution_value .'</option>';
161 foreach ($listResolutions as $key => $resolution){
162 echo '<option>'.$resolution->name.'</option>';
167 echo '<select name="etat">';
168 echo '<option selected>'. $status_value .'</option>';
169 foreach ($listStatus as $key => $status){
170 echo '<option>'.$status->name.'</option>';
176 echo '<td>'._('Found in').'</td>';
177 echo '<td>'._('Fixed in').'</td>';
178 echo '<td colspan="3">'._('Target').'</td>';
182 echo '<select name="version">';
183 echo '<option selected>'. $version_value .'</option>';
184 echo '<option></option>';
185 foreach ($listVersions as $key => $version){
186 echo '<option>'.$version->name.'</option>';
191 echo '<select name="fixed_in_version">';
192 echo '<option selected>'. $fixed_value .'</option>';
193 echo '<option></option>';
194 foreach ($listVersions as $key => $fixed_version){
195 echo '<option>'.$fixed_version->name.'</option>';
199 echo '<td colspan="3">';
200 echo '<select name="target_version">';
201 echo '<option selected>'. $target_value .'</option>';
202 echo '<option></option>';
203 foreach ($listVersionsMilestone as $key => $target_version){
204 echo '<option>'.$target_version->name.'</option>';
213 echo '<td width="20%">'._('Summary').' <span style="font-weight:normal">'._('(max128 char )').'</span></td>';
214 echo '<td><input type="text" value="'.htmlspecialchars($defect->summary,ENT_QUOTES).'" name="resume" MAXLENGTH="128" style="width:99%"></td>';
217 echo '<td width="20%">'._('Description').'</td>';
218 echo '<td><textarea name="description" style="width:99%;" rows="6">'.htmlspecialchars($defect->description, ENT_QUOTES).'</textarea></td>';
221 echo '<td width="20%">'._('Additional Informations').'</td>';
222 echo '<td><textarea name="informations" style="width:99%;" rows="6">'. $additional_value .'</textarea></td>';
226 echo '<div align="center">';
227 echo '<input type="button" name="submitbutton" onclick="validate();" value="'._('Update').'">';