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 37d03d9db38157a3385d85f1dab8e1d1ac2ed231 (commit)
via 7c9f9128c6215cad6280428f5e35b4838338165a (commit)
via 464cfb29e7690d7859ddcb39a093ad9cdc72641a (commit)
via 9b888b8c6a6671a75a0fd0107ffd61d7d97ebb4b (commit)
from dcfa3949ef5b0d7cfaadac040a1492bffcc7d415 (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=37d03d9db38157a3385d85f1dab8e1d1ac2ed231
commit 37d03d9db38157a3385d85f1dab8e1d1ac2ed231
Author: Franck Villaume <[email protected]>
Date: Sat Mar 4 18:39:41 2017 +0100
forge cli: dump 1 document using documentDump
diff --git a/src/bin/forge b/src/bin/forge
index ce2195a..c276496 100755
--- a/src/bin/forge
+++ b/src/bin/forge
@@ -27,6 +27,7 @@ require (dirname(__FILE__).'/../common/include/env.inc.php');
require_once $gfcommon.'include/pre.php';
require_once $gfcommon.'tracker/ArtifactFactory.class.php';
require_once $gfcommon.'tracker/ArtifactTypeFactory.class.php';
+require_once $gfcommon.'docman/DocumentReviewFactory.class.php';
class CliActions {
function help($method = null) {
@@ -74,6 +75,20 @@ class CliActions {
echo " - raw: (default)\n";
echo " standard PHP array print_r format\n";
break;
+ case 'documentDump':
+ echo "Use: .../forge documentDump <docid>
[latest|all] [json|raw]\n";
+ echo "to dump a document from a specific
project.\n";
+ echo "the following functions are available:\n";
+ echo " - latest: (default option)\n";
+ echo " use it to dump the latest value of the
document\n";
+ echo " - all:\n";
+ echo " use it to dump the full history and
latest value of the document\n";
+ echo "the following output formats are
available:\n";
+ echo " - json:\n";
+ echo " pretty json formated string output\n";
+ echo " - raw: (default)\n";
+ echo " standard PHP array print_r format\n";
+ break;
case 'docmanDump':
echo "Use: .../forge trackerDump <groupid>
[setup|data|all] [json|raw]\n";
echo "to dump docman from a specific
project.\n";
@@ -139,7 +154,6 @@ class CliActions {
$artifactDump['history'][] = $arr;
}
}
-
case 'latest':
$artifactDump['artifact'] =
(array)$artf;
unset($artifactDump['artifact']['ArtifactType']);
@@ -290,6 +304,35 @@ class CliActions {
return $trackerDump;
}
+ function documentDump($docid, $params = array('latest', 'json')) {
+ $documentDump = array();
+ $documentDump['id'] = $docid;
+ $doc = document_get_object($docid);
+ if ($doc && is_object($doc) && !$doc->isError()) {
+ switch ($params[0]) {
+ case 'all':
+ $dvf = new DocumentVersionFactory($doc);
+ $documentDump['versions'] =
$dvf->getVersions();
+ $serialIDs = $dvf->getSerialIDs();
+ $drf = new DocumentReviewFactory($doc);
+ $documentDump['reviews'] =
$drf->getReviews();
+ case 'latest':
+ $documentDump['document'] = (array)$doc;
+
unset($documentDump['document']['Group']);
+ $documentDump['monitor'] =
$doc->getMonitorIds();
+ break;
+ default:
+ $documentDump['error'][] = _('Unknown
function');
+ break;
+ }
+ } else {
+ $documentDump['error'][] = _('Unable to get document
id')._(': ').$docid;
+ }
+ ksort($documentDump);
+ $this->print_result($documentDump, $params);
+ return $documentDump;
+ }
+
function docmanDump($group_id, $params = array('setup', 'json')) {
$docmanDump = array();
$group = group_get_object($group_id);
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=7c9f9128c6215cad6280428f5e35b4838338165a
commit 7c9f9128c6215cad6280428f5e35b4838338165a
Author: Franck Villaume <[email protected]>
Date: Sat Mar 4 18:39:15 2017 +0100
init default value
diff --git a/src/common/docman/DocumentReviewFactory.class.php
b/src/common/docman/DocumentReviewFactory.class.php
index d1d6de1..59fc008 100644
--- a/src/common/docman/DocumentReviewFactory.class.php
+++ b/src/common/docman/DocumentReviewFactory.class.php
@@ -35,7 +35,7 @@ class DocumentReviewFactory extends FFError {
/**
* @var array $reviews Reviews of this document
*/
- var $reviews;
+ var $reviews = array();
/**
* @param $Document
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=464cfb29e7690d7859ddcb39a093ad9cdc72641a
commit 464cfb29e7690d7859ddcb39a093ad9cdc72641a
Author: Franck Villaume <[email protected]>
Date: Sat Mar 4 18:23:27 2017 +0100
add helper to retrieve user ids monitoring the document
diff --git a/src/common/docman/Document.class.php
b/src/common/docman/Document.class.php
index f16446f..c179331 100644
--- a/src/common/docman/Document.class.php
+++ b/src/common/docman/Document.class.php
@@ -7,7 +7,7 @@
* Copyright 2009, Roland Mas
* Copyright 2010-2011, Franck Villaume - Capgemini
* Copyright (C) 2011-2012 Alain Peyrat - Alcatel-Lucent
- * Copyright 2011-2016, Franck Villaume - TrivialDev
+ * Copyright 2011-2017, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -608,6 +608,16 @@ class Document extends FFObject {
}
/**
+ * getMonitorIds - get user ids monitoring this Document.
+ *
+ * @return array of user ids monitoring this Artifact.
+ */
+ function getMonitorIds() {
+ $MonitorElementObject = new MonitorElement('artifact');
+ return
$MonitorElementObject->getMonitorUsersIdsInArray($this->getID());
+ }
+
+ /**
* isMonitoredBy - get the monitored status of this document for a
specific user id.
*
* @param string $userid
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=9b888b8c6a6671a75a0fd0107ffd61d7d97ebb4b
commit 9b888b8c6a6671a75a0fd0107ffd61d7d97ebb4b
Author: Franck Villaume <[email protected]>
Date: Sat Mar 4 18:22:53 2017 +0100
fix comment
diff --git a/src/common/tracker/Artifact.class.php
b/src/common/tracker/Artifact.class.php
index 31984ce..ee72070 100644
--- a/src/common/tracker/Artifact.class.php
+++ b/src/common/tracker/Artifact.class.php
@@ -7,7 +7,7 @@
* Copyright 2009, Roland Mas
* Copyright (C) 2009-2013 Alain Peyrat, Alcatel-Lucent
* Copyright 2012, Thorsten “mirabilos” Glaser <[email protected]>
- * Copyright 2014-2016, Franck Villaume - TrivialDev
+ * Copyright 2014-2017, Franck Villaume - TrivialDev
* Copyright 2016-2017, Stéphane-Eymeric Bredthauer - TrivialDev
*
* This file is part of FusionForge. FusionForge is free software;
@@ -654,9 +654,9 @@ class Artifact extends FFObject {
}
/**
- * getMonitorIds - array of email addresses monitoring this Artifact.
+ * getMonitorIds - get user ids monitoring this Artifact.
*
- * @return array of email addresses monitoring this Artifact.
+ * @return array of user ids monitoring this Artifact.
*/
function getMonitorIds() {
$MonitorElementObject = new MonitorElement('artifact');
-----------------------------------------------------------------------
Summary of changes:
src/bin/forge | 45 ++++++++++++++++++++++-
src/common/docman/Document.class.php | 12 +++++-
src/common/docman/DocumentReviewFactory.class.php | 2 +-
src/common/tracker/Artifact.class.php | 6 +--
4 files changed, 59 insertions(+), 6 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits