[Fusionforge-commits] r12354 - in trunk/src/plugins/mantisbt: view www www/group

Franck VILLAUME nerville at fusionforge.org
Thu Feb 24 19:05:38 CET 2011


Author: nerville
Date: 2011-02-24 19:05:37 +0100 (Thu, 24 Feb 2011)
New Revision: 12354

Modified:
   trunk/src/plugins/mantisbt/view/viewIssues.php
   trunk/src/plugins/mantisbt/www/group/index.php
   trunk/src/plugins/mantisbt/www/index.php
Log:
migrate to the new init

Modified: trunk/src/plugins/mantisbt/view/viewIssues.php
===================================================================
--- trunk/src/plugins/mantisbt/view/viewIssues.php	2011-02-24 17:51:54 UTC (rev 12353)
+++ trunk/src/plugins/mantisbt/view/viewIssues.php	2011-02-24 18:05:37 UTC (rev 12354)
@@ -32,13 +32,15 @@
  * @todo : remove all css and js
  */
 
+global $mantisbt;
+global $mantisbtConf;
 
 global $prioritiesImg, $bugPerPage;
 
 try {
 /* do not recreate $clientSOAP object if already created by other pages */
 	if (!isset($clientSOAP))
-		$clientSOAP = new SoapClient(forge_get_config('server_url','mantisbt')."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
+		$clientSOAP = new SoapClient($mantisbtConf['url']."/api/soap/mantisconnect.php?wsdl", array('trace'=>true, 'exceptions'=>true));
 
 } catch (SoapFault $soapFault) {
 	echo '<div class="warning" >'. _('Technical error occurs during data retrieving:'). ' ' .$soapFault->faultstring.'</div>';
@@ -91,9 +93,9 @@
 </div>
 <br/>
 	<?php
-	
+
 	echo '<h2 style="border-bottom: 1px solid black">'. _('Tickets') .'</h2>';
-	
+
 	// recuperation des bugs
 	$listBug = array();
 	try {
@@ -124,8 +126,8 @@
 		// construction du tableau
 		foreach ($idsBugAll as $defect) {
 			$listBugAll[] = array( "id"=> $defect->id, "idPriority"=> $defect->priority->id,
-						"category"=> $defect->category,"project" => $defect->project->name, 
-						"severityId" => $defect->severity->id, "severity" => $defect->severity->name, 
+						"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, "handler" => $defect->handler->name,
 						"summary" => htmlspecialchars($defect->summary,ENT_QUOTES), "view_state" => $defect->view_state->id,

Modified: trunk/src/plugins/mantisbt/www/group/index.php
===================================================================
--- trunk/src/plugins/mantisbt/www/group/index.php	2011-02-24 17:51:54 UTC (rev 12353)
+++ trunk/src/plugins/mantisbt/www/group/index.php	2011-02-24 18:05:37 UTC (rev 12354)
@@ -3,7 +3,7 @@
 /*
  * Project MantisBT page
  *
- * Copyright 2009-2010, Franck Villaume - Capgemini
+ * Copyright 2009-2011, Franck Villaume - Capgemini
  * http://fusionforge.org
  *
  * This file is part of FusionForge.
@@ -23,43 +23,27 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-$action = getStringFromRequest('action');
-$view = getStringFromRequest('view');
+global $mantisbt;
+global $mantisbtConf;
+global $group_id;
+global $gfplugins;
 
-switch ($action) {
-	case "updateIssue":
-	case "addNote":
-	case "addIssue":
-	case "deleteNote":
-	case "addAttachment":
-	case "deleteAttachment": {
-		include ("mantisbt/action/$action.php");
-		break;
-	}
-	case "updateNote":
-	case "privateNote":
-	case "publicNote": {
-		include ("mantisbt/action/updateNote.php");
-		break;
-	}
-}
-
 // submenu
-$labelTitle = array ();
+$labelTitle = array();
 $labelTitle[] = _('Roadmap');
 $labelTitle[] = _('Tickets');
 $labelPage = array();
-$labelPage[] = "/plugins/mantisbt/?type=group&id=".$id."&pluginname=".$pluginname."&view=roadmap";
-$labelPage[] = "/plugins/mantisbt/?type=group&id=".$id."&pluginname=".$pluginname;
+$labelPage[] = "/plugins/".$mantisbt->name."/?type=group&id=".$group_id."&pluginname=".$mantisbt->name."&view=roadmap";
+$labelPage[] = "/plugins/".$mantisbt->name."/?type=group&id=".$group_id."&pluginname=".$mantisbt->name;
 $userperm = $group->getPermission($user);
-if ( $userperm->isAdmin() ) {
+if ($userperm->isAdmin()) {
 	$labelTitle[] = _('Administration');
-	$labelPage[] = "/plugins/mantisbt/?type=admin&id=".$id."&pluginname=".$pluginname;
+	$labelPage[] = "/plugins/".$mantisbt->name."/?type=admin&id=".$group_id."&pluginname=".$mantisbt->name;
 	$labelTitle[] = _('Statistics');
-	$labelPage[] = "/plugins/mantisbt/?type=admin&id=".$id."&pluginname=".$pluginname."&view=stat";
+	$labelPage[] = "/plugins/".$mantisbt->name."/?type=admin&id=".$group_id."&pluginname=".$mantisbt->name."&view=stat";
 }
 
-echo $HTML->subMenu( $labelTitle, $labelPage );
+echo $HTML->subMenu($labelTitle, $labelPage);
 
 // page a afficher
 switch ($view) {
@@ -68,25 +52,25 @@
 	case "addIssue":
 	case "addAttachment":
 	case "roadmap": {
-		include("mantisbt/view/$view.php");
+		include($gfplugins.$mantisbt->name."/view/$view.php");
 		break;
 	}
 	case "viewIssue": {
-		include("mantisbt/view/$view.php");
-		include('mantisbt/view/viewNote.php');
-		include('mantisbt/view/viewAttachment.php');
+		include($gfplugins.$mantisbt->name."/view/$view.php");
+		include($gfplugins.$mantisbt->name."/view/viewNote.php");
+		include($gfplugins.$mantisbt->name."/view/viewAttachment.php");
 		break;
 	}
 	case "editNote":
 	case "addNote": {
-		include("mantisbt/view/addOrEditNote.php");
+		include($gfplugins.$mantisbt->name."/view/addOrEditNote.php");
 		break;
 	}
 	/* viewAllIssues is the default page */
 	default: {
-		include('mantisbt/view/viewIssues.php');
+		include($gfplugins.$mantisbt->name."/view/viewIssues.php");
 		break;
 	}
 }
 
-?>
+?>
\ No newline at end of file

Modified: trunk/src/plugins/mantisbt/www/index.php
===================================================================
--- trunk/src/plugins/mantisbt/www/index.php	2011-02-24 17:51:54 UTC (rev 12353)
+++ trunk/src/plugins/mantisbt/www/index.php	2011-02-24 18:05:37 UTC (rev 12354)
@@ -75,6 +75,25 @@
 		}
 
 		$mantisbtConf = $mantisbt->getMantisBTConf($group_id);
+
+		switch ($action) {
+			case "updateIssue":
+			case "addNote":
+			case "addIssue":
+			case "deleteNote":
+			case "addAttachment":
+			case "deleteAttachment": {
+				include ("mantisbt/action/$action.php");
+				break;
+			}
+			case "updateNote":
+			case "privateNote":
+			case "publicNote": {
+				include ("mantisbt/action/updateNote.php");
+				break;
+			}
+		}
+
 		$mantisbt->getHeader('project');
 
 		if ($mantisbtConf['id_mantisbt'] === 0) {




More information about the Fusionforge-commits mailing list