[Fusionforge-commits] r13478 - in trunk/src: common/docman/views www/docman/scripts

Franck VILLAUME nerville at fusionforge.org
Fri Jun 10 13:04:04 CEST 2011


Author: nerville
Date: 2011-06-10 13:04:04 +0200 (Fri, 10 Jun 2011)
New Revision: 13478

Modified:
   trunk/src/common/docman/views/listfile.php
   trunk/src/common/docman/views/pendingfiles.php
   trunk/src/www/docman/scripts/DocManController.js
Log:
last fix: get actions only when you have selected files

Modified: trunk/src/common/docman/views/listfile.php
===================================================================
--- trunk/src/common/docman/views/listfile.php	2011-06-10 10:06:03 UTC (rev 13477)
+++ trunk/src/common/docman/views/listfile.php	2011-06-10 11:04:04 UTC (rev 13478)
@@ -99,6 +99,7 @@
 						{selector: '#docman-editdirectory', options:{delayIn: 500, delayOut: 0, fade: true}},
 						{selector: '#docman-deletedirectory', options:{delayIn: 500, delayOut: 0, fade: true}},
 						{selector: '#docman-trashdirectory', options:{delayIn: 500, delayOut: 0, fade: true}},
+						{selector: '#docman-massactionmessage', options:{gravity: 'nw', delayIn: 500, delayOut: 0, fade: true}},
 						{selector: '.docman-downloadaszip', options:{delayIn: 500, delayOut: 0, fade: true}},
 						{selector: '.docman-viewfile', options:{gravity: 'nw', delayIn: 500, delayOut: 0, fade: true}},
 						{selector: '.docman-reserveddocument', options:{delayIn: 500, delayOut: 0, fade: true}},
@@ -348,8 +349,14 @@
 	}
 	echo $HTML->listTableBottom();
 	echo '<p>';
+	echo '<span id="docman-massactionmessage"';
+	if ($use_tooltips)
+		echo ' title="'. _('Actions availables for checked files, you need to check at least one file to get actions') . '" ';
+
+	echo '>';
 	echo _('Mass actions for selected files:');
