[Fusionforge-commits] r14010 - in trunk/src/common/docman: . views

Franck VILLAUME nerville at fusionforge.org
Fri Jul 29 17:32:51 CEST 2011


Author: nerville
Date: 2011-07-29 17:32:51 +0200 (Fri, 29 Jul 2011)
New Revision: 14010

Modified:
   trunk/src/common/docman/DocumentGroup.class.php
   trunk/src/common/docman/views/listfile.php
Log:
fix getPath

Modified: trunk/src/common/docman/DocumentGroup.class.php
===================================================================
--- trunk/src/common/docman/DocumentGroup.class.php	2011-07-29 15:17:22 UTC (rev 14009)
+++ trunk/src/common/docman/DocumentGroup.class.php	2011-07-29 15:32:51 UTC (rev 14010)
@@ -409,10 +409,8 @@
 	}
 
 	function getNumberOfDocuments($stateId = 1) {
-		if (isset($this->data_array['numberFiles'][$stateId])) {
-			echo "from cache";
+		if (isset($this->data_array['numberFiles'][$stateId]))
 			return $this->data_array['numberFiles'][$stateId];
-		}
 
 		$res = db_query_params('select count(*) from docdata_vw where doc_group = $1 and group_id = $2 and stateid = $3',
 					array($this->getID(), $this->Group->getID(), $stateId));
@@ -488,7 +486,7 @@
 				$returnPath .= '/'.$this->getName();
 			}
 		}
-		if (!sizeof($returnPath))
+		if (!strlen($returnPath))
 			$returnPath = '/';
 
 		return $returnPath;

Modified: trunk/src/common/docman/views/listfile.php
===================================================================
--- trunk/src/common/docman/views/listfile.php	2011-07-29 15:17:22 UTC (rev 14009)
+++ trunk/src/common/docman/views/listfile.php	2011-07-29 15:32:51 UTC (rev 14010)
@@ -160,7 +160,7 @@
 		echo '<a href="#" class="tabtitle" id="docman-additem" title="'. _('Add a new item in this folder') . '" >'. html_image('docman/insert-directory.png',22,22,array('alt'=>'additem')). '</a>';
 	}
 
-	$numFiles = $ndg->getNumberOfDocuments();
+	$numFiles = $ndg->getNumberOfDocuments(1);
 	if (forge_check_perm('docman', $group_id, 'approve'))
 		$numPendingFiles = $ndg->getNumberOfDocuments(3);
 	if ($numFiles || (isset($numPendingFiles) && $numPendingFiles))




More information about the Fusionforge-commits mailing list