[Fusionforge-commits] FusionForge branch master updated. v6.0.5-1502-g76285e7

Franck Villaume nerville at libremir.placard.fr.eu.org
Sun Mar 5 19:28:21 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  76285e70a9d6b6b1a77641523ac882f9a011c182 (commit)
      from  0f104ca9f9d9165ad237adf297cdfa3fb052c668 (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=76285e70a9d6b6b1a77641523ac882f9a011c182

commit 76285e70a9d6b6b1a77641523ac882f9a011c182
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sun Mar 5 19:28:05 2017 +0100

    forge cli: implement frsDump setup

diff --git a/src/bin/forge b/src/bin/forge
index a7f2ca2..fe22437 100755
--- a/src/bin/forge
+++ b/src/bin/forge
@@ -259,7 +259,7 @@ class CliActions {
 						$groupDump['forums'] = array();
 					}
 					if ($group->usesFRS()) {
-						$groupDump['frs'] = array();
+						$groupDump['frs'] = $this->frsDump($group_id, array('setup', 'return'));
 					}
 					if ($group->usesNews()) {
 						$groupDump['news'] = array();
@@ -374,6 +374,43 @@ class CliActions {
 		return $docmanDump;
 	}
 
+	function frsDump($group_id, $params = array('setup', 'json')) {
+		$frsDump = array();
+		$group = group_get_object($group_id);
+		if ($group && is_object($group) && !$group->isError()) {
+			if ($group->usesFRS()) {
+				$frsp = new FRSPackageFactory($group);
+				if ($frsp && is_object($frsp) && !$frsp->isError()) {
+					switch ($params[0]) {
+						case 'all':
+							$frsDump['setup'] = $frsp->getFRSs();
+						case 'data':
+							break;
+						case 'setup':
+							$frss = $frsp->getFRSs();
+							foreach ($frss as $frs) {
+								unset($frs->Group);
+								$frsDump['setup'][] = $frs;
+							}
+							break;
+						default:
+							$frsDump['error'][] = _('Unknown function');
+							break;
+					}
+				} else {
+					$docmanDump['error'][] = _('Unable to get document manager for group id')._(': ').$group_id;
+				}
+			} else {
+				$frsDump['error'][] = _('FRS not enabled for group id')._(': ').$group_id;
+			}
+		} else {
+			$frsDump['error'][] = _('Unable to get group id')._(': ').$group_id;
+		}
+		ksort($frsDump);
+		$this->print_result($frsDump, $params);
+		return $frsDump;
+	}
+
 	function print_result($arrayDump, $params) {
 		if (isset($params[1])) {
 			if (in_array($params[1], array('json', 'raw', 'return'))) {

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

Summary of changes:
 src/bin/forge | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list