-	echo '<span id="massactionactive" class="docman-massaction-hide" >';
+	echo '</span>';
+	echo '<span id="massactionactive" style="display: none;" >';
 	if (forge_check_perm('docman', $group_id, 'approve')) {
 		echo '<a class="docman-movetotrash" href="#" onclick="window.location.href=\'?group_id='.$group_id.'&action=trashfile&view=listfile&dirid='.$dirid.'&fileid=\'+controllerListFile.buildUrlByCheckbox(\'active\')" ';
 		if ($use_tooltips)

Modified: trunk/src/common/docman/views/pendingfiles.php
===================================================================
--- trunk/src/common/docman/views/pendingfiles.php	2011-06-10 10:06:03 UTC (rev 13477)
+++ trunk/src/common/docman/views/pendingfiles.php	2011-06-10 11:04:04 UTC (rev 13478)
@@ -47,7 +47,7 @@
 		groupId:		<?php echo $group_id ?>,
 		tipsyElements:		[
 						{selector: '.docman-pendingdownloadaszip', options:{delayIn: 500, delayOut: 0, fade: true}},
-						{selector: '#docman-massactionpendingmessage', options:{delayIn: 500, delayOut: 0, fade: true}},
+						{selector: '#docman-massactionpendingmessage', options:{gravity: 'nw', delayIn: 500, delayOut: 0, fade: true}},
 						{selector: '.docman-pendingactivate', options:{delayIn: 500, delayOut: 0, fade: true}},
 						{selector: '.docman-pendingviewfile', options:{gravity: 'nw', delayIn: 500, delayOut: 0, fade: true}},
 						{selector: '.docman-pendingeditfile', options:{gravity: 'ne', delayIn: 500, delayOut: 0, fade: true}},
@@ -62,14 +62,14 @@
 	if (isset($nested_pending_docs[$dirid]) && is_array($nested_pending_docs[$dirid])) {
 		echo '<div class="docmanDiv">';
 		echo '<h4>'._('Pending files').'</h4>';
-		$tabletop = array('<input id="checkallpending" type="checkbox" onchange="controllerListPending.checkAll(\'checkeddocidPending\', \'pending\')" />', '', _('Filename'), _('Title'), _('Description'), _('Author'), _('Last time'), _('Status'), _('Size'), _('Actions'));
+		$tabletop = array('<input id="checkallpending" type="checkbox" onchange="controllerListPending.checkAll(\'checkeddocidpending\', \'pending\')" />', '', _('Filename'), _('Title'), _('Description'), _('Author'), _('Last time'), _('Status'), _('Size'), _('Actions'));
 		$classth = array('unsortable', 'unsortable', '', '', '', '', '', '', '', 'unsortable');
 		echo $HTML->listTableTop($tabletop, false, 'sortable_docman_listfile', 'sortable', $classth);
 		$time_new = 604800;
 		foreach ($nested_pending_docs[$dirid] as $d) {
 			echo '<tr>';
 			echo '<td>';
-			echo '<input type="checkbox" value="'.$d->getID().'" class="checkeddocidPending" onchange="controllerListPending.checkgeneral(\'pending\')" />';
+			echo '<input type="checkbox" value="'.$d->getID().'" class="checkeddocidpending" onchange="controllerListPending.checkgeneral(\'pending\')" />';
 			echo '</td>';
 			switch ($d->getFileType()) {
 				case "URL": {
@@ -151,12 +151,12 @@
 		echo _('Mass actions for selected pending files:');
 		echo '</span>';
 		echo '<span id="massactionpending" class="docman-massaction-hide" style="display:none;" >';
-		echo '<a class="docman-pendingdownloadaszip" href="#" onclick="window.location.href=\'/docman/view.php/'.$group_id.'/zip/selected/'.$dirid.'/\'+controllerListPending.buildUrlByCheckbox(\'Pending\')" ';
+		echo '<a class="docman-pendingdownloadaszip" href="#" onclick="window.location.href=\'/docman/view.php/'.$group_id.'/zip/selected/'.$dirid.'/\'+controllerListPending.buildUrlByCheckbox(\'pending\')" ';
 		if ($use_tooltips)
 			echo ' title="'. _('Download as a zip') . '" ';
 
 		echo '>' . html_image('docman/download-directory-zip.png', 22, 22, array('alt'=>'Download as Zip')). '</a>';
-		echo '<a class="docman-pendingactivate" href="#" onclick="window.location.href=\'?group_id='.$group_id.'&action=validatefile&view=listfile&dirid='.$dirid.'&fileid=\'+controllerListPending.buildUrlByCheckbox(\'Pending\')" ';
+		echo '<a class="docman-pendingactivate" href="#" onclick="window.location.href=\'?group_id='.$group_id.'&action=validatefile&view=listfile&dirid='.$dirid.'&fileid=\'+controllerListPending.buildUrlByCheckbox(\'pending\')" ';
 		if ($use_tooltips)
 			echo ' title="'. _('Activate in this directory') . '" ';
 

Modified: trunk/src/www/docman/scripts/DocManController.js
===================================================================
--- trunk/src/www/docman/scripts/DocManController.js	2011-06-10 10:06:03 UTC (rev 13477)
+++ trunk/src/www/docman/scripts/DocManController.js	2011-06-10 11:04:04 UTC (rev 13478)
@@ -208,6 +208,11 @@
 			jQuery('#checkall'+id).attr('checked', false);
 			jQuery('#massaction'+id).hide();
 		}
+		for (var h = 0; h < jQuery("input:checked").length; h++) {
+			if (typeof(jQuery("input:checked")[h].className) != "undefined" && jQuery("input:checked")[h].className == 'checkeddocid'+id ) {
+				jQuery('#massaction'+id).show();
+			}
+		}
 	},
 
 	computeDocumentsData: function() {




More information about the Fusionforge-commits mailing list