[Fusionforge-commits] r10419 - in trunk/src/plugins/mantisbt: . action action/admin common controler etc/plugins/mantisbt view view/admin www www/admin www/group www/user

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Wed Sep 8 11:37:14 CEST 2010


Author: nerville
Date: 2010-09-08 11:37:14 +0200 (Wed, 08 Sep 2010)
New Revision: 10419

Added:
   trunk/src/plugins/mantisbt/controler/
   trunk/src/plugins/mantisbt/controler/filter.php
   trunk/src/plugins/mantisbt/controler/filter_roadmap.php
   trunk/src/plugins/mantisbt/view/admin/StatPerMember.php
   trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php
   trunk/src/plugins/mantisbt/view/admin/stat.php
   trunk/src/plugins/mantisbt/view/jumpToIssue.php
Modified:
   trunk/src/plugins/mantisbt/action/addAttachment.php
   trunk/src/plugins/mantisbt/action/addIssue.php
   trunk/src/plugins/mantisbt/action/admin/addCategory.php
   trunk/src/plugins/mantisbt/action/admin/addVersion.php
   trunk/src/plugins/mantisbt/action/admin/deleteCategory.php
   trunk/src/plugins/mantisbt/action/admin/deleteVersion.php
   trunk/src/plugins/mantisbt/action/admin/renameCategory.php
   trunk/src/plugins/mantisbt/action/admin/updateVersion.php
   trunk/src/plugins/mantisbt/action/deleteAttachment.php
   trunk/src/plugins/mantisbt/action/deleteNote.php
   trunk/src/plugins/mantisbt/action/updateIssue.php
   trunk/src/plugins/mantisbt/action/updateNote.php
   trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php
   trunk/src/plugins/mantisbt/etc/plugins/mantisbt/config.php
   trunk/src/plugins/mantisbt/view/addAttachment.php
   trunk/src/plugins/mantisbt/view/addIssue.php
   trunk/src/plugins/mantisbt/view/addOrEditNote.php
   trunk/src/plugins/mantisbt/view/admin/addVersion.php
   trunk/src/plugins/mantisbt/view/admin/editVersion.php
   trunk/src/plugins/mantisbt/view/admin/viewCategorie.php
   trunk/src/plugins/mantisbt/view/admin/viewVersion.php
   trunk/src/plugins/mantisbt/view/editIssue.php
   trunk/src/plugins/mantisbt/view/roadmap.php
   trunk/src/plugins/mantisbt/view/viewAttachment.php
   trunk/src/plugins/mantisbt/view/viewIssue.php
   trunk/src/plugins/mantisbt/view/viewIssues.php
   trunk/src/plugins/mantisbt/view/viewNote.php
   trunk/src/plugins/mantisbt/www/admin/index.php
   trunk/src/plugins/mantisbt/www/group/index.php
   trunk/src/plugins/mantisbt/www/index.php
   trunk/src/plugins/mantisbt/www/user/index.php
Log:
sync mantisbt plugin

Modified: trunk/src/plugins/mantisbt/action/addAttachment.php
===================================================================
--- trunk/src/plugins/mantisbt/action/addAttachment.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/addAttachment.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,9 +21,15 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 $data = file_get_contents ($_FILES['attachment']['tmp_name'] );
 $content = base64_encode ($data);
-$clientSOAP->__soapCall('mc_issue_attachment_add', array("username" => $username, "password" => $password, "issue_id" => $idBug, "name" => $_FILES['attachment']['name'], "file_type" => $_FILES['attachment']['type'], "content" => $content ));
-
+try {
+    $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+    $clientSOAP->__soapCall('mc_issue_attachment_add', array("username" => $username, "password" => $password, "issue_id" => $idBug, "name" => $_FILES['attachment']['name'], "file_type" => $_FILES['attachment']['type'], "content" => $content ));
+    $feedback = 'Opération réussie';
+} catch (SoapFault $soapFault) {
+    $feedback = 'Error : '.$soapFault->faultstring;
+    session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$idBug.'&view=viewIssue&error_msg='.urlencode($feedback));
+}
+session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$idBug.'&view=viewIssue&feedback='.urlencode($feedback));
 ?>

Modified: trunk/src/plugins/mantisbt/action/addIssue.php
===================================================================
--- trunk/src/plugins/mantisbt/action/addIssue.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/addIssue.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -1,8 +1,7 @@
 <?php
-
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,13 +20,24 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 $defect = array();
 
 $defect['category'] = $_POST['categorie'];
 $defect['project']['id'] = $idProjetMantis;
 
-$listSeverities = $clientSOAP->__soapCall('mc_enum_severities', array("username" => $username, "password" => $password));
+try {
+    $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+    $listSeverities = $clientSOAP->__soapCall('mc_enum_severities', array("username" => $username, "password" => $password));
+    $listReproducibilities = $clientSOAP->__soapCall('mc_enum_reproducibilities', array("username" => $username, "password" => $password));
+    $listUsers = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis, "acces" => 10));
+    $listViewStates = $clientSOAP->__soapCall('mc_enum_view_states', array("username" => $username, "password" => $password));
+    $listPriorities = $clientSOAP->__soapCall('mc_enum_priorities', array("username" => $username, "password" => $password));
+    $listResolutions= $clientSOAP->__soapCall('mc_enum_resolutions', array("username" => $username, "password" => $password));
+    $listStatus= $clientSOAP->__soapCall('mc_enum_status', array("username" => $username, "password" => $password));
+} catch (SoapFault $soapFault) {
+    $feedback = 'Error : '.$soapFault->faultstring;
+    session_redirect('plugins/mantisbt/?type='.$type.'&id='.$group_id.'&pluginname=mantisbt&view=viewIssues&error_msg='.urlencode($feedback));
+}
 foreach($listSeverities as $key => $severity){
 	if ($_POST['severite'] == $severity->name){
 		$defect['severity']['id'] = $severity->id;
@@ -36,7 +46,6 @@
 	}
 }
 
-$listReproducibilities = $clientSOAP->__soapCall('mc_enum_reproducibilities', array("username" => $username, "password" => $password));
 foreach($listReproducibilities as $key => $reproducibility){
 	if ($_POST['reproductibilite'] == $reproducibility->name){
 		$defect['reproducibility']['id'] = $reproducibility->id;
@@ -45,7 +54,6 @@
 	}
 }
 
-$listUsers = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis, "acces" => 10));
 foreach($listUsers as $key => $mantisuser){
 	if ($username == $mantisuser->name){
 		$defect['reporter']['id'] = $mantisuser->id;
@@ -56,7 +64,6 @@
 	}
 }
 
-$listViewStates = $clientSOAP->__soapCall('mc_enum_view_states', array("username" => $username, "password" => $password));
 foreach($listViewStates as $key => $viewState){
 	if ($viewState->id ==  10){
 		$defect['view_state']['id'] = $viewState->id;
@@ -76,13 +83,8 @@
 			break;
 		}
 	}
-} else {
-	$defect['handler'] = null;
 }
 
-$defect['projection'] = null;
-$defect['eta'] = null;
-$listPriorities = $clientSOAP->__soapCall('mc_enum_priorities', array("username" => $username, "password" => $password));
 foreach($listPriorities as $key => $priority){
 	if ($_POST['priorite'] == $priority->name){
 		$defect['priority']['id'] = $priority->id;
@@ -91,7 +93,6 @@
 	}
 }
 
-$listResolutions= $clientSOAP->__soapCall('mc_enum_resolutions', array("username" => $username, "password" => $password));
 foreach($listResolutions as $key => $resolution){
 	if ($resolution->id == 10){
 		$defect['resolution']['id'] = $resolution->id;
@@ -100,7 +101,6 @@
 	}
 }
 
-$listStatus= $clientSOAP->__soapCall('mc_enum_status', array("username" => $username, "password" => $password));
 foreach($listStatus as $key => $status){
 	if ($status->id == 10){ // status nouveau
 		$defect['status']['id'] = $status->id;
@@ -121,6 +121,13 @@
 	$defect['version'] = $_POST['version'];
 }
 
-$clientSOAP->__soapCall('mc_issue_add', array("username" => $username, "password" => $password, "issue" => $defect));
+try {
+    $newIdBug = $clientSOAP->__soapCall('mc_issue_add', array("username" => $username, "password" => $password, "issue" => $defect));
+    $feedback = 'Ticket '.$newIdBug.' cr&eacute;e';
+    session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$newIdBug.'&view=viewIssue&feedback='.urlencode($feedback));
+} catch (SoapFault $soapFault) {
+    $feedback = 'Erreur : '.$soapFault->faultstring;
+    session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&error_msg='.urlencode($feedback));
+}
 
 ?>

Modified: trunk/src/plugins/mantisbt/action/admin/addCategory.php
===================================================================
--- trunk/src/plugins/mantisbt/action/admin/addCategory.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/admin/addCategory.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,11 +21,20 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+/* addCategory action page */
+
 $nameCategory = $_POST['nameCategory'];
 
 if ($nameCategory != "") {
-	$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-	$clientSOAP->__soapCall('mc_project_add_category', array("username" => $username, "password" => $password, "p_project_id" => $idProjetMantis, "p_category_name" => $nameCategory));
+    try {
+	    $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+	    $clientSOAP->__soapCall('mc_project_add_category', array("username" => $username, "password" => $password, "p_project_id" => $idProjetMantis, "p_category_name" => $nameCategory));
+    } catch (SoapFault $soapFault) {
+        $feedback = 'Error : '.$soapFault->faultstring;
+        session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&error_msg='.urlencode($feedback));
+    }
+    $feedback = 'Op&eacute;ration r&eacute;ussie';
+    session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&feedback='.urlencode($feedback));
 }
 
 ?>

Modified: trunk/src/plugins/mantisbt/action/admin/addVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/action/admin/addVersion.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/admin/addVersion.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,17 +21,42 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-$version = $_POST['version'];
-
-if ($version != "") {
+/* addVersion action page */
+if (isset($_POST['version'])) {
 	$versionStruct = array();
-	$versionStruct['name'] = $version;
+	$versionStruct['name'] = $_POST['version'];
 	$versionStruct['project_id'] = $idProjetMantis;
 	$versionStruct['released'] = '';
 	$versionStruct['description'] = '';
 	$versionStruct['date_order'] = '';
+    try {
         $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
         $clientSOAP->__soapCall('mc_project_version_add', array("username" => $username, "password" => $password, "version" => $versionStruct));
+        if (isset($_POST['transverse'])) {
+            $listChild = $clientSOAP->__soapCall('mc_project_get_subprojects', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
+            foreach ($listChild as $key => $child) {
+                $listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $child));
+                $todo = 1;
+                foreach ($listVersions as $key => $version ) {
+                    if ($version->name == $versionStruct['name'])
+                        $todo = 0;
+                }
+                if ($todo) {
+                    try {
+                        $versionStruct['project_id'] = $child;
+                        $clientSOAP->__soapCall('mc_project_version_add', array("username" => $username, "password" => $password, "version" => $versionStruct));
+                    } catch (SoapFault $soapFault) {
+                        echo 'Error : '.$versionStruct['name'].' '.$soapFault->faultstring;
+                        echo "<br/>";
+                    }
+                }
+            }
+        }
+    } catch (SoapFault $soapFault) {
+        $msg = 'Erreur : '.$versionStruct['name'].' '.$soapFault->faultstring;
+        session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&error_msg='.urlencode($msg));
+    }
+    $feedback = 'Op&eacute;ration r&eacute;ussie';
+    session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&feedback='.urlencode($feedback));
 }
-
 ?>

Modified: trunk/src/plugins/mantisbt/action/admin/deleteCategory.php
===================================================================
--- trunk/src/plugins/mantisbt/action/admin/deleteCategory.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/admin/deleteCategory.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,10 +21,22 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+/* deleteCategory action page */
+
 $deleteCategory = $_POST['deleteCategory'];
 
 if ($deleteCategory) {
-	$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-	$clientSOAP->__soapCall('mc_project_delete_category', array("username" => $username, "password" => $password, "p_project_id" => $idProjetMantis, "p_category_name" => $deleteCategory));
+    try {
+	    $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+	    $clientSOAP->__soapCall('mc_project_delete_category', array("username" => $username, "password" => $password, "p_project_id" => $idProjetMantis, "p_category_name" => $deleteCategory));
+    } catch (SoapFault $soapFault) {
+        $msg = 'Error : '.$soapFault->faultstring;
+        session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&error_msg='.urlencode($msg));
+    }
+    $feedback = 'Op&eacute;ration r&eacute;ussie';
+    session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&feedback='.urlencode($feedback));
+} else {
+    $warning = 'Param&egravetres manquants';
+    session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&warning_msg='.urlencode($warning));
 }
 ?>

Modified: trunk/src/plugins/mantisbt/action/admin/deleteVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/action/admin/deleteVersion.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/admin/deleteVersion.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,10 +21,22 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+/* deleteVersion action page */
+
 $deleteVersion = $_POST['deleteVersion'];
 
 if ($deleteVersion) {
-	$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-	$clientSOAP->__soapCall('mc_project_version_delete', array("username" => $username, "password" => $password, "version_id" => $deleteVersion));
+    try {
+	    $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+	    $clientSOAP->__soapCall('mc_project_version_delete', array("username" => $username, "password" => $password, "version_id" => $deleteVersion));
+    } catch (SoapFault $soapFault) {
+        $msg = 'Erreur : '.$soapFault->faultstring;
+        session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&error_msg='.urlencode($msg));
+    }
+    $feedback = 'Op&eacute;ration r&eacute;ussie';
+    session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&feedback='.urlencode($feedback));
+} else {
+    $warning = 'Param&egravetres manquants';
+    session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&warning_msg='.urlencode($warning));
 }
 ?>

Modified: trunk/src/plugins/mantisbt/action/admin/renameCategory.php
===================================================================
--- trunk/src/plugins/mantisbt/action/admin/renameCategory.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/admin/renameCategory.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,11 +21,23 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+/* renameCategory action page */
+
 $newCategoryName = $_POST['newCategoryName'];
 $renameCategory = $_POST['renameCategory'];
 
 if ( $newCategoryName && $renameCategory ) {
-	$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-	$clientSOAP->__soapCall('mc_project_rename_category_by_name', array("username" => $username, "password" => $password, "p_project_id" => $idProjetMantis, "p_category_name" => $renameCategory, "p_category_name_new" => $newCategoryName, "p_assigned_to" => ''));
+    try {
+	    $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+	    $clientSOAP->__soapCall('mc_project_rename_category_by_name', array("username" => $username, "password" => $password, "p_project_id" => $idProjetMantis, "p_category_name" => $renameCategory, "p_category_name_new" => $newCategoryName, "p_assigned_to" => ''));
+    } catch (SoapFault $soapFault) {
+        $msg = 'Error : '.$soapFault->faultstring;
+        session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&error_msg='.urlencode($msg));
+    }
+    $feedback = 'Op&eacute;ration r&eacute;ussie';
+    session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&feedback='.urlencode($feedback));
+} else {
+    $warning = 'Param&egravetres manquants';
+    session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&warning_msg='.urlencode($warning));
 }
 ?>

Modified: trunk/src/plugins/mantisbt/action/admin/updateVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/action/admin/updateVersion.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/admin/updateVersion.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,24 +21,42 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-$version_name = $_POST['version_name'];
-$version_date_order = $_POST['version_date_order'];
-$version_release = $_POST['version_release'];
+/* update a version action page */
+
 $version_id = $_POST['version_id'];
 
 $version_data = array();
-if ( $version_release == 1 ) {
+if ( $_POST['version_release'] == 1 ) {
 	$version_data['released'] = 1;
 } else {
 	$version_data['released'] = 0;
 }
 $version_data['project_id'] = $idProjetMantis;
-$version_data['name'] = $version_name;
-list($day, $month, $year) = split('[/.-]', $version_date_order);
+$version_data['name'] = $_POST['version_name'];
+list($day, $month, $year) = split('[/.-]', $_POST['version_date_order']);
 $version_data['date_order'] = $month."/".$day."/".$year;
 $version_data['description'] = '';
 
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-$clientSOAP->__soapCall('mc_project_version_update', array("username" => $username, "password" => $password, "version_id" => $version_id, "version" => $version_data));
+try {
+    $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+    $clientSOAP->__soapCall('mc_project_version_update', array("username" => $username, "password" => $password, "version_id" => $version_id, "version" => $version_data));
+    if (isset($_POST['transverse'])) {
+        $listChild = $clientSOAP->__soapCall('mc_project_get_subprojects', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
+        foreach ($listChild as $key => $child) {
+            $listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $child));
+            foreach ($listVersions as $key => $version) {
+                if ($version->name == $_POST['version_old_name'])
+                    $child_version_id = $version->id;
+            }
+            $version_data['project_id'] = $child;
+            $clientSOAP->__soapCall('mc_project_version_update', array("username" => $username, "password" => $password, "version_id" => $child_version_id, "version" => $version_data));
+        }
+    }
+} catch (SoapFault $soapFault) {
+    $msg = 'Erreur : '.$version_data['name'].' '.$soapFault->faultstring;
+    session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisb&error_msg='.urlencode($msg));
+}
+$feedback = 'Op&eacute;ration r&eacute;ussie';
+session_redirect('plugins/mantisbt/?type=admin&id='.$id.'&pluginname=mantisbt&feedback='.urlencode($feedback));
 
 ?>

Modified: trunk/src/plugins/mantisbt/action/deleteAttachment.php
===================================================================
--- trunk/src/plugins/mantisbt/action/deleteAttachment.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/deleteAttachment.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,10 +21,14 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 $idAttachment = getIntFromRequest('idAttachment');
 if ($idAttachment) {
-	return $clientSOAP->__soapCall('mc_issue_attachment_delete', array("username" => $username, "password" => $password, "issue_attachment_id" => $idAttachment));
+    try {
+        $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+	    $clientSOAP->__soapCall('mc_issue_attachment_delete', array("username" => $username, "password" => $password, "issue_attachment_id" => $idAttachment));
+    } catch (SoapFault $soapFault) {
+        echo 'Error : '.$soapFault->faultstring;
+        echo '<br/>';
+    }
 }
-
 ?>

Modified: trunk/src/plugins/mantisbt/action/deleteNote.php
===================================================================
--- trunk/src/plugins/mantisbt/action/deleteNote.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/deleteNote.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,7 +21,13 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-return $clientSOAP->__soapCall('mc_issue_note_delete', array("username" => $username, "password" => $password, "issue_note_id" => $idNote));
-
+try {
+    $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+    $clientSOAP->__soapCall('mc_issue_note_delete', array("username" => $username, "password" => $password, "issue_note_id" => $idNote));
+} catch (SoapFault $soapFault) {
+    $feedback = 'Error : '.$soapFault->faultstring;
+    session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$idBug.'&view=viewIssue&error_msg='.urlencode($feedback));
+}
+$feedback = 'Op&eacute;ration r&eacute;ussie';
+session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$idBug.'&view=viewIssue&feedback='.urlencode($feedback));
 ?>

Modified: trunk/src/plugins/mantisbt/action/updateIssue.php
===================================================================
--- trunk/src/plugins/mantisbt/action/updateIssue.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/updateIssue.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,8 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
+ *          Antoine Mercadal - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -24,7 +25,7 @@
 $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
 if ($defect->category != $_POST['categorie']){
-	$defect->category =$_POST['categorie'];
+	$defect->category = $_POST['categorie'];
 }
 
 if ($defect->severity->name != $_POST['severite']){
@@ -147,8 +148,14 @@
 	$defect->target_version = $_POST['target_version'];
 }
 
-$clientSOAP->__soapCall('mc_issue_update', array("username" => $username, "password" => $password, "issue_id" => $idBug, "issue" => $defect));
+try {
+    $clientSOAP->__soapCall('mc_issue_update', array("username" => $username, "password" => $password, "issue_id" => $idBug, "issue" => $defect));
+} catch (SoapFault $soapFault) {
+    $feedback = 'Erreur : '.$soapFault->faultstring;
+    session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$idBug.'&view=viewIssue&error_msg='.urlencode($feedback));
+}
 
