[Fusionforge-commits] r13999 - trunk/src/common/docman

Franck VILLAUME nerville at fusionforge.org
Thu Jul 28 22:49:33 CEST 2011


Author: nerville
Date: 2011-07-28 22:49:33 +0200 (Thu, 28 Jul 2011)
New Revision: 13999

Modified:
   trunk/src/common/docman/DocumentManager.class.php
Log:
display informations about number of files only if there is files

Modified: trunk/src/common/docman/DocumentManager.class.php
===================================================================
--- trunk/src/common/docman/DocumentManager.class.php	2011-07-28 20:48:20 UTC (rev 13998)
+++ trunk/src/common/docman/DocumentManager.class.php	2011-07-28 20:49:33 UTC (rev 13999)
@@ -157,23 +157,16 @@
 				} else {
 					$link = '/docman/?group_id='.$this->Group->getID().'&view='.$linkmenu.'&dirid='.$localDg->getID();
 				}
-				$nbDocsLabel = ' (';
+				$nbDocsLabel = '';
 				$nbDocs = $localDg->getNumberOfDocuments();
-				if ($nbDocs) {
-					$nbDocsLabel .= $nbDocs;
-				} else {
-					$nbDocsLabel .= '-';
-				}
-				if (forge_check_perm('docman', $this->Group->getID(), 'approve')) {
+				if (forge_check_perm('docman', $this->Group->getID(), 'approve'))
 					$nbDocsPending = $localDg->getNumberOfDocuments(3);
-					if ($nbDocsPending) {
-						$nbDocsLabel .= '/'.$nbDocsPending;
-					} else {
-						$nbDocsLabel .= '/-';
-					}
-				}
-				$nbDocsLabel .= ')';
 
+				if ($nbDocs && (!isset($nbDocsPending) || $nbDocsPending == 0)) {
+					$nbDocsLabel = '('.$nbDocs.')';
+				} elseif (isset($nbDocsPending) && $nbDocsPending) {
+					$nbDocsLabel = '('.$nbDocs.'/'.$nbDocsPending.')';
+				}
 				echo '<li class="'.$liclass.'">'.util_make_link($link, $localDg->getName()).$nbDocsLabel.'</li>';
 				$this->getTree($selecteddir, $linkmenu, $subGroupIdValue);
 			}




More information about the Fusionforge-commits mailing list