[Fusionforge-commits] FusionForge branch master updated. v6.0.5-1448-g2e9e578

Franck Villaume nerville at libremir.placard.fr.eu.org
Tue Feb 14 05:10:48 CET 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  2e9e578eaed25d8231c56d1ee14edc7b69d87025 (commit)
      from  707c0b35fac3b3871d6d78c786287000d8c6d735 (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=2e9e578eaed25d8231c56d1ee14edc7b69d87025

commit 2e9e578eaed25d8231c56d1ee14edc7b69d87025
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Tue Feb 14 05:09:55 2017 +0100

    tracker cloning display layout fix

diff --git a/src/common/tracker/ArtifactType.class.php b/src/common/tracker/ArtifactType.class.php
index 34709fd..4954ced 100644
--- a/src/common/tracker/ArtifactType.class.php
+++ b/src/common/tracker/ArtifactType.class.php
@@ -7,7 +7,7 @@
  * Copyright 2009, Roland Mas
  * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
  * Copyright 2012, Thorsten “mirabilos” Glaser <t.glaser at tarent.de>
- * Copyright 2014,2016, Franck Villaume - TrivialDev
+ * Copyright 2014,2016-2017, Franck Villaume - TrivialDev
  * Copyright 2016-2017, Stéphane-Eymeric Bredthauer - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -854,8 +854,8 @@ class ArtifactType extends FFError {
 		// do not filter and get disabled fields as well
 		$efs = $at->getExtraFields(array(), true);
 
-		// get current getExtraFields if any
-		$current_efs = $this->getExtraFields();
+		// get current getExtraFields if any and includes disabled fields as well...
+		$current_efs = $this->getExtraFields(array(), true);
 
 		//
 		//	Iterate list of extra fields
diff --git a/src/common/widget/WidgetLayoutManager.class.php b/src/common/widget/WidgetLayoutManager.class.php
index b546d13..ef855f3 100644
--- a/src/common/widget/WidgetLayoutManager.class.php
+++ b/src/common/widget/WidgetLayoutManager.class.php
@@ -223,22 +223,23 @@ class WidgetLayoutManager {
 	}
 
 	function createDefaultLayoutForTracker($owner_id, $template_id = 0, $newEFIds = array()) {
+		var_dump($owner_id);
 		db_begin();
 		$success = true;
 		$notemplate = true;
+		$res = db_query_params('SELECT content_id FROM layouts_contents WHERE content_id != $1 AND owner_type = $2 AND owner_id = $3', array(0, 't', $owner_id));
+		if ($res && db_numrows($res) > 0) {
+			$contentIdArr = util_result_column_to_array($res);
+			foreach ($contentIdArr as $contentId) {
+				db_query_params('DELETE FROM artifact_display_widget_field WHERE id = $1', array($contentId));
+				db_query_params('DELETE FROM artifact_display_widget WHERE id = $1 AND owner_id = $2', array($contentId, $owner_id));
+			}
+		}
+		db_query_params('DELETE FROM layouts_contents WHERE owner_id = $1 AND owner_type = $2', array($owner_id, 't'));
+		db_query_params('DELETE FROM owner_layouts WHERE owner_id = $1 AND owner_type = $2', array($owner_id, 't'));
 		if ($template_id) {
 			$res = db_query_params('SELECT layout_id FROM owner_layouts WHERE owner_type = $1 AND owner_id = $2', array(self::OWNER_TYPE_TRACKER, $template_id));
 			if ($res && db_numrows($res) == 1) {
-				$res = db_query_params('SELECT content_id FROM layouts_contents WHERE content_id != $1 AND owner_type = $2 AND owner_id = $3', array(0, 't', $owner_id));
-				if ($res && db_numrows($res) > 0) {
-					$contentIdArr = util_result_column_to_array($res);
-					foreach ($contentIdArr as $contentId) {
-						db_query_params('DELETE FROM artifact_display_widget_field WHERE id = $1', array($contentId));
-						db_query_params('DELETE FROM artifact_display_widget WHERE id = $1 AND owner_id = $2', array($contentId, $owner_id));
-					}
-				}
-				db_query_params('DELETE FROM layouts_contents WHERE owner_id = $1 AND owner_type = $2', array($owner_id, 't'));
-				db_query_params('DELETE FROM owner_layouts WHERE owner_id = $1 AND owner_type = $2', array($owner_id, 't'));
 				$res = db_query_params('INSERT INTO owner_layouts(layout_id, is_default, owner_id, owner_type)
 						SELECT layout_id, is_default, $1, owner_type
 						FROM owner_layouts

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

Summary of changes:
 src/common/tracker/ArtifactType.class.php       |  6 +++---
 src/common/widget/WidgetLayoutManager.class.php | 21 +++++++++++----------
 2 files changed, 14 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list