[evolvis-commits] r16396: cleanup

mirabilos at evolvis.org mirabilos at evolvis.org
Tue Mar 1 01:13:21 CET 2011


Author: mirabilos
Date: 2011-03-01 01:13:20 +0100 (Tue, 01 Mar 2011)
New Revision: 16396

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/common/docman/include/utils.php
   trunk/gforge_base/evolvisforge-5.1/src/common/docman/views/menu.php
   trunk/gforge_base/evolvisforge-5.1/src/www/docman/view.php
Log:
cleanup

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/docman/include/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/docman/include/utils.php	2011-03-01 00:13:17 UTC (rev 16395)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/docman/include/utils.php	2011-03-01 00:13:20 UTC (rev 16396)
@@ -6,7 +6,7 @@
  * Copyright 1999-2001, VA Linux Systems
  * Copyright 2000, Quentin Cregan/SourceForge
  * Copyright 2002-2004, GForge Team
- * Copyright 2010, Franck Villaume
+ * Copyright 2010, Franck Villaume - Capgemini
  *
  * This file is part of FusionForge.
  *
@@ -89,18 +89,21 @@
  * @param	$integer	documentgroup id : default value = 0
  * @param	$string		documentgroup parent name : default value = empty
  */
-function docman_fill_zip($zip,$nested_groups,$document_factory,$docgroup = 0,$parent_docname = '') {
+function docman_fill_zip($zip, $nested_groups, $document_factory, $docgroup = 0, $parent_docname = '') {
 	if (is_array(@$nested_groups[$docgroup])) {
 		foreach ($nested_groups[$docgroup] as $dg) {
-			$zip->addEmptyDir($parent_docname.'/'.$dg->getName());
+            if (!$zip->addEmptyDir($parent_docname.'/'.$dg->getName()))
+                return false;
+
 			$document_factory->setDocGroupID($dg->getID());
 			$docs = $document_factory->getDocuments();
 			if (is_array($docs) && count($docs) > 0) {      // this group has documents
 				foreach ($docs as $doc) {
-					$zip->addFromString($parent_docname.'/'.$dg->getName().'/'.$doc->getFileName(),$doc->getFileData());
+                    if ( !$zip->addFromString($parent_docname.'/'.$dg->getName().'/'.$doc->getFileName(),$doc->getFileData()))
+                        return false;
 				}
 			}
-			docman_fill_zip($zip,$nested_groups,$document_factory,$dg->getID(),$parent_docname.'/'.$dg->getName());
+			docman_fill_zip($zip, $nested_groups, $document_factory, $dg->getID(), $parent_docname.'/'.$dg->getName());
 		}
 	}
 	return true;

Modified: trunk/gforge_base/evolvisforge-5.1/src/common/docman/views/menu.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/common/docman/views/menu.php	2011-03-01 00:13:17 UTC (rev 16395)
+++ trunk/gforge_base/evolvisforge-5.1/src/common/docman/views/menu.php	2011-03-01 00:13:20 UTC (rev 16396)
@@ -6,7 +6,7 @@
  * Copyright 1999-2001, VA Linux Systems
  * Copyright 2000, Quentin Cregan/SourceForge
  * Copyright 2002-2004, GForge Team
- * Copyright 2010, Franck Villaume
+ * Copyright 2010, Franck Villaume - Capgemini
  *
  * This file is part of FusionForge.
  *
@@ -30,6 +30,7 @@
 global $HTML; // html object
 global $d_arr; // document array
 global $group_id; // id of group
+global $g; // project group object
 
 /* create the submenu following role, rules and content */
 $menu_text=array();

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/docman/view.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/docman/view.php	2011-03-01 00:13:17 UTC (rev 16395)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/docman/view.php	2011-03-01 00:13:20 UTC (rev 16396)
@@ -103,11 +103,11 @@
 			exit_error(_('Unable to open zip archive for backup'),'docman');
 		}
 
-		docman_fill_zip($zip,$nested_groups,$df);
+        if ( !docman_fill_zip($zip,$nested_groups,$df))
+            exit_error(_('Unable to fill zip archive for backup'),'docman');
 
-		if ( !$zip->close()) {
+		if ( !$zip->close())
 			exit_error(_('Unable to close zip archive for backup'),'docman');
-		}
 
 		Header ('Content-disposition: filename="'.$filename.'"');
 		Header ('Content-type: application/binary');



More information about the evolvis-commits mailing list