[Fusionforge-commits] FusionForge branch Branch_5_3 updated. 0371729b6c96b8a5ac6e65871fb2fbf6327ce8de

Franck VILLAUME nerville at fusionforge.org
Thu Feb 6 16:58:08 CET 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, Branch_5_3 has been updated
       via  0371729b6c96b8a5ac6e65871fb2fbf6327ce8de (commit)
      from  df3e42562e704117e51293b447a9263ffa46e96e (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 0371729b6c96b8a5ac6e65871fb2fbf6327ce8de
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Feb 6 16:54:08 2014 +0100

    merge from Branch_5_2: fix [#193]

diff --git a/src/common/tracker/ArtifactType.class.php b/src/common/tracker/ArtifactType.class.php
index 45d3dbe..ec6769a 100644
--- a/src/common/tracker/ArtifactType.class.php
+++ b/src/common/tracker/ArtifactType.class.php
@@ -7,6 +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, 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
@@ -653,6 +654,9 @@ class ArtifactType extends Error {
 		}
 		$efs = $at->getExtraFields();
 
+		// get current getExtraFields if any
+		$current_efs = $this->getExtraFields();
+
 		//
 		//	Iterate list of extra fields
 		//
@@ -660,6 +664,13 @@ class ArtifactType extends Error {
 		foreach ($efs as $ef) {
 			//new field in this tracker
 			$nef = new ArtifactExtraField($this);
+			foreach ($current_efs as $current_ef) {
+				if ($current_ef['field_name'] == $ef['field_name']) {
+					// we delete the current extra field and use the template one...
+					$current_ef_todelete = new ArtifactExtraField($this, $current_ef);
+					$current_ef_todelete->delete(true,true);
+				}
+			}
 			if (!$nef->create(util_unconvert_htmlspecialchars($ef['field_name']), $ef['field_type'], $ef['attribute1'], $ef['attribute2'], $ef['is_required'], $ef['alias'])) {
 				$this->setError('Error Creating New Extra Field: '.$nef->getErrorMessage());
 				db_rollback();
diff --git a/src/common/tracker/views/form-clonetracker.php b/src/common/tracker/views/form-clonetracker.php
index 9a4f33d..5096d17 100644
--- a/src/common/tracker/views/form-clonetracker.php
+++ b/src/common/tracker/views/form-clonetracker.php
@@ -3,6 +3,7 @@
  * FusionForge Tracker Cloning Form
  *
  * Copyright 2010, FusionForge Team
+ * Copyright 2014, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -54,7 +55,7 @@ if (!$g || !is_object($g)) {
 		<p><?php echo _('Choose the template tracker to clone.') ?></p>
 		<form action="<?php echo getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&atid='.$ath->getID(); ?>" method="post">
 		<input type="hidden" name="clone_tracker" value="y" />
-		<div class="warning" ><?php echo _('WARNING!!! Cloning this tracker will duplicate all the fields and all the elements from those fields into this tracker. There is nothing to prevent you from cloning multiple times or making a huge mess. You have been warned!') ?></div>
+		<div class="warning" ><?php echo _('WARNING!!! Cloning this tracker will duplicate all the fields and all the elements from those fields into this tracker. There is nothing to prevent you from cloning multiple times or making a huge mess. If you have preexisting extrafields with same name, they will be dropped. You have been warned!') ?></div>
 		<p><?php echo html_build_select_box_from_arrays($ids,$titles,'clone_id','',false); ?></p>
 		<input type="submit" name="post_changes" value="<?php echo _('Submit') ?>" />
 		</form>

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

Summary of changes:
 src/common/tracker/ArtifactType.class.php      |   11 +++++++++++
 src/common/tracker/views/form-clonetracker.php |    3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list