[Fusionforge-commits] FusionForge branch master updated. v6.0.5-1359-gfd4ba07

Franck Villaume nerville at libremir.placard.fr.eu.org
Thu Jan 19 23:54:09 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  fd4ba075aa63181b2f4765cee24caf810a556d0d (commit)
      from  32c9dc9d74d034e0ca7135749dd9c24dce9d5ae3 (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=fd4ba075aa63181b2f4765cee24caf810a556d0d

commit fd4ba075aa63181b2f4765cee24caf810a556d0d
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Thu Jan 19 23:53:26 2017 +0100

    remove limitation about templating trackers. all template trackers can be used. not only the default "template project"

diff --git a/src/common/tracker/views/form-clonetracker.php b/src/common/tracker/views/form-clonetracker.php
index 24cbc56..4320552 100644
--- a/src/common/tracker/views/form-clonetracker.php
+++ b/src/common/tracker/views/form-clonetracker.php
@@ -3,7 +3,7 @@
  * FusionForge Tracker Cloning Form
  *
  * Copyright 2010, FusionForge Team
- * Copyright 2014-2015	, Franck Villaume - TrivialDev
+ * Copyright 2014-2015,2017, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -23,50 +23,47 @@
  */
 
 global $HTML;
-
-$g = group_get_object(forge_get_config('template_group'));
-if (!$g || !is_object($g)) {
+global $ath;
+$arr_g = group_get_template_projects();
+if (!$arr_g || !is_array($arr_g)) {
 	exit_no_group();
-} elseif ($g->isError()) {
-	exit_error($g->getErrorMessage(),'tracker');
-} else {
-	$atf = new ArtifactTypeFactory($g);
-	if (!$atf || !is_object($atf)) {
-		exit_error(_('Unable to Create Template Group Object'),'tracker');
-	} elseif ($atf->isError()) {
-		exit_error($atf->getErrorMessage(),'tracker');
-	} else {
-		$ata = $atf->getArtifactTypes();
-		$ids = array();
-		$titles = array();
-		for ($i=0; $i<count($ata); $i++) {
-			if (!$ata[$i] || $ata[$i]->isError()) {
-//skip it
-			} else {
-				$ids[]=$ata[$i]->getID();
-				$titles[]=$g->getPublicName().'::'.$ata[$i]->getName();
+}
+$ids = array();
+$titles = array();
+foreach ($arr_g as $g) {
+	if (!$g->isError()) {
+		$atf = new ArtifactTypeFactory($g);
+		if ($atf && is_object($atf) && !$atf->isError()) {
+			$ata = $atf->getArtifactTypes();
+			for ($i=0; $i<count($ata); $i++) {
+				if (!$ata[$i] || $ata[$i]->isError()) {
+	//skip it
+				} else {
+					$ids[]=$ata[$i]->getID();
+					$titles[]=$g->getPublicName().'::'.$ata[$i]->getName();
+				}
 			}
 		}
+	}
+}
 
-		$ath->adminHeader(array ('title'=>_('Clone Tracker'), 'modal'=>1));
+$ath->adminHeader(array ('title'=>_('Clone Tracker'), 'modal'=>1));
 
-		if (empty($ata)) {
-			echo $HTML->warning_msg(_('The site administrator must first set up template trackers in the template project with default values and set permissions properly so you can access them.'));
-		} else {
-			?>
-			<p><?php echo _('Choose the template tracker to clone.') ?></p>
-			<?php
-			echo $HTML->openForm(array('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID(), 'method' => 'post'));
-			?>
-			<input type="hidden" name="clone_tracker" value="y" />
-			<?php
-			echo $HTML->warning_msg(_('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!'));
-			?>
-			<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') ?>" />
-			<?php
-			echo $HTML->closeForm();
-		}
-		$ath->footer();
-	}
+if (count($ids) < 1) {
+	echo $HTML->warning_msg(_('The site administrator must first set up template trackers in the template project with default values and set permissions properly so you can access them.'));
+} else {
+	?>
+	<p><?php echo _('Choose the template tracker to clone.') ?></p>
+	<?php
+	echo $HTML->openForm(array('/tracker/admin/?group_id='.$group_id.'&atid='.$ath->getID(), 'method' => 'post'));
+	?>
+	<input type="hidden" name="clone_tracker" value="y" />
+	<?php
+	echo $HTML->warning_msg(_('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!'));
+	?>
+	<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') ?>" />
+	<?php
+	echo $HTML->closeForm();
 }
+$ath->footer();

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

Summary of changes:
 src/common/tracker/views/form-clonetracker.php | 81 +++++++++++++-------------
 1 file changed, 39 insertions(+), 42 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list