+//TODO : est-ce vraiment utilise ?
 if ($_POST['note_ajout'] != null && $_POST['note_ajout'] != ''){
 	$note = array();
 	$note['text'] = $_POST['note_ajout'];
@@ -164,7 +171,10 @@
 			}
 		}
 	}
-	return $clientSOAP->__soapCall('mc_issue_note_add', array("username" => $username, "password" => $password, "issue_id" => $idBug, "note" => $note));
+	$clientSOAP->__soapCall('mc_issue_note_add', array("username" => $username, "password" => $password, "issue_id" => $idBug, "note" => $note));
 }
 
+$feedback = 'Op&eacute;ration r&eacute;ussie';
+session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$idBug.'&view=viewIssue&feedback='.urlencode($feedback));
+
 ?>

Modified: trunk/src/plugins/mantisbt/action/updateNote.php
===================================================================
--- trunk/src/plugins/mantisbt/action/updateNote.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/action/updateNote.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,8 +21,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+$noteEdit;
 $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-$noteEdit;
 $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
 foreach($defect->notes as $key => $note){
 	if ($note->id == $idNote){
@@ -33,7 +33,12 @@
 
 if (isset($_POST['edit_texte_note'])){
 	$noteEdit->text = $_POST['edit_texte_note'];
-	return  $clientSOAP->__soapCall('mc_issue_note_update', array("username" => $username, "password" => $password, "issue_id" => $idBug, "issue_note_id" => $idNote, "note" => $noteEdit, "type_update" => "text"));
+    try {
+	    $clientSOAP->__soapCall('mc_issue_note_update', array("username" => $username, "password" => $password, "issue_id" => $idBug, "issue_note_id" => $idNote, "note" => $noteEdit, "type_update" => "text"));
+    } catch (SoapFault $soapFault) {
+        $feedback = 'Erreur : '.$soapFault->faultstring;
+        session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$idBug.'&view=viewIssue&error_msg='.urlencode($feedback));
+    }
 } else {
 	$listViewStates = $clientSOAP->__soapCall('mc_enum_view_states', array("username" => $username, "password" => $password));
 	foreach($listViewStates as $state){
@@ -44,7 +49,15 @@
 		}
 	}
 
-return  $clientSOAP->__soapCall('mc_issue_note_update', array("username" => $username, "password" => $password, "issue_id" => $idBug, "issue_note_id" => $idNote, "note" => $noteEdit, "type_update" => "state"));
+    try {
+        $clientSOAP->__soapCall('mc_issue_note_update', array("username" => $username, "password" => $password, "issue_id" => $idBug, "issue_note_id" => $idNote, "note" => $noteEdit, "type_update" => "state"));
+    } catch (SoapFault $soapFault) {
+        $feedback = 'Erreur : '.$soapFault->faultstring;
+        session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$idBug.'&view=viewIssue&error_msg='.urlencode($feedback));
+    }
 }
 
+$feedback = 'Op&eacute;ration r&eacute;ussie';
+session_redirect('plugins/mantisbt/?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$idBug.'&view=viewIssue&feedback='.urlencode($feedback));
+
 ?>

Modified: trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php
===================================================================
--- trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/common/MantisBTPlugin.class.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -3,8 +3,7 @@
 /**
  * MantisBPlugin Class
  *
- * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Copyright 2009 - 2010 (c) : Franck Villaume - Capgemini
  *
  * This file is part of FusionForge.
  *
@@ -23,7 +22,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-require_once $gfcommon.'include/database-pgsql.php';
+require_once 'include/database-pgsql.php';
 
 class MantisBTPlugin extends Plugin {
 	function MantisBTPlugin () {
@@ -39,6 +38,7 @@
 		$this->hooks[] = "userisactivecheckboxpost" ; //
 		$this->hooks[] = "project_admin_plugins"; // to show up in the admin page fro group
 		$this->hooks[] = "change_cal_permission";
+		$this->hooks[] = "change_cal_mail";
 		$this->hooks[] = "add_cal_link_father";
 		$this->hooks[] = "del_cal_link_father";
 		$this->hooks[] = "group_approved";
@@ -61,19 +61,13 @@
 			case "groupmenu":
 				$group_id=$params['group'];
 				$project = &group_get_object($group_id);
-				if (!$project || !is_object($project)) {
+				if (!$project || !is_object($project) || $project->isError() || !$project->isProject()) {
 					return;
 				}
-				if ($project->isError()) {
-					return;
-				}
-				if (!$project->isProject()) {
-					return;
-				}
-			
+
 				if ($project->usesPlugin($this->name)) {
 					$params['TITLES'][]=$this->text;
-					$params['DIRS'][]='/plugins/' . $this->name . '/index.php?type=group&id=' . $group_id . "&pluginname=" . $this->name;
+					$params['DIRS'][]='/plugins/' . $this->name . '/?type=group&id=' . $group_id . "&pluginname=" . $this->name;
 				} else {
 					$params['TITLES'][]='<font color="#444444">'.$this->text.'</font>';
 					if ($G_SESSION && $project->getPermission(user_get_object($G_SESSION->getId()))->isAdmin()) {
@@ -82,7 +76,9 @@
 							$params['DIRS'][]='#';
 					}
 				}
-				(($params['toptab'] == $this->name) ? $params['selected']=(count($params['TITLES'])-1) : '' );
+				if ($params['toptab'] == $this->name) {
+                    $params['selected']=(count($params['TITLES'])-1);
+                } 
 				break;
 
 			case "groupisactivecheckbox":
@@ -95,7 +91,7 @@
 				echo ' <input type="CHECKBOX" name="use_mantisbtplugin" value="1" ';
 				// CHECKED OR UNCHECKED?
 				if ( $group->usesPlugin ( $this->name ) ) {
-					echo "CHECKED disabled";
+					echo "CHECKED";
 				}
 				echo "><br/>";
 				echo "</td>";
@@ -117,7 +113,7 @@
 					
 						// ajout du projet mantis s'il n'existe pas
 						if (!isProjetMantisCreated($group->data_array['group_id'])){
-							addProjetMantis($group->data_array['group_id'],$group->data_array['group_name'],$group->data_array['is_public'], $group->data_array['description']);
+							addProjetMantis($group->data_array['group_id'],$group->data_array['group_name'],$group->data_array['is_public'], $group->data_array['short_description']);
 						}
 						// mise a jour des utilisateurs avec les roles
 						$members = array ();
@@ -223,6 +219,12 @@
 				updateUsersProjetMantis($group->data_array['group_id'],$members);
 				break;
 
+            // mise a jour de l'adresse mail utilisateur
+            case "change_cal_mail":
+                $user_id=$params[1];
+                updateUserInMantis($user_id);
+                break;
+
 			case "add_cal_link_father":
 			case "del_cal_link_father":
 				$sub_group_id = $params[0];
@@ -383,6 +385,23 @@
 	
 }
 
+function updateUserInMantis($user_id) {
+	global $sys_mantisbt_host, $sys_mantisbt_db_user, $sys_mantisbt_db_password, $sys_mantisbt_db_port, $sys_mantisbt_db_name;
+    // recuperation du nouveau mail
+	$resUser = db_query_params ('SELECT user_name, email FROM users WHERE user_id = $1',array($user_id));
+	echo db_error();
+	$row =& db_fetch_array($resUser);
+	$dbConnection = db_connect_host($sys_mantisbt_db_name, $sys_mantisbt_db_user, $sys_mantisbt_db_password, $sys_mantisbt_host, $sys_mantisbt_db_port);
+	if(!$dbConnection){
+		$errMantis1 =  "Error : Could not open connection" . db_error($dbConnection);
+		echo $errMantis1;
+		db_rollback($dbConnection);
+	} else {
+        db_query_params('UPDATE mantis_user_table set email = $1 where username = $2',array($row['email'],$row['user_name']),'-1','0',$dbConnection);
+        echo db_error();
+    }
+}
+
 function updateUsersProjetMantis($idProjet, $members){
 	
 	global $role;
@@ -447,41 +466,50 @@
 }
 
 function refreshHierarchyMantisBt(){
-        global $sys_mantisbt_host, $sys_mantisbt_db_user, $sys_mantisbt_db_password, $sys_mantisbt_db_port, $sys_mantisbt_db_name;
+    global $sys_mantisbt_host, $sys_mantisbt_db_user, $sys_mantisbt_db_password, $sys_mantisbt_db_port, $sys_mantisbt_db_name;
 
-        $hierarchies=db_query_params('SELECT project_id, sub_project_id FROM plugin_projects_hierarchy WHERE activated=true');
-	echo db_error();
-        $dbConnection = db_connect_host($sys_mantisbt_db_name, $sys_mantisbt_db_user, $sys_mantisbt_db_password, $sys_mantisbt_host, $sys_mantisbt_db_port);
-        if(!$dbConnection){
-                db_rollback($dbConnection);
-                return false;
-        }
+    $hierarchies=db_query_params('SELECT project_id, sub_project_id FROM plugin_projects_hierarchy WHERE activated=true',array());
+    echo db_error();
+    $dbConnection = db_connect_host($sys_mantisbt_db_name, $sys_mantisbt_db_user, $sys_mantisbt_db_password, $sys_mantisbt_host, $sys_mantisbt_db_port);
+    if(!$dbConnection){
+        db_rollback($dbConnection);
+        return false;
+    }
 
-        db_begin($dbConnection);
-        db_query_params('TRUNCATE TABLE mantis_project_hierarchy_table',array() , '-1', 0, $dbConnection);
-        while ($hierarchy = db_fetch_array($hierarchies)) {
-                $result = db_query_params ('INSERT INTO mantis_project_hierarchy_table (child_id, parent_id, inherit_parent)
-                                                                        VALUES ($1, $2, $3)',
-                                                                        array (getIdProjetMantis($hierarchy['sub_project_id']),
-                                                                                  getIdProjetMantis($hierarchy['project_id']),
-                                                                                  1
-                                                                        ),
-                                                                        '-1',
-                                                                        0,
-                                                                        $dbConnection) ;
+    db_begin($dbConnection);
+    db_query_params('TRUNCATE TABLE mantis_project_hierarchy_table',array() , '-1', 0, $dbConnection);
+    while ($hierarchy = db_fetch_array($hierarchies)) {
+        $result = db_query_params ('INSERT INTO mantis_project_hierarchy_table (child_id, parent_id, inherit_parent) VALUES ($1, $2, $3)',
+                                array (getIdProjetMantis($hierarchy['sub_project_id']), getIdProjetMantis($hierarchy['project_id']), 1),
+                                '-1',
+                                0,
+                                $dbConnection) ;
 
-                if (!$result) {
-                        $this->setError(_('Insert Failed') . db_error($dbConnection));
-                        db_rollback();
-                        return false;
-                }
+        if (!$result) {
+            $this->setError(_('Insert Failed') . db_error($dbConnection));
+            db_rollback();
+            return false;
         }
+    }
 
-        db_commit($dbConnection);
-        pg_close($dbConnection);
-        return true;
+    db_commit($dbConnection);
+    pg_close($dbConnection);
+    return true;
 }
 
+function getGroupIdByName($name){
+
+    $child_query = db_query_params('select group_id from groups where group_name = $1',array($name));
+    echo db_error();
+    $row =& db_fetch_array($child_query);
+
+    if ($row == null) {
+	return 0;
+    }else{
+	return $row['group_id'];
+    }
+}
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"

Added: trunk/src/plugins/mantisbt/controler/filter.php
===================================================================
--- trunk/src/plugins/mantisbt/controler/filter.php	                        (rev 0)
+++ trunk/src/plugins/mantisbt/controler/filter.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -0,0 +1,183 @@
+<?php
+
+/*
+ * Copyright 2010, Capgemini
+ * Authors: Franck Villaume - capgemini
+ *          Antoine Mercadal - capgemini
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+$bugfilter = array ();
+$bugfilter['_view_type'] = "advanced";
+
+if ( $_POST['sort'] ) {
+    $bugfilter['sort'] = $_POST['sort'];
+} else {
+    $bugfilter['sort'] = "last_updated";
+}
+if ( $_POST['dir'] ) {
+    $bugfilter['dir'] = $_POST['dir'];
+} else {
+    $bugfilter['dir'] = "DESC";
+}
+echo    '<form name="viewissues" id="mainform" method="post" action="?type='.$type.'&id='.$id.'&pluginname=mantisbt">';
+if ( $_POST['sort'] ) {
+    echo '<input type="hidden" name="sort" value="'.$_POST['sort'].'" />';
+}
+if ( $_POST['dir'] ) {
+    echo '<input type="hidden" name="dir" value="'.$_POST['dir'].'" />';
+}
+echo    '<div>';
+$listStatus= $clientSOAP->__soapCall('mc_enum_status', array("username" => $username, "password" => $password));
+    
+echo "<div style='float: left;margin-right: 10px; width: 160px'>";
+echo "<h4 style='border-bottom: 1px solid #DAE0EA'>avec les status :</h3>";
+    
+echo '<select name="projectStatus[]" id="projectStatus" multiple size="'.sizeof($listStatus).'" style="width: 160px; height: 100px">';
+foreach ($listStatus as $key => $status){
+    echo '<option value="'.$status->id.'"';
+    if (isset($_POST['projectStatus'])) {
+            $flipped_projectStatus = array_flip($_POST['projectStatus']); 
+            if (isset($flipped_projectStatus[$status->id])) {
+                echo 'selected="selected"';
+            }
+    }
+    echo '>'.$status->name.'</option>';
+}
+echo '</select>';
+echo '</div>';
+
+if ($type == "group"){
+    $bugfilter['project_id'][] = $idProjetMantis;
+    $listChild = $clientSOAP->__soapCall('mc_project_get_subprojects', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
+    $mantisbtMembers =  $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis, "access" => "ANYBODY"));
+    if ( 0 != sizeof($listChild) ) {
+        echo '<div style="float: left; margin-right: 10px; width: 160px">';    
+        echo '<h4 style="border-bottom: 1px solid #DAE0EA">Inclure les sous-projets :</h3>';
+
+        echo '<select name="projectChildId[]" id="projectChildId" multiple style="width: 160px; height: 100px">';
+        foreach ( $listChild as $key => $child ) {
+            // on en profite pour récupérer tous les membres de tous les projets
+            $mantisbtMembersChild =  $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $child, "access" => "ANYBODY"));
+            foreach ( $mantisbtMembersChild as $key => $mantisbtMemberChild ) {
+                $found = 0;
+                foreach ($mantisbtMembers as $key => $mantisbtMember ) {
+                    if ( $mantisbtMemberChild->id == $mantisbtMember->id )
+                        $found = 1;
+                }
+                if ( !$found) 
+                    $mantisbtMembers[] = $mantisbtMemberChild;
+            }
+            $resultGroupNameFusionForge = db_query_params ('select groups.group_name from groups,group_mantisbt where groups.group_id = group_mantisbt.id_group and group_mantisbt.id_mantisbt = $1',
+                                                array($child));
+            $rowGroupNameFusionForge =& db_fetch_array($resultGroupNameFusionForge);
+            echo '<option value="'.$child.'"';
+            if (isset($_POST['projectChildId'])) {
+                $flipped_projectChildId = array_flip($_POST['projectChildId']); 
+                if (isset($flipped_projectChildId[$child])) {
+                    echo 'selected="selected"';
+                }
+            }
+            echo '>'.$rowGroupNameFusionForge['group_name'].'</option>';
+        }
+        echo '</select>';
+        echo '</div>';
+    }
+    echo '<div style="float: left; margin-right: 10px; width: 160px">';
+    echo '<h4 style="border-bottom: 1px solid #DAE0EA">rapport&eacute; par :</h3>';
+    echo '<select name="projectReporters[]" id="projectReporters" multiple style="width: 160px; height: 100px">';
+    foreach ($mantisbtMembers as $key => $mantisbtMember ) {
+        echo '<option value="'.$mantisbtMember->id.'"';
+        if (isset($_POST['projectReporters'])) {
+            $flipped_projectReporters = array_flip($_POST['projectReporters']);
+            if (isset($flipped_projectReporters[$mantisbtMember->id])) {
+                echo 'selected="selected"';
+            }
+        }
+        echo '>'.htmlspecialchars($mantisbtMember->real_name,ENT_QUOTES).'</option>';
+    }
+    echo '</select>';
+    echo '</div>';
+
+    echo '<div style="float: left; margin-right: 10px; width: 160px">';
+    echo '<h4 style="border-bottom: 1px solid #DAE0EA">attribu&eacute; &agrave; :</h3>';
+    echo '<select name="projectFixers[]" id="projectFixers" multiple style="width: 160px; height: 100px">';
+    foreach ($mantisbtMembers as $key => $mantisbtMember ) {
+        echo '<option value="'.$mantisbtMember->id.'"';
+        if (isset($_POST['projectFixers'])) {
+            $flipped_projectFixers = array_flip($_POST['projectFixers']);
+            if (isset($flipped_projectFixers[$mantisbtMember->id])) {
+                echo 'selected="selected"';
+            }
+        }
+        echo '>'.htmlspecialchars($mantisbtMember->real_name,ENT_QUOTES).'</option>';
+    }
+    echo '</select>';
+    echo '</div>';
+
+    if ( $_POST['projectChildId'] ) {
+        foreach ( $_POST['projectChildId'] as $key => $child ) {
+            $bugfilter['project_id'][] = $child;
+        }
+    }
+
+    if ( $_POST['projectReporters'] ) {
+        foreach ( $_POST['projectReporters'] as $key => $projectReporter ) {
+            $bugfilter['reporter_id'][] = $projectReporter;
+        }
+    }
+
+    if ( $_POST['projectFixers'] ) {
+        foreach ( $_POST['projectFixers'] as $key => $projectFixer ) {
+            $bugfilter['handler_id'][] = $projectFixer;
+        }
+    }
+}
+if ( $_POST['projectStatus'] ) {
+    foreach ( $_POST['projectStatus'] as $key => $statusId ) {
+        $bugfilter['show_status'][] = $statusId;
+    }
+} else {
+    foreach ($listStatus as $key => $status){
+        if ( $status->id != 90 ) {
+            $bugfilter['show_status'][] = $status->id;
+        }
+    }
+}
+echo <<< EOT
+    <script>
+        function reinit()
+        {
+            document.getElementById("projectStatus").selectedIndex = -1;
+            if (document.getElementById("projectChildId"))
+                document.getElementById("projectChildId").selectedIndex = -1;
+            if (document.getElementById("projectFixers"))
+                document.getElementById("projectFixers").selectedIndex = -1;
+            if (document.getElementById("projectReporters"))
+                document.getElementById("projectReporters").selectedIndex = -1;
+            document.getElementById("mainform").submit();
+        }
+    </script>
+EOT;
+echo    '</div>';
+echo '<br/><div style="clear:both;width:100%; text-align: right">'.
+     '<input type="button" value="Reinitialiser" onclick="reinit();"/> '.
+     '<input type="submit" value="Appliquer le filtre" /></div>';
+echo '</form>';
+
+?>

Added: trunk/src/plugins/mantisbt/controler/filter_roadmap.php
===================================================================
--- trunk/src/plugins/mantisbt/controler/filter_roadmap.php	                        (rev 0)
+++ trunk/src/plugins/mantisbt/controler/filter_roadmap.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -0,0 +1,115 @@
+<?php
+
+/*
+ * Copyright 2010, Capgemini
+ * Authors: Franck Villaume - capgemini
+ *          Antoine Mercadal - capgemini
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+echo '<form id="mainform" method="post" action="?type=group&id='.$id.'&pluginname=mantisbt&view=roadmap">';
+
+$listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
+if ( sizeof($listVersions) ) {
+    echo '<div style="float: left;margin-right: 10px; width: 145px; height: 140px;">';
+    echo '<h4 style="border-bottom: 1px solid #DAE0EA">Versions :</h4>';
+    echo '<select name="projectVersionId[]" id="projectVersionId" multiple style="width: 145px; height: 100px">';
+    foreach ( $listVersions as $key => $version ) {
+        echo '<option value="'.$version->id.'"';
+        if (isset($_POST['projectVersionId'])) {
+            $flipped_projectVersionId = array_flip($_POST['projectVersionId']);
+            if (isset($flipped_projectVersionId[$version->id])) {
+                echo 'selected="selected"';
+            }
+        }
+        echo '>'.$version->name;
+        if ( $version->released ) {
+            echo '(<i>release</i>)';
+        } else {
+            echo '(<i>milestone</i>)';
+        }
+        echo '</option>';
+    }
+    echo '</select>';
+    echo '</div>';
+}
+
+if ( sizeof($listChild)) {
+    // nous avons deja un bloc
+    $nbblock = 1;
+    foreach ( $listChild as $key => $child ) {
+        $listChildVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $child));
+        if ( sizeof($listChildVersions)) {
+            $resultGroupNameFusionForge = db_query_params ('select groups.group_name from groups,group_mantisbt where groups.group_id = group_mantisbt.id_group and group_mantisbt.id_mantisbt = $1',
+                                                           array($child));
+            $rowGroupNameFusionForge =& db_fetch_array($resultGroupNameFusionForge);
+            echo '<div id="childVersion'.$child.'" style="float: left;margin-right: 10px; width: 145px; height: 140px;">';
+            echo '<h4 style="border-bottom: 1px solid #DAE0EA; width: 145px;">'.$rowGroupNameFusionForge['group_name'].'</h4>';
+            echo '<select name="project'.$child.'VersionId[]" id="project'.$child.'VersionId" multiple style="width: 145px; height: 100px">';
+            foreach ( $listChildVersions as $key => $version ) {
+                echo '<option value="'.$version->id.'"';
+                if (isset($_POST['project'.$child.'VersionId'])) {
+                    $flipped_projectVersionId = array_flip($_POST['project'.$child.'VersionId']);
+                    if (isset($flipped_projectVersionId[$version->id])) {
+                        echo 'selected="selected"';
+                    }
+                }
+                echo '>'.$version->name;
+                if ( $version->released ) {
+                    echo '(<i>release</i>)';
+                } else {
+                    echo '(<i>milestone</i>)';
+                }
+                echo '</option>';
+            }
+            echo '</select>';
+            echo '</div>';
+            $nbblock++;
+            if ( $nbblock == 7 ) {
+                echo '<div style="clear:both; width:100%"></div>';
+		$nbblock = 0;
+            }
+        }
+    }
+}
+
+echo <<< EOT
+    <script>
+        function reinit()
+        {
+            if (document.getElementById("projectVersionId"))
+                document.getElementById("projectVersionId").selectedIndex = -1;
+EOT;
+if ( sizeof($listChild)) {
+    foreach ( $listChild as $key => $child ) {
+        echo 'if (document.getElementById("project'.$child.'VersionId"))
+                document.getElementById("project'.$child.'VersionId").selectedIndex = -1;';
+    }
+}
+echo <<< EOT
+
+            document.getElementById("mainform").submit();
+        }
+    </script>
+EOT;
+echo '<br/><div style="clear:both;width:100%; text-align: right">'.
+     '<input type="button" value="Reinitialiser" onclick="reinit();"/> '.
+     '<input type="submit" value="Appliquer le filtre" /></div>';
+echo '</form>';
+
+?>

Modified: trunk/src/plugins/mantisbt/etc/plugins/mantisbt/config.php
===================================================================
--- trunk/src/plugins/mantisbt/etc/plugins/mantisbt/config.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/etc/plugins/mantisbt/config.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -30,4 +30,10 @@
 
 $bugPerPage = 20;
 
+// correspondance role forge:mantisbt (mais non utilisé car bug inclusion)
+$role['Manager'] = 70;
+$role['Concepteur'] = 55;
+$role['Collaborateur'] = 55;
+$role['Rapporteur'] = 55;
+
 ?>

Modified: trunk/src/plugins/mantisbt/view/addAttachment.php
===================================================================
--- trunk/src/plugins/mantisbt/view/addAttachment.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/addAttachment.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,34 +21,12 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-GLOBAL $HTML;
+echo '<form method="POST" Action="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$idBug.'&action=addAttachment&view=viewIssue" enctype="multipart/form-data">';
+echo	'<table class="innertabs">';
+echo '<tr><td>';
+echo '     Fichier : <input type="file" name="attachment">';
+echo '</td></tr></table>';
+echo '<br/><input type="button" onclick="this.form.submit();this.disabled=true;" name="envoyer" value="Envoyer le fichier">';
+echo '</form>';
 
-if (!isset($defect)){
-	try{
-		$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-		$defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
-	}catch (SoapFault $soapFault) {
-		echo $soapFault->faultstring;
-		echo "<br/>";
-		$errorPage = true;
-	}
-}
-
-$boxTitle = 'Ajouter un fichier (<a style="color:#FFFFFF;font-size:0.8em;" href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$idBug.'&view=viewIssue">Retour Ticket '.$idBug.'</a>)';
-echo $HTML->boxTop($boxTitle,InTextBorder);
-
-if ($errorPage){
-	echo 	'<div>Un problème est survenu lors de la récupération des données</div>';
-	echo $HTML->boxBottom();
-}else {
-	echo '<form method="POST" Action="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$idBug.'&action=addAttachment&view=viewIssue" enctype="multipart/form-data">';
-	echo	'<table class="innertabs">';
-	echo '<tr><td>';
-	echo '     Fichier : <input type="file" name="attachment">';
-	echo '</td><td>';
-	echo '     <input type="submit" name="envoyer" value="Envoyer le fichier">';
-	echo '</td></tr></table>';
-	echo '</form>';
-	echo $HTML->boxBottom();
-}
 ?>

Modified: trunk/src/plugins/mantisbt/view/addIssue.php
===================================================================
--- trunk/src/plugins/mantisbt/view/addIssue.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/addIssue.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,8 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
+ *          Antoine Mercadal - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -31,105 +32,111 @@
 			alert ("champ Description obligatoire");
 		} else {
 			document.issue.submit();
+            document.issue.submitbutton.disabled="true";
 		}
 	}
 	</script>
 	');
 
-// included the hability to use $HTML tool to create box
-GLOBAL $HTML;
+try {
+    /* do not recreate $clientSOAP object if already created by other pages */
+    if (!isset($clientSOAP))
+        $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+    $listCategories = $clientSOAP->__soapCall('mc_project_get_categories', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
+    $listSeverities = $clientSOAP->__soapCall('mc_enum_severities', array("username" => $username, "password" => $password));
+    $listReproducibilities = $clientSOAP->__soapCall('mc_enum_reproducibilities', array("username" => $username, "password" => $password));
+    $listViewStates = $clientSOAP->__soapCall('mc_enum_view_states', array("username" => $username, "password" => $password));
+    $listDevelopers = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis, "acces" => 25));
+    $listPriorities = $clientSOAP->__soapCall('mc_enum_priorities', array("username" => $username, "password" => $password));
+    $listResolutions= $clientSOAP->__soapCall('mc_enum_resolutions', array("username" => $username, "password" => $password));
+    $listStatus= $clientSOAP->__soapCall('mc_enum_status', array("username" => $username, "password" => $password));
+    $listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
+} catch (SoapFault $soapFault) {
+        $msg = $soapFault->faultstring;
+        $errorPage = true;
+}
 
