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 //validate function : to be sure needed informations are set before submit
33 <script language="javacript" type="text/javascript">
35 if ( document.issue.resume.value.length == 0 ) {
36 alert ("champ Résumé obligatoire");
37 } elseif ( document.issue.description.value.length == 0 ) {
38 alert ("champ Description obligatoire");
40 document.issue.submit();
41 document.issue.submitbutton.disabled="true";
48 /* do not recreate $clientSOAP object if already created by other pages */
49 if (!isset($clientSOAP))
50 $clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
52 $listCategories = $clientSOAP->__soapCall('mc_project_get_categories', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt']));
53 $listSeverities = $clientSOAP->__soapCall('mc_enum_severities', array("username" => $username, "password" => $password));
54 $listReproducibilities = $clientSOAP->__soapCall('mc_enum_reproducibilities', array("username" => $username, "password" => $password));
55 $listViewStates = $clientSOAP->__soapCall('mc_enum_view_states', array("username" => $username, "password" => $password));
56 $listDevelopers = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt'], "acces" => 25));
57 $listPriorities = $clientSOAP->__soapCall('mc_enum_priorities', array("username" => $username, "password" => $password));
58 $listResolutions= $clientSOAP->__soapCall('mc_enum_resolutions', array("username" => $username, "password" => $password));
59 $listStatus= $clientSOAP->__soapCall('mc_enum_status', array("username" => $username, "password" => $password));
60 $listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $mantisbtConf['id_mantisbt']));
61 } catch (SoapFault $soapFault) {
62 echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
66 if (!isset($errorPage)){
67 echo '<form name="issue" method="POST" action="?type='.$type.'&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&action=addIssue" >';
70 echo '<td width="16%">'._('Category').'</td>';
71 echo '<td width="16%">'._('Reproducibility').'</td>';
72 echo '<td width="16%">'._('Severity').'</td>';
73 echo '<td width="16%">'._('Priority').'</td>';
74 echo '<td width="16%">'._('Assigned to').'</td>';
75 echo '<td width="16%">'._('Found in').'</td>';
79 echo '<select name="categorie">';
80 foreach ($listCategories as $key => $category){
81 echo "<option>".$category."</option>";
86 echo '<select name="reproductibilite">';
87 foreach ($listReproducibilities as $key => $reproducibility){
88 echo "<option>".$reproducibility->name."</option>";
93 echo '<select name="severite">';
94 foreach ($listSeverities as $key => $severity){
95 echo "<option>".$severity->name."</option>";
100 echo '<select name="priorite">';
101 foreach ($listPriorities as $key => $priority){
102 echo "<option>".$priority->name."</option>";
107 echo '<select name="handler">';
108 echo "<option></option>";
109 foreach ($listDevelopers as $key => $user){
110 echo "<option>".$user->name."</option>";
114 if (sizeof($listVersions)) {
116 echo '<select name="version">';
117 echo "<option></option>";
118 foreach ($listVersions as $key => $version){
119 echo "<option>".$version->name."</option>";
125 echo _('No version defined');
133 echo '<td width="20%">'._('Summary').' * <span style="font-weight:normal">'._('(128 char max)').'</span></td>';
134 echo '<td><input type="text" name="resume" MAXLENGTH="128" style="width:99%;"></td>';
137 echo '<td>'._('Description').' *</td>';
138 echo '<td><textarea name="description" style="width:99%;" rows="12"></textarea></td>';
141 echo '<td>'._('Additional informations').'</td>';
142 echo '<td><textarea name="informations" style="width:99%;" rows="12"></textarea></td>';
145 echo '<div align="center">';
146 echo '<input type="button" name="submitbutton" value="'._('Submit').'" onclick="validate();">';
148 echo '* '._('Mandatory fields');