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 09adceb2af8dc1ad1753cb2130258799f3b5b2ef (commit)
from b693ca4421dafbaa5e5bc4dac8de01096b9f5a0d (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=09adceb2af8dc1ad1753cb2130258799f3b5b2ef
commit 09adceb2af8dc1ad1753cb2130258799f3b5b2ef
Author: Franck Villaume <[email protected]>
Date: Wed Aug 24 12:48:49 2016 +0200
fix [#829] extrafield cloning when not using default template project
diff --git a/src/CHANGES b/src/CHANGES
index 3aaa340..a8883c1 100644
--- a/src/CHANGES
+++ b/src/CHANGES
@@ -25,6 +25,7 @@ FusionForge 6.X:
* Tracker: add new extrafield: User (TrivialDev)
* Tracker: add support for mandatory fields on workflow of artifact
(TrivialDev)
* Tracker: add support for description on extrafield to be used in tooltip
(TrivialDev)
+* Tracker: fix extrafield cloning when not using default template fusionforge
project [#829] (TrivialDev)
* Utils: cross ref document. Use [DNNN] where NNN is the ID of the document.
(TrivialDev)
* Web UI: upgrade splitter jquery plugin to 0.20.0 (TrivialDev)
* Web UI: upgrade jquery ui to 1.11.4 (TrivialDev)
diff --git a/src/common/include/Group.class.php
b/src/common/include/Group.class.php
index 8c58694..96ed724 100644
--- a/src/common/include/Group.class.php
+++ b/src/common/include/Group.class.php
@@ -2562,7 +2562,7 @@ class Group extends FFError {
$t = new ArtifactType ($this);
$t->create
($this->replaceTemplateStrings($o->getName()),$this->replaceTemplateStrings($o->getDescription()),$o->emailAll(),$o->getEmailAddress(),$o->getDuePeriod()/86400,0,$o->getSubmitInstructions(),$o->getBrowseInstructions());
$id_mappings['tracker'][$o->getID()] = $t->getID();
- $t->cloneFieldsFrom
($o->getID());
+
$t->cloneFieldsFrom($o->getID(), $o->Group->getID());
}
}
}
diff --git a/src/common/tracker/ArtifactType.class.php
b/src/common/tracker/ArtifactType.class.php
index 2cdbc7d..11dc710 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 <[email protected]>
- * Copyright 2014, Franck Villaume - TrivialDev
+ * Copyright 2014,2016, Franck Villaume - TrivialDev
* Copyright 2016, Stéphane-Eymeric Bredthauer - TrivialDev
*
* This file is part of FusionForge. FusionForge is free software;
@@ -653,11 +653,15 @@ class ArtifactType extends FFError {
* cloneFieldsFrom - clone all the fields and elements from another
tracker
*
* @param int $clone_tracker_id
+ * @param int $group_id id of the project
template to use.
* @return boolean true/false on success
*/
- function cloneFieldsFrom($clone_tracker_id) {
-
- $g = group_get_object(forge_get_config('template_group'));
+ function cloneFieldsFrom($clone_tracker_id, $group_id = null) {
+ if ($group_id) {
+ $g = group_get_object($group_id);
+ } else {
+ $g =
group_get_object(forge_get_config('template_group'));
+ }
if (!$g || !is_object($g)) {
$this->setError(_('Could Not Get Template Group'));
return false;
@@ -709,10 +713,14 @@ class ArtifactType extends FFError {
while ($el = db_fetch_array($resel)) {
//new element
$nel = new ArtifactExtraFieldElement($nef);
- if
(!$nel->create(util_unconvert_htmlspecialchars($el['element_name']),
$el['status_id'])) {
- db_rollback();
- $this->setError(_('Error Creating New
Extra Field Element')._(':').' '.$nel->getErrorMessage());
- return false;
+ if ($nef->getType() ==
ARTIFACT_EXTRAFIELDTYPE_STATUS && ($el['element_name'] == 'Open' ||
$el['element_name'] == 'Closed')) {
+ //by default extrafield status is
created with default values: 'Open' & 'Closed'
+ } else {
+ if
(!$nel->create(util_unconvert_htmlspecialchars($el['element_name']),
$el['status_id'])) {
+ db_rollback();
+ $this->setError(_('Error
Creating New Extra Field Element')._(':').' '.$nel->getErrorMessage());
+ return false;
+ }
}
$newEFElIds[$ef['extra_field_id']][$el['element_id']] = $nel->getID();
}
-----------------------------------------------------------------------
Summary of changes:
src/CHANGES | 1 +
src/common/include/Group.class.php | 2 +-
src/common/tracker/ArtifactType.class.php | 24 ++++++++++++++++--------
3 files changed, 18 insertions(+), 9 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits