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

This commit is contained in:
Uwe Steinmann 2023-10-14 12:55:20 +02:00
commit 1085401ccf
6 changed files with 127 additions and 76 deletions

View File

@ -280,6 +280,8 @@
- fix creating preview image of file in drop folder if it contains
special chars
- show fileѕ and folders in dropfolder dir recursively
- fix 'Add to clipboard' menu item in bootstrap theme
- open confirm box when changing category in batch operation
--------------------------------------------------------------------------------
Changes in version 5.1.32

View File

@ -136,8 +136,8 @@ video/mp4
This will take 12th frame of a video and converts into a png. It requires
ffmpeg to be installed.
convert -resize %wx '%f[12]' 'png:%o'
convert -resize %wx "%f[12]" "png:%o"
audio/mpeg
sox '%f' -n spectrogram -x 600 -Y 550 -r -l -o - | convert -resize %wx png:- 'png:%o'
sox "%f" -n spectrogram -x 600 -Y 550 -r -l -o - | convert -resize %wx png:- "png:%o"

View File

@ -680,7 +680,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
if(!empty($submenuitem['divider'])) {
$content .= " <li class=\"divider\"></li>\n";
} else {
$content .= "<li><a".(isset($menuitem['link']) ? " href=\"".$menuitem['link']."\"" : "").(isset($menuitem['target']) ? ' target="'.$menuitem['target'].'"' : '');
$content .= "<li><a".(isset($menuitem['class']) ? " class=\"".$menuitem['class']."\"" : "").(isset($menuitem['link']) ? " href=\"".$menuitem['link']."\"" : "").(isset($menuitem['target']) ? ' target="'.$menuitem['target'].'"' : '');
if(!empty($menuitem['attributes']))
foreach($menuitem['attributes'] as $attr)
$content .= ' '.$attr[0].'="'.$attr[1].'"';

View File

@ -54,14 +54,12 @@ class SeedDMS_View_Search extends SeedDMS_Theme_Style {
?>
$(document).ready( function() {
$('#export').on('click', function(e) {
e.preventDefault();
var url = "";
url = $(this).attr('href')+'&includecontent='+($('#includecontent').prop('checked') ? '1' : '0');
var inputs = $('input[name^=\"marks\"]');
$('#export').on('click', function(ev) {
ev.preventDefault();
ev.stopPropagation();
var url = $(this).attr('href')+'&includecontent='+($('#includecontent').prop('checked') ? '1' : '0');
var values = {};
inputs.each(function() {
$('input[name^=\"marks\"]').each(function() {
if(this.checked)
values[this.name] = 1;
});
@ -69,83 +67,46 @@ $(document).ready( function() {
window.location.href = url;
});
$('#changecategory').on('click', function(e) {
e.preventDefault();
var url = "";
url = $(this).attr('href')+'&changecategory='+$('#batchcategory').val()+'&removecategory='+($('#removecategory').prop('checked') ? '1' : '0');
var inputs = $('input[name^=\"marks\"]');
$('#changecategory').on('click', function(ev) {
ev.preventDefault();
ev.stopPropagation();
confirmmsg = $(ev.currentTarget).attr('confirmmsg');
var url = $(this).attr('href')+'&changecategory='+$('#batchcategory').val()+'&removecategory='+($('#removecategory').prop('checked') ? '1' : '0');
var values = {};
inputs.each(function() {
$('input[name^=\"marks\"]').each(function() {
if(this.checked)
values[this.name] = 1;
});
url += '&'+$.param(values);
window.location.href = url;
if($('#batchcategory').val() && Object.keys(values).length > 0) {
SeedDMSBox.redirect(url, {
'message': confirmmsg,
'cancelLabel': '<?= getMLText("cancel") ?>',
'confirmLabel': '<i class="fa fa-user"></i> <?= getMLText("batch_change_category") ?>'
});
}
});
<?php if($this->getParam('theme') !== 'bootstrap4'): ?>
$('body').on('click', 'a.change-owner-btn', function(ev){
ev.preventDefault();
ev.stopPropagation();
confirmmsg = $(ev.currentTarget).attr('confirmmsg');
href = $(ev.currentTarget).attr('href');
bootbox.dialog(confirmmsg, [{
"label" : "<i class='fa fa-user'></i> <?= getMLText("batch_change_owner") ?>",
"class" : "btn-danger",
"callback": function() {
var url = "";
url = href+'&newowner='+($('#newowner').val());
var inputs = $('input[name^=\"marks\"]');
var values = {};
inputs.each(function() {
if(this.checked)
values[this.name] = 1;
});
url += '&'+$.param(values);
window.location.href = url;
}
}, {
"label" : "<?= getMLText("cancel") ?>",
"class" : "btn-cancel",
"callback": function() {
}
}]);
});
<?php else: ?>
$('body').on('click', 'a.change-owner-btn', function(ev){
ev.preventDefault();
ev.stopPropagation();
confirmmsg = $(ev.currentTarget).attr('confirmmsg');
href = $(ev.currentTarget).attr('href');
bootbox.confirm({
"message": confirmmsg,
"buttons": {
"confirm": {
"label" : "<i class='fa fa-user'></i> <?= getMLText("batch_change_owner") ?>",
"className" : "btn-danger",
},
"cancel": {
"label" : " <?= getMLText("cancel") ?>",
"className" : "btn-secondary",
}
},
"callback": function(result) {
if(result) {
var url = "";
url = href+'&newowner='+($('#newowner').val());
var inputs = $('input[name^=\"marks\"]');
var values = {};
inputs.each(function() {
if(this.checked)
values[this.name] = 1;
});
url += '&'+$.param(values);
window.location.href = url;
}
}
var url = href+'&newowner='+($('#newowner').val());
var values = {};
$('input[name^=\"marks\"]').each(function() {
if(this.checked)
values[this.name] = 1;
});
url += '&'+$.param(values);
if($('#newowner').val() && Object.keys(values).length > 0) {
SeedDMSBox.redirect(url, {
'message': confirmmsg,
'cancelLabel': '<?= getMLText("cancel") ?>',
'confirmLabel': '<i class="fa fa-user"></i> <?= getMLText("batch_change_owner") ?>'
});
}
});
<?php endif; ?>
});
<?php
// $this->printFolderChooserJs("form1");
@ -1405,7 +1366,6 @@ $(document).ready(function() {
ob_start();
$users = $dms->getAllUsers();
$options = array();
$options[] = array("-1", getMLText("choose_user"));
foreach ($users as $currUser) {
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin().' - '.$currUser->getFullName()), false, array(array('data-subtitle', htmlspecialchars($currUser->getEmail()))));
}
@ -1416,6 +1376,7 @@ $(document).ready(function() {
'id'=>'newowner',
'class'=>'chzn-select',
'options'=>$options,
'allow_empty'=>true,
'placeholder'=>getMLText('select_users'),
'attributes'=>array(array('style', 'width: 100%;'))
)
@ -1431,7 +1392,6 @@ $(document).ready(function() {
$cats = $dms->getDocumentCategories();
if($cats) {
$options = array();
$options[] = array("-1", getMLText("choose_category"));
foreach ($cats as $currcat) {
$options[] = array($currcat->getID(), htmlspecialchars($currcat->getName()), false);
}
@ -1443,6 +1403,7 @@ $(document).ready(function() {
'class'=>'chzn-select',
'options'=>$options,
'multiple'=>false,
'allow_empty'=>true,
'placeholder'=>getMLText('select_category'),
'attributes'=>array(array('style', 'width: 100%;'))
)
@ -1457,7 +1418,7 @@ $(document).ready(function() {
)
);
print $this->html_link('Search', array_merge($_GET, array('action'=>'changecategory')), array('class'=>'btn btn-primary change-category-btn mt-4', 'id'=>'changecategory'), "<i class=\"fa fa-user\"></i> ".getMLText("batch_change_category"), false, true)."\n";
print $this->html_link('Search', array_merge($_GET, array('action'=>'changecategory')), array('class'=>'btn btn-primary change-category-btn mt-4', 'confirmmsg'=>htmlspecialchars(getMLText("confirm_change_category", array ()), ENT_QUOTES), 'id'=>'changecategory'), "<i class=\"fa fa-user\"></i> ".getMLText("batch_change_category"), false, true)."\n";
$content = ob_get_clean();
$this->printAccordion(getMLText('batch_change_category'), $content);

View File

@ -1542,3 +1542,41 @@ $(document).ready(function() { /* {{{ */
}
}
}( window.SeedDMSAjax = window.SeedDMSAjax || {}, jQuery )); /* }}} */
(function( SeedDMSBox, $, undefined ) { /* {{{ */
/* Open dialog box and
* redirect to the given url if confirm was pressed
*/
SeedDMSBox.redirect = function(url, boxparams) {
bootbox.dialog(boxparams.message, [{
"label" : boxparams.confirmLabel,
"class" : "btn-danger",
"callback": function() {
window.location.href = url;
}
}, {
"label" : boxparams.cancelLabel,
"class" : "btn-cancel",
"callback": function() {
}
}]);
}
/* Open confirm box and
* calls the callback if the confirm button was pressed
*/
SeedDMSBox.callback = function(callback, boxparams) {
bootbox.dialog(boxparams.message, [{
"label" : boxparams.confirmLabel,
"class" : "btn-danger",
"callback": function() {
callback();
}
}, {
"label" : boxparams.cancelLabel,
"class" : "btn-cancel",
"callback": function() {
}
}]);
}
}( window.SeedDMSBox = window.SeedDMSBox || {}, jQuery )); /* }}} */

View File

@ -1598,3 +1598,53 @@ $(document).ready(function() { /* {{{ */
}
}
}( window.SeedDMSAjax = window.SeedDMSAjax || {}, jQuery )); /* }}} */
(function( SeedDMSBox, $, undefined ) { /* {{{ */
/* Open confirm box (which has just one callback) and
* redirect to the given url if confirm was pressed
*/
SeedDMSBox.redirect = function(url, boxparams) {
bootbox.confirm({
"message": boxparams.message,
"buttons": {
"confirm": {
"label" : boxparams.confirmLabel,
"className" : "btn-danger",
},
"cancel": {
"label" : boxparams.cancelLabel,
"className" : "btn-secondary",
}
},
"callback": function(result) {
if(result) {
window.location.href = url;
}
}
});
}
/* Open confirm box (which has just one callback) and
* calls the callback if the confirm button was pressed
*/
SeedDMSBox.callback = function(callback, boxparams) {
bootbox.confirm({
"message": boxparams.message,
"buttons": {
"confirm": {
"label" : boxparams.confirmLabel,
"className" : "btn-danger",
},
"cancel": {
"label" : boxparams.cancelLabel,
"className" : "btn-secondary",
}
},
"callback": function(result) {
if(result) {
callback();
}
}
});
}
}( window.SeedDMSBox = window.SeedDMSBox || {}, jQuery )); /* }}} */