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  7e38d9ba26bde5bbf0ccb098149f463bcf0ebd39 (commit)
      from  efe0b23f0eebd8a8085c93dc1edc50116dfdc8dc (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=7e38d9ba26bde5bbf0ccb098149f463bcf0ebd39

commit 7e38d9ba26bde5bbf0ccb098149f463bcf0ebd39
Author: Franck Villaume <[email protected]>
Date:   Mon May 29 12:54:04 2017 +0200

    add new FRSManager class to handle FRS setup. improve forge cli for FRS

diff --git a/src/bin/forge b/src/bin/forge
index 8b5eb1c..aa463b7 100755
--- a/src/bin/forge
+++ b/src/bin/forge
@@ -25,11 +25,12 @@
 
 require (dirname(__FILE__).'/../common/include/env.inc.php');
 require_once $gfcommon.'include/pre.php';
+require_once $gfcommon.'include/User.class.php';
+require_once $gfcommon.'docman/DocumentReviewFactory.class.php';
+require_once $gfcommon.'frs/FRSManager.class.php';
 require_once $gfcommon.'tracker/ArtifactFactory.class.php';
 require_once $gfcommon.'tracker/ArtifactTypeFactory.class.php';
 require_once $gfcommon.'tracker/EffortUnitFactory.class.php';
-require_once $gfcommon.'docman/DocumentReviewFactory.class.php';
-require_once $gfcommon.'include/User.class.php';
 
 class CliActions {
        function help($method = null) {
@@ -100,21 +101,41 @@ class CliActions {
                                echo "to dump docman from a specific 
project.\n";
                                echo $dumpFormatInfo;
                                break;
+                       case 'docmanImport':
+                               echo "Use: .../forge docmanImport <file> 
[json|raw]\n";
+                               echo "to import a docman setup and all his 
elements.\n";
+                               echo $dumpFormatInfo.$importFormatInfo;
+                               break;
                        case 'releaseDump':
                                echo "Use: .../forge releaseDump <releaseid> 
[json|raw]\n";
                                echo "to dump a spectific FRS release from a 
specific project.\n";
                                echo $dumpFormatInfo;
                                break;
+                       case 'releaseImport':
+                               echo "Use: .../forge releaseImport <file> 
[json|raw]\n";
+                               echo "to import a specific FRS release and all 
his elements into a package.\n";
+                               echo $dumpFormatInfo.$importFormatInfo;
+                               break;
                        case 'packageDump':
                                echo "Use: .../forge packageDump <packageid> 
[json|raw]\n";
                                echo "to dump a spectific FRS package from a 
specific project.\n";
                                echo $dumpFormatInfo;
                                break;
+                       case 'packageImport':
+                               echo "Use: .../forge packageImport <file> 
[json|raw]\n";
+                               echo "to import a specific FRS package and all 
his elements.\n";
+                               echo $dumpFormatInfo.$importFormatInfo;
+                               break;
                        case 'frsDump':
                                echo "Use: .../forge frsDump <groupid> 
[json|raw]\n";
                                echo "to dump FRS from a specific project.\n";
                                echo $dumpFormatInfo;
                                break;
+                       case 'frsImport':
+                               echo "Use: .../forge frsImport <file> 
[json|raw]\n";
+                               echo "to import a full FRS setup and all his 
elements.\n";
+                               echo $dumpFormatInfo.$importFormatInfo;
+                               break;
                        case 'pmDump':
                                echo "Use: .../forge pmDump <groupid> 
[json|raw]\n";
                                echo "to dump Project Management (tasks) from a 
specific project.\n";
@@ -1333,6 +1354,8 @@ class CliActions {
                $group = group_get_object($group_id);
                if ($group && is_object($group) && !$group->isError()) {
                        if ($group->usesFRS()) {
+                               $frsm = new FRSManager($group);
+                               $frsDump['setup'] = $frsm->getSettings();
                                $frsfp = new FRSPackageFactory($group);
                                if ($frsfp && is_object($frsfp) && 
!$frsfp->isError()) {
                                        $frspIds = $frsfp->getAllPackagesIds();
@@ -1353,6 +1376,15 @@ class CliActions {
                return $frsDump;
        }
 
+       function frsImport($file, $format = 'json') {
+               global $importRefMapping;
+               $stream = $this->loadFile($file, $format);
+               if (!$stream) {
+                       return false;
+               }
+               return true;
+       }
+
        function packageDump($packageid, $format = 'json') {
                $packageDump['id'] = $packageid;
                $package = frspackage_get_object($packageid);
@@ -1374,6 +1406,15 @@ class CliActions {
                return $packageDump;
        }
 
+       function packageImport($file, $format = 'json') {
+               global $importRefMapping;
+               $stream = $this->loadFile($file, $format);
+               if (!$stream) {
+                       return false;
+               }
+               return true;
+       }
+
        function releaseDump($releaseid, $format = 'json') {
                $releaseDump['id'] = $releaseid;
                $release = frsrelease_get_object($releaseid);
@@ -1388,6 +1429,15 @@ class CliActions {
                return $releaseDump;
        }
 
+       function releaseImport($file, $format = 'json') {
+               global $importRefMapping;
+               $stream = $this->loadFile($file, $format);
+               if (!$stream) {
+                       return false;
+               }
+               return true;
+       }
+
        function pmDump($projectgroupid, $format = 'json') {
                $pmDump['id'] = $projectgroupid;
                $pg = projectgroup_get_object($projectgroupid);
diff --git a/src/common/frs/FRSManager.class.php 
b/src/common/frs/FRSManager.class.php
new file mode 100644
index 0000000..82d566f
--- /dev/null
+++ b/src/common/frs/FRSManager.class.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * FusionForge file release system
+ *
+ * Copyright 2017, 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
+ * GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the Licence, or (at your option)
+ * any later version.
+ *
+ * FusionForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FusionForge; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+class FRSManager extends FFError {
+       /**
+        * The Group object.
+        *
+        * @var object  $Group.
+        */
+       var $Group;
+
+       /**
+        * @param       $Group
+        */
+       function __construct(&$Group) {
+               parent::__construct();
+               if (!$Group || !is_object($Group)) {
+                       $this->setError(_('Invalid Project'));
+                       return;
+               }
+               if ($Group->isError()) {
+                       $this->setError('FRSManager: 
'.$Group->getErrorMessage());
+                       return;
+               }
+               if (!$Group->usesFRS()) {
+                       $this->setError(_('This Group does not use FRS'));
+                       return;
+               }
+               $this->Group =& $Group;
+       }
+
+       function getSettings() {
+               $settings = array();
+               $settings['send_all_frs'] = $this->Group->frsEmailAll();
+               $settings['new_frs_address'] = 
$this->Group->getFRSEmailAddress();
+               return $settings;
+       }
+}

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

Summary of changes:
 src/bin/forge                                      | 54 +++++++++++++++++++++-
 .../FRSManager.class.php}                          | 45 ++++++++++++------
 2 files changed, 83 insertions(+), 16 deletions(-)
 copy src/common/{tracker/include/ArtifactFileHtml.class.php => 
frs/FRSManager.class.php} (52%)


hooks/post-receive
-- 
FusionForge

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

Reply via email to