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

Franck VILLAUME nerville at fusionforge.org
Wed Jun 26 00:24:20 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  7d079729dbaaa4e163483967e4809e625a3697e8 (commit)
      from  9b6dad47b04ecab48389e5bf0d2519d2f3d22f15 (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 7d079729dbaaa4e163483967e4809e625a3697e8
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Wed Jun 26 00:23:46 2013 +0200

    docman: fix #559 empty trash failed due to missing docs when moving to trash

diff --git a/src/common/docman/actions/trashdir.php b/src/common/docman/actions/trashdir.php
index 5bea482..ab8299a 100644
--- a/src/common/docman/actions/trashdir.php
+++ b/src/common/docman/actions/trashdir.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;
@@ -69,6 +70,19 @@ if (is_array($d_arr)) {
 	}
 }
 
+if (is_array($trashnested_groups[$dirid])) {
+	foreach ($trashnested_groups[$dirid] as $dg) {
+		$localdf = new DocumentFactory($g);
+		$localdf->setDocGroupID($dg->getID());
+		$d_arr =& $localdf->getDocuments();
+		if (is_array($d_arr)) {
+			foreach ($d_arr as $doc) {
+				$trashnested_docs[$doc->getDocGroupID()][] = $doc;
+			}
+		}
+	}
+}
+
 /* set to trash content of this dirid */
 docman_recursive_stateid($dirid, $trashnested_groups, $trashnested_docs, 2);
 
diff --git a/src/common/docman/include/utils.php b/src/common/docman/include/utils.php
index 00b8306..16c34e0 100644
--- a/src/common/docman/include/utils.php
+++ b/src/common/docman/include/utils.php
@@ -7,7 +7,7 @@
  * Copyright 2002-2004, GForge Team
  * Copyright 2010-2011, Franck Villaume - Capgemini
  * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012-2013, Franck Villaume - TrivialDev
  * http://fusionforge.org
  *
  * This file is part of FusionForge. FusionForge is free software;
@@ -73,14 +73,19 @@ function docman_fill_zip($zip, $nested_groups, $document_factory, $docgroup = 0,
 }
 
 function docman_recursive_stateid($docgroup, $nested_groups, $nested_docs, $stateid = 2) {
+	$localdocgroup_arr = array();
+	$localdocgroup_arr[] = $docgroup;
 	if (is_array(@$nested_groups[$docgroup])) {
 		foreach ($nested_groups[$docgroup] as $dg) {
 			$dg->setStateID($stateid);
+			$localdocgroup_arr[] = $dg->getID();
 		}
 	}
-	if (isset($nested_docs[$docgroup]) && is_array($nested_docs[$docgroup])) {
-		foreach ($nested_docs[$docgroup] as $d) {
-			$d->setState($stateid);
+	foreach ($localdocgroup_arr as $docgroup_id) {
+		if (isset($nested_docs[$docgroup_id]) && is_array($nested_docs[$docgroup_id])) {
+			foreach ($nested_docs[$docgroup_id] as $d) {
+				$d->setState($stateid);
+			}
 		}
 	}
 }

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

Summary of changes:
 src/common/docman/actions/trashdir.php |   14 ++++++++++++++
 src/common/docman/include/utils.php    |   13 +++++++++----
 2 files changed, 23 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list