[Fusionforge-commits] FusionForge branch master updated. v6.0.5-1946-gdab823f

Franck Villaume nerville at libremir.placard.fr.eu.org
Tue Jun 20 16:23:39 CEST 2017


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  dab823ff7f06f2e526c479f9f60535f6ea247bdc (commit)
      from  9fa15efd7ba1cee6ea88042899b0e9d75838668f (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=dab823ff7f06f2e526c479f9f60535f6ea247bdc

commit dab823ff7f06f2e526c479f9f60535f6ea247bdc
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Tue Jun 20 14:23:31 2017 +0000

    adjust tracker widget & scmhook to implement commits tab

diff --git a/src/common/widget/Widget_TrackerComment.class.php b/src/common/widget/Widget_TrackerComment.class.php
index e28cf4e..f558c79 100644
--- a/src/common/widget/Widget_TrackerComment.class.php
+++ b/src/common/widget/Widget_TrackerComment.class.php
@@ -2,7 +2,7 @@
 /**
  * Comment Tracker Content Widget Class
  *
- * Copyright 2016, Franck Villaume - TrivialDev
+ * Copyright 2016-2017, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is a part of Fusionforge.
@@ -161,9 +161,18 @@ class Widget_TrackerComment extends Widget {
 		$tabberContent .= html_e('div', array('id' => 'tabber-attachments', 'class' => 'tabbertab'),
 						$attachmentContent, false);
 		if ($pluginfound) {
-			//TODO: implement it!!!
+			$params = array();
+			$params['group_id'] = $group_id;
+			$params['artifact_id'] = $aid;
+			$params['content'] = '';
+			plugin_hook_by_reference('artifact_extra_detail', $params);
+			if ($params['content'] == '') {
+				$divcontent = $HTML->information(_('No related commits.'));
+			} else {
+				$divcontent = $HTML->listTableTop(array(), array(), 'full').$params['content'].$HTML->listTableBottom();
+			}
 			$tabberContent .= html_e('div', array('id' => 'tabber-commits', 'class' => 'tabbertab'),
-							'', false);
+							$divcontent, false);
 		}
 		if ($func == 'detail') {
 			$tabberContent .= html_e('div', array('id' => 'tabber-changes', 'class' => 'tabbertab'),
diff --git a/src/plugins/scmhook/common/scmhookPlugin.class.php b/src/plugins/scmhook/common/scmhookPlugin.class.php
index b1d990e..5864342 100644
--- a/src/plugins/scmhook/common/scmhookPlugin.class.php
+++ b/src/plugins/scmhook/common/scmhookPlugin.class.php
@@ -3,8 +3,8 @@
  * scmhookPlugin Class
  * Copyright 2011, Franck Villaume - Capgemini
  * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
- * Copyright 2012-2014, Franck Villaume - TrivialDev
  * Copyright 2012, Benoit Debaenst - TrivialDev
+ * Copyright 2012-2014,2017, Franck Villaume - TrivialDev
  * Copyright 2014, Sylvain Beucler - Inria
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -273,7 +273,7 @@ project independently.");
 		return $validHooks;
 	}
 
-	function artifact_extra_detail($params) {
+	function artifact_extra_detail(&$params) {
 		$hooksAvailable = $this->getAvailableHooks($params['group_id']);
 		$hooksEnabled = $this->getEnabledHooks($params['group_id']);
 		foreach ($hooksAvailable as $hookAvailable) {
diff --git a/src/plugins/scmhook/library/scmgit/commitTracker.class.php b/src/plugins/scmhook/library/scmgit/commitTracker.class.php
index f1428ba..9c588f1 100644
--- a/src/plugins/scmhook/library/scmgit/commitTracker.class.php
+++ b/src/plugins/scmhook/library/scmgit/commitTracker.class.php
@@ -6,7 +6,7 @@
  * Copyright 2011, Franck Villaume - Capgemini
  * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
  * Copyright 2013-2014, Benoit Debaenst - TrivialDev
- * Copyright 2014,2016, Franck Villaume - TrivialDev
+ * Copyright 2014,2016-2017, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -56,7 +56,7 @@ class GitCommitTracker extends scmhook {
 		return $this->disabledMessage;
 	}
 
-	function artifact_extra_detail($params) {
+	function artifact_extra_detail(&$params) {
 		global $HTML;
 		$DBResult = db_query_params('SELECT * FROM plugin_scmhook_scmgit_committracker_data_master, plugin_scmhook_scmgit_committracker_data_artifact
 						WHERE plugin_scmhook_scmgit_committracker_data_artifact.group_artifact_id = $1
@@ -69,7 +69,7 @@ class GitCommitTracker extends scmhook {
 			$return = $this->getCommitEntries($DBResult, $params['group_id']);
 		}
 		if (isset($params['content'])) {
-			$params['content'] = $return;
+			$params['content'] .= $return;
 		} else {
 			echo $return;
 		}
@@ -78,8 +78,8 @@ class GitCommitTracker extends scmhook {
 	function task_extra_detail($params) {
 		$return = '';
 		$DBResult = db_query_params ('SELECT * FROM plugin_scmhook_scmgit_committracker_data_master, plugin_scmhook_scmgit_committracker_data_artifact
-						WHERE plugin_scmhook_scmgit_committracker_data_artifact.project_task_id=$1
-						AND plugin_scmhook_scmgit_committracker_data_master.holder_id=plugin_scmhook_scmgit_committracker_data_artifact.id
+						WHERE plugin_scmhook_scmgit_committracker_data_artifact.project_task_id = $1
+						AND plugin_scmhook_scmgit_committracker_data_master.holder_id = plugin_scmhook_scmgit_committracker_data_artifact.id
 						ORDER BY git_date',
 						array($params['task_id']));
 		if (!$DBResult) {
@@ -104,18 +104,17 @@ class GitCommitTracker extends scmhook {
 	function getCommitEntries($DBResult, $group_id) {
 		global $HTML;
 		$group = group_get_object($group_id);
-		$Rows= db_numrows($DBResult);
+		$Rows = db_numrows($DBResult);
 		$return = '';
 
 		if ($Rows > 0) {
-			echo '<tr><td>';
+			$return .= '<tr><td>';
 			$return .= html_e('h2', array(), _('Related Git commits'), false);
 
 			$title_arr = $this->getTitleArr($group_id);
 			$return .= $HTML->listTableTop($title_arr);
 
-			for ($i=0; $i<$Rows; $i++) {
-				$Row = db_fetch_array($DBResult);
+			while ($Row = db_fetch_array($DBResult)) {
 				$cells = array();
 				$cells[][] = $this->getFileLink($group->getUnixName(), $Row['file'], $Row['actual_version']);
 				$cells[][] = date(_('Y-m-d'), $Row['git_date']);
diff --git a/src/plugins/scmhook/library/scmsvn/commitTracker.class.php b/src/plugins/scmhook/library/scmsvn/commitTracker.class.php
index 1712534..98f843b 100644
--- a/src/plugins/scmhook/library/scmsvn/commitTracker.class.php
+++ b/src/plugins/scmhook/library/scmsvn/commitTracker.class.php
@@ -5,7 +5,7 @@
  * Copyright 2005, Guillaume Smet <guillaume-gforge at smet.org>
  * Copyright 2011, Franck Villaume - Capgemini
  * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
- * Copyright 2014, Franck Villaume - TrivialDev
+ * Copyright 2014,2017, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -55,17 +55,23 @@ class SvnCommitTracker extends scmhook {
 		return $this->disabledMessage;
 	}
 
-	function artifact_extra_detail($params) {
+	function artifact_extra_detail(&$params) {
 		$DBResult = db_query_params('SELECT * FROM plugin_scmhook_scmsvn_committracker_data_master, plugin_scmhook_scmsvn_committracker_data_artifact
 						WHERE plugin_scmhook_scmsvn_committracker_data_artifact.group_artifact_id = $1
 						AND plugin_scmhook_scmsvn_committracker_data_master.holder_id = plugin_scmhook_scmsvn_committracker_data_artifact.id
 						ORDER BY svn_date',
 						array($params['artifact_id']));
 		if (!$DBResult) {
-			echo $HTML->error_msg(_('Unable to retrieve data'));
+			$return = $HTML->error_msg(_('Unable to retrieve data'));
 		} else {
-			$this->getCommitEntries($DBResult, $params['group_id']);
+			$return = $this->getCommitEntries($DBResult, $params['group_id']);
 		}
+                if (isset($params['content'])) {
+                        $params['content'] .= $return;
+                } else {
+                        echo $return;
+                }
+
 	}
 
 	function task_extra_detail($params) {
@@ -93,14 +99,14 @@ class SvnCommitTracker extends scmhook {
 		global $HTML;
 		$group = group_get_object($group_id);
 		$Rows= db_numrows($DBResult);
+		$return = '';
 
 		if ($Rows > 0) {
-			echo "<tr>\n";
-			echo "<td>\n";
-			echo html_e('h2', array(), _('Related SVN commits'), false);
+			$return .= "<tr><td>\n";
+			$return .= html_e('h2', array(), _('Related SVN commits'), false);
 
 			$title_arr = $this->getTitleArr();
-			echo $HTML->listTableTop($title_arr);
+			$return .= $HTML->listTableTop($title_arr);
 
 			for ($i=0; $i<$Rows; $i++) {
 				$Row = db_fetch_array($DBResult);
@@ -111,12 +117,12 @@ class SvnCommitTracker extends scmhook {
 				$cells[][] = $this->getActualVersionLink($group->getUnixName(), $Row['file'], $Row['actual_version']);
 				$cells[][] = htmlspecialchars($Row['log_text']);
 				$cells[][] = util_make_link_u($Row['author'], user_get_object_by_name($Row['author'])->getId(), $Row['author']);
-				echo $HTML->multiTableRow(array(), $cells);
+				$return .= $HTML->multiTableRow(array(), $cells);
 			}
-			echo $HTML->listTableBottom();
-			echo "</td>\n";
-			echo "</tr>\n";
+			$return .= $HTML->listTableBottom();
+			$return .= "</td></tr>\n";
 		}
+		return $return;
 	}
 
 	/**

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

Summary of changes:
 src/common/widget/Widget_TrackerComment.class.php  | 15 ++++++++---
 src/plugins/scmhook/common/scmhookPlugin.class.php |  4 +--
 .../scmhook/library/scmgit/commitTracker.class.php | 17 ++++++------
 .../scmhook/library/scmsvn/commitTracker.class.php | 30 +++++++++++++---------
 4 files changed, 40 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list