This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, master has been updated
via 7840d1490f4120bc8f66aaef084d9e98e54e7e59 (commit)
from ec921f59d9ec9d8a2514bd95500ac993a18a9dd1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=7840d1490f4120bc8f66aaef084d9e98e54e7e59
commit 7840d1490f4120bc8f66aaef084d9e98e54e7e59
Author: Franck Villaume <[email protected]>
Date: Tue Dec 15 23:08:07 2015 +0100
docman search engine: support mass action download
diff --git a/src/www/docman/view.php b/src/www/docman/view.php
index 87157ac..636fb0b 100644
--- a/src/www/docman/view.php
+++ b/src/www/docman/view.php
@@ -6,7 +6,7 @@
* Copyright 2002-2003, Tim Perdue/GForge, LLC
* Copyright 2010-2011, Franck Villaume - Capgemini
* Copyright (C) 2010-2012 Alain Peyrat - Alcatel-Lucent
- * Copyright 2012,2014, Franck Villaume - TrivialDev
+ * Copyright 2012,2015, Franck Villaume - TrivialDev
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
@@ -267,7 +267,11 @@ if (is_numeric($docid)) {
$zip->close();
unlink($file);
$warning_msg = _('No action to
perform');
-
session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid);
+ $redirect_url =
'/docman/?group_id='.$group_id.'&view=listfile';
+ if (is_numeric($dirid)) {
+ $redirect_url .=
'&dirir='.$dirid;
+ }
+ session_redirect($redirect_url);
}
}
if ( !$zip->close()) {
@@ -286,7 +290,7 @@ if (is_numeric($docid)) {
if(!readfile_chunked($file)) {
unlink($file);
$error_msg = _('Unable to download ZIP
archive');
-
session_redirect('/docman/?group_id='.$group_id.'&view=admin');
+
session_redirect('/docman/?group_id='.$group_id);
}
unlink($file);
} else {
diff --git a/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php
b/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php
index 8410156..6b9756f 100644
--- a/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php
+++ b/src/www/search/include/renderers/DocsHtmlSearchRenderer.class.php
@@ -68,6 +68,7 @@ class DocsHtmlSearchRenderer extends HtmlGroupSearchRenderer {
}
global $HTML;
+ global $LUSER;
$rowsCount = $this->searchQuery->getRowsCount();
$result =& $this->searchQuery->getResult();
@@ -76,6 +77,27 @@ class DocsHtmlSearchRenderer extends HtmlGroupSearchRenderer
{
$lastDocGroupID = null;
$rowColor = 0;
+ if ($rowsCount) {
+ use_javascript('/docman/scripts/DocManController.js');
+ $return .= $HTML->getJavascripts();
+ $return .= $HTML->getStylesheets();
+ echo html_ao('script', array('type' =>
'text/javascript'));
+ ?>
+ //<![CDATA[
+ var controllerListFile;
+
+ jQuery(document).ready(function() {
+ controllerListFile = new
DocManListFileController({
+ groupId: <?php echo
$this->groupId ?>,
+ docManURL: '<?php echo
util_make_uri('/docman') ?>',
+ childGroupId: <?php echo
util_ifsetor($childgroup_id, 0) ?>,
+ });
+ });
+
+ //]]>
+ <?php
+ echo html_ac(html_ap() - 1);
+ }
for($i = 0; $i < $rowsCount; $i++) {
$document = document_get_object(db_result($result, $i,
'docid'));
$currentDocGroup =
documentgroup_get_object($document->getDocGroupID());
@@ -93,13 +115,21 @@ class DocsHtmlSearchRenderer extends
HtmlGroupSearchRenderer {
$rowColor = 0;
}
$cells = array();
- $cells[][] = ' ';
- $cells[][] =
util_make_link('/docman/view.php/'.$document->Group->getID().'/'.$document->getID().'/'.urlencode($document->getFileName()),
html_image($document->getFileTypeImage(), 22, 22));
+ if (!$document->getLocked() &&
!$document->getReserved()) {
+ $cells[][] = html_e('input', array('type' =>
'checkbox', 'value' => $document->getID(), 'class' => 'checkeddocidactive',
'title' => _('Select / Deselect this document for massaction'), 'onClick' =>
'controllerListFile.checkgeneral("active")'));
+ } else {
+ if (session_loggedin() &&
($document->getReservedBy() != $LUSER->getID())) {
+ $cells[][] = html_e('input',
array('type' => 'checkbox', 'name' => 'disabled', 'disabled' => 'disabled'));
+ } else {
+ $cells[][] = html_e('input',
array('type' => 'checkbox', 'value' => $document->getID(), 'class' =>
'checkeddocidactive', 'title' => _('Select / Deselect this document for
massaction'), 'onClick' => 'controllerListFile.checkgeneral("active")'));
+ }
+ }
+ $cells[][] =
util_make_link('/docman/view.php/'.$document->Group->getID().'/'.$document->getID().'/'.urlencode($document->getFileName()),
html_image($document->getFileTypeImage(), 22, 22), array('title' => _('View
this document')));
$cells[][] = db_result($result, $i, 'title');
$cells[][] = db_result($result, $i, 'description');
if (forge_check_perm('docman',
$document->Group->getID(), 'approve')) {
if (!$document->getLocked() &&
!$document->getReserved()) {
- $cells[][] =
util_make_link('/docman/?group_id='.$document->Group->getID().'&view=listfile&dirid='.$document->getDocGroupID().'&filedetailid='.$document->getID(),
html_image('docman/edit-file.png', 22, 22, array('alt' => _('Edit this
document'))));
+ $cells[][] =
util_make_link('/docman/?group_id='.$document->Group->getID().'&view=listfile&dirid='.$document->getDocGroupID().'&filedetailid='.$document->getID(),
html_image('docman/edit-file.png', 22, 22, array('alt' => _('Edit this
document'))), array('title' => _('Edit this document')));
} else {
$cells[][] = ' ';
}
@@ -109,6 +139,13 @@ class DocsHtmlSearchRenderer extends
HtmlGroupSearchRenderer {
$return .= $HTML->multiTableRow(array('class' =>
$HTML->boxGetAltRowStyle($rowColor, true)), $cells);
$rowColor++;
}
+ $content = html_ao('span', array('id' => 'massactionactive',
'class' => 'hide'));
+ $content .= html_e('span', array('id' =>
'docman-massactionmessage', 'title' => _('Actions availables for selected
documents, you need to check at least one document to get actions')), _('Mass
actions for selected documents')._(':'), false);
+ $content .= util_make_link('#',
html_image('docman/download-directory-zip.png', 22, 22, array('alt' =>
_('Download as a ZIP'))) , array('onclick' =>
'window.location.href=\''.util_make_uri('/docman/view.php/'.$this->groupId.'/zip/selected/files/\'+controllerListFile.buildUrlByCheckbox("active")'),
'title' => _('Download as a ZIP')), true);
+ $content .= html_ac(html_ap() - 1);
+ $cells = array();
+ $cells[] = array($content, 'colspan' => 4);
+ $return .= $HTML->multiTableRow(array(), $cells);
return $return;
}
-----------------------------------------------------------------------
Summary of changes:
src/www/docman/view.php | 10 +++--
.../renderers/DocsHtmlSearchRenderer.class.php | 43 ++++++++++++++++++++--
2 files changed, 47 insertions(+), 6 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits