[Fusionforge-commits] FusionForge branch master updated. 1776851ebe7d8c5aac6c507d5abee42d4a90319a

Franck Villaume nerville at fusionforge.org
Fri Apr 11 18:22:23 CEST 2014


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  1776851ebe7d8c5aac6c507d5abee42d4a90319a (commit)
      from  5b4f1c4ed46146dfa9085fa2f21a5ec9f867dc03 (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 1776851ebe7d8c5aac6c507d5abee42d4a90319a
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Apr 11 18:20:38 2014 +0200

    docman: DG, remove unused code, remove monitoring when dg is trashed

diff --git a/src/common/docman/DocumentGroup.class.php b/src/common/docman/DocumentGroup.class.php
index 97aed1c..65737c5 100644
--- a/src/common/docman/DocumentGroup.class.php
+++ b/src/common/docman/DocumentGroup.class.php
@@ -596,34 +596,6 @@ class DocumentGroup extends Error {
 	}
 
 	/**
-	 * hasSubgroup - Checks if this group has a specified subgroup associated to it
-	 *
-	 * @param	array	$nested_groups		Array of nested groups information, fetched from DocumentGroupFactory class
-	 * @param	int	$doc_subgroup_id	ID of the subgroup
-	 * @return	boolean	success
-	 * @access	public
-	 */
-	function hasSubgroup(&$nested_groups, $doc_subgroup_id) {
-		$doc_group_id = $this->getID();
-
-		if (is_array(@$nested_groups[$doc_group_id])) {
-			$count = count($nested_groups[$doc_group_id]);
-			for ($i=0; $i < $count; $i++) {
-				// child is a match?
-				if ($nested_groups[$doc_group_id][$i]->getID() == $doc_subgroup_id) {
-					return true;
-				} else {
-					// recursively check if this child has this subgroup
-					if ($nested_groups[$doc_group_id][$i]->hasSubgroup($nested_groups, $doc_subgroup_id)) {
-						return true;
-					}
-				}
-			}
-		}
-		return false;
-	}
-
-	/**
 	 * getSubgroup - Return the ids of any sub folders (first level only) in specific folder
 	 *
 	 * @param	int	$docGroupId	ID of the specific folder
@@ -806,8 +778,13 @@ class DocumentGroup extends Error {
 		if (!$this->getLocked() || ((time() - $this->getLockdate()) > 600)) {
 			//we need to move recursively all docs and all doc_groups in trash
 			// aka setStateID to 2.
-			if ($this->setStateID(2, true))
-				return true;
+			if (!$this->setStateID(2, true))
+				return false;
+
+			$this->setLock(0);
+			$this->sendNotice(false);
+			$this->clearMonitor();
+			return true;
 		}
 		return false;
 	}

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

Summary of changes:
 src/common/docman/DocumentGroup.class.php |   37 ++++++-----------------------
 1 file changed, 7 insertions(+), 30 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list