4 * Copyright 2010, Capgemini
5 * Authors: Franck Villaume - capgemini
7 * This file is part of FusionForge.
9 * FusionForge is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 /* do not recreate $clientSOAP object if already created by other pages */
29 if (!isset($clientSOAP))
30 $clientSOAP = new SoapClient("http://".forge_get_config('server','mantisbt')."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
32 $stats = $clientSOAP->__soapCall('mc_project_get_statistiques', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis, "level" => 0));
33 } catch (SoapFault $soapFault) {
34 echo '<div class="warning" >Un problème est survenu lors de la récupération des données : '.$soapFault->faultstring.'</div>';
38 if (!isset($errorPage)){
39 $total = array('open' => 0, 'resolved' => 0, 'resolved' => 0, 'closed' => 0 , 'total' => 0);
40 echo $HTML->boxTop("Répartition par état");
42 echo '<th class="InTextBrown">Projet</th>';
43 echo '<th class="InTextBrown">Ouvert</th>';
44 echo '<th class="InTextBrown">Résolu</th>';
45 echo '<th class="InTextBrown">Fermé</th>';
46 echo '<th class="InTextBrown">Total</th>';
49 foreach ($stats as $stat){
51 for($i = 1; $i < $stat->project_level; $i++){
52 $indentation = $indentation .' ';
54 if ( $nbligne % 2 == 0 ) {
55 echo '<tr class="LignePaire">';
57 echo '<tr class="LigneImpaire">';
60 if ($stat->project_level > 1){
61 echo sprintf('<td class="InTextBrown">%s >> <a class="DataLink" href="?type=group&id=%s&pluginname=mantisbt">%s</a></td>',$indentation,group_get_objectid_by_publicname($stat->project_name), $stat->project_name);
63 echo sprintf('<td class="InTextBrown"><a class="DataLink" href="?type=group&id=%s&pluginname=mantisbt">%s</a></td>',group_get_objectid_by_publicname($stat->project_name), $stat->project_name);
65 echo '<td class="InTextBrown">'.$stat->open.'</td>';
66 echo '<td class="InTextBrown">'.$stat->resolved.'</td>';
67 echo '<td class="InTextBrown">'.$stat->closed.'</td>';
68 echo '<td class="InTextBrown">'.$stat->total.'</td>';
72 $total['open'] += $stat->open;
73 $total['resolved'] += $stat->resolved;
74 $total['closed'] += $stat->closed;
75 $total['total'] += $stat->total;
79 echo '<th class="InTextBrown"></th>';
80 echo '<th class="InTextBrown">'.$total['open'].'</th>';
81 echo '<th class="InTextBrown">'.$total['resolved'].'</th>';
82 echo '<th class="InTextBrown">'.$total['closed'].'</th>';
83 echo '<th class="InTextBrown">'.$total['total'].'</th>';
85 echo $HTML->boxBottom();