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  09563dd7d692abc4f468d14373b801997f2efe2c (commit)
       via  ea6b2b2e62b3f80620b6943b6f0e7a28ef3ca8f5 (commit)
      from  1fad02576b35e104aafa60935685bfab450d0f27 (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=09563dd7d692abc4f468d14373b801997f2efe2c

commit 09563dd7d692abc4f468d14373b801997f2efe2c
Author: Franck Villaume <[email protected]>
Date:   Sun Sep 11 20:18:26 2016 +0200

    refactor approve function to prepare tracker workflow support on template 
creation.

diff --git a/src/common/include/Group.class.php 
b/src/common/include/Group.class.php
index 96ed724..456b23f 100644
--- a/src/common/include/Group.class.php
+++ b/src/common/include/Group.class.php
@@ -2562,7 +2562,6 @@ 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(), $o->Group->getID());
                                        }
                                }
                        }
@@ -2664,7 +2663,7 @@ class Group extends FFError {
                        }
 
                        foreach ($template->getRoles() as $oldrole) {
-                               $newrole = 
RBACEngine::getInstance()->getRoleById 
($id_mappings['role'][$oldrole->getID()]);
+                               $newrole = 
RBACEngine::getInstance()->getRoleById($id_mappings['role'][$oldrole->getID()]);
                                if ($oldrole->getHomeProject() != NULL
                                        && $oldrole->getHomeProject()->getID() 
== $template->getID()) {
                                        $newrole->setPublic 
($oldrole->isPublic());
@@ -2691,6 +2690,18 @@ class Group extends FFError {
                                }
                        }
 
+                       // second computation to clone fields and workflow
+                       if (forge_get_config('use_tracker')) {
+                               if ($template->usesTracker()) {
+                                       $oldatf = new 
ArtifactTypeFactory($template);
+                                       foreach ($oldatf->getArtifactTypes() as 
$o) {
+                                               $t = 
artifactType_get_object($id_mappings['tracker'][$o->getID()]);
+                                               
$id_mappings['tracker'][$o->getID()] = $t->getID();
+                                               
$t->cloneFieldsFrom($o->getID(), $o->Group->getID());
+                                       }
+                               }
+                       }
+
                        $lm = new WidgetLayoutManager();
                        $lm->createDefaultLayoutForProject ($this->getID(), 
$template->getID());
 

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=ea6b2b2e62b3f80620b6943b6f0e7a28ef3ca8f5

commit ea6b2b2e62b3f80620b6943b6f0e7a28ef3ca8f5
Author: Franck Villaume <[email protected]>
Date:   Sun Sep 11 20:17:32 2016 +0200

    PHP doc

diff --git a/src/common/tracker/ArtifactType.class.php 
b/src/common/tracker/ArtifactType.class.php
index fe62ed7..4069a65 100644
--- a/src/common/tracker/ArtifactType.class.php
+++ b/src/common/tracker/ArtifactType.class.php
@@ -653,7 +653,7 @@ class ArtifactType extends FFError {
        /**
         * cloneFieldsFrom - clone all the fields and elements from another 
tracker
         *
-        * @param       int     $clone_tracker_id
+        * @param       int     $clone_tracker_id       id of the cloned tracker
         * @param       int     $group_id               id of the project 
template to use.
         * @return      boolean true/false on success
         */

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

Summary of changes:
 src/common/include/Group.class.php        | 15 +++++++++++++--
 src/common/tracker/ArtifactType.class.php |  2 +-
 2 files changed, 14 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to