-$listCategories = $clientSOAP->__soapCall('mc_project_get_categories', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
-$listSeverities = $clientSOAP->__soapCall('mc_enum_severities', array("username" => $username, "password" => $password));
-$listReproducibilities = $clientSOAP->__soapCall('mc_enum_reproducibilities', array("username" => $username, "password" => $password));
-$listViewStates = $clientSOAP->__soapCall('mc_enum_view_states', array("username" => $username, "password" => $password));
-$listDevelopers = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis, "acces" => 25));
-$listPriorities = $clientSOAP->__soapCall('mc_enum_priorities', array("username" => $username, "password" => $password));
-$listResolutions= $clientSOAP->__soapCall('mc_enum_resolutions', array("username" => $username, "password" => $password));
-$listStatus= $clientSOAP->__soapCall('mc_enum_status', array("username" => $username, "password" => $password));
-$listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
-
-
-echo $HTML->boxTop("Ajout d'un ticket",InTextBorder);
-echo 	'<form name="issue" method="POST" action="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&action=addIssue" >';
-echo	'<table class="innertabs">';
-echo		'<tr>';
-echo 			'<td width="16%" class="FullBoxTitle">Catégorie</td>';
-echo 			'<td width="16%" class="FullBoxTitle">Reproductibilité</td>';
-echo 			'<td width="16%" class="FullBoxTitle">Sévérité</td>';
-echo 			'<td width="16%" class="FullBoxTitle">Priorité</td>';
-echo 			'<td width="16%" class="FullBoxTitle">Assigné à</td>';
-echo 			'<td width="16%" class="FullBoxTitle">Détecté en</td>';
-echo		'</tr>';
-echo		'<tr>';
-echo 			'<td class="FullBox">';
-echo				'<select name="categorie" class="sirhen">';
-foreach ($listCategories as $key => $category){
-	echo				"<option>".$category."</option>";
+if ($errorPage){
+    echo    '<div class="warning" >Un probl&egrave;me est survenu lors de la r&eacute;cup&eacute;ration des donn&eacute;es : '.$msg.'</div>';
+} else {
+    echo 	'<form name="issue" method="POST" action="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&action=addIssue" >';
+    echo	'<table class="innertabs">';
+    echo		'<tr>';
+    echo 			'<td width="16%" class="FullBoxTitle">Catégorie</td>';
+    echo 			'<td width="16%" class="FullBoxTitle">Reproductibilité</td>';
+    echo 			'<td width="16%" class="FullBoxTitle">Sévérité</td>';
+    echo 			'<td width="16%" class="FullBoxTitle">Priorité</td>';
+    echo 			'<td width="16%" class="FullBoxTitle">Assigné à</td>';
+    echo 			'<td width="16%" class="FullBoxTitle">Détecté en</td>';
+    echo		'</tr>';
+    echo		'<tr>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="categorie" class="sirhen">';
+    foreach ($listCategories as $key => $category){
+	    echo				"<option>".$category."</option>";
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="reproductibilite" class="sirhen">';
+    foreach ($listReproducibilities as $key => $reproducibility){
+	    echo				"<option>".$reproducibility->name."</option>";
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="severite" class="sirhen">';
+    foreach ($listSeverities as $key => $severity){
+	    echo				"<option>".$severity->name."</option>";
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="priorite" class="sirhen">';
+    foreach ($listPriorities as $key => $priority){
+	    echo				"<option>".$priority->name."</option>";
+    }
+    echo				'</select>';
+    echo 			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="handler" class="sirhen">';
+    echo					"<option></option>";
+    foreach ($listDevelopers as $key => $user){
+	    echo				"<option>".$user->name."</option>";
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="version" class="sirhen">';
+    echo					"<option></option>";
+    foreach ($listVersions as $key => $version){
+	    echo				"<option>".$version->name."</option>";
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo		'</tr>';
+    echo	'</table>';
+    echo	'<br/>';
+    echo	'<table class="innertabs">';
+    echo		'<tr>';
+    echo 			'<td width="20%" lass="FullBoxTitle">Résumé * <span style="font-weight:normal">(128 caractères max)</span></td>';
+    echo			'<td class="FullBox"><input type="text" name="resume" MAXLENGTH="128" style="width:99%;"></td>';
+    echo		'</tr>';
+    echo		'<tr>';
+    echo 			'<td class="FullBoxTitle">Description *</td>';
+    echo			'<td class="FullBox"><textarea name="description" style="width:99%;" rows="12"></textarea></td>';
+    echo		'</tr>';
+    echo		'<tr>';
+    echo 			'<td class="FullBoxTitle">Informations complémentaires</td>';
+    echo			'<td class="FullBox"><textarea name="informations" style="width:99%;" rows="12"></textarea></td>';
+    echo		'</tr>';
+    echo	'</table>';
+    echo 	'<div align="center">';
+    echo 		'<input type="button" name="submitbutton" value="Soumettre le ticket" onclick="validate();">';
+    echo 		'<input type="button" name="Annuler" value="Annuler" onclick="window.location.href=\'?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'\'">';
+    echo 	'</div>';
+    echo	'* obligatoire';
+    echo 	'</form>';
 }
-echo				'</select>';
-echo			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="reproductibilite" class="sirhen">';
-foreach ($listReproducibilities as $key => $reproducibility){
-	echo				"<option>".$reproducibility->name."</option>";
-}
-echo				'</select>';
-echo			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="severite" class="sirhen">';
-foreach ($listSeverities as $key => $severity){
-	echo				"<option>".$severity->name."</option>";
-}
-echo				'</select>';
-echo			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="priorite" class="sirhen">';
-foreach ($listPriorities as $key => $priority){
-	echo				"<option>".$priority->name."</option>";
-}
-echo				'</select>';
-echo 			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="handler" class="sirhen">';
-echo					"<option></option>";
-foreach ($listDevelopers as $key => $user){
-	echo				"<option>".$user->name."</option>";
-}
-echo				'</select>';
-echo			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="version" class="sirhen">';
-echo					"<option></option>";
-foreach ($listVersions as $key => $version){
-	echo				"<option>".$version->name."</option>";
-}
-echo				'</select>';
-echo			'</td>';
-echo		'</tr>';
-echo	'</table>';
-echo	'<br/>';
-echo	'<table class="innertabs">';
-echo		'<tr>';
-echo 			'<td width="20%" lass="FullBoxTitle">Résumé * <span style="font-weight:normal">(128 caractères max)</span></td>';
-echo			'<td class="FullBox"><input type="text" name="resume" MAXLENGTH="128" style="width:99%;"></td>';
-echo		'</tr>';
-echo		'<tr>';
-echo 			'<td class="FullBoxTitle">Description *</td>';
-echo			'<td class="FullBox"><textarea name="description" style="width:99%;" rows="12"></textarea></td>';
-echo		'</tr>';
-echo		'<tr>';
-echo 			'<td class="FullBoxTitle">Informations complémentaires</td>';
-echo			'<td class="FullBox"><textarea name="informations" style="width:99%;" rows="12"></textarea></td>';
-echo		'</tr>';
-echo	'</table>';
-echo 	'<div align="center">';
-echo 		'<input type="button" value="Soumettre le ticket" onclick="validate();">';
-echo 		'<input type="button" name="Annuler" value="Annuler" onclick="window.location.href=\'?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'\'">';
-echo 	'</div>';
-echo	"* obligatoire";
-echo 	'</form>';
-echo $HTML->boxBottom();
 ?>

Modified: trunk/src/plugins/mantisbt/view/addOrEditNote.php
===================================================================
--- trunk/src/plugins/mantisbt/view/addOrEditNote.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/addOrEditNote.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,8 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
+ *          Antoine Mercadal - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,43 +22,49 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-// included the hability to use $HTML tool to create box
-GLOBAL $HTML;
+$noteEdit;
+try {
+    /* do not recreate $clientSOAP object if already created by other pages */
+    if (!isset($clientSOAP))
+        $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 
-$noteEdit;
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-$defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
-if ($view == "editNote"){
-	foreach($defect->notes as $key => $note){
-		if ($note->id == $idNote){
-			$noteEdit = $note;
-			break;
-		}
-	}
+    $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
+    if ($view == "editNote"){
+	    foreach($defect->notes as $key => $note){
+		    if ($note->id == $idNote){
+			    $noteEdit = $note;
+			    break;
+		    }
+	    }
+    }
+} catch (SoapFault $soapFault) {
+    $msg = $soapFault->faultstring;
+    $errorPage = true;
 }
-if($view == "editNote"){
-	$labelboxTitle = 'Modifier la note';
-	$actionform = 'updateNote';
-	$labelButtonSubmit = 'Mettre à jour';
+
+if ($errorPage){
+    echo    '<div class="warning">Un probl&egrave;me est survenu lors de la r&eacute;cup&eacute;ration des donn&eacute;es : '.$msg.'</div>';
 } else {
-	$labelboxTitle = 'Ajouter la note';
-	$actionform = 'addNote';
-	$labelButtonSubmit = 'Valider';
+    if($view == "editNote"){
+	    $labelboxTitle = 'Modifier la note';
+	    $actionform = 'updateNote';
+	    $labelButtonSubmit = 'Mettre à jour';
+    } else {
+	    $labelboxTitle = 'Ajouter la note';
+	    $actionform = 'addNote';
+	    $labelButtonSubmit = 'Valider';
+    }
+
+    echo 		'<div align="center" id="add_edit_note">';
+    echo 		'<form Method="POST" Action="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&idNote='.$idNote.'&action='.$actionform.'&view=viewIssue">';
+    echo				'<table class="innertabs">';
+    echo 					'<tr>';
+    echo						'<td class="FullBox" ><textarea name="edit_texte_note" style="width:99%;" rows=12>'.$noteEdit->text.'</textarea></td>';
+    echo 					'</tr>';
+    echo				'</table>';
+    echo 				'<input type=button onclick="this.form.submit();this.disabled=true;" value="'.$labelButtonSubmit.'">';
+    echo 			'</form>';
+    echo 		'</div>';
 }
 
-$boxTitle = $labelboxTitle.' (<a style="color:#FFFFFF;font-size:0.8em" href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&view=viewIssue">Retour Ticket '.$defect->id.'</a>)';
-
-echo $HTML->boxTop($boxTitle,InTextBorder);
-echo 		'<div align="center" id="add_edit_note">';
-echo 		'<form Method="POST" Action="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&idNote='.$idNote.'&action='.$actionform.'&view=viewIssue">';
-echo				'<table class="innertabs">';
-echo 					'<tr>';
-echo						'<td class="FullBox" ><textarea name="edit_texte_note" style="width:99%;" rows=12>'.$noteEdit->text.'</textarea></td>';
-echo 					'</tr>';
-echo				'</table>';
-echo 				'<input type=submit value="'.$labelButtonSubmit.'">';
-echo 			'</form>';
-echo 		'</div>';
-echo $HTML->boxBottom();
-
 ?>

Added: trunk/src/plugins/mantisbt/view/admin/StatPerMember.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/StatPerMember.php	                        (rev 0)
+++ trunk/src/plugins/mantisbt/view/admin/StatPerMember.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -0,0 +1,29 @@
+<?php
+
+/*
+ * Copyright 2010, Capgemini
+ * Author: Franck Villaume -- Capgemini
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+/* main display */
+global $HTML;
+
+echo "TO BE IMPLEMENTED";
+}
+?>

Added: trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php	                        (rev 0)
+++ trunk/src/plugins/mantisbt/view/admin/StatPerStatus.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -0,0 +1,91 @@
+<?php
+
+/*
+ * Copyright 2010, Capgemini
+ * Authors: Franck Villaume - capgemini
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+/* main display */
+global $HTML;
+
+try {
+    /* do not recreate $clientSOAP object if already created by other pages */
+    if (!isset($clientSOAP))
+        $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+
+    $stats = $clientSOAP->__soapCall('mc_project_get_statistiques', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis, "level" => 0));
+} catch (SoapFault $soapFault) {
+    echo $soapFault->faultstring;
+    echo "<br/>";
+    $errorPage = true;
+}
+
+if ($errorPage){
+    echo    '<div>Un problème est survenu lors de la récupération des données</div>';
+} else {
+$total = array('open' => 0, 'resolved' => 0, 'resolved' => 0, 'closed' => 0 , 'total' => 0);
+echo $HTML->boxTop("Répartition par état");
+echo    '<tr>';
+echo                    '<th class="InTextBrown">Projet</th>';
+echo                    '<th class="InTextBrown">Ouvert</th>';
+echo                    '<th class="InTextBrown">Résolu</th>';
+echo                    '<th class="InTextBrown">Fermé</th>';
+echo                    '<th class="InTextBrown">Total</th>';
+echo    '</tr>';
+$nbligne = 0;
+foreach ($stats as $stat){
+    $indentation = "";
+    for($i = 1; $i < $stat->project_level; $i++){
+        $indentation =  $indentation .'&nbsp;&nbsp;';
+    }
+    if ( $nbligne % 2 == 0 ) {
+        echo    '<tr class="LignePaire">';
+    } else {
+        echo '<tr class="LigneImpaire">';
+    }
+
+    if ($stat->project_level > 1){
+        echo sprintf('<td class="InTextBrown">%s >> <a class="DataLink" href="http://%s/plugins/mantisbt/index.php?type=group&id=%s&pluginname=mantisbt">%s</a></td>',$indentation,$sys_default_domain,group_get_objectid_by_publicname($stat->project_name), $stat->project_name);
+    }else{
+        echo sprintf('<td class="InTextBrown"><a class="DataLink" href="http://%s/plugins/mantisbt/index.php?type=group&id=%s&pluginname=mantisbt">%s</a></td>',$sys_default_domain,group_get_objectid_by_publicname($stat->project_name), $stat->project_name);
+    }
+    echo                    '<td class="InTextBrown">'.$stat->open.'</td>';
+    echo                    '<td class="InTextBrown">'.$stat->resolved.'</td>';
+    echo                    '<td class="InTextBrown">'.$stat->closed.'</td>';
+    echo                    '<td class="InTextBrown">'.$stat->total.'</td>';
+    echo    '</tr>';
+
+    // calcul du total
+    $total['open'] += $stat->open;
+    $total['resolved'] += $stat->resolved;
+    $total['closed'] += $stat->closed;
+    $total['total'] += $stat->total;
+    $nbligne++;
+}
+echo    '<tr>';
+echo            '<th class="InTextBrown"></th>';
+echo            '<th class="InTextBrown">'.$total['open'].'</th>';
+echo            '<th class="InTextBrown">'.$total['resolved'].'</th>';
+echo            '<th class="InTextBrown">'.$total['closed'].'</th>';
+echo            '<th class="InTextBrown">'.$total['total'].'</th>';
+echo    '</tr>';
+echo $HTML->boxBottom();
+
+}
+?>

Modified: trunk/src/plugins/mantisbt/view/admin/addVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/addVersion.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/admin/addVersion.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -27,6 +27,7 @@
 echo $HTML->boxTop('Ajouter une version');
 echo '<td>';
 echo '<input name="version" type="text"></input>';
+echo '<input name="transverse" type="checkbox" value="1" >version transverse (fils inclus)</input>';
 echo '</td>';
 echo '<td>';
 print'<div style="float:left"><img src="'.util_make_url('themes/gforge/images/bouton_gauche.png').'"></img></div>

Modified: trunk/src/plugins/mantisbt/view/admin/editVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/editVersion.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/admin/editVersion.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -26,49 +26,61 @@
 
 $idVersion=getIntFromRequest('idVersion');
 
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-$detailVersion = $clientSOAP->__soapCall('mc_project_get_version_details', array("username" => $username, "password" => $password, "version_id" => $idVersion));
+try {
+    $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+    $detailVersion = $clientSOAP->__soapCall('mc_project_get_version_details', array("username" => $username, "password" => $password, "version_id" => $idVersion));
+} catch (SoapFault $soapFault) {
+    echo $soapFault->faultstring;
+    echo "<br/>";
+    $errorPage = true;
+}
 
-echo $HTML->boxTop('Detail Version');
-echo '<form method="POST" name="updateVersion'.$detailVersion->id.'" action="index.php?type=admin&id='.$id.'&pluginname=mantisbt&action=updateVersion">';
-echo '<table class="innertabs">';
-echo    '<tr>';
-echo            '<td class="FullBoxTitle">Version</td>';
-echo            '<td class="FullBoxTitle">Date Livraison</td>';
-echo            '<td class="FullBoxTitle">Type</td>';
-echo    '</tr>';
-echo    '<tr>';
-echo            '<td><input type="text" name="version_name" value="'.$detailVersion->name.'" /></td>';
-echo            '<td><input type="text" name="version_date_order" size="32" value="'.strftime("%d/%m/%Y",strtotime($detailVersion->date_order)).'" />(format : DD/MM/YYYY)</td>';
-echo            '<td>';
-echo               '<select name="version_release">';
-if ( $detailVersion->released ) {
-echo                  '<option value="1" selected>Release</option>';
-echo                  '<option value="0" >Milestone</option>';
+if ($errorPage){
+    echo    '<div>Un problème est survenu lors de la récupération des données</div>';
 } else {
-echo                  '<option value="1" >Release</option>';
-echo                  '<option value="0" selected>Milestone</option>';
+    echo $HTML->boxTop('Detail Version');
+    echo '<form method="POST" name="updateVersion'.$detailVersion->id.'" action="index.php?type=admin&id='.$id.'&pluginname=mantisbt&action=updateVersion">';
+    echo '<table class="innertabs">';
+    echo    '<tr>';
+    echo            '<td class="FullBoxTitle">Version</td>';
+    echo            '<td class="FullBoxTitle">Date Livraison</td>';
+    echo            '<td class="FullBoxTitle">Type</td>';
+    echo    '</tr>';
+    echo    '<tr>';
+    echo            '<td><input type="text" name="version_name" value="'.htmlspecialchars($detailVersion->name,ENT_QUOTES).'" /></td>';
+    echo            '<td><input type="text" name="version_date_order" size="32" value="'.strftime("%d/%m/%Y",strtotime($detailVersion->date_order)).'" />(format : DD/MM/YYYY)</td>';
+    echo            '<td>';
+    echo               '<select name="version_release">';
+    if ( $detailVersion->released ) {
+        echo               '<option value="1" selected>Release</option>';
+        echo               '<option value="0" >Milestone</option>';
+    } else {
+        echo               '<option value="1" >Release</option>';
+        echo               '<option value="0" selected>Milestone</option>';
+    }
+    echo               '</select>';
+    echo            '</td>';
+    echo     '</tr>';
+    echo '</table>';
+    echo '<input type="checkbox" name="transverse" value="1">mise à jour transverse (fils inclus)</input>';
+    echo '<input type="hidden" name="version_id" value="'.$detailVersion->id.'"></input>';
+    echo '<input type="hidden" name="version_old_name" value="'.$detailVersion->name.'"></input>';
+    echo '<br/>';
+    print'<div style="float:left"><img src="'.util_make_url('themes/gforge/images/bouton_gauche.png').'"></img></div>
+	    <div style="background: url('.util_make_url('themes/gforge/images/bouton_centre.png').');vertical-align:top;display:inline;font-size:15px">
+	    <a href="javascript:document.updateVersion'.$detailVersion->id.'.submit();" style="color:white;font-size:0.8em;font-weight:bold;">Mettre &agrave; jour</a>
+	    </div>
+	    <div style="display:inline"><img src="'.util_make_url('themes/gforge/images/bouton_droit.png').'"></img></div>';
+    echo '</form>';
+    echo $HTML->boxBottom();
+
+    echo '<form method="POST" name="deleteVersion'.$detailVersion->id.'" action="index.php?type=admin&id='.$id.'&pluginname=mantisbt&action=deleteVersion">';
+    echo '<input type="hidden" name="deleteVersion" value="'.$detailVersion->id.'"></input>';
+    print'<div style="float:left"><img src="'.util_make_url('themes/gforge/images/bouton_gauche.png').'"></img></div>
+	    <div style="background: url('.util_make_url('themes/gforge/images/bouton_centre.png').');vertical-align:top;display:inline;font-size:15px">
+	    <a href="javascript:document.deleteVersion'.$detailVersion->id.'.submit();" style="color:white;font-size:0.8em;font-weight:bold;">Supprimer cette version</a>
+	    </div>
+	    <div style="display:inline"><img src="'.util_make_url('themes/gforge/images/bouton_droit.png').'"></img></div>';
+    echo '</form>';
 }
-echo               '</select>';
-echo            '</td>';
-echo     '</tr>';
-echo '</table>';
-echo '<input type="hidden" name="version_id" value="'.$detailVersion->id.'"></input>';
-print'<div style="float:left"><img src="'.util_make_url('themes/gforge/images/bouton_gauche.png').'"></img></div>
-	<div style="background: url('.util_make_url('themes/gforge/images/bouton_centre.png').');vertical-align:top;display:inline;font-size:15px">
-	<a href="javascript:document.updateVersion'.$detailVersion->id.'.submit();" style="color:white;font-size:0.8em;font-weight:bold;">Mettre &agrave; jour</a>
-	</div>
-	<div style="display:inline"><img src="'.util_make_url('themes/gforge/images/bouton_droit.png').'"></img></div>';
-echo '</form>';
-echo $HTML->boxBottom();
-
-echo '<form method="POST" name="deleteVersion'.$detailVersion->id.'" action="index.php?type=admin&id='.$id.'&pluginname=mantisbt&action=deleteVersion">';
-echo '<input type="hidden" name="deleteVersion" value="'.$detailVersion->id.'"></input>';
-print'<div style="float:left"><img src="'.util_make_url('themes/gforge/images/bouton_gauche.png').'"></img></div>
-	<div style="background: url('.util_make_url('themes/gforge/images/bouton_centre.png').');vertical-align:top;display:inline;font-size:15px">
-	<a href="javascript:document.deleteVersion'.$detailVersion->id.'.submit();" style="color:white;font-size:0.8em;font-weight:bold;">Supprimer cette version</a>
-	</div>
-	<div style="display:inline"><img src="'.util_make_url('themes/gforge/images/bouton_droit.png').'"></img></div>';
-echo '</form>';
-
 ?>

Added: trunk/src/plugins/mantisbt/view/admin/stat.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/stat.php	                        (rev 0)
+++ trunk/src/plugins/mantisbt/view/admin/stat.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -0,0 +1,32 @@
+<?php
+
+/*
+ * Copyright 2010, Capgemini
+ * Authors: Franck Villaume - capgemini
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+/* main display */
+echo "<div style='float:left; width:49%'>";
+include ("mantisbt/view/admin/StatPerStatus.php");
+echo "</div>";
+//echo "<div>";
+//include ("mantisbt/view/admin/StatPerMember.php");
+//echo "</div>";
+
+?>

Modified: trunk/src/plugins/mantisbt/view/admin/viewCategorie.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/viewCategorie.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/admin/viewCategorie.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -25,50 +25,63 @@
 
 global $HTML;
 
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-$listCategories = $clientSOAP->__soapCall('mc_project_get_categories', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
-echo $HTML->boxTop('Gestion des categories');
-echo    '<table class="innertabs">';
-echo            '<tr>';
-echo                    '<td class="FullBoxTitle">Catégorie</td>';
-echo 			'<td colspan="3" class="FullBoxTitle">Actions</td>';
-echo		'</tr>';
-$i = 0;
-foreach ($listCategories as $key => $category){
-	if ( $i % 2 == 0 ) {
-		echo '<tr class="LignePaire">';
-	} else {
-		echo '<tr class="LigneImpaire">';
-	}
-	if ( $category != 'General' ) {
-	echo '<td class="InText">'.$category.'</td>';
-	echo '<td>';
-        
-	echo '<form method="POST" name="rename'.$i.'" action="index.php?type=admin&id='.$id.'&pluginname=mantisbt&action=renameCategory">';
-	echo '<input type="hidden" name="renameCategory" value="'.htmlspecialchars($category).'" />';
-	echo '<input name="newCategoryName" type="text"></input>';
-	echo '</td><td>';
+try {
+    /* do not recreate $clientSOAP object if already created by other pages */
+    if (!isset($clientSOAP))
+        $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+
+    $listCategories = $clientSOAP->__soapCall('mc_project_get_categories', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
+} catch (SoapFault $soapFault) {
+    echo $soapFault->faultstring;
+    echo "<br/>";
+    $errorPage = true;
+}
+
+if ($errorPage){
+    echo    '<div>Un problème est survenu lors de la récupération des données</div>';
+} else {
+    echo $HTML->boxTop('Gestion des categories');
+    echo    '<table class="innertabs">';
+    echo            '<tr>';
+    echo                    '<td class="FullBoxTitle">Catégorie</td>';
+    echo 			'<td colspan="3" class="FullBoxTitle">Actions</td>';
+    echo		'</tr>';
+    $i = 0;
+    foreach ($listCategories as $key => $category){
+	    if ( $i % 2 == 0 ) {
+		    echo '<tr class="LignePaire">';
+	    } else {
+		    echo '<tr class="LigneImpaire">';
+	    }
+	    if ( $category != 'General' ) {
+	    echo '<td class="InText">'.$category.'</td>';
+	    echo '<td>';
+ 
+	    echo '<form method="POST" name="rename'.$i.'" action="index.php?type=admin&id='.$id.'&pluginname=mantisbt&action=renameCategory">';
+	    echo '<input type="hidden" name="renameCategory" value="'.htmlspecialchars($category).'" />';
+	    echo '<input name="newCategoryName" type="text"></input>';
+	    echo '</td><td>';
         print'<div style="float:left"><img src="'.util_make_url('themes/gforge/images/bouton_gauche.png').'"></img></div>
-              <div style="background: url('.util_make_url('themes/gforge/images/bouton_centre.png').');vertical-align:top;display:inline;font-size:15px">
-              <a href="javascript:document.rename'.$i.'.submit();" style="color:white;font-size:0.8em;font-weight:bold;">Renommer</a>
-              </div>
-              <div style="display:inline"><img src="'.util_make_url('themes/gforge/images/bouton_droit.png').'"></img></div>';
-	echo '</td>';
-	echo '</form>';
-	echo '<td class="InText">';
-	echo '<form method="POST" name="delete'.$i.'" action="index.php?type=admin&id='.$id.'&pluginname=mantisbt&action=deleteCategory">';
-	echo '<input type="hidden" name="deleteCategory" value="'.htmlspecialchars($category).'" />';
+                <div style="background: url('.util_make_url('themes/gforge/images/bouton_centre.png').');vertical-align:top;display:inline;font-size:15px">
+                <a href="javascript:document.rename'.$i.'.submit();" style="color:white;font-size:0.8em;font-weight:bold;">Renommer</a>
+                </div>
+                <div style="display:inline"><img src="'.util_make_url('themes/gforge/images/bouton_droit.png').'"></img></div>';
+	    echo '</td>';
+	    echo '</form>';
+	    echo '<td class="InText">';
+	    echo '<form method="POST" name="delete'.$i.'" action="index.php?type=admin&id='.$id.'&pluginname=mantisbt&action=deleteCategory">';
+	    echo '<input type="hidden" name="deleteCategory" value="'.htmlspecialchars($category).'" />';
         print'<div style="float:left"><img src="'.util_make_url('themes/gforge/images/bouton_gauche.png').'"></img></div>
               <div style="background: url('.util_make_url('themes/gforge/images/bouton_centre.png').');vertical-align:top;display:inline;font-size:15px">
               <a href="javascript:document.delete'.$i.'.submit();" style="color:white;font-size:0.8em;font-weight:bold;">Supprimer</a>
               </div>
               <div style="display:inline"><img src="'.util_make_url('themes/gforge/images/bouton_droit.png').'"></img></div>';
-	echo '</form>';
-	echo '</td></tr>';
-	$i++;
-	}
+	    echo '</form>';
+	    echo '</td></tr>';
+	    $i++;
+	    }
+    }
+    echo '</table>';
+    echo $HTML->boxBottom();
 }
-echo '</table>';
-echo $HTML->boxBottom();
-
 ?>

Modified: trunk/src/plugins/mantisbt/view/admin/viewVersion.php
===================================================================
--- trunk/src/plugins/mantisbt/view/admin/viewVersion.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/admin/viewVersion.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -26,43 +26,56 @@
 /* main display */
 global $HTML;
 
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-$listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
+try {
+    /* do not recreate $clientSOAP object if already created by other pages */
+    if (!isset($clientSOAP))
+        $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 
-echo $HTML->boxTop('Gestion des Versions');
-echo '<table class="innertabs">';
-echo	'<tr>';
-echo            '<td class="FullBoxTitle">Version</td>';
-echo		'<td class="FullBoxTitle">Date Livraison</td>';
-echo		'<td class="FullBoxTitle">Type</td>';
-echo 		'<td class="FullBoxTitle">Action</td>';
-echo	'</tr>';
-$i = 0;
-foreach ($listVersions as $key => $version){
-	if ( $i % 2 == 0 ) {
-		echo '<tr class="LignePaire">';
-	} else {
-		echo '<tr class="LigneImpaire">';
-	}
-	echo '<td class="InText">'.$version->name.'</td>';
-	echo '<td class="InText">'.strftime("%d/%m/%Y",strtotime($version->date_order)).'</td>';
-	/* est-ce une version release ? */
-	if ( $version->released ) {
-		echo '<td class="InText">Release</td>';
-	/* juste une milestone alors */
-	} else {
-		echo '<td class="InText">Milestone</td>';
-	}
-	echo '<td>';
-	print'<div style="float:left"><img src="'.util_make_url('themes/gforge/images/bouton_gauche.png').'"></img></div>
-		<div style="background: url('.util_make_url('themes/gforge/images/bouton_centre.png').');vertical-align:top;display:inline;font-size:15px">
-		<a href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&view=editVersion&idVersion='.$version->id.'" style="color:white;font-size:0.8em;font-weight:bold;">Modifier</a>
-		</div>
-		<div style="display:inline"><img src="'.util_make_url('themes/gforge/images/bouton_droit.png').'"></img></div>';
-	echo '</td></tr>';
-	$i++;
+    $listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
+} catch  (SoapFault $soapFault) {
+    echo $soapFault->faultstring;
+    echo "<br/>";
+    $errorPage = true;
 }
-echo '</table>';
-echo $HTML->boxBottom();
 
+if ($errorPage){
+    echo    '<div>Un problème est survenu lors de la récupération des données</div>';
+} else {
+    echo $HTML->boxTop('Gestion des Versions');
+    echo '<table class="innertabs">';
+    echo	'<tr>';
+    echo            '<td class="FullBoxTitle">Version</td>';
+    echo		'<td class="FullBoxTitle">Date Livraison</td>';
+    echo		'<td class="FullBoxTitle">Type</td>';
+    echo 		'<td class="FullBoxTitle">Action</td>';
+    echo	'</tr>';
+    $i = 0;
+    foreach ($listVersions as $key => $version){
+	    if ( $i % 2 == 0 ) {
+		    echo '<tr class="LignePaire">';
+	    } else {
+		    echo '<tr class="LigneImpaire">';
+	    }
+	    echo '<td class="InText">'.$version->name.'</td>';
+	    echo '<td class="InText">'.strftime("%d/%m/%Y",strtotime($version->date_order)).'</td>';
+	    /* est-ce une version release ? */
+	    if ( $version->released ) {
+		    echo '<td class="InText">Release</td>';
+	    /* juste une milestone alors */
+	    } else {
+		    echo '<td class="InText">Milestone</td>';
+	    }
+	    echo '<td>';
+	    print'<div style="float:left"><img src="'.util_make_url('themes/gforge/images/bouton_gauche.png').'"></img></div>
+		    <div style="background: url('.util_make_url('themes/gforge/images/bouton_centre.png').');vertical-align:top;display:inline;font-size:15px">
+		    <a href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&view=editVersion&idVersion='.$version->id.'" style="color:white;font-size:0.8em;font-weight:bold;">Modifier</a>
+		    </div>
+		    <div style="display:inline"><img src="'.util_make_url('themes/gforge/images/bouton_droit.png').'"></img></div>';
+	    echo '</td></tr>';
+	    $i++;
+    }
+    echo '</table>';
+    echo $HTML->boxBottom();
+}
+
 ?>

Modified: trunk/src/plugins/mantisbt/view/editIssue.php
===================================================================
--- trunk/src/plugins/mantisbt/view/editIssue.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/editIssue.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,8 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
+ *          Antoine Mercadal - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,201 +22,192 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-// included the hability to use $HTML tool to create box
-GLOBAL $HTML;
+//validate function : to be sure needed informations are set before submit
+print   ('
+    <script language="javacript" type="text/javascript">
+    function validate() {
+        if ( document.issue.resume.value.length == 0 ) {
+            alert ("champ Résumé obligatoire");
+        } else if ( document.issue.description.value.length == 0 ) {
+            alert ("champ Description obligatoire");
+        } else {
+            document.issue.submit();
+            document.issue.submitbutton.disabled="true";
+        }
+    }
+    </script>
+    ');
 
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-$defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
-$listCategories = $clientSOAP->__soapCall('mc_project_get_categories', array("username" => $username, "password" => $password, "project_id" => $defect->project->id));
-$listSeverities = $clientSOAP->__soapCall('mc_enum_severities', array("username" => $username, "password" => $password));
-$listReproducibilities = $clientSOAP->__soapCall('mc_enum_reproducibilities', array("username" => $username, "password" => $password));
-$listViewStates = $clientSOAP->__soapCall('mc_enum_view_states', array("username" => $username, "password" => $password));
-$listReporters = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $defect->project->id, "acces" => 10));
-$listDevelopers = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $defect->project->id, "acces" => 25));
-$listPriorities = $clientSOAP->__soapCall('mc_enum_priorities', array("username" => $username, "password" => $password));
-$listResolutions= $clientSOAP->__soapCall('mc_enum_resolutions', array("username" => $username, "password" => $password));
-$listStatus= $clientSOAP->__soapCall('mc_enum_status', array("username" => $username, "password" => $password));
-$listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $defect->project->id));
-$listVersionsMilestone = $clientSOAP->__soapCall('mc_project_get_unreleased_versions', array("username" => $username, "password" => $password, "project_id" => $defect->project->id));
+try {
+    /* do not recreate $clientSOAP object if already created by other pages */
+    if (!isset($clientSOAP))
+        $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 
-$boxTitle = 'Edition Ticket : '.sprintf($format,$defect->id);
-echo $HTML->boxTop($boxTitle,InTextBorder);
-echo 	'<form Method="POST" Action="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&action=updateIssue">';
-echo	'<table class="innertabs">';
-echo		'<tr>';
-echo 			'<td width="20%" class="FullBoxTitle">Catégorie</td>';
-echo 			'<td width="20%" class="FullBoxTitle">Sévérité</td>';
-echo 			'<td width="20%" class="FullBoxTitle">Reproductibilité</td>';
-echo 			'<td width="20%" class="FullBoxTitle">Date de soumission</td>';
-echo 			'<td width="20%" class="FullBoxTitle">Date mise à jour</td>';
-echo		'</tr>';
-echo		'<tr>';
-echo 			'<td class="FullBox">';
-echo				'<select name="categorie" class="sirhen" >';
-foreach ($listCategories as $key => $category){
-	if($defect->category == $category){
-		echo			"<option selected>".$category."</option>";
-	}else{
-		echo			"<option>".$category."</option>";
-	}
+    $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
+    $listCategories = $clientSOAP->__soapCall('mc_project_get_categories', array("username" => $username, "password" => $password, "project_id" => $defect->project->id));
+    $listSeverities = $clientSOAP->__soapCall('mc_enum_severities', array("username" => $username, "password" => $password));
+    $listReproducibilities = $clientSOAP->__soapCall('mc_enum_reproducibilities', array("username" => $username, "password" => $password));
+    $listReporters = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $defect->project->id, "acces" => 10));
+    $listDevelopers = $clientSOAP->__soapCall('mc_project_get_users', array("username" => $username, "password" => $password, "project_id" => $defect->project->id, "acces" => 25));
+    $listPriorities = $clientSOAP->__soapCall('mc_enum_priorities', array("username" => $username, "password" => $password));
+    $listResolutions= $clientSOAP->__soapCall('mc_enum_resolutions', array("username" => $username, "password" => $password));
+    $listStatus= $clientSOAP->__soapCall('mc_enum_status', array("username" => $username, "password" => $password));
+    $listVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $defect->project->id));
+    $listVersionsMilestone = $clientSOAP->__soapCall('mc_project_get_unreleased_versions', array("username" => $username, "password" => $password, "project_id" => $defect->project->id));
+} catch (SoapFault $soapFault) {
+    echo $soapFault->faultstring;
+    echo "<br/>";
+    $errorPage = true;
 }
-echo				'</select>';
-echo			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="severite" class="sirhen">';
-foreach ($listSeverities as $key => $severity){
-	if($defect->severity->id == $severity->id){
-		echo			"<option selected>".$severity->name."</option>";
-	}else{
-		echo			"<option>".$severity->name."</option>";
-	}
+
+if ($errorPage){
+    echo    '<div>Un problème est survenu lors de la récupération des données</div>';
+} else {
+    $boxTitle = 'Edition Ticket : '.sprintf($format,$defect->id);
+    echo 	'<form name="issue" Method="POST" Action="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&action=updateIssue&view=viewIssue">';
+    echo	'<table class="innertabs">';
+    echo		'<tr>';
+    echo 			'<td width="20%" class="FullBoxTitle">Catégorie</td>';
+    echo 			'<td width="20%" class="FullBoxTitle">Sévérité</td>';
+    echo 			'<td width="20%" class="FullBoxTitle">Reproductibilité</td>';
+    echo 			'<td width="20%" class="FullBoxTitle">Date de soumission</td>';
+    echo 			'<td width="20%" class="FullBoxTitle">Date mise à jour</td>';
+    echo		'</tr>';
+    echo		'<tr>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="categorie" class="sirhen" >';
+    echo					"<option></option>";
+    echo                    '<option selected>'.$defect->category.'</option>';
+    foreach ($listCategories as $key => $category){
+	    echo			    '<option>'.$category.'</option>';
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="severite" class="sirhen">';
+	echo    			    '<option selected>'.$defect->severity->name.'</option>';
+    foreach ($listSeverities as $key => $severity){
+	    echo			    '<option>'.$severity->name.'</option>';
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="reproductibilite" class="sirhen">';
+    echo			        '<option selected>'.$defect->reproducibility->name.'</option>';
+    foreach ($listReproducibilities as $key => $reproducibility){
+	    echo			    '<option>'.$reproducibility->name.'</option>';
+    }
+    echo				'</select>';
+    echo			'</td>';
+    // TODO a revoir le problème des dates
+    date_default_timezone_set("UTC");
+    echo 			'<td class="FullBox">'.date("Y-m-d G:i",strtotime($defect->date_submitted)).'</td>';
+    echo 			'<td class="FullBox">'.date("Y-m-d G:i",strtotime($defect->last_updated)).'</td>';
+    echo		'</tr>';
+    echo		'<tr>';
+    echo 			'<td class="FullBoxTitle">Rapporteur</td>';
+    echo 			'<td class="FullBoxTitle">Assigné à</td>';
+    echo 			'<td class="FullBoxTitle">Priorité</td>';
+    echo 			'<td class="FullBoxTitle">Résolution</td>';
+    echo 			'<td class="FullBoxTitle">Etat</td>';
+    echo		'</tr>';
+    echo		'<tr>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="reporter" class="sirhen">';
+	echo			        '<option selected>'.$defect->reporter->name.'</option>';
+    foreach ($listReporters as $key => $user){
+		echo			    '<option>'.$user->name.'</option>';
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="handler" class="sirhen">';
+    echo			        '<option selected>'.$defect->handler->name.'</option>';
+    echo					'<option></option>';
+    foreach ($listDevelopers as $key => $user){
+		echo			    '<option>'.$user->name.'</option>';
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="priorite" class="sirhen">';
+	echo			        '<option selected>'.$defect->priority->name.'</option>';
+    foreach ($listPriorities as $key => $priority){
+	    echo			    '<option>'.$priority->name.'</option>';
+    }
+    echo				'</select>';
+    echo 			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="resolution" class="sirhen">';
+	echo			        '<option selected>'.$defect->resolution->name.'</option>';
+    foreach ($listResolutions as $key => $resolution){
+	    echo			    '<option>'.$resolution->name.'</option>';
+    }
+    echo				'</select>';
+    echo 			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="etat" class="sirhen">';
+	echo			        '<option selected>'.$defect->status->name.'</option>';
+    foreach ($listStatus as $key => $status){
+		echo			    '<option>'.$status->name.'</option>';
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo		'</tr>';
+    echo		'<tr>';
+    echo 			'<td class="FullBoxTitle">Detecté en</td>';
+    echo 			'<td class="FullBoxTitle">Corrigé en</td>';
+    echo 			'<td colspan="3" class="FullBoxTitle">Milestone</td>';
+    echo		'</tr>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="version" class="sirhen">';
+	echo			        '<option selected>'.$defect->version.'</option>';
+    echo					'<option></option>';
+    foreach ($listVersions as $key => $version){
+	    echo			    '<option>'.$version->name.'</option>';
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo 			'<td class="FullBox">';
+    echo				'<select name="fixed_in_version" class="sirhen">';
+	echo			        '<option selected>'.$defect->fixed_in_version.'</option>';
+    echo					'<option></option>';
+    foreach ($listVersions as $key => $fixed_version){
+		echo			    '<option>'.$fixed_version->name.'</option>';
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo 			'<td colspan="3" class="FullBox">';
+    echo				'<select name="target_version" class="sirhen">';
+	echo			        '<option selected>'.$defect->target_version.'</option>';
+    echo					'<option></option>';
+    foreach ($listVersionsMilestone as $key => $target_version){
+		echo			    '<option>'.$target_version->name.'</option>';
+    }
+    echo				'</select>';
+    echo			'</td>';
+    echo		'<tr>';
+    echo	'</table>';
+    echo	'<br/>';
+    echo	'<table class="innertabs">';
+    echo		'<tr>';
+    echo 			'<td width="20%" class="FullBoxTitle">Résumé <span style="font-weight:normal">(128 caractères max)</span></td>';
+    echo			'<td class="FullBox"><input type="text" value="'.htmlspecialchars($defect->summary,ENT_QUOTES).'" name="resume" MAXLENGTH="128" style="width:99%"></td>';
+    echo		'</tr>';
+    echo		'<tr>';
+    echo 			'<td width="20%" class="FullBoxTitle">Description</td>';
+    echo			'<td class="FullBox"><textarea name="description" style="width:99%;" rows="6">'.htmlspecialchars($defect->description, ENT_QUOTES).'</textarea></td>';
+    echo		'</tr>';
+    echo		'<tr>';
+    echo 			'<td width="20%" class="FullBoxTitle">Informations complémentaires</td>';
+    echo			'<td class="FullBox"><textarea name="informations" style="width:99%;" rows="6">'.htmlspecialchars($defect->additional_information, ENT_QUOTES).'</textarea></td>';
+    echo		'</tr>';
+    echo	'</table>';
+    echo	'<br/>';
+    echo 	'<div align="center">';
+    echo 		'<input type="button" name="submitbutton" onclick="validate();" value="Mettre à jour l\'information">';
+    echo 		'<input type="button" name="Annuler" value="Annuler" onclick="window.location.href=\'?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'\'">';
+    echo 	'</div>';
+    echo 	'</form>';
 }
-echo				'</select>';
-echo			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="reproductibilite" class="sirhen">';
-foreach ($listReproducibilities as $key => $reproducibility){
-	if($defect->reproducibility->id == $reproducibility->id){
-		echo			"<option selected>".$reproducibility->name."</option>";
-	}else{
-		echo			"<option>".$reproducibility->name."</option>";
-	}
-}
-echo				'</select>';
-echo			'</td>';
-// TODO a revoir le problème des dates
-date_default_timezone_set("UTC");
-echo 			'<td class="FullBox">'.date("Y-m-d G:i",strtotime($defect->date_submitted)).'</td>';
-echo 			'<td class="FullBox">'.date("Y-m-d G:i",strtotime($defect->last_updated)).'</td>';
-echo		'</tr>';
-echo		'<tr>';
-echo 			'<td class="FullBoxTitle">Rapporteur</td>';
-echo 			'<td class="FullBoxTitle">Assigné à</td>';
-echo 			'<td class="FullBoxTitle">Priorité</td>';
-echo 			'<td class="FullBoxTitle">Résolution</td>';
-echo 			'<td class="FullBoxTitle">Etat</td>';
-echo		'</tr>';
-echo		'<tr>';
-echo 			'<td class="FullBox">';
-echo				'<select name="reporter" class="sirhen">';
-foreach ($listReporters as $key => $user){
-	if($defect->reporter->id == $user->id){
-		echo			"<option selected>".$user->name."</option>";
-	}else{
-		echo			"<option>".$user->name."</option>";
-	}
-}
-echo				'</select>';
-echo			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="handler" class="sirhen">';
-echo					"<option></option>";
-foreach ($listDevelopers as $key => $user){
-	if($defect->handler->id == $user->id){
-		echo			"<option selected>".$user->name."</option>";
-	}else{
-		echo			"<option>".$user->name."</option>";
-	}
-}
-echo				'</select>';
-echo			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="priorite" class="sirhen">';
-foreach ($listPriorities as $key => $priority){
-	if($defect->priority->id == $priority->id){
-		echo			"<option selected>".$priority->name."</option>";
-	}else{
-		echo			"<option>".$priority->name."</option>";
-	}
-}
-echo				'</select>';
-echo 			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="resolution" class="sirhen">';
-foreach ($listResolutions as $key => $resolution){
-	if($defect->resolution->id == $resolution->id){
-		echo			"<option selected>".$resolution->name."</option>";
-	}else{
-		echo			"<option>".$resolution->name."</option>";
-	}
-}
-echo				'</select>';
-echo 			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="etat" class="sirhen">';
-foreach ($listStatus as $key => $status){
-	if($defect->status->id == $status->id){
-		echo			"<option selected>".$status->name."</option>";
-	}else{
-		echo			"<option>".$status->name."</option>";
-	}
-}
-echo				'</select>';
-echo			'</td>';
-echo		'</tr>';
-echo		'<tr>';
-echo 			'<td class="FullBoxTitle">Detecté en</td>';
-echo 			'<td class="FullBoxTitle">Corrigé en</td>';
-echo 			'<td colspan="3" class="FullBoxTitle">Milestone</td>';
-echo		'</tr>';
-echo 			'<td class="FullBox">';
-echo				'<select name="version" class="sirhen">';
-echo					"<option></option>";
-foreach ($listVersions as $key => $version){
-	if($defect->version == $version->name){
-		echo			"<option selected>".$version->name."</option>";
-	}else{
-		echo			"<option>".$version->name."</option>";
-	}
-}
-echo				'</select>';
-echo			'</td>';
-echo 			'<td class="FullBox">';
-echo				'<select name="fixed_in_version" class="sirhen">';
-echo					"<option></option>";
-foreach ($listVersions as $key => $fixed_version){
-	if($defect->fixed_in_version == $fixed_version->name){
-		echo			"<option selected>".$fixed_version->name."</option>";
-	}else{
-		echo			"<option>".$fixed_version->name."</option>";
-	}
-}
-echo				'</select>';
-echo			'</td>';
-echo 			'<td colspan="3" class="FullBox">';
-echo				'<select name="target_version" class="sirhen">';
-echo					"<option></option>";
-foreach ($listVersionsMilestone as $key => $target_version){
-	if($defect->target_version == $target_version->name){
-		echo			"<option selected>".$target_version->name."</option>";
-	}else{
-		echo			"<option>".$target_version->name."</option>";
-	}
-}
-echo				'</select>';
-echo			'</td>';
-echo		'<tr>';
-echo	'</table>';
-echo	'<br/>';
-echo	'<table class="innertabs">';
-echo		'<tr>';
-echo 			'<td width="20%" class="FullBoxTitle">Résumé <span style="font-weight:normal">(128 caractères max)</span></td>';
-echo			'<td class="FullBox"><input type="text" value="'.$defect->summary.'" name="resume" MAXLENGTH="128" style="width:99%"></td>';
-echo		'</tr>';
-echo		'<tr>';
-echo 			'<td width="20%" class="FullBoxTitle">Description</td>';
-echo			'<td class="FullBox"><textarea name="description" style="width:99%;" rows=12>'.$defect->description.'</textarea></td>';
-echo		'</tr>';
-echo		'<tr>';
-echo 			'<td width="20%" class="FullBoxTitle">Informations complémentaires</td>';
-echo			'<td class="FullBox"><textarea name="informations" style="width:99%;" rows=12>'.$defect->additional_information.'</textarea></td>';
-echo		'</tr>';
-echo	'</table>';
-echo	'<br/>';
-echo 	'<div align="center">';
-echo 		'<input type=submit value="Mettre à jour l\'information">';
-echo 		'<input type="button" name="Annuler" value="Annuler" onclick="window.location.href=\'?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'\'">';
-echo 	'</div>';
-echo 	'</form>';
-echo $HTML->boxBottom();
 ?>

Added: trunk/src/plugins/mantisbt/view/jumpToIssue.php
===================================================================
--- trunk/src/plugins/mantisbt/view/jumpToIssue.php	                        (rev 0)
+++ trunk/src/plugins/mantisbt/view/jumpToIssue.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -0,0 +1,31 @@
+<?php
+
+/*
+ * Copyright 2010, Capgemini
+ * Authors: Franck Villaume - capgemini
+ *
+ * This file is part of FusionForge.
+ *
+ * FusionForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FusionForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ */
+
+echo '<div style="width:98%; text-align:right; padding:5px;" >';
+echo '<form name="jump" method="post" action="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&view=viewIssue">';
+echo '<span>Aller au ticket :</span>';
+echo '<input type="text" name="idBug">';
+echo '<input type="submit" value="Ok" />';
+echo '</form>';
+echo '</div>';
+?>

Modified: trunk/src/plugins/mantisbt/view/roadmap.php
===================================================================
--- trunk/src/plugins/mantisbt/view/roadmap.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/roadmap.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,8 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
+ *          Antoine Mercadal - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,138 +22,176 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-// included the hability to use $HTML tool to create box
-GLOBAL $HTML;
+try {
+    /* do not recreate $clientSOAP object if already created by other pages */
+    if (!isset($clientSOAP))
+        $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 
-echo $HTML->boxTop("Feuille de route",InTextBorder);
-echo	'<form name="roadmap" method="post" action="?type=group&id='.$id.'&pluginname=mantisbt&view=roadmap">';
-echo	'<div>';
-echo	'<input type="checkbox" name="addReleases" value="1" ';
-if ( $_POST['addReleases'] ) {
-	echo 'checked';
+} catch (SoapFault $soapFault) {
+    echo $soapFault->faultstring;
+    echo "<br/>";
+    $errorPage = true;
 }
-echo	'>Afficher les releases</input>';
-echo	'<input type="checkbox" name="addChild" value="1" ';
-if ( $_POST['addChild'] ) {
-	echo 'checked';
-}
-echo	'>Afficher les sous-projets</input>';
-echo	'<input type="checkbox" name="addChildReleases" value="1" ';
-if ( $_POST['addChildReleases'] ) {
-	echo 'checked';
-}
-echo	'>Afficher les releases des sous-projets</input>';
-echo	'</div>';
-print'<div style="float:left"><img src="'.util_make_url('themes/gforge/images/bouton_gauche.png').'"></img></div>
-	<div style="background: url('.util_make_url('themes/gforge/images/bouton_centre.png').');vertical-align:top;display:inline;font-size:15px">
-	<a href="javascript:document.roadmap.submit();" style="color:white;font-size:0.8em;font-weight:bold;">Recharger</a>
-	</div>
-	<div style="display:inline"><img src="'.util_make_url('themes/gforge/images/bouton_droit.png').'"></img></div>';
-echo $HTML->boxBottom();
 
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('exceptions'=>true));
-$listFullVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
-if (!empty($listFullVersions)){
-	arsort($listFullVersions);
-	if ( $_POST['addReleases'] ) {
-		$listPrintVersions = $listFullVersions;
-	} else {
-		foreach ($listFullVersions as $key => $version) {
-			if ( $version->released == 0 ) {
-				$listPrintVersions[] = $version;
-			}
-		}
+if ($errorPage) {
+    echo    '<div>Un problème est survenu lors de la r&eacute;cup&eacute;ration des donn&eacute;es</div>';
+} else {
+    GLOBAL $HTML;
+    $listChild = $clientSOAP->__soapCall('mc_project_get_subprojects', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
+
+?>
+<script type="text/javascript">
+    $(document).ready(function() {
+<?php
+    $view = 0;
+    foreach ($listChild as $key => $child) {
+        if ( isset($_POST['project'.$child.'VersionId'])) {
+            $view = 1;
 	}
-	if (isset($listPrintVersions) && !empty($listPrintVersions)) {
-		foreach ($listPrintVersions as $key => $version){
-			$idsBug = $clientSOAP->__soapCall('mc_issue_get_list_by_project_for_specific_version', array("username" => $username, "password" => $password, "project" => $idProjetMantis, "version" => $version->name ));
-			echo	'<fieldset>';
-			$typeVersion = "Milestone";
-			if ( $version->released == 1 ) {
-				$typeVersion = "Release";
-			}
-			echo	'Version : '.$version->name.' (<i>'.strftime("%d/%m/%Y",strtotime($version->date_order)).'</i> '.$typeVersion.') - <i>'.count($idsBug).' ticket(s)</i>';
-			echo	'<ul>';
-			foreach ( $idsBug as $key => $idBug ) {
-			$defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
-			if ( !array_key_exists('handler', $defect) || !array_key_exists('name', $defect->handler) ) {
-				$defect_handler_name = "non-affecte";
-			} else {
-				$defect_handler_name = $defect->handler->name;
-			}
-			echo	'<li>';
-			if ( $defect->status->id >= 80 ) {
-				echo '<strike>';
-			}
-			echo	'<a href="?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$defect->id.'&view=viewIssue">'.$defect->id.'</a>: '.$defect->summary.' ('.$defect->resolution->name.') - ('.$defect_handler_name.')';
-			if ( $defect->status->id >= 80 ) {
-				echo '</strike>';
-			}
-			echo	'</li>';
-			}
-			echo	'</ul>';
-			echo	'</fieldset>';
-		}
-	}
+    }
+    if ( isset($_POST['projectVersionId']) ) {
+        $view = 1;
+    }
+    if ( $view == 0 ) {
+?>
+        $("#expandable_filter").hide();
+<?php
+    }
+?>
+    });
+</script>
+
+<style>
+.notice_title {
+    background-color: #D7E0EB;
+    padding: 10px;
+    font-weight: bold;
+    margin-bottom:0px;
+    cursor: pointer;
+    color: #4F93C3;
 }
 
-if ( $_POST['addChild'] ) {
-	$listChild = $clientSOAP->__soapCall('mc_project_get_subprojects', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis));
-	echo '<fieldset>';
-	echo '<legend>Sous-projets</legend>';
-	foreach ( $listChild as $key => $child ) {
-		$projectInfo = $clientSOAP->__soapCall('mc_project_as_array_by_id', array("username" => $username, "password" => $password, "project_id" => $child));
-		echo $HTML->boxTop($projectInfo[1]);
-		echo '<fieldset>';
-		$listChildFullVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $child));
-		if (!empty($listChildFullVersions)){
-        		arsort($listChildFullVersions);
-			$listChildPrintVersions = array();
-        		if ( $_POST['addChildReleases'] ) {
-                		$listChildPrintVersions = $listChildFullVersions;
-        		} else {
-                		foreach ($listChildFullVersions as $key => $childversion) {
-                        		if ( $childversion->released == 0 ) {
-                                		$listChildPrintVersions[] = $childversion;
-                        		}
-                		}
-        		}
-			if (isset($listChildFullVersions) && !empty($listChildFullVersions)) {
-        			foreach ($listChildPrintVersions as $key => $childversion){
-                			echo    '<fieldset>';
-                			$idsBug = $clientSOAP->__soapCall('mc_issue_get_list_by_project_for_specific_version', array("username" => $username, "password" => $password, "project" => $child, "version" => $childversion->name ));
-                			$typeVersion = "Milestone";
-                			if ( $childversion->released == 1 ) {
-                        			$typeVersion = "Release";
-                			}
-                			echo    'Version : '.$childversion->name.' (<i>'.strftime("%d/%m/%Y",strtotime($childversion->date_order)).'</i> '.$typeVersion.') - <i>'.count($idsBug).'</i>';
-                			echo    '<ul>';
-                			foreach ( $idsBug as $key => $idBug ) {
-                				$defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
-                				if ( !array_key_exists('handler', $defect) || !array_key_exists('name', $defect->handler) ) {
-                        				$defect_handler_name = "non-affecte";
-                				} else {
-                        				$defect_handler_name = $defect->handler->name;
-                				}
-                				echo    '<li>';
-                				if ( $defect->status->id >= 80 ) {
-                        				echo '<strike>';
-                				}
-                				echo    '<a href="?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$defect->id.'&view=viewIssue">'.$defect->id.'</a>: '.$defect->summary.' ('.$defect->resolution->name.') - ('.$defect_handler_name.')';
-                				if ( $defect->status->id >= 80 ) {
-                        				echo '</strike>';
-                				}
-                				echo    '</li>';
-                			}
-                			echo    '</ul>';
-                			echo    '</fieldset>';
-        			}
-			}
-		}
+.notice_content {
+    border: 1px solid #D7E0EB;
+    padding: 10px;
+    font-weight: bold;
+    -moz-border-radius-bottomright: 8px;
+    -moz-border-radius-bottomleft: 8px;
+    -webkit-border-bottom-right-radius: 8px;
+    -webkit-border-bottom-left-radius: 8px;
+    margin-top:0px;
+}
+</style>
 
-		echo '</fieldset>';
-		echo $HTML->boxBottom();
-	}
-	echo '</fieldset>';
+<h2 style='border-bottom: 1px solid black'>Filtres</h2>
+<p class="notice_title" onclick='$("#expandable_filter").slideToggle(300)'>Afficher les r&egrave;gles de filtrage</p>
+
+<div id='expandable_filter' class="notice_content" style='clear: both'>
+<?php
+    include('mantisbt/controler/filter_roadmap.php');
+?>
+</div>
+
+<?php
+    echo '<h2 style="border-bottom: 1px solid black">Feuille de route</h2>';
+    if (!isset($_POST['projectVersionId'])) {
+	    if (isset($listVersions) && !empty($listVersions)) {
+            $listPrintVersions = $listVersions;
+        }
+    } else {
+        $flipped_projectVersionId = array_flip($_POST['projectVersionId']);
+        foreach ($listVersions as $key => $version) {
+            if (isset($flipped_projectVersionId[$version->id])) {
+                $listPrintVersions[] = $version;
+            }
+        }
+    }
+    if (isset($listPrintVersions) && !empty($listPrintVersions)) {
+    	foreach ($listPrintVersions as $key => $version) {
+	    $idsBug = $clientSOAP->__soapCall('mc_issue_get_list_by_project_for_specific_version', array("username" => $username, "password" => $password, "project" => $idProjetMantis, "version" => $version->name ));
+	    echo	'<fieldset>';
+	    $typeVersion = "Milestone";
+	    if ( $version->released ) {
+	        $typeVersion = "Release";
+	    }
+	    echo	'Version : '.$version->name.' (<i>'.strftime("%d/%m/%Y",strtotime($version->date_order)).'</i> '.$typeVersion.') - <i>'.count($idsBug).' ticket(s)</i>';
+	    echo	'<ul>';
+	    foreach ( $idsBug as $key => $idBug ) {
+	        $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
+	        if ( !array_key_exists('handler', $defect) || !array_key_exists('name', $defect->handler) ) {
+	            $defect_handler_name = "non-affecte";
+	        } else {
+	            $defect_handler_name = $defect->handler->name;
+	        }
+	        echo	'<li>';
+	        if ( $defect->status->id >= 80 ) {
+	            echo '<strike>';
+	        }
+	        echo	'<a href="?type=group&id='.$id.'&pluginname=mantisbt&idBug='.$defect->id.'&view=viewIssue">'.$defect->id.'</a>: '.$defect->summary.' ('.$defect->resolution->name.') - ('.$defect_handler_name.')';
+	        if ( $defect->status->id >= 80 ) {
+	            echo '</strike>';
+	        }
+	        echo	'</li>';
+	    }
+		echo	'</ul>';
+		echo	'</fieldset>';
+         }
+
+    if (sizeof($listChild)) {
+        foreach ($listChild as $key => $child) {
+            if (isset($_POST['project'.$child.'VersionId'])) {
+                $resultGroupNameFusionForge = db_query_params ('select groups.group_name, groups.group_id from groups,group_mantisbt
+                                                            where groups.group_id = group_mantisbt.id_group and group_mantisbt.id_mantisbt = $1',
+                                                            array($child));
+                $rowGroupNameFusionForge =& db_fetch_array($resultGroupNameFusionForge);
+		        echo $HTML->boxTop('<a style="color:white;" href="?type=group&id='.$rowGroupNameFusionForge['group_id'].'&pluginname=mantisbt">'.$rowGroupNameFusionForge['group_name'].'</a>');
+		        echo '<fieldset>';
+		        $listChildVersions = $clientSOAP->__soapCall('mc_project_get_versions', array("username" => $username, "password" => $password, "project_id" => $child));
+		        if (!empty($listChildVersions)){
+                    $flipped_projectChildVersionId = array_flip($_POST['project'.$child.'VersionId']);
+			        $listChildPrintVersions = array();
+                    foreach ($listChildVersions as $key => $childVersion) {
+                        if (isset($flipped_projectChildVersionId[$childVersion->id])) {
+                            $listChildPrintVersions[] = $childVersion;
+                        }
+                    }
+			        if (isset($listChildPrintVersions) && !empty($listChildPrintVersions)) {
+        		        foreach ($listChildPrintVersions as $key => $childprintversion){
+               		        echo    '<fieldset>';
+               		        $idsBug = $clientSOAP->__soapCall('mc_issue_get_list_by_project_for_specific_version', array("username" => $username, "password" => $password, "project" => $child, "version" => $childprintversion->name ));
+               		        $typeVersion = "Milestone";
+               		        if ( $childprintversion->released == 1 ) {
+               			        $typeVersion = "Release";
+               		        }
+               		        echo    'Version : '.$childprintversion->name.' (<i>'.strftime("%d/%m/%Y",strtotime($childprintversion->date_order)).'</i> '.$typeVersion.') - <i>'.count($idsBug).'</i>';
+               		        echo    '<ul>';
+               		        foreach ( $idsBug as $key => $idBug ) {
+               			        $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
+               			        if ( !array_key_exists('handler', $defect) || !array_key_exists('name', $defect->handler) ) {
+               				        $defect_handler_name = "non-affecte";
+               			        } else {
+               				        $defect_handler_name = $defect->handler->name;
+               			        }
+               			        echo    '<li>';
+               			        if ( $defect->status->id >= 80 ) {
+               				        echo '<strike>';
+               			        }
+               			        echo    '<a href="?type=group&id='.$rowGroupNameFusionForge['group_id'].'&pluginname=mantisbt&idBug='.$defect->id.'&view=viewIssue">'.$defect->id.'</a>: '.$defect->summary.' ('.$defect->resolution->name.') - ('.$defect_handler_name.')';
+               			        if ( $defect->status->id >= 80 ) {
+               				        echo '</strike>';
+               			        }
+               			        echo    '</li>';
+               		        }
+               		        echo    '</ul>';
+               		        echo    '</fieldset>';
+        		        }
+			        }
+		        }
+		        echo '</fieldset>';
+		        echo $HTML->boxBottom();
+	        }
+            }
+        }
+    }
 }
 ?>

Modified: trunk/src/plugins/mantisbt/view/viewAttachment.php
===================================================================
--- trunk/src/plugins/mantisbt/view/viewAttachment.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/viewAttachment.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,8 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
+ *          Antoine Mercadal - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,42 +22,78 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-GLOBAL $HTML;
+if (empty($msg)) {
+    if (!isset($defect)){
+	    try{
+		    $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+		    $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
+	    }catch (SoapFault $soapFault) {
+		    $error_attachment = $soapFault->faultstring;
+		    $errorPage = true;
+	    }
+    }
 
-if (!isset($defect)){
-	try{
-		$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-		$defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
-	}catch (SoapFault $soapFault) {
-		echo $soapFault->faultstring;
-		echo "<br/>";
-		$errorPage = true;
-	}
+    if ($errorPage){
+	    echo 	'<div>Un probl&egrave;me est survenu lors de la r&eacute;cup&eacute;ration des donn&eacute;es : '.$error_attachment.'</div>';
+    }else {
+        echo "<h2 style='border-bottom: 1px solid black'>Fichiers attach&eacute;s</h2>";
+        $boxTitle = 'Fichiers attach&eacute;s (<a style="color:#FFFFFF;font-size:0.8em" href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$idBug.'&view=addAttachment">Ajouter un fichier</a>)';
+	    if ($defect->attachments) {
+		    echo	'<table class="innertabs">';
+		    echo '<tr>';
+		    echo '<td class="FullBoxTitle">Nom du fichier</td>';
+		    echo '<td class="FullBoxTitle">Actions</td>';
+		    echo '</tr>';
+		    foreach ($defect->attachments as $key => $attachement){
+			    echo	'<tr>';
+			    echo		'<td class="FullBox">'.$attachement->filename.'</td>';
+			    echo 		'<td class="FullBox">';
+			    echo			'<input type=button value="Télécharger" onclick="window.location.href=\'getAttachment.php/'.$attachement->id.'/'.$attachement->filename.'\'">';
+			    echo			'<input type=button value="Supprimer" onclick="window.location.href=\'?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$idBug.'&idAttachment='.$attachement->id.'&action=deleteAttachment&view=viewIssue\'">';
+			    echo		'</td>';
+			    echo 	'</tr>';
+		    }
+            echo "</table>";
+	    } else {
+            echo "Il n'y a pas de fichier attach&eacute; pour ce ticket.";
+        }
+    }
+?>
+<style>
+.notice_title {
+    background-color: #D7E0EB;
+    padding: 10px;
+    font-weight: bold;
+    margin-bottom:0px;
+    cursor: pointer;
+    color: #4F93C3;
 }
 
-$boxTitle = 'Fichiers attachés (<a style="color:#FFFFFF;font-size:0.8em" href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$idBug.'&view=addAttachment">Ajouter un fichier</a>)';
-echo $HTML->boxTop($boxTitle,InTextBorder);
+.notice_content {
+    border: 1px solid #D7E0EB;
+    padding: 10px;
+    font-weight: bold;
+    -moz-border-radius-bottomright: 8px;
+    -moz-border-radius-bottomleft: 8px;
+    -webkit-border-bottom-right-radius: 8px;
+    -webkit-border-bottom-left-radius: 8px;
+    margin-top:0px;
+}
+</style>
+<script type="text/javascript">
+    $(document).ready(function() {
+        $("#expandable_file").hide();
+    });    
 
-if ($errorPage){
-	echo 	'<div>Un problème est survenu lors de la récupération des données</div>';
-	echo $HTML->boxBottom();
-}else {
-	if ($defect->attachments) {
-		echo	'<table class="innertabs">';
-		echo '<tr>';
-		echo '<td class="FullBoxTitle">Nom du fichier</td>';
-		echo '<td class="FullBoxTitle">Actions</td>';
-		echo '</tr>';
-		foreach ($defect->attachments as $key => $attachement){
-			echo	'<tr>';
-			echo		'<td class="FullBox">'.$attachement->filename.'</td>';
-			echo 		'<td class="FullBox">';
-			echo			'<input type=button value="Télécharger" onclick="window.location.href=\'getAttachment.php/'.$attachement->id.'/'.$attachement->filename.'\'">';
-			echo			'<input type=button value="Supprimer" onclick="window.location.href=\'?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$idBug.'&idAttachment='.$attachement->id.'&action=deleteAttachment&view=viewIssue\'">';
-			echo		'</td>';
-			echo 	'</tr>';
-		}
-	}
-	echo $HTML->boxBottom();
+</script>
+<p class="notice_title" onclick='$("#expandable_file").slideToggle(300)'>Ajouter un fichier</p>
+<div id='expandable_file' class="notice_content">
+<?php
+    include("addAttachment.php");
+?>
+</div>
+<br/>
+<br/>
+<?php
 }
 ?>

Modified: trunk/src/plugins/mantisbt/view/viewIssue.php
===================================================================
--- trunk/src/plugins/mantisbt/view/viewIssue.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/viewIssue.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,8 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
+ *          Antoine Mercadal - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,25 +22,23 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-// included the hability to use $HTML tool to create box
-GLOBAL $HTML;
+if (!isset($defect)) {
+	try {
+        /* do not recreate $clientSOAP object if already created by other pages */
+        if (!isset($clientSOAP))
+		    $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 
-if (!isset($defect)){
-	try {
-		$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 		$defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
-	}catch (SoapFault $soapFault) {
-		echo $soapFault->faultstring;
-		echo "<br/>";
+	} catch (SoapFault $soapFault) {
+		$msg = $soapFault->faultstring;
 		$errorPage = true;
 	}
 }
-$boxTitle = 'Détail Ticket : '.sprintf($format,$defect->id).' (<a style="color:#FFFFFF;font-size:0.8em" href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.sprintf($format,$defect->id).'&view=editIssue">Editer</a>)';
-echo $HTML->boxTop($boxTitle,InTextBorder);
 if ($errorPage){
-	echo 	'<div>Un problème est survenu lors de la récupération des données</div>';
-	echo $HTML->boxBottom();
-}else {
+	echo 	'<div class="warning" >Un probl&egrave;me est survenu lors de la r&eacute;cup&eacute;ration des donn&eacute;es : Ticket '.$idBug.' : <i>'.$msg.'</i></div>';
+} else {
+    include('jumpToIssue.php');
+    echo "<h2 style='border-bottom: 1px solid black'>Détail du ticket #$idBug</h2>";
 	echo	'<table class="innertabs">';
 	echo		'<tr>';
 	echo 			'<td width="14%" class="FullBoxTitle">Catégorie</td>';
@@ -82,17 +81,51 @@
 	echo	'<table class="innertabs">';
 	echo		'<tr>';
 	echo 			'<td width="25%" class="FullBoxTitle">Résumé</td>';
-	echo			'<td width="75%" class="FullBox">'.$defect->summary.'</td>';
+	echo			'<td width="75%" class="FullBox">'.htmlspecialchars($defect->summary,ENT_QUOTES).'</td>';
 	echo		'</tr>';
 	echo		'<tr>';
 	echo 			'<td width="25%" class="FullBoxTitle">Description</td>';
-	echo			'<td width="75%" class="FullBox">'.$defect->description.'</td>';
+	echo			'<td width="75%" class="FullBox"><textarea disabled name="description" style="width:99%; background-color:white; color:black; border: none;" rows="6">'.htmlspecialchars($defect->description, ENT_QUOTES).'</textarea></td>';
 	echo		'</tr>';
 	echo		'<tr>';
 	echo 			'<td width="25%" class="FullBoxTitle">Informations complémentaires</td>';
-	echo			'<td width="75%" class="FullBox">'.$defect->additional_information.'</td>';
+	echo			'<td width="75%" class="FullBox"><textarea disabled name="description" style="width:99%; background-color:white; color:black; border: none;" rows="6">'.htmlspecialchars($defect->additional_information, ENT_QUOTES).'</textarea></td>';
 	echo		'</tr>';
 	echo	'</table>';
-	echo $HTML->boxBottom();
-	}
 ?>
+<style>
+.notice_title {
+    background-color: #D7E0EB; 
+    padding: 10px; 
+    font-weight: bold; 
+    margin-bottom:0px;
+    cursor: pointer;
+    color: #4F93C3;
+}
+
+.notice_content {
+    border: 1px solid #D7E0EB;
+    padding: 10px; 
+    font-weight: bold; 
+    -moz-border-radius-bottomright: 8px; 
+    -moz-border-radius-bottomleft: 8px; 
+    -webkit-border-bottom-right-radius: 8px;
+    -webkit-border-bottom-left-radius: 8px;
+    margin-top:0px;
+}
+</style>
+<script type="text/javascript">
+    $(document).ready(function() {
+        $("#expandable_edition").hide();
+    });    
+
+</script>
+<p class="notice_title" onclick='$("#expandable_edition").slideToggle(300)'>Editer le ticket</p>
+<div id='expandable_edition' class="notice_content">
+<?php
+    include("editIssue.php");
+}
+?>
+</div>
+
+<br/>

Modified: trunk/src/plugins/mantisbt/view/viewIssues.php
===================================================================
--- trunk/src/plugins/mantisbt/view/viewIssues.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/viewIssues.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,8 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
+ *          Antoine Mercadal - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,65 +22,82 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-GLOBAL $HTML;
+/**
+ * View All Issues
+ *  - for a specific group id
+ *  - for a specific user
+ */
 
 global $prioritiesImg,$bugPerPage;
 
-// creation du filtre par defaut
-$bugfilter = array ();
-$bugfilter['_view_type'] = "simple";
-if ( $_POST['sort'] ) {
-	$bugfilter['sort'] = $_POST['sort'];
-} else {
-	$bugfilter['sort'] = "last_updated";
+try {
+    /* do not recreate $clientSOAP object if already created by other pages */
+    if (!isset($clientSOAP))
+        $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+
+} catch (SoapFault $soapFault) {
+	echo $soapFault->faultstring;
+	echo "<br/>";
+	$errorPage = true;
 }
-if ( $_POST['dir'] ) {
-	$bugfilter['dir'] = $_POST['dir'];
+
+if ($errorPage) {
+    echo    '<div>Un problème est survenu lors de la r&eacute;cup&eacute;ration des donn&eacute;es</div>';
 } else {
-	$bugfilter['dir'] = "ASC";
+
+    echo "<h2 style='border-bottom: 1px solid black'>Filtres</h2>";
+?>
+<style>
+.notice_title {
+    background-color: #D7E0EB; 
+    padding: 10px; 
+    font-weight: bold; 
+    margin-bottom:0px;
+    cursor: pointer;
+    color: #4F93C3;
 }
 
-// filtres initiaux
-echo $HTML->boxTop("Règles de filtrage");
-echo    '<form name="viewissues" method="post" action="?type='.$type.'&id='.$id.'&pluginname=mantisbt">';
-if ( $_POST['sort'] ) {
-	echo '<input type="hidden" name="sort" value="'.$_POST['sort'].'" />';
+.notice_content {
+    border: 1px solid #D7E0EB;
+    padding: 10px; 
+    font-weight: bold; 
+    -moz-border-radius-bottomright: 8px; 
+    -moz-border-radius-bottomleft: 8px; 
+    -webkit-border-bottom-right-radius: 8px;
+    -webkit-border-bottom-left-radius: 8px;
+    margin-top:0px;
 }
-if ( $_POST['dir'] ) {
-	echo '<input type="hidden" name="dir" value="'.$_POST['dir'].'" />';
-}
-echo    '<div>';
-echo    '<input type="checkbox" name="addClosed" value="1" ';
-if ( $_POST['addClosed'] ) {
-       	echo 'checked';
-	$bugfilter['_view_type'] = 'full';
-}
-echo    '>Inclure les tickets fermés</input>';
-echo    '</div>';
-print'<div style="float:left"><img src="'.util_make_url('themes/gforge/images/bouton_gauche.png').'"></img></div>
-       	<div style="background: url('.util_make_url('themes/gforge/images/bouton_centre.png').');vertical-align:top;display:inline;font-size:15px">
-       	<a href="javascript:document.viewissues.submit();" style="color:white;font-size:0.8em;font-weight:bold;">Recharger</a>
-       	</div>
-       	<div style="display:inline"><img src="'.util_make_url('themes/gforge/images/bouton_droit.png').'"></img></div>';
-echo	'</form>';
-echo $HTML->boxBottom();
+</style>
 
-// recuperation des bugs
-$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-$listBug = array();
-try {
+<script type="text/javascript">
+    $(document).ready(function() {
+        <?php
+            if ( !isset($_POST["projectStatus"]) && !isset($_POST["projectChildId"]) && !isset($_POST["projectFixers"]) && !isset($_POST["projectReporters"]))
+            {
+            ?>   
+                $("#expandable_filter").hide();
+            <?php 
+            }
+            ?>
+        $("#expandable_ticket").hide();
+    });
+</script>
+<p class="notice_title" onclick='$("#expandable_filter").slideToggle(300)'>Afficher les règles de filtrage</p>
+<div id='expandable_filter' class="notice_content" style='clear: both'>
+    <?php
+        include('mantisbt/controler/filter.php');
+    ?>
+</div>
+<br/>
+    <?php
+    // recuperation des bugs
+    $listBug = array();
 	if ($type == "user"){
 		$idsBugAll = $clientSOAP->__soapCall('mc_issue_get_filtered_by_user', array("username" => $username, "password" => $password, "filter" => $bugfilter ));
-	}else if ($type == "group"){
-		$idsBugAll = $clientSOAP->__soapCall('mc_project_get_issues', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis,  "page_number" => -1, "per_page" => -1, "filter" => $bugfilter));
+	} else if ($type == "group"){
+		$idsBugAll = $clientSOAP->__soapCall('mc_project_get_issue_headers', array("username" => $username, "password" => $password, "project_id" => $idProjetMantis,  "page_number" => -1, "per_page" => -1, "filter" => $bugfilter));
 	}
-}catch (SoapFault $soapFault) {
-	echo $soapFault->faultstring;
-	echo "<br/>";
-	$errorPage = true;
-}
 
-if (!$errorPage){
 	$pageActuelle = getIntFromRequest('page');
 	if (empty($pageActuelle)) {
 		$pageActuelle = 1;
@@ -95,16 +113,12 @@
 	$indexMax = ($pageActuelle * $bugPerPage) -1;
 	// construction du tableau
 	foreach ($idsBugAll as $defect) {
-		$nbNote=0;
-		if (isset($defect->notes)){
-			$nbNote = count($defect->notes);
-		}
 		$listBugAll[] = array( "id"=> $defect->id, "idPriority"=> $defect->priority->id,
 					"category"=> $defect->category,"project" => $defect->project->name, 
 					"severityId" => $defect->severity->id, "severity" => $defect->severity->name, 
 					"status" => $defect->status->name, "statusId" => $defect->status->id,
-					"last_updated" => $defect->last_updated, "nb_note" => $nbNote, "handler" => $defect->handler->name,
-					"summary" => $defect->summary, "view_state" => $defect->view_state->id,
+					"last_updated" => $defect->last_updated, "handler" => $defect->handler->name,
+					"summary" => htmlspecialchars($defect->summary,ENT_QUOTES), "view_state" => $defect->view_state->id,
 					"version" => $defect->version, "fixed_in_version" => $defect->fixed_in_version,
 					"target_version" => $defect->target_version
 				);
@@ -122,24 +136,18 @@
 // affichage page
 $nbligne=0;
 
-if ($type == "group"){
-	$boxTitle = 'Liste des tickets (<a style="color:#FFFFFF;font-size:0.8em" href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&view=addIssue">Rapporter un ticket</a>)';
-}else {
-	$boxTitle = 'Liste des tickets';
-}
+$boxTitle = 'Tickets';
 
-echo $HTML->boxTop($boxTitle,InTextBorder);
-
+echo "<h2 style='border-bottom: 1px solid black'>$boxTitle</h2>";
 if ($errorPage){
-	echo 	'<div>Un problème est survenu lors de la récupération des données</div>';
-	echo $HTML->boxBottom();
+	echo 	'<div>Un problème est survenu lors de la r&eacute;cup&eacute;ration des donn&eacute;es</div>';
 }else {
 	$picto_haut = util_make_url('themes/gforge/images/picto_fleche_haut_marron.png');
 	$picto_bas = util_make_url('themes/gforge/images/picto_fleche_bas_marron.png');
 	$nbligne++;
+	include('jumpToIssue.php');
+    	echo '<table class="innertabs" style="border: 1px solid #3d7c95">';
 	echo    '<tr>';
-	echo		'<th class="InText" width="2%"></th>';
-	echo		'<th class="InText" width="2%"></th>';
 	// Priority
 	echo 		'<th class="InText" width="2%">';
 	echo			'<form name="filterprority" method="post" action="?type='.$type.'&id='.$id.'&pluginname=mantisbt">';
@@ -148,9 +156,16 @@
 	}else if ($bugfilter['sort'] == "priority" && $bugfilter['dir'] == "DESC") {
 		echo			'<input type="hidden" name="dir" value="ASC"/>';
 	}
-	if ($_POST['addClosed']) {
-		echo			'<input type="hidden" name="addClosed" value="1"; />';
+	if ( isset($bugfilter['show_status'])) {
+		foreach ($bugfilter['show_status'] as $key => $childStatus) {
+			echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+		}
 	}
+	if ( isset($bugfilter['project_id'])) {
+		foreach ($bugfilter['project_id'] as $key => $childId) {
+			echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+		}
+	}
 	echo				'<input type=hidden name="sort" value="priority" />';
 	echo				'<a class="DataLink" href="javascript:document.filterprority.submit();">P';
 	if ($bugfilter['sort'] == "priority" && $bugfilter['dir'] == "ASC" ){
@@ -169,9 +184,16 @@
 	}else if ($bugfilter['sort'] == "id" && $bugfilter['dir'] == "DESC") {
 		echo			'<input type="hidden" name="dir" value="ASC"/>';
 	}
-	if ($_POST['addClosed']) {
-		echo			'<input type="hidden" name="addClosed" value="1"; />';
+	if ( isset($bugfilter['show_status'])) {
+		foreach ($bugfilter['show_status'] as $key => $childStatus) {
+			echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+		}
 	}
+	if ( isset($bugfilter['project_id'])) {
+		foreach ($bugfilter['project_id'] as $key => $childId) {
+			echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+		}
+	}
 	echo				'<input type=hidden name="sort" value="id" />';
 	echo				'<a class="DataLink" href="javascript:document.filterid.submit();">ID';
 	if ($bugfilter['sort'] == "id" && $bugfilter['dir'] == "ASC" ){
@@ -182,8 +204,6 @@
 	echo 				'</a>';
 	echo			'</form>';
 	echo 		'</th>';
-	// Note
-	echo 		'<th class="InText" width="1%"> # </th>';
 	// Catégorie
 	echo		'<th class="InText" width="7%">';
 	echo			'<form name="filtercat" method="post" action="?type='.$type.'&id='.$id.'&pluginname=mantisbt">';
@@ -192,11 +212,18 @@
 	}else if ($bugfilter['sort'] == "category_id" && $bugfilter['dir'] == "DESC") {
 		echo			'<input type="hidden" name="dir" value="ASC"/>';
 	}
-	if ($_POST['addClosed']) {
-		echo			'<input type="hidden" name="addClosed" value="1"; />';
+	if ( isset($bugfilter['show_status'])) {
+		foreach ($bugfilter['show_status'] as $key => $childStatus) {
+			echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+		}
 	}
+	if ( isset($bugfilter['project_id'])) {
+		foreach ($bugfilter['project_id'] as $key => $childId) {
+			echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+		}
+	}
 	echo				'<input type=hidden name="sort" value="category_id" />';
-	echo				'<a class="DataLink" href="javascript:document.filtercat.submit();">Catégorie';
+	echo				'<a class="DataLink" href="javascript:document.filtercat.submit();">Cat&eacute;gorie';
 	if ($bugfilter['sort'] == "category_id" && $bugfilter['dir'] == "ASC" ){
 		echo				'<img src="'.$picto_haut.'">';
 	}else if ($bugfilter['sort'] == "category_id" && $bugfilter['dir'] == "DESC" ) {
@@ -213,9 +240,16 @@
 	}else if ($bugfilter['sort'] == "project_id" && $bugfilter['dir'] == "DESC") {
 		echo			'<input type="hidden" name="dir" value="ASC"/>';
 	}
-	if ($_POST['addClosed']) {
-		echo			'<input type="hidden" name="addClosed" value="1"; />';
+	if ( isset($bugfilter['show_status'])) {
+		foreach ($bugfilter['show_status'] as $key => $childStatus) {
+			echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+		}
 	}
+	if ( isset($bugfilter['project_id'])) {
+		foreach ($bugfilter['project_id'] as $key => $childId) {
+			echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+		}
+	}
 	echo				'<input type=hidden name="sort" value="project_id" />';
 	echo				'<a class="DataLink" href="javascript:document.projectid.submit();">Projet';
 	if ($bugfilter['sort'] == "project_id" && $bugfilter['dir'] == "ASC" ){
@@ -234,11 +268,18 @@
 	}else if ($bugfilter['sort'] == "severity" && $bugfilter['dir'] == "DESC") {
 		echo			'<input type="hidden" name="dir" value="ASC"/>';
 	}
-	if ($_POST['addClosed']) {
-		echo			'<input type="hidden" name="addClosed" value="1"; />';
+	if ( isset($bugfilter['show_status'])) {
+		foreach ($bugfilter['show_status'] as $key => $childStatus) {
+			echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+		}
 	}
+	if ( isset($bugfilter['project_id'])) {
+		foreach ($bugfilter['project_id'] as $key => $childId) {
+			echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+		}
+	}
 	echo				'<input type=hidden name="sort" value="severity" />';
-	echo				'<a class="DataLink" href="javascript:document.severity.submit();">Sévérité';
+	echo				'<a class="DataLink" href="javascript:document.severity.submit();">S&eacute;v&eacute;rit&eacute;';
 	if ($bugfilter['sort'] == "severity" && $bugfilter['dir'] == "ASC" ){
 		echo				'<img src="'.$picto_haut.'">';
 	}else if ($bugfilter['sort'] == "severity" && $bugfilter['dir'] == "DESC" ) {
@@ -255,9 +296,16 @@
 	}else if ($bugfilter['sort'] == "status" && $bugfilter['dir'] == "DESC") {
 		echo			'<input type="hidden" name="dir" value="ASC"/>';
 	}
-	if ($_POST['addClosed']) {
-		echo			'<input type="hidden" name="addClosed" value="1"; />';
+	if ( isset($bugfilter['show_status'])) {
+		foreach ($bugfilter['show_status'] as $key => $childStatus) {
+			echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+		}
 	}
+	if ( isset($bugfilter['project_id'])) {
+		foreach ($bugfilter['project_id'] as $key => $childId) {
+			echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+		}
+	}
 	echo				'<input type=hidden name="sort" value="status" />';
 	echo				'<a class="DataLink" href="javascript:document.statusid.submit();">Etat';
 	if ($bugfilter['sort'] == "status" && $bugfilter['dir'] == "ASC" ){
@@ -276,9 +324,16 @@
 	}else if ($bugfilter['sort'] == "last_updated" && $bugfilter['dir'] == "DESC") {
 		echo			'<input type="hidden" name="dir" value="ASC"/>';
 	}
-	if ($_POST['addClosed']) {
-		echo			'<input type="hidden" name="addClosed" value="1"; />';
+	if ( isset($bugfilter['show_status'])) {
+		foreach ($bugfilter['show_status'] as $key => $childStatus) {
+			echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+		}
 	}
+	if ( isset($bugfilter['project_id'])) {
+		foreach ($bugfilter['project_id'] as $key => $childId) {
+			echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+		}
+	}
 	echo				'<input type=hidden name="sort" value="last_updated" />';
 	echo				'<a class="DataLink" href="javascript:document.lastupdate.submit();">Mis à jour';
 	if ($bugfilter['sort'] == "last_updated" && $bugfilter['dir'] == "ASC" ){
@@ -297,11 +352,18 @@
 	}else if ($bugfilter['sort'] == "summary" && $bugfilter['dir'] == "DESC") {
 		echo			'<input type="hidden" name="dir" value="ASC"/>';
 	}
-	if ($_POST['addClosed']) {
-		echo			'<input type="hidden" name="addClosed" value="1"; />';
+	if ( isset($bugfilter['show_status'])) {
+		foreach ($bugfilter['show_status'] as $key => $childStatus) {
+			echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+		}
 	}
+	if ( isset($bugfilter['project_id'])) {
+		foreach ($bugfilter['project_id'] as $key => $childId) {
+			echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+		}
+	}
 	echo				'<input type=hidden name="sort" value="summary" />';
-	echo				'<a class="DataLink" href="javascript:document.summary.submit();">Résumé';
+	echo				'<a class="DataLink" href="javascript:document.summary.submit();">R&eacute;sum&eacute;';
 	if ($bugfilter['sort'] == "summary" && $bugfilter['dir'] == "ASC" ){
 		echo				'<img src="'.$picto_haut.'">';
 	}else if ($bugfilter['sort'] == "summary" && $bugfilter['dir'] == "DESC" ) {
@@ -312,20 +374,27 @@
 	echo 		'</th>';
 	// version de détection
 	echo 		'<th class="InText" width="6%">';
-	echo			'<form name="detected" method="post" action="?type='.$type.'&id='.$id.'&pluginname=mantisbt">';
-	if ($bugfilter['sort'] == "detected" && $bugfilter['dir'] == "ASC") {
+	echo			'<form name="version" method="post" action="?type='.$type.'&id='.$id.'&pluginname=mantisbt">';
+	if ($bugfilter['sort'] == "version" && $bugfilter['dir'] == "ASC") {
 		echo			'<input type=hidden name="dir" value="DESC"/>';
-	}else if ($bugfilter['sort'] == "detected" && $bugfilter['dir'] == "DESC") {
+	}else if ($bugfilter['sort'] == "version" && $bugfilter['dir'] == "DESC") {
 		echo			'<input type="hidden" name="dir" value="ASC"/>';
 	}
-	if ($_POST['addClosed']) {
-		echo			'<input type="hidden" name="addClosed" value="1"; />';
+	if ( isset($bugfilter['show_status'])) {
+		foreach ($bugfilter['show_status'] as $key => $childStatus) {
+			echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+		}
 	}
-	echo				'<input type=hidden name="sort" value="detected" />';
-	echo				'<a class="DataLink" href="javascript:document.detected.submit();">Détecté en';
-	if ($bugfilter['sort'] == "detected" && $bugfilter['dir'] == "ASC" ){
+	if ( isset($bugfilter['project_id'])) {
+		foreach ($bugfilter['project_id'] as $key => $childId) {
+			echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+		}
+	}
+	echo				'<input type=hidden name="sort" value="version" />';
+	echo				'<a class="DataLink" href="javascript:document.version.submit();">D&eacute;tect&eacute; en';
+	if ($bugfilter['sort'] == "version" && $bugfilter['dir'] == "ASC" ){
 		echo				'<img src="'.$picto_haut.'">';
-	}else if ($bugfilter['sort'] == "detected" && $bugfilter['dir'] == "DESC" ) {
+	}else if ($bugfilter['sort'] == "version" && $bugfilter['dir'] == "DESC" ) {
 		echo				'<img src="'.$picto_bas.'">';
 	}
 	echo 				'</a>';
@@ -339,11 +408,18 @@
 	}else if ($bugfilter['sort'] == "fixed_in_version" && $bugfilter['dir'] == "DESC") {
 		echo			'<input type="hidden" name="dir" value="ASC"/>';
 	}
-	if ($_POST['addClosed']) {
-		echo			'<input type="hidden" name="addClosed" value="1"; />';
+	if ( isset($bugfilter['show_status'])) {
+		foreach ($bugfilter['show_status'] as $key => $childStatus) {
+			echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+		}
 	}
+	if ( isset($bugfilter['project_id'])) {
+		foreach ($bugfilter['project_id'] as $key => $childId) {
+			echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+		}
+	}
 	echo				'<input type=hidden name="sort" value="fixed_in_version" />';
-	echo				'<a class="DataLink" href="javascript:document.fixed.submit();">Corrigé en';
+	echo				'<a class="DataLink" href="javascript:document.fixed.submit();">Corrig&eacute; en';
 	if ($bugfilter['sort'] == "fixed_in_version" && $bugfilter['dir'] == "ASC" ){
 		echo				'<img src="'.$picto_haut.'">';
 	}else if ($bugfilter['sort'] == "fixed_in_version" && $bugfilter['dir'] == "DESC" ) {
@@ -360,9 +436,16 @@
 	}else if ($bugfilter['sort'] == "target_version" && $bugfilter['dir'] == "DESC") {
 		echo			'<input type="hidden" name="dir" value="ASC"/>';
 	}
-	if ($_POST['addClosed']) {
-		echo			'<input type="hidden" name="addClosed" value="1"; />';
+	if ( isset($bugfilter['show_status'])) {
+		foreach ($bugfilter['show_status'] as $key => $childStatus) {
+			echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+		}
 	}
+	if ( isset($bugfilter['project_id'])) {
+		foreach ($bugfilter['project_id'] as $key => $childId) {
+			echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+		}
+	}
 	echo				'<input type=hidden name="sort" value="target_version" />';
 	echo				'<a class="DataLink" href="javascript:document.target.submit();">Milestone';
 	if ($bugfilter['sort'] == "target_version" && $bugfilter['dir'] == "ASC" ){
@@ -383,20 +466,12 @@
 		} else {
 			echo '<tr class="LigneImpaire">';
 		}
-		echo		'<td class="InText"><input type="checkbox" name="check_'.$cpt.'" value="action_bug"></td>';
-		echo		'<input type="hidden" name="idBug_'.$cpt.'" value="'.$bug['id'].'">';
-		echo		'<td class="InText"><a class="DataLink" href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$bug['id'].'&view=editIssue"><img src="./img/update.png"></a></td>';
 		if($prioritiesImg[$bug['idPriority']] != ""){
 			echo		'<td class="InText"><img src="./img/'.$prioritiesImg[$bug['idPriority']].'"></td>';
 		}else{
 			echo		'<td class="InText"></td>';
 		}
 		echo		'<td class="InText"><a class="DataLink" href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$bug['id'].'&view=viewIssue">'.sprintf($format,$bug['id']).'</a></td>';
-		if ($bug['nb_note'] != 0){
-			echo		'<td class="InText"><a class="DataLink" href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$bug['id'].'&view=viewNote">'.$bug['nb_note'].'</a></td>';
-		}else{
-			echo		'<td class="InText"></td>';
-		}
 		echo 		'<td class="InText">'.$bug['category'].'</td>';
 		echo 		'<td class="InText">'.$bug['project'].'</td>';
 		echo 		'<td class="InText">';
@@ -421,9 +496,23 @@
 		echo	'</tr>';
 		$cpt ++;
 	}
-	echo $HTML->boxBottom();
-	echo 	'<div align="center">';
+	echo "</table><br/>";
+
+
+    // Ajout de ticket
+    if ($type == "group")
+    {
+        ?>
+            <p class="notice_title" onclick='$("#expandable_ticket").slideToggle(300);'>Soumettre un ticket</p>
+            <div id='expandable_ticket' class="notice_content">
+                <?php include("addIssue.php") ?>
+            </div>
+            <br/>
+        <?
+    }
+    
 	// Creation de la pagination
+    echo    '<div align="center">';
 	for($i=1; $i<=$nombreDePages; $i++)
 	{
 		if($i==$pageActuelle) //Si il s'agit de la page actuelle...
@@ -433,13 +522,19 @@
 			echo '<form style="display:inline" name="page'.$i.'" method="post" action="?type='.$type.'&id='.$id.'&pluginname=mantisbt&page='.$i.'" >';
 			echo 	'<input type="hidden" name="sort" value="'.$bugfilter['sort'].'" />';
 			echo 	'<input type="hidden" name="dir" value="'.$bugfilter['dir'].'" />';
-			if ($_POST['addClosed']) {
-				echo 	'<input type="hidden" name="addClosed" value="1" />';
+			if ( isset($bugfilter['show_status'])) {
+				foreach ($bugfilter['show_status'] as $key => $childStatus) {
+					echo	'<input type="hidden" name="projectStatus[]" value="'.$childStatus.'"/>';
+				}
 			}
+			if ( isset($bugfilter['project_id'])) {
+				foreach ($bugfilter['project_id'] as $key => $childId) {
+					echo	'<input type="hidden" name="projectChildId[]" value="'.$childId.'"/>';
+				}
+			}
 			echo '| <a href="javascript:document.page'.$i.'.submit();">'.$i.'</a>';
 			echo '</form>';
 		}
 	}
 	echo 	'</div>';
 }
-?>

Modified: trunk/src/plugins/mantisbt/view/viewNote.php
===================================================================
--- trunk/src/plugins/mantisbt/view/viewNote.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/view/viewNote.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,7 +2,7 @@
 
 /*
  * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Authors: Franck Villaume - capgemini
  *
  * This file is part of FusionForge.
  *
@@ -21,39 +21,84 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-// included the hability to use $HTML tool to create box
-GLOBAL $HTML;
+//$msg is coming from previous soap error
+if (empty($msg)) {
+    if (!isset($defect)){
+        /* do not recreate $clientSOAP object if already created by other pages */
+        if (!isset($clientSOAP))
+	        $clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 
-if (!isset($defect)){
-	$clientSOAP = new SoapClient("http://$sys_mantisbt_host/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
-	$defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
+	    $defect = $clientSOAP->__soapCall('mc_issue_get', array("username" => $username, "password" => $password, "issue_id" => $idBug));
+    }
+
+    $boxTitle = 'Notes';
+
+    echo "<h2 style='border-bottom: 1px solid black'>Notes</h2>";
+
+    if (isset($defect->notes)){
+        echo    '<table class="innertabs">';
+	    foreach ($defect->notes as $key => $note){
+		    echo	'<tr>';
+		    echo		'<td width="10%" class="FullBoxTitle">';
+		    echo 			'('.sprintf($format,$note->id).')';
+		    echo 			'<br/>';
+		    echo			$note->reporter->name;
+		    echo 			'<br/>';
+		    // TODO
+		    //date_default_timezone_set("UTC");
+		    echo 			date("Y-m-d G:i",strtotime($note->date_submitted));
+		    echo 		'</td>';
+		    echo		'<td width="9%" class="FullBoxTitle">';
+		    echo 			'<input type=button name="upNote" value="Modifier" onclick="window.location.href=\'?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&idNote='.$note->id.'&view=editNote\'">';
+		    echo 			'<input type=button name="delNote" value="Supprimer" onclick="window.location.href=\'?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&idNote='.$note->id.'&action=deleteNote&view=viewIssue\'">';
+		    echo 		"</td>";
+		    echo 		'<td class="FullBox">';
+		    echo		'<textarea disabled name="description" style="width:99%; background-color:white; color:black; border: none;" row="3">'.htmlspecialchars($note->text, ENT_QUOTES).'</textarea>';
+		    echo 		"</td>";
+		    echo 	'</tr>';
+	    }
+        echo "</table>";
+    } else {
+        echo "Il n'y a pas de notes pour ce ticket.";
+    }
+?>
+
+<style>
+.notice_title {
+    background-color: #D7E0EB;
+    padding: 10px;
+    font-weight: bold;
+    margin-bottom:0px;
+    cursor: pointer;
+    color: #4F93C3;
 }
 
-$boxTitle = 'Notes (<a style="color:#FFFFFF;font-size:0.8em" href="?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&view=addNote">Ajouter une note</a>)';
-echo $HTML->boxTop($boxTitle,InTextBorder);
+.notice_content {
+    border: 1px solid #D7E0EB;
+    padding: 10px;
+    font-weight: bold;
+    -moz-border-radius-bottomright: 8px;
+    -moz-border-radius-bottomleft: 8px;
+    -webkit-border-bottom-right-radius: 8px;
+    -webkit-border-bottom-left-radius: 8px;
+    margin-top:0px;
+}
+</style>
+<script type="text/javascript">
+    $(document).ready(function() {
+        $("#expandable_note").hide();
+    });    
 
-echo	'<table class="innertabs">';
-if (isset($defect->notes)){
-	foreach ($defect->notes as $key => $note){
-		echo	'<tr>';
-		echo		'<td width="10%" class="FullBoxTitle">';
-		echo 			'('.sprintf($format,$note->id).')';
-		echo 			'<br/>';
-		echo			$note->reporter->name;
-		echo 			'<br/>';
-		// TODO
-		//date_default_timezone_set("UTC");
-		echo 			date("Y-m-d G:i",strtotime($note->date_submitted));
-		echo 		'</td>';
-		echo		'<td width="13%" class="FullBoxTitle">';
-		echo 			'<input type=button name="upNote" value="Modifier" onclick="window.location.href=\'?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&idNote='.$note->id.'&view=editNote\'">';
-		echo 			'<input type=button name="delNote" value="Supprimer" onclick="window.location.href=\'?type='.$type.'&id='.$id.'&pluginname='.$pluginname.'&idBug='.$defect->id.'&idNote='.$note->id.'&action=deleteNote&view=viewIssue\'">';
-		echo 		"</td>";
-		echo 		'<td class="FullBox">';
-		echo			$note->text;
-		echo 		"</td>";
-		echo 	'</tr>';
-	}
+</script>
+<p class="notice_title" onclick='$("#expandable_note").slideToggle(300)'>Ajouter une note</p>
+<div id='expandable_note' class="notice_content">
+<?php
+    include("addOrEditNote.php");
+?>
+</div>
+
+<br/>
+
+<?php
 }
-echo $HTML->boxBottom();
 ?>

Modified: trunk/src/plugins/mantisbt/www/admin/index.php
===================================================================
--- trunk/src/plugins/mantisbt/www/admin/index.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/www/admin/index.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -1,8 +1,8 @@
 <?php
 
 /*
- * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Copyright 2010 (c) : Franck Villaume - Capgemini
+ * Admin MantisBT page
  *
  * This file is part of FusionForge.
  *
@@ -21,10 +21,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-/*
- * Admin MantisBT page
- */
-
 $action = getStringFromRequest('action');
 $view = getStringFromRequest('view');
 
@@ -50,12 +46,15 @@
 if ( $userperm->isAdmin() ) {
         $labelTitle[] = _('Admin');
         $labelPage[] = "/plugins/mantisbt/?type=admin&id=".$id."&pluginname=".$pluginname;
+        $labelTitle[] = _('Stats');
+        $labelPage[] = "/plugins/mantisbt/?type=admin&id=".$id."&pluginname=".$pluginname."&view=stat";
 }
 
 echo $HTML->subMenu( $labelTitle, $labelPage );
 
 switch($view) {
 	case "editVersion":
+	case "stat":
 		include ("mantisbt/view/admin/$view.php");
 		exit;
 	default:

Modified: trunk/src/plugins/mantisbt/www/group/index.php
===================================================================
--- trunk/src/plugins/mantisbt/www/group/index.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/www/group/index.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -1,9 +1,8 @@
 <?php
 
 /*
- * Group MantisBT page
- * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Copyright 2010 (c) : Franck Villaume - Capgemini
+ * Project MantisBT page
  *
  * This file is part of FusionForge.
  *
@@ -52,6 +51,8 @@
 if ( $userperm->isAdmin() ) {
 	$labelTitle[] = _('Admin');
 	$labelPage[] = "/plugins/mantisbt/?type=admin&id=".$id."&pluginname=".$pluginname;
+	$labelTitle[] = _('Stats');
+	$labelPage[] = "/plugins/mantisbt/?type=admin&id=".$id."&pluginname=".$pluginname."&view=stat";
 }
 
 echo $HTML->subMenu( $labelTitle, $labelPage );

Modified: trunk/src/plugins/mantisbt/www/index.php
===================================================================
--- trunk/src/plugins/mantisbt/www/index.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/www/index.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -1,9 +1,9 @@
 <?php
-
 /*
- * MantisBT plugin
  * Copyright 2010, Capgemini
  * Author: Franck Villaume - Capgemini
+ * Author: Fabien Dubois - Capgemini
+ * Author: Antoine Mercadal - Capgemini
  *
  * This file is part of FusionForge.
  *
@@ -22,6 +22,11 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+/*
+ * MantisBT plugin
+ *
+ */
+
 require_once('../../env.inc.php');
 require_once $gfcommon.'include/pre.php';
 require_once $gfcommon.'ldap/ldapUtils.php';
@@ -72,6 +77,9 @@
 $id = getStringFromRequest('id');
 $idProjetMantis = getIdProjetMantis($id);
 $pluginname = getStringFromRequest('pluginname');
+$feedback = htmlspecialchars(getStringFromRequest('feedback'));
+$error_msg = htmlspecialchars(getStringFromRequest('error_msg'));
+$warning_msg = htmlspecialchars(getStringFromRequest('warning_msg'));
 
 $password = getPasswordFromLDAP($user);
 $username = $user->getUnixName();
@@ -81,107 +89,111 @@
 } elseif (!$id) {
 	exit_error("Cannot Process your request","No ID specified");
 } else {
-	if ($type == 'group') {
-		$group = group_get_object($id);
-		if ( !$group) {
-			exit_error("Invalid Project", "Inexistent Project");
-		}
-		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the MantisBT plugin active
-			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");
-		}
-		$userperm = $group->getPermission($user);//we'll check if the user belongs to the group (optional)
-		if ( !$userperm->IsMember()) {
-			exit_error("Access Denied", "You are not a member of this project");
-		}
-		// other perms checks here...
-		mantisbt_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));
+    switch ($type) {
+	    case 'group':
+		    $group = group_get_object($id);
+		    if ( !$group) {
+			    exit_error("Invalid Project", "Inexistent Project");
+		    }
+		    if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the MantisBT plugin active
+			    exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");
+		    }
+		    $userperm = $group->getPermission($user);//we'll check if the user belongs to the group (optional)
+		    if ( !$userperm->IsMember()) {
+			    exit_error("Access Denied", "You are not a member of this project");
+		    }
+		    // other perms checks here...
+		    mantisbt_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));
 			
-		// recuperer les info de URL
-		$sort = getStringFromRequest('sort');
-		$dir = getStringFromRequest('dir');
-		$action = getStringFromRequest('action');
-		$idBug = getStringFromRequest('idBug');
+		    // recuperer les info de URL
+		    $sort = getStringFromRequest('sort');
+		    $dir = getStringFromRequest('dir');
+		    $action = getStringFromRequest('action');
+		    $idBug = getStringFromRequest('idBug');
 			
-		$idNote = getStringFromRequest('idNote');
-		$idAttachment = getStringFromRequest('idAttachment');
-		$actionAttachment = getStringFromRequest('actionAttachment');
-		$page = getStringFromRequest('page');
-		// Si la variable $_GET['page'] existe...
-		if($page != null && $page != ''){
-			$pageActuelle=intval($page);
-		}
-		else {
-			$pageActuelle=1; // La page actuelle est la n°1 
-		}
+		    $idNote = getStringFromRequest('idNote');
+		    $idAttachment = getStringFromRequest('idAttachment');
+		    $actionAttachment = getStringFromRequest('actionAttachment');
+		    $page = getStringFromRequest('page');
+
+		    // Si la variable $_GET['page'] existe...
+		    if($page != null && $page != ''){
+			    $pageActuelle=intval($page);
+		    }
+		    else {
+			    $pageActuelle=1; // La page actuelle est la n°1 
+		    }
 			
-		$format = "%07d";
+		    $format = "%07d";
 
 
-		if($idProjetMantis == 0){
-		 	echo "Projet non initialisé. Pour forcer son activation, il faut désactiver/activer mantis pour ce projet";
-		} else if (is_int($password)){
-			echo "Impossible de récupérer les identifiants de connexions depuis le LDAP";
-		} else {
-			// do the job
-			include ('mantisbt/www/group/index.php');
-		}
-	} elseif ($type == 'user') {
-		$realuser = user_get_object($id);//
-		if (!($realuser) || !($realuser->usesPlugin($pluginname))) {
-			exit_error("Error", "First activate the User's $pluginname plugin through Account Manteinance Page");
-		}
-		if ( (!$user) || ($user->getID() != $id)) { // if someone else tried to access the private MantisBT part of this user
-			exit_error("Access Denied", "You cannot access other user's personal $pluginname");
-		}
-		mantisbt_User_Header(array('title'=>'My '.$pluginname,'pagename'=>"$pluginname",'sectionvals'=>array($realuser->getUnixName())));
+		    if($idProjetMantis == 0){
+		 	    echo "Projet non initialisé. Pour forcer son activation, il faut désactiver/activer mantis pour ce projet";
+		    } else if (is_int($password)){
+			    echo "Impossible de récupérer les identifiants de connexions depuis le LDAP";
+		    } else {
+			    // do the job
+			    include ('mantisbt/www/group/index.php');
+		    }
+            break;
+        case 'user':
+		    $realuser = user_get_object($id);//
+		    if (!($realuser) || !($realuser->usesPlugin($pluginname))) {
+			    exit_error("Error", "First activate the User's $pluginname plugin through Account Manteinance Page");
+		    }
+		    if ( (!$user) || ($user->getID() != $id)) { // if someone else tried to access the private MantisBT part of this user
+			    exit_error("Access Denied", "You cannot access other user's personal $pluginname");
+		    }
+		    mantisbt_User_Header(array('title'=>'My '.$pluginname,'pagename'=>"$pluginname",'sectionvals'=>array($realuser->getUnixName())));
 			
-		$password = getPasswordFromLDAP($realuser);
-		$username = $realuser->getUnixName();
+		    $password = getPasswordFromLDAP($realuser);
+		    $username = $realuser->getUnixName();
 			
-		// recuperer les info de URL
-		$sort = getStringFromRequest('sort');
-		$dir = getStringFromRequest('dir');
-		$action = getStringFromRequest('action');
-		$idBug = getStringFromRequest('idBug');
+		    // recuperer les info de URL
+		    $sort = getStringFromRequest('sort');
+		    $dir = getStringFromRequest('dir');
+		    $action = getStringFromRequest('action');
+		    $idBug = getStringFromRequest('idBug');
 			
-		$idNote = getStringFromRequest('idNote');
-		$page = getStringFromRequest('page');
-		// Si la variable $_GET['page'] existe...
-		if($page != null && $page != ''){
-			$pageActuelle=intval($page);
-		}
-		else {
-			$pageActuelle=1; // La page actuelle est la n°1 
-		}
+		    $idNote = getStringFromRequest('idNote');
+		    $page = getStringFromRequest('page');
+		    // Si la variable $_GET['page'] existe...
+		    if($page != null && $page != ''){
+			    $pageActuelle=intval($page);
+		    } else {
+			    $pageActuelle=1; // La page actuelle est la n°1 
+		    }
 		
-		$format = "%07d";
+		    $format = "%07d";
 			
-		if (!is_int($password)){
-			// do the job
-			include ('mantisbt/www/user/index.php');
-		} else {
-			echo "Un problème est survenu lors de la récupération des tickets";
-		}
-	} elseif ($type == 'admin') {
-		$group = group_get_object($id);
-		if ( !$group) {
-			exit_error("Invalid Project", "Inexistent Project");
-		}
-		if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the MantisBT plugin active
-			exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");
-		}
-		$userperm = $group->getPermission($user);//we'll check if the user belongs to the group
-		if ( !$userperm->IsMember()) {
-			exit_error("Access Denied", "You are not a member of this project");
-		}
-		//only project admin can access here
-		if ( $userperm->isAdmin() ) {
-			// DO THE STUFF FOR THE PROJECT ADMINISTRATION PART HERE
-			mantisbt_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));	
-			include ('mantisbt/www/admin/index.php');
-		} else {
-			exit_error("Access Denied", "You are not a project Admin");
-		}
+		    if (!is_int($password)){
+			    // do the job
+			    include ('mantisbt/www/user/index.php');
+		    } else {
+			    echo "Un problème est survenu lors de la récupération des tickets";
+		    }
+            break;
+        case 'admin':
+		    $group = group_get_object($id);
+		    if ( !$group) {
+			    exit_error("Invalid Project", "Inexistent Project");
+		    }
+		    if ( ! ($group->usesPlugin ( $pluginname )) ) {//check if the group has the MantisBT plugin active
+			    exit_error("Error", "First activate the $pluginname plugin through the Project's Admin Interface");
+		    }
+		    $userperm = $group->getPermission($user);//we'll check if the user belongs to the group
+		    if ( !$userperm->IsMember()) {
+			    exit_error("Access Denied", "You are not a member of this project");
+		    }
+		    //only project admin can access here
+		    if ( $userperm->isAdmin() ) {
+			    // DO THE STUFF FOR THE PROJECT ADMINISTRATION PART HERE
+			    mantisbt_Project_Header(array('title'=>$pluginname . ' Project Plugin!','pagename'=>"$pluginname",'sectionvals'=>array(group_getname($id))));	
+			    include ('mantisbt/www/admin/index.php');
+		    } else {
+			    exit_error("Access Denied", "You are not a project Admin");
+		    }
+            break;
 	}
 }
 

Modified: trunk/src/plugins/mantisbt/www/user/index.php
===================================================================
--- trunk/src/plugins/mantisbt/www/user/index.php	2010-09-07 17:49:04 UTC (rev 10418)
+++ trunk/src/plugins/mantisbt/www/user/index.php	2010-09-08 09:37:14 UTC (rev 10419)
@@ -2,8 +2,7 @@
 
 /*
  * User MantisBT page
- * Copyright 2010, Capgemini
- * Author: Franck Villaume - Capgemini
+ * Copyright 2010 (c) Franck Villaume - Capgemini
  *
  * This file is part of FusionForge.
  *




More information about the Fusionforge-commits mailing list