[Fusionforge-commits] FusionForge branch 6.1 updated. v6.1beta1-146-g145d14f

Franck Villaume nerville at libremir.placard.fr.eu.org
Sun Feb 11 17:40:14 CET 2018


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, 6.1 has been updated
       via  145d14ff2cb1ce69afba5731577ba1be210840cf (commit)
      from  3b0b77e65ee70adfb9b323c2487ae219857dc249 (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 -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=145d14ff2cb1ce69afba5731577ba1be210840cf

commit 145d14ff2cb1ce69afba5731577ba1be210840cf
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Feb 11 17:39:57 2018 +0100

    SCM admin page: make it allow_multiple_scm friendly

diff --git a/src/plugins/scmarch/common/ArchPlugin.class.php b/src/plugins/scmarch/common/ArchPlugin.class.php
index 3718ed2..f6075d4 100644
--- a/src/plugins/scmarch/common/ArchPlugin.class.php
+++ b/src/plugins/scmarch/common/ArchPlugin.class.php
@@ -121,7 +121,23 @@ some control over it to the project's administrator.");
 			system ("rm -rf $tmp") ;
 		}
 	}
-  }
+
+	function scm_admin_form(&$params) {
+		global $HTML;
+		$project = $this->checkParams($params);
+		if (!$project) {
+			return false;
+		}
+		session_require_perm('project_admin', $params['group_id']);
+
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ao('div', array('id' => 'tabber-'.$this->name, 'class' => 'tabbertab'));
+		}
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ac(html_ap() - 1);
+		}
+	}
+}
 
 // Local Variables:
 // mode: php
diff --git a/src/plugins/scmbzr/common/BzrPlugin.class.php b/src/plugins/scmbzr/common/BzrPlugin.class.php
index 1fdca11..0dd940b 100644
--- a/src/plugins/scmbzr/common/BzrPlugin.class.php
+++ b/src/plugins/scmbzr/common/BzrPlugin.class.php
@@ -522,6 +522,22 @@ over it to the project's administrator.");
 			system ("rm -rf $tmp") ;
 		}
 	}
+
+	function scm_admin_form(&$params) {
+		global $HTML;
+		$project = $this->checkParams($params);
+		if (!$project) {
+			return false;
+		}
+		session_require_perm('project_admin', $params['group_id']);
+
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ao('div', array('id' => 'tabber-'.$this->name, 'class' => 'tabbertab'));
+		}
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ac(html_ap() - 1);
+		}
+	}
 }
 
 // Local Variables:
diff --git a/src/plugins/scmccase/common/CCasePlugin.class.php b/src/plugins/scmccase/common/CCasePlugin.class.php
index 7fdaffe..710dec5 100644
--- a/src/plugins/scmccase/common/CCasePlugin.class.php
+++ b/src/plugins/scmccase/common/CCasePlugin.class.php
@@ -217,7 +217,23 @@ class CCasePlugin extends SCMPlugin {
 
 		// TODO (by someone who uses ClearCase): trigger repository creation
 	}
-  }
+
+	function scm_admin_form(&$params) {
+		global $HTML;
+		$project = $this->checkParams($params);
+		if (!$project) {
+			return false;
+		}
+		session_require_perm('project_admin', $params['group_id']);
+
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ao('div', array('id' => 'tabber-'.$this->name, 'class' => 'tabbertab'));
+		}
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ac(html_ap() - 1);
+		}
+	}
+}
 
 // Local Variables:
 // mode: php
diff --git a/src/plugins/scmcpold/common/CpoldPlugin.class.php b/src/plugins/scmcpold/common/CpoldPlugin.class.php
index 684f0d5..1a3278a 100644
--- a/src/plugins/scmcpold/common/CpoldPlugin.class.php
+++ b/src/plugins/scmcpold/common/CpoldPlugin.class.php
@@ -174,6 +174,22 @@ class CpoldPlugin extends SCMPlugin {
 		unlink ("$tmp/tarball.tar.gz") ;
 		system ("rm -rf $tmp") ;
 	}
+
+	function scm_admin_form(&$params) {
+		global $HTML;
+		$project = $this->checkParams($params);
+		if (!$project) {
+			return false;
+		}
+		session_require_perm('project_admin', $params['group_id']);
+
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ao('div', array('id' => 'tabber-'.$this->name, 'class' => 'tabbertab'));
+		}
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ac(html_ap() - 1);
+		}
+	}
 }
 
 // Local Variables:
