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  fb24e1245e20079fe5ea16b8a63c5832d10dc054 (commit)
      from  c7a062fb755db5fca860c636c8621e75f2e0d93f (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=fb24e1245e20079fe5ea16b8a63c5832d10dc054

commit fb24e1245e20079fe5ea16b8a63c5832d10dc054
Author: Franck Villaume <franck.villa...@trivialdev.com>
Date:   Sun Sep 18 12:00:10 2016 +0200

    template project: support frs release

diff --git a/src/common/frs/FRSRelease.class.php 
b/src/common/frs/FRSRelease.class.php
index 6a33d6c..59db39e 100644
--- a/src/common/frs/FRSRelease.class.php
+++ b/src/common/frs/FRSRelease.class.php
@@ -27,6 +27,24 @@ require_once $gfcommon.'include/FFError.class.php';
 require_once $gfcommon.'frs/FRSFile.class.php';
 
 /**
+ * get_frs_releases - get all FRS releases for a specific package
+ *
+ * @param      FRSPackage      $package
+ * @return     array
+ */
+function get_frs_releases($package) {
+       $rs = array();
+       $res = db_query_params('SELECT * FROM frs_release WHERE package_id=$1',
+                               array($package->getID()));
+       if (db_numrows($res) > 0) {
+               while($arr = db_fetch_array($res)) {
+                       $rs[] = new FRSRelease($package, $arr['release_id'], 
$arr);
+               }
+       }
+       return $rs;
+}
+
+/**
  * Factory method which creates a FRSRelease from an release id
  *
  * @param      int     $release_id     The release id
diff --git a/src/common/include/Group.class.php 
b/src/common/include/Group.class.php
index 42cdd1f..b9b9a27 100644
--- a/src/common/include/Group.class.php
+++ b/src/common/include/Group.class.php
@@ -35,6 +35,7 @@ require_once $gfcommon.'pm/ProjectGroup.class.php';
 require_once $gfcommon.'pm/ProjectGroupFactory.class.php';
 require_once $gfcommon.'include/Role.class.php';
 require_once $gfcommon.'frs/FRSPackage.class.php';
+require_once $gfcommon.'frs/FRSRelease.class.php';
 require_once $gfcommon.'docman/DocumentGroup.class.php';
 require_once $gfcommon.'docman/DocumentGroupFactory.class.php';
 require_once $gfcommon.'mail/MailingList.class.php';
@@ -2594,8 +2595,13 @@ class Group extends FFError {
                                        foreach (get_frs_packages($template) as 
$o) {
                                                $newp = new FRSPackage($this);
                                                $nname = 
$this->replaceTemplateStrings($o->getName());
-                                               $newp->create ($nname, 
$o->isPublic());
+                                               $newp->create($nname, 
$o->isPublic());
                                                
$id_mappings['frs'][$o->getID()] = $newp->getID();
+                                               foreach(get_frs_releases($o) as 
$or) {
+                                                       $newr = new 
FRSRelease($newp);
+                                                       
$newr->create($this->replaceTemplateStrings($or->getName()), 
$this->replaceTemplateStrings($or->getNotes()), 
$this->replaceTemplateStrings($or->getChanges()), $or->getPreformatted());
+                                                       
$id_mappings['frs_release'][$or->getID()] = $newr->getID();
+                                               }
                                        }
                                }
                        }

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

Summary of changes:
 src/common/frs/FRSRelease.class.php | 18 ++++++++++++++++++
 src/common/include/Group.class.php  |  8 +++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
Fusionforge-commits@lists.fusionforge.org
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to