[Fusionforge-commits] FusionForge branch master updated. 5682b14bc5423892a47a9a02c6ca33f27a8dabcb

Franck Villaume nerville at fusionforge.org
Thu Sep 18 18:22:47 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  5682b14bc5423892a47a9a02c6ca33f27a8dabcb (commit)
       via  4e6f9e9c81549bfac32c6c7ec25bdb2450deda64 (commit)
       via  6efca935bc3c7f8d8cb1c695846750395e3c7af2 (commit)
      from  88d2520fec1057151f22e5f1be6a96fcdcd8508f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5682b14bc5423892a47a9a02c6ca33f27a8dabcb
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Sep 18 18:20:40 2014 +0200

    plugin mantisbt: user view only if there is available projects

diff --git a/src/plugins/mantisbt/www/index.php b/src/plugins/mantisbt/www/index.php
index 3174778..053914d 100644
--- a/src/plugins/mantisbt/www/index.php
+++ b/src/plugins/mantisbt/www/index.php
@@ -148,55 +148,66 @@ switch ($type) {
 		if (!($user) || !($user->usesPlugin($mantisbt->name))) {
 			exit_error(sprintf(_('First activate the User\'s %s plugin through Account Maintenance Page'), $mantisbt->name), 'my');
 		}
+		$projects = $user->getGroups();
+		$validProjectIds = array();
+		foreach ($projects as $project) {
+			if ($project->usesPlugin($mantisbt->name)) {
+				$validProjects[] = $project;
+			}
+		}
 
-		$action = getStringFromRequest('action');
-		$view = getStringFromRequest('view');
-		$sort = getStringFromRequest('sort');
-		$dir = getStringFromRequest('dir');
-		$action = getStringFromRequest('action');
-		$idBug = getStringFromRequest('idBug');
-		$idNote = getStringFromRequest('idNote');
-		$page = getStringFromRequest('page');
+		if (count($validProjects)) {
+			$action = getStringFromRequest('action');
+			$view = getStringFromRequest('view');
+			$sort = getStringFromRequest('sort');
+			$dir = getStringFromRequest('dir');
+			$action = getStringFromRequest('action');
+			$idBug = getStringFromRequest('idBug');
+			$idNote = getStringFromRequest('idNote');
+			$page = getStringFromRequest('page');
+
+			if ($view != 'inituser' && $action != 'inituser') {
+				$mantisbtConf = $mantisbt->getUserConf($user->getID());
+				if ($mantisbtConf) {
+					$username = $mantisbtConf['user'];
+					$password = $mantisbtConf['password'];
+					$mantisbt_userid = $mantisbtConf['mantisbt_userid'];
+				}  else {
+					$warning_msg = _('Your mantisbt user is not initialized.');
+					$redirect_url = '/plugins/'.$mantisbt->name.'/?type=user&pluginname='.$mantisbt->name.'&view=inituser';
+					session_redirect($redirect_url);
+				}
+			}
 
-		if ($view != 'inituser' && $action != 'inituser') {
-			$mantisbtConf = $mantisbt->getUserConf($user->getID());
-			if ($mantisbtConf) {
-				$username = $mantisbtConf['user'];
-				$password = $mantisbtConf['password'];
-				$mantisbt_userid = $mantisbtConf['mantisbt_userid'];
-			}  else {
-				$warning_msg = _('Your mantisbt user is not initialized.');
-				$redirect_url = '/plugins/'.$mantisbt->name.'/?type=user&pluginname='.$mantisbt->name.'&view=inituser';
-				session_redirect($redirect_url);
+			switch ($action) {
+				case 'inituser':
+				case 'updateIssue':
+				case 'updateNote':
+				case 'addNote':
+				case 'deleteNote':
+				case 'addAttachment':
+				case 'deleteAttachment':
+				case 'updateuserConf': {
+					include($gfplugins.$mantisbt->name.'/action/'.$action.'.php');
+					break;
+				}
 			}
-		}
 
-		switch ($action) {
-			case 'inituser':
-			case 'updateIssue':
-			case 'updateNote':
-			case 'addNote':
-			case 'deleteNote':
-			case 'addAttachment':
-			case 'deleteAttachment':
-			case 'updateuserConf': {
-				include($gfplugins.$mantisbt->name.'/action/'.$action.'.php');
-				break;
+			// Si la variable $_GET['page'] existe...
+			if($page != null && $page != '') {
+				$pageActuelle=intval($page);
+			} else {
+				$pageActuelle=1; // La page actuelle est la n°1
 			}
-		}
 
-		// Si la variable $_GET['page'] existe...
-		if($page != null && $page != '') {
-			$pageActuelle=intval($page);
+			$format = "%07d";
+			// do the job
+
+			$mantisbt->getHeader('user');
+			include($gfplugins.$mantisbt->name.'/www/user/index.php');
 		} else {
-			$pageActuelle=1; // La page actuelle est la n°1
+			echo $HTML->information(_('None of your projects are using MantisBT plugin.'));
 		}
-
-		$format = "%07d";
-		// do the job
-
-		$mantisbt->getHeader('user');
-		include($gfplugins.$mantisbt->name.'/www/user/index.php');
 		break;
 	}
 	case 'admin': {

commit 4e6f9e9c81549bfac32c6c7ec25bdb2450deda64
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Sep 18 18:20:08 2014 +0200

    plugin mantis: fix typo

diff --git a/src/plugins/mantisbt/view/init.php b/src/plugins/mantisbt/view/init.php
index ed9facd..87eece1 100644
--- a/src/plugins/mantisbt/view/init.php
+++ b/src/plugins/mantisbt/view/init.php
@@ -71,7 +71,7 @@ $cells[] = array(_('Create the project in MantisBT')._(':'), 'class' => 'align-r
 $cells[][] = html_e('input', array('title' => _('If this project does NOT exist in MantisBT, do you want to create it ? The current project name will be used.'), 'id' => 'mantisbtcreate', 'type' => 'checkbox', 'name' => 'mantisbtcreate', 'value' => 1));
 echo $HTML->multiTableRow(array(), $cells);
 $cells = array();
-$cells[] = array(_('Link with a existing project in MantisBT')._(':'), 'class' => 'align-right');
+$cells[] = array(_('Link with an existing project in MantisBT')._(':'), 'class' => 'align-right');
 $cells[][] = html_e('input', array('title' => _('Specify the name of the project already created in MantisBT'), 'id' => 'mantisbtname', 'type' => 'text', 'size' => 50, 'maxlength' => 255, 'name' => 'mantisbtname'));
 echo $HTML->multiTableRow(array(), $cells);
 // echo '<tr><td><label id="mantisbtinit-syncroles" title="'._('Do you want to sync FusionForge -> MantisBT roles ?').'" >Sync Roles</label></td><td><input disabled="disabled" type="checkbox" name="sync_roles" /></td></tr>';

commit 6efca935bc3c7f8d8cb1c695846750395e3c7af2
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Sep 18 18:04:54 2014 +0200

    plugin mantisbt: revamp init project

diff --git a/src/plugins/mantisbt/view/init.php b/src/plugins/mantisbt/view/init.php
index 77af439..ed9facd 100644
--- a/src/plugins/mantisbt/view/init.php
+++ b/src/plugins/mantisbt/view/init.php
@@ -3,7 +3,7 @@
  * MantisBT plugin
  *
  * Copyright 2011, Franck Villaume - Capgemini
- * Copyright 2011-2012, Franck Villaume - TrivialDev
+ * Copyright 2011-2012,2014 Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -27,8 +27,7 @@
 global $type;
 global $group_id;
 global $mantisbt;
-global $use_tooltips;
-
+global $HTML;
 ?>
 
 <script type="text/javascript">
@@ -49,36 +48,33 @@ jQuery(document).ready(function() {
 
 <?php
 
-echo '<form method="POST" Action="?type='.$type.'&group_id='.$group_id.'&pluginname='.$mantisbt->name.'&action=init" >';
-echo '<table>';
-echo '<tr><td><label id="mantisbtinit-global" ';
-if ($use_tooltips)
-	echo 'title="'._('Use the global configuration defined at forge level').'"';
-echo ' >'._('Use global configuration').'</label></td><td><input id="mantisbtglobalconf" type="checkbox" name="global_conf" value="1" /></td></tr>';
-echo '<tr><td><label id="mantisbtinit-url" ';
-if ($use_tooltips)
-	echo 'title="'._('Specify the Full URL of the MantisBT Web Server.').'"';
-echo ' >URL</label></td><td><input id="mantisbturl" type="text" size="50" maxlength="255" name="url" /></td></tr>';
-echo '<tr><td><label id="mantisbtinit-user" ';
-if ($use_tooltips)
-	echo 'title="'._('Specify the user with admin right to be used thru SOAP API.').'"';
-echo ' >SOAP User</label></td><td><input id="mantisbtuser" type="text" size="50" maxlength="255" name="soap_user" /></td></tr>';
-echo '<tr><td><label id="mantisbtinit-password" ';
-if ($use_tooltips)
-	echo 'title="'._('Specify the password of this user.').'"';
-echo ' >SOAP Password</label></td><td><input id="mantisbtpassword" type="text" size="50" maxlength="255" name="soap_password" /></td></tr>';
-echo '<tr><td><label id="mantisbtinit-create" ';
-if ($use_tooltips)
-	echo 'title="'._('If this project does NOT exist in MantisBT, do you want to create it ?').'"';
-echo ' >Create the project in MantisBT</label></td><td><input id="mantisbtcreate" type="checkbox" name="mantisbtcreate" value="1" /></td></tr>';
-echo '<tr><td><label id="mantisbtinit-name" ';
-if ($use_tooltips)
-	echo 'title="'._('Specify the name of the project in MantisBT if already created in MantisBT').'"';
-echo ' >Name of the project in MantisBT</label></td><td><input id="mantisbtname" type="text" size="50" maxlength="255" name="mantisbtname" /></td></tr>';
-echo '<tr><td><label id="mantisbtinit-syncroles" ';
-if ($use_tooltips)
-	echo 'title="'._('Do you want to sync FusionForge -> MantisBT roles ?').'"';
-echo ' >Sync Roles</label></td><td><input disabled="disabled" type="checkbox" name="sync_roles" /></td></tr>';
-echo '</table>';
-echo '<input type="submit" value="'._('Initialize').'" />';
-echo '</form>';
+echo $HTML->openForm(array('method' => 'post', 'action' => util_make_uri('/plugins/'.$mantisbt->name.'/?type='.$type.'&group_id='.$group_id.'&action=init')));
+echo $HTML->listTableTop();
+$cells = array();
+$cells[] = array(_('Use global configuration')._(':'), 'class' => 'align-right');
+$cells[][] = html_e('input', array('type' => 'checkbox', 'title' => _('Use the global configuration defined at forge level'), 'id' => 'mantisbtglobalconf', 'name' => 'global_conf', 'value' => 1));
+echo $HTML->multiTableRow(array(), $cells);
+$cells = array();
+$cells[] = array(_('URL')._(':'), 'class' => 'align-right');
+$cells[][] = html_e('input', array('id' => 'mantisbturl', 'title' => _('Specify the Full URL of the MantisBT Web Server.'), 'type' => 'url', 'size' => 50, 'maxlength' => 255, 'name' => 'url'));
+echo $HTML->multiTableRow(array(), $cells);
+$cells = array();
+$cells[] = array(_('SOAP User')._(':'), 'class' => 'align-right');
+$cells[][] = html_e('input', array('id' => 'mantisbtuser', 'title' => _('Specify the user with admin right to be used thru SOAP API.'), 'type' => 'text', 'size' => 50, 'maxlength' => 255, 'name' => 'soap_user'));
+echo $HTML->multiTableRow(array(), $cells);
+$cells = array();
+$cells[] = array(_('SOAP Password')._(':'), 'class' => 'align-right');
+$cells[][] = html_e('input', array('id' => 'mantisbtpassword', 'title' => _('Specify the password of this SOAP User.'), 'type' => 'password', 'size' => 50, 'maxlength' => 255, 'name' => 'soap_password'));
+echo $HTML->multiTableRow(array(), $cells);
+$cells = array();
+$cells[] = array(_('Create the project in MantisBT')._(':'), 'class' => 'align-right');
+$cells[][] = html_e('input', array('title' => _('If this project does NOT exist in MantisBT, do you want to create it ? The current project name will be used.'), 'id' => 'mantisbtcreate', 'type' => 'checkbox', 'name' => 'mantisbtcreate', 'value' => 1));
+echo $HTML->multiTableRow(array(), $cells);
+$cells = array();
+$cells[] = array(_('Link with a existing project in MantisBT')._(':'), 'class' => 'align-right');
+$cells[][] = html_e('input', array('title' => _('Specify the name of the project already created in MantisBT'), 'id' => 'mantisbtname', 'type' => 'text', 'size' => 50, 'maxlength' => 255, 'name' => 'mantisbtname'));
+echo $HTML->multiTableRow(array(), $cells);
+// echo '<tr><td><label id="mantisbtinit-syncroles" title="'._('Do you want to sync FusionForge -> MantisBT roles ?').'" >Sync Roles</label></td><td><input disabled="disabled" type="checkbox" name="sync_roles" /></td></tr>';
+echo $HTML->listTableBottom();
+echo html_e('input', array('type' => 'submit', 'value' => _('Initialize')));
+echo $HTML->closeForm();

-----------------------------------------------------------------------

Summary of changes:
 src/plugins/mantisbt/view/init.php |   68 +++++++++++++-------------
 src/plugins/mantisbt/www/index.php |   93 ++++++++++++++++++++----------------
 2 files changed, 84 insertions(+), 77 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list