diff --git a/src/plugins/scmcvs/common/CVSPlugin.class.php b/src/plugins/scmcvs/common/CVSPlugin.class.php
index c3979c1..fda3b17 100644
--- a/src/plugins/scmcvs/common/CVSPlugin.class.php
+++ b/src/plugins/scmcvs/common/CVSPlugin.class.php
@@ -135,8 +135,7 @@ over it to the project's administrator.");
 		return $b ;
 	}
 
-	function getSnapshotPara ($project) {
-
+	function getSnapshotPara($project) {
 		$b = "" ;
 		$filename = $project->getUnixName().'-scm-latest.tar'.util_get_compressed_file_extension();
 		if (file_exists(forge_get_config('scm_snapshots_path').'/'.$filename)) {
@@ -499,7 +498,23 @@ over it to the project's administrator.");
 			system ("rm -rf $tmp") ;
 		}
 	}
-  }
+
+	function scm_admin_form(&$params) {
+		global $HTML;
+		$project = $this->checkParams($params);
+		if (!$project) {
+			return false;
+		}
+		session_require_perm('project_admin', $params['group_id']);
+
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ao('div', array('id' => 'tabber-'.$this->name, 'class' => 'tabbertab'));
+		}
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ac(html_ap() - 1);
+		}
+	}
+}
 
 // Local Variables:
 // mode: php
diff --git a/src/plugins/scmdarcs/common/DarcsPlugin.class.php b/src/plugins/scmdarcs/common/DarcsPlugin.class.php
index 4569a49..0f6cd30 100644
--- a/src/plugins/scmdarcs/common/DarcsPlugin.class.php
+++ b/src/plugins/scmdarcs/common/DarcsPlugin.class.php
@@ -641,6 +641,21 @@ over it to the project's administrator.");
 		}
 	}
 
+	function scm_admin_form(&$params) {
+		global $HTML;
+		$project = $this->checkParams($params);
+		if (!$project) {
+			return false;
+		}
+		session_require_perm('project_admin', $params['group_id']);
+
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ao('div', array('id' => 'tabber-'.$this->name, 'class' => 'tabbertab'));
+		}
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ac(html_ap() - 1);
+		}
+	}
 }
 
 function DarcsPluginStartElement($parser, $name, $attrs) {
diff --git a/src/plugins/scmgit/common/GitPlugin.class.php b/src/plugins/scmgit/common/GitPlugin.class.php
index 4966b8b..12ee188 100644
--- a/src/plugins/scmgit/common/GitPlugin.class.php
+++ b/src/plugins/scmgit/common/GitPlugin.class.php
@@ -1148,6 +1148,10 @@ control over it to the project's administrator.");
 
 		session_require_perm('project_admin', $params['group_id']);
 
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ao('div', array('id' => 'tabber-'.$this->name, 'class' => 'tabbertab'));
+		}
+
 		$project_name = $project->getUnixName();
 
 		$result = db_query_params('SELECT repo_name, description, clone_url FROM scm_secondary_repos WHERE group_id=$1 AND next_action = $2 AND plugin_id=$3 ORDER BY repo_name',
@@ -1204,6 +1208,9 @@ control over it to the project's administrator.");
 		echo $HTML->html_input('cancel', '', '', 'submit', _('Cancel'), array(), array('style' => 'display: inline-block!important'));
 		echo $HTML->html_input('submit', '', '', 'submit', _('Submit'), array(), array('style' => 'display: inline-block!important'));
 		echo $HTML->closeForm();
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ac(html_ap() - 1);
+		}
 	}
 
 	function getCommits($project, $user = null, $nb_commits) {
diff --git a/src/plugins/scmhg/common/HgPlugin.class.php b/src/plugins/scmhg/common/HgPlugin.class.php
index 5f6fdc4..7b1ef11 100644
--- a/src/plugins/scmhg/common/HgPlugin.class.php
+++ b/src/plugins/scmhg/common/HgPlugin.class.php
@@ -874,6 +874,9 @@ Offer DAV or SSH access.");
 		}
 
 		session_require_perm('project_admin', $params['group_id']);
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ao('div', array('id' => 'tabber-'.$this->name, 'class' => 'tabbertab'));
+		}
 
 		$project_name = $project->getUnixName();
 		$result = db_query_params('SELECT repo_name, description FROM scm_secondary_repos WHERE group_id=$1 AND next_action = $2 AND plugin_id=$3 ORDER BY repo_name',
@@ -926,6 +929,9 @@ Offer DAV or SSH access.");
 		echo html_e('input', array('type' => 'submit', 'name' => 'cancel', 'value' => _('Cancel')));
 		echo html_e('input', array('type' => 'submit', 'name' => 'submit', 'value' => _('Submit')));
 		echo $HTML->closeForm();
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ac(html_ap() - 1);
+		}
 	}
 
 	function getRepositories($group, $autoinclude = true) {
diff --git a/src/plugins/scmsvn/common/SVNPlugin.class.php b/src/plugins/scmsvn/common/SVNPlugin.class.php
index 622745c..84da697 100644
--- a/src/plugins/scmsvn/common/SVNPlugin.class.php
+++ b/src/plugins/scmsvn/common/SVNPlugin.class.php
@@ -872,6 +872,22 @@ some control over it to the project's administrator.");
 			}
 		}
 	}
