[Fusionforge-commits] r13998 - trunk/src/common/docman/views

Franck VILLAUME nerville at fusionforge.org
Thu Jul 28 22:48:20 CEST 2011


Author: nerville
Date: 2011-07-28 22:48:20 +0200 (Thu, 28 Jul 2011)
New Revision: 13998

Modified:
   trunk/src/common/docman/views/listfile.php
Log:
display zip download only if there are files to download

Modified: trunk/src/common/docman/views/listfile.php
===================================================================
--- trunk/src/common/docman/views/listfile.php	2011-07-28 20:34:11 UTC (rev 13997)
+++ trunk/src/common/docman/views/listfile.php	2011-07-28 20:48:20 UTC (rev 13998)
@@ -152,7 +152,11 @@
 		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>';
 	}
 
-	echo '<a href="/docman/view.php/'.$group_id.'/zip/full/'.$dirid.'" class="tabtitle" title="'. _('Download this folder as a zip') . '" >' . html_image('docman/download-directory-zip.png',22,22,array('alt'=>'downloadaszip')). '</a>';
+	$numFiles = $ndg->getNumberOfDocuments();
+	if (forge_check_perm('docman', $group_id, 'approve'))
+		$numPendingFiles = $ndg->getNumberOfDocuments(3);
+	if ($numFiles || (isset($numPendingFiles) && $numPendingFiles))
+		echo '<a href="/docman/view.php/'.$group_id.'/zip/full/'.$dirid.'" class="tabtitle" title="'. _('Download this folder as a zip') . '" >' . html_image('docman/download-directory-zip.png',22,22,array('alt'=>'downloadaszip')). '</a>';
 
 	echo '</h3>';
 




More information about the Fusionforge-commits mailing list