[Fusionforge-commits] FusionForge branch master updated. 94fe780d401e17d528df453d07dc4539a5b663ef

Franck VILLAUME nerville at fusionforge.org
Tue Feb 19 18:53:30 CET 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  94fe780d401e17d528df453d07dc4539a5b663ef (commit)
      from  5e37df2510d53fdbca540ec29e5177c79ac3a0f7 (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 94fe780d401e17d528df453d07dc4539a5b663ef
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Tue Feb 19 18:49:20 2013 +0100

    docman: clean, remove unused code & better check

diff --git a/src/common/docman/DocumentGroupFactory.class.php b/src/common/docman/DocumentGroupFactory.class.php
index d4a0b84..d4e4cc9 100644
--- a/src/common/docman/DocumentGroupFactory.class.php
+++ b/src/common/docman/DocumentGroupFactory.class.php
@@ -6,7 +6,7 @@
  * Copyright 2002-2003, Tim Perdue/GForge, LLC
  * Copyright 2009, Roland Mas
  * Copyright 2010, Franck Villaume - Capgemini
- * Copyright 2012, Franck Villaume - TrivialDev
+ * Copyright 2012-2013, Franck Villaume - TrivialDev
  * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
  * http://fusionforge.org
  *
@@ -97,34 +97,6 @@ class DocumentGroupFactory extends Error {
 		}
 		return $this->nested_groups;
 	}
-
-	/**
-	 * getDocumentGroups - Return an array of DocumentGroup objects.
-	 *
-	 * @param	int	The stateid of DocumentGroups : default is public (1).
-	 * @return	array	The array of DocumentGroup.
-	 */
-	function &getDocumentGroups($stateid = 1) {
-		if ($this->flat_groups) {
-			return $this->flat_groups;
-		}
-
-		$this->flat_groups = array();
-
-		$result = db_query_params('SELECT * FROM doc_groups WHERE group_id=$1 AND stateid=$2 ORDER BY groupname ASC',
-						array($this->Group->getID(), $stateid));
-		$rows = db_numrows($result);
-
-		if (!$result || $rows < 1) {
-			$this->setError(_('No Documents Folder Found').' '.db_error());
-		} else {
-			while ($arr = db_fetch_array($result)) {
-				$this->flat_groups[] = new DocumentGroup($this->Group, $arr);
-			}
-		}
-
-		return $this->flat_groups;
-	}
 }
 
 // Local Variables:
diff --git a/src/common/docman/views/addfile.php b/src/common/docman/views/addfile.php
index 71c350b..7c72780 100644
--- a/src/common/docman/views/addfile.php
+++ b/src/common/docman/views/addfile.php
@@ -7,7 +7,7 @@
  * Copyright 2010-2011, Franck Villaume - Capgemini
  * Copyright 2011, Roland Mas
  * 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;
@@ -35,7 +35,7 @@ global $dirid; //id of the doc_group
 // plugin projects-hierarchy
 $actionurl = '?group_id='.$group_id.'&action=addfile&dirid='.$dirid;
 $redirecturl = '/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid;
-if ($childgroup_id) {
+if (isset($childgroup_id) && $childgroup_id) {
 	$g = group_get_object($childgroup_id);
 	$actionurl .= '&childgroup_id='.$childgroup_id;
 	$redirecturl .= '&childgroup_id='.$childgroup_id;
diff --git a/src/common/docman/views/addsubdocgroup.php b/src/common/docman/views/addsubdocgroup.php
index 824d200..14c2a45 100644
--- a/src/common/docman/views/addsubdocgroup.php
+++ b/src/common/docman/views/addsubdocgroup.php
@@ -6,6 +6,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;
@@ -36,7 +37,7 @@ if (!forge_check_perm('docman', $group_id, 'approve')) {
 
 // plugin projects-hierarchy
 $actionurl = '?group_id='.$group_id.'&action=addsubdocgroup&dirid='.$dirid;
-if ($childgroup_id) {
+if (isset($childgroup_id) && $childgroup_id) {
 	$g = group_get_object($childgroup_id);
 	$actionurl .= '&childgroup_id='.$childgroup_id;
 }
diff --git a/src/common/docman/views/help.php b/src/common/docman/views/help.php
index f73d064..3354759 100644
--- a/src/common/docman/views/help.php
+++ b/src/common/docman/views/help.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;
@@ -24,7 +25,7 @@
 /* please do not add require here : use www/docman/index.php to add require */
 /* global variables used */
 global $group_id; // id of the group
-global $g; //id of the doc_group
+global $g; // the project object
 
 if (!forge_check_perm('docman', $group_id, 'read')) {
 	$return_msg= _('Document Manager Access Denied');
@@ -33,7 +34,7 @@ if (!forge_check_perm('docman', $group_id, 'read')) {
 
 echo '<div class="docmanDivIncluded">';
 plugin_hook ("blocks", "doc help");
-if ($g->useWebdav()) {
+if (forge_get_config('use_webdav') && $g->useWebdav()) {
 	echo '<p>'. _('Documents parsing is also available thru webdav') .'</p>';
 	echo '<p>'. util_make_link('/docman/view.php/'.$group_id.'/webdav',_('Direct Webdav URL')) .'</p>';
 }
diff --git a/src/common/docman/views/listtrashfile.php b/src/common/docman/views/listtrashfile.php
index 8fe5ae5..cd293b2 100644
--- a/src/common/docman/views/listtrashfile.php
+++ b/src/common/docman/views/listtrashfile.php
@@ -39,7 +39,7 @@ if (!forge_check_perm('docman', $group_id, 'approve')) {
 }
 
 // plugin projects-hierarchy
-if ($childgroup_id) {
+if (isset($childgroup_id) && $childgroup_id) {
 	$g = group_get_object($childgroup_id);
 }
 

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

Summary of changes:
 src/common/docman/DocumentGroupFactory.class.php |   30 +---------------------
 src/common/docman/views/addfile.php              |    4 +--
 src/common/docman/views/addsubdocgroup.php       |    3 ++-
 src/common/docman/views/help.php                 |    5 ++--
 src/common/docman/views/listtrashfile.php        |    2 +-
 5 files changed, 9 insertions(+), 35 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list