+
+	function scm_admin_form(&$params) {
+		global $HTML;
+		$project = $this->checkParams($params);
+		if (!$project) {
+			return false;
+		}
+		session_require_perm('project_admin', $params['group_id']);
+
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ao('div', array('id' => 'tabber-'.$this->name, 'class' => 'tabbertab'));
+		}
+		if (forge_get_config('allow_multiple_scm') && ($params['allow_multiple_scm'] > 1)) {
+			echo html_ac(html_ap() - 1);
+		}
+	}
 }
 
 // End of class, helper functions now
diff --git a/src/www/scm/admin/index.php b/src/www/scm/admin/index.php
index 78f0347..f910223 100644
--- a/src/www/scm/admin/index.php
+++ b/src/www/scm/admin/index.php
@@ -183,6 +183,7 @@ if (count($scm_plugins) != 0) {
 					$inputAttr['type'] = 'radio';
 			}
 			if ($group->usesPlugin($myPlugin->name)) {
+				$scmPluginObjects[] = $myPlugin;
 				$scm = $myPlugin->name;
 				$inputAttr['checked'] = 'checked';
 			}
@@ -200,7 +201,23 @@ echo html_e('input', array('type' => 'hidden', 'name' => 'group_id', 'value' =>
 echo html_e('p', array(), html_e('input', array('type' => 'submit', 'name' => 'submit', 'value' => _('Update'))));
 echo $HTML->closeForm();
 
+if (forge_get_config('allow_multiple_scm') && (count($scmPluginObjects) > 1)) {
+	$elementsLi = array();
+	foreach ($scmPluginObjects as $scmPluginObject) {
+		$elementsLi[] = array('content' => util_make_link('#tabber-'.$scmPluginObject->name, $scmPluginObject->text, false, true));
+	}
+	echo html_ao('div', array('id' => 'tabberid'));
+	echo $HTML->html_list($elementsLi);
+}
+
+$hook_params['allow_multiple_scm'] = count($scmPluginObjects);
 plugin_hook('scm_admin_form', $hook_params);
+
+if (forge_get_config('allow_multiple_scm') && (count($scmPluginObjects) > 1)) {
+	echo html_ac(html_ap() - 1);
+}
+
+echo html_e('script', array('type'=>'text/javascript'), '//<![CDATA['."\n".'jQuery("[id^=tabber]").tabs();'."\n".'//]]>');
 scm_footer();
 
 // Local Variables:

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

Summary of changes:
 src/plugins/scmarch/common/ArchPlugin.class.php   | 18 +++++++++++++++++-
 src/plugins/scmbzr/common/BzrPlugin.class.php     | 16 ++++++++++++++++
 src/plugins/scmccase/common/CCasePlugin.class.php | 18 +++++++++++++++++-
 src/plugins/scmcpold/common/CpoldPlugin.class.php | 16 ++++++++++++++++
 src/plugins/scmcvs/common/CVSPlugin.class.php     | 21 ++++++++++++++++++---
 src/plugins/scmdarcs/common/DarcsPlugin.class.php | 15 +++++++++++++++
 src/plugins/scmgit/common/GitPlugin.class.php     |  7 +++++++
 src/plugins/scmhg/common/HgPlugin.class.php       |  6 ++++++
 src/plugins/scmsvn/common/SVNPlugin.class.php     | 16 ++++++++++++++++
 src/www/scm/admin/index.php                       | 17 +++++++++++++++++
 10 files changed, 145 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list