Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2020-12-10 13:54:21 +01:00
commit 0d9cdf7dcd
6 changed files with 26 additions and 6 deletions

View File

@ -203,6 +203,8 @@
folderid wasn't checked propperly for being an integer (CVE-2020-28727)
- output format for dates can be configured
- add filter function to notification service
- reindex document after it was edited
- show preview images in drop folder menu after mouse over
--------------------------------------------------------------------------------
Changes in version 5.1.20

View File

@ -26,6 +26,7 @@ class SeedDMS_Controller_EditDocument extends SeedDMS_Controller_Common {
$dms = $this->params['dms'];
$user = $this->params['user'];
$settings = $this->params['settings'];
$fulltextservice = $this->params['fulltextservice'];
$document = $this->params['document'];
$name = $this->params['name'];
@ -156,6 +157,14 @@ class SeedDMS_Controller_EditDocument extends SeedDMS_Controller_Common {
}
}
if($fulltextservice && ($index = $fulltextservice->Indexer()) && $document) {
$idoc = $fulltextservice->IndexedDocument($document);
if(false !== $this->callHook('preIndexDocument', $document, $idoc)) {
$index->addDocument($idoc);
$index->commit();
}
}
if(!$this->callHook('postEditDocument')) {
}

View File

@ -121,6 +121,7 @@ foreach($document->getAttributes() as $ai=>$aa)
$oldattributes[$ai] = clone $aa;
//$oldattributes = $document->getAttributes();
$controller->setParam('fulltextservice', $fulltextservice);
$controller->setParam('document', $document);
$controller->setParam('name', $name);
$controller->setParam('comment', $comment);

View File

@ -1231,6 +1231,14 @@ $(document).ready(function() { /* {{{ */
$(this).parent().hide();
e.stopPropagation();
});
$("body").on("mouseenter", "#main-menu-dropfolderlist ul.dropdown-menu li a", function(e) {
$(e.currentTarget).find('.dropfolder-menu-img').css('display', 'inline');
});
$("body").on("mouseleave", "#main-menu-dropfolderlist ul.dropdown-menu li a", function(e) {
$(e.currentTarget).find('.dropfolder-menu-img').hide();
});
}); /* }}} */
(function( SeedDMSTask, $, undefined ) { /* {{{ */

View File

@ -192,7 +192,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
$this->addFooterJS('SeedDMSTask.run();');
}
if($this->params['enabledropfolderlist'] && isset($this->params['user']) && $this->params['user']) {
$this->addFooterJS("SeedDMSTask.add({name: 'dropfolder', interval: 15, func: function(){\$('#menu-dropfolder > div.ajax').trigger('update', {folderid: seeddms_folder});}});");
$this->addFooterJS("SeedDMSTask.add({name: 'dropfolder', interval: 30, func: function(){\$('#menu-dropfolder > div.ajax').trigger('update', {folderid: seeddms_folder});}});");
}
if($this->footerjs) {
$jscode = "$(document).ready(function () {\n";
@ -2120,7 +2120,7 @@ $(function() {
const $tree = $('#jqtree<?php echo $formid ?>');
$tree.tree({
// saveState: false,
selectable: true,
selectable: false,
data: data,
saveState: 'jqtree<?php echo $formid; ?>',
openedIcon: $('<i class="fa fa-minus-circle"></i>'),
@ -2155,8 +2155,8 @@ $(function() {
if(!node)
return;
if(node.is_folder) {
<?php if($showdocs) { ?>
$('#jqtree<?php echo $formid ?>').tree('openNode', node);
<?php if($showdocs) { ?>
// event.preventDefault();
if(typeof node.fetched == 'undefined') {
node.fetched = true;

View File

@ -86,10 +86,10 @@ $('.folderselect').click(function(ev) {
if($previewwidth) {
$previewer->createRawPreview($dir.'/'.$entry, 'dropfolder/', $mimetype);
if($previewer->hasRawPreview($dir.'/'.$entry, 'dropfolder/')) {
$filecontent .= "<div style=\"float: left; display:inline; width:40px; max-height:40px;overflow:hidden;\"><img filename=\"".$entry."\" width=\"".$previewwidth."\" src=\"../op/op.DropFolderPreview.php?filename=".$entry."&width=".$previewwidth."\" title=\"".htmlspecialchars($mimetype)."\"></div>";
$filecontent .= "<div class=\"dropfolder-menu-img\" style=\"_float: left; display: none; _width:40px; _max-height:40px;overflow:hidden;\"><img filename=\"".$entry."\" width=\"".$previewwidth."\" src=\"../op/op.DropFolderPreview.php?filename=".$entry."&width=".$previewwidth."\" title=\"".htmlspecialchars($mimetype)."\"></div>";
}
}
$filecontent .= "<div style=\"margin-left:10px; margin-right: 40px; display:inline-block;\">".$entry."<br /><span style=\"font-size: 85%;\">".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry)).", ".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."</span></div></a></li>\n";
$filecontent .= "<div class=\"dropfolder-menu-text\" style=\"margin-left:10px; margin-right: 10px; display:inline-block;\">".$entry."<br /><span style=\"font-size: 85%;\">".SeedDMS_Core_File::format_filesize(filesize($dir.'/'.$entry)).", ".date('Y-m-d H:i:s', filectime($dir.'/'.$entry))."</span></div></a></li>\n";
}
} elseif($showfolders && is_dir($dir.'/'.$entry)) {
$filecontent .= "<li><a _href=\"\">".$entry."</a></li>";
@ -103,7 +103,7 @@ $('.folderselect').click(function(ev) {
$content .= " <ul id=\"main-menu-dropfolderlist\" class=\"nav pull-right\">\n";
$content .= " <li class=\"dropdown add-dropfolderlist-area\">\n";
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" class=\"add-dropfolderlist-area\">".getMLText('menu_dropfolder')." (".$c.") <i class=\"fa fa-caret-down\"></i></a>\n";
$content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
$content .= " <ul class=\"dropdown-menu\" role=\"menu\" style=\"width: 400px;\">\n";
$content .= $filecontent;
$content .= " </ul>\n";
$content .= " </li>\n";