[Fusionforge-commits] FusionForge branch master updated. 7e4f5714c096cf7597b7bcea3f74a33e7bcc1cb8

Franck VILLAUME nerville at fusionforge.org
Mon Aug 19 19:53:16 CEST 2013


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  7e4f5714c096cf7597b7bcea3f74a33e7bcc1cb8 (commit)
      from  957be4f8590921833c997bb7d3867aab7959d34e (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 -----------------------------------------------------------------
commit 7e4f5714c096cf7597b7bcea3f74a33e7bcc1cb8
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Mon Aug 19 19:52:51 2013 +0200

    docman: fix restore bug: restore a folder and all is content... and fix redirect when trash is emptied

diff --git a/src/common/docman/actions/editdocgroup.php b/src/common/docman/actions/editdocgroup.php
index 3f83c61..5e8cf3e 100644
--- a/src/common/docman/actions/editdocgroup.php
+++ b/src/common/docman/actions/editdocgroup.php
@@ -5,6 +5,7 @@
  * Copyright 2000, Quentin Cregan/Sourceforge
  * Copyright 2002-2003, Tim Perdue/GForge, LLC
  * Copyright 2010-2011, Franck Villaume - Capgemini
+ * Copyright 2013, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -65,8 +66,8 @@ if ($dg->getState() == 2) {
 	if ($dgf->isError())
 		exit_error($dgf->getErrorMessage(), 'docman');
 
-	$trashnested_groups =& $dgf->getNested();
-
+	$trashnested_groups =& $dgf->getNested(2);
+	
 	$df->setDocGroupID($dirid);
 	$d_arr =& $df->getDocuments();
 
@@ -77,6 +78,20 @@ if ($dg->getState() == 2) {
 			$trashnested_docs[$doc->getDocGroupID()][] = $doc;
 		}
 	}
+	
+	if (is_array($trashnested_groups[$dirid])) {
+		foreach ($trashnested_groups[$dirid] as $ndg) {
+			$localdf = new DocumentFactory($g);
+			$localdf->setDocGroupID($ndg->getID());
+			$d_arr =& $localdf->getDocuments();
+			if (is_array($d_arr)) {
+				foreach ($d_arr as $doc) {
+					$trashnested_docs[$doc->getDocGroupID()][] = $doc;
+				}
+			}
+		}
+	}
+
 	docman_recursive_stateid($dirid, $trashnested_groups, $trashnested_docs, 1);
 }
 
diff --git a/src/common/docman/actions/emptytrash.php b/src/common/docman/actions/emptytrash.php
index 44d21f4..1a53b57 100644
--- a/src/common/docman/actions/emptytrash.php
+++ b/src/common/docman/actions/emptytrash.php
@@ -3,6 +3,7 @@
  * FusionForge Documentation Manager
  *
  * Copyright 2010-2011, Franck Villaume - Capgemini
+ * Copyright 2013, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -39,4 +40,4 @@ if (!$dm->cleanTrash()) {
 }
 
 $return_msg = _('Emptied Trash successfully.');
-session_redirect('/docman/?group_id='.$group_id.'&view=listtrashfile&feedback='.urlencode($return_msg));
+session_redirect('/docman/?group_id='.$group_id.'&view=listfile&feedback='.urlencode($return_msg));
diff --git a/src/common/docman/views/editdocgroup.php b/src/common/docman/views/editdocgroup.php
index bc0d6b7..06ac8af 100644
--- a/src/common/docman/views/editdocgroup.php
+++ b/src/common/docman/views/editdocgroup.php
@@ -7,6 +7,7 @@
  * Copyright 2002-2003, Tim Perdue/GForge, LLC
  * Copyright 2010-2011, Franck Villaume - Capgemini
  * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2013, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -63,7 +64,7 @@ if ($dg->isError())
 <?php
 if ($dg->getState() == 2) {
 	$newdgf = new DocumentGroupFactory($g);
-	$dgh->showSelectNestedGroups($newdgf->getNested(), 'parent_dirid', false, false);
+	$dgh->showSelectNestedGroups($newdgf->getNested(), 'parent_dirid', true, false);
 	$labelSubmit = _('Restore');
 } else {
 	$dgh->showSelectNestedGroups($dgf->getNested(), 'parent_dirid', true, $dg->getParentId(), array($dg->getID()));

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

Summary of changes:
 src/common/docman/actions/editdocgroup.php |   19 +++++++++++++++++--
 src/common/docman/actions/emptytrash.php   |    3 ++-
 src/common/docman/views/editdocgroup.php   |    3 ++-
 3 files changed, 21 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list