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  e894d0b8d3386542a9082b6c775089092c0037c4 (commit)
      from  0c6137117ea00002c5a97a414dbb1f8b28594d40 (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=e894d0b8d3386542a9082b6c775089092c0037c4

commit e894d0b8d3386542a9082b6c775089092c0037c4
Author: Franck Villaume <[email protected]>
Date:   Sun Apr 30 12:43:26 2017 +0200

    forge cli: support docgroupImport with files

diff --git a/src/bin/forge b/src/bin/forge
index fe8bdbb..5f77679 100755
--- a/src/bin/forge
+++ b/src/bin/forge
@@ -517,6 +517,18 @@ class CliActions {
                                        @unlink($filename);
                                }
                        }
+                       if (isset($stream['files']) && 
is_array($stream['files'])) {
+                               foreach ($stream['files'] as $file) {
+                                       $filename = 
'documentDump-'.$file['data_array']['docid'].'.'.$format;
+                                       $this->createSubfile($filename, $file, 
$format);
+                                       if (!$this->documentImport($filename, 
$format)) {
+                                               echo _('Unable to inject child 
file')."\n";
+                                               db_rollback();
+                                               return false;
+                                       }
+                                       @unlink($filename);
+                               }
+                       }
                        db_commit();
                        echo _('Document Group injected')."\n";
                        return true;
diff --git a/src/common/docman/DocumentFactory.class.php 
b/src/common/docman/DocumentFactory.class.php
index 673dd1e..d15ae53 100644
--- a/src/common/docman/DocumentFactory.class.php
+++ b/src/common/docman/DocumentFactory.class.php
@@ -343,9 +343,8 @@ class DocumentFactory extends FFError {
                        foreach ($docs as $doc) {
                                $dvf = new DocumentVersionFactory($doc);
                                $docArr = array();
-                               $docArr['id'] = $doc->getID();
-                               $docArr['document'] = (array)$doc;
-                               unset($docArr['document']['Group']);
+                               $docArr = (array)$doc;
+                               unset($docArr['Group']);
                                $docArr['versions'] = $dvf->getVersions();
                                $docArr['monitor'] = $doc->getMonitorIds();
                                $serialIDs = $dvf->getSerialIDs();
@@ -353,6 +352,7 @@ class DocumentFactory extends FFError {
                                        $drf = new DocumentReviewFactory($doc);
                                        $docArr['reviews'] = 
$drf->getReviews($serialIDs);
                                }
+                               ksort($docArr);
                                $return[] = $docArr;
                        }
                }

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

Summary of changes:
 src/bin/forge                               | 12 ++++++++++++
 src/common/docman/DocumentFactory.class.php |  6 +++---
 2 files changed, 15 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