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

This commit is contained in:
Uwe Steinmann 2022-04-08 12:44:34 +02:00
commit b558844841
5 changed files with 65 additions and 23 deletions

View File

@ -231,6 +231,7 @@
- prevent cross site scripting in views/bootstrap/class.DefaultKeywords.php
- fix possible DoS in op/op.RemoveLog.php
- show only calendar events of logged in user
- show expired documents in calendar
--------------------------------------------------------------------------------
Changes in version 5.1.24

View File

@ -113,9 +113,11 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base {
$this->lastpreviewfile = $target.'.pdf';
if($target != '' && (!file_exists($target.'.pdf') || filectime($target.'.pdf') < filectime($infile))) {
if($this->conversionmgr) {
// if($this->conversionmgr->hasService($mimetype, 'application/pdf')) {
return $this->conversionmgr->convert($infile, $mimetype, 'application/pdf', $target.'.pdf');
// }
if(!$this->conversionmgr->convert($infile, $mimetype, 'application/pdf', $target.'.pdf')) {
$this->lastpreviewfile = '';
return false;
}
$new = true;
} else {
$cmd = '';
$mimeparts = explode('/', $mimetype, 2);

View File

@ -122,12 +122,10 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base {
$this->lastpreviewfile = $target.'.png';
if($target != '' && (!file_exists($target.'.png') || filectime($target.'.png') < filectime($infile))) {
if($this->conversionmgr) {
// if($this->conversionmgr->hasService($mimetype, 'image/png')) {
if(!$this->conversionmgr->convert($infile, $mimetype, 'image/png', $target.'.png', array('width'=>$width))) {
$this->lastpreviewfile = '';
return false;
}
// }
if(!$this->conversionmgr->convert($infile, $mimetype, 'image/png', $target.'.png', array('width'=>$width))) {
$this->lastpreviewfile = '';
return false;
}
$new = true;
} else {
$cmd = '';

View File

@ -62,6 +62,12 @@ application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
application/vnd.oasis.opendocument.spreadsheet
unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'
message/rfc822
java -jar emailconverter-2.5.3-all.jar '%f' -o '%o'
The emailconverter can be obtained from https://github.com/nickrussler/email-to-pdf-converter
It requires wkhtmltopdf which is part of debian.
Conversion to png for preview images
=====================================

View File

@ -172,7 +172,28 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
case 'regular':
$events = $calendar->getEventsInInterval(mktime(0,0,0, $start[1], $start[2], $start[0]), mktime(23,59,59, $end[1], $end[2], $end[0]));
foreach ($events as $event){
$arr[] = array('start'=>date('Y-m-d', $event["start"]), 'end'=>date('Y-m-d', $event["stop"]), 'title'=>$event["name"].($event['comment'] ? "\n".$event['comment'] : ''), 'eventid'=>$event["id"]);
$arr[] = array(
'start'=>date('Y-m-d', $event["start"]),
'end'=>date('Y-m-d', $event["stop"]),
'title'=>$event["name"].($event['comment'] ? "\n".$event['comment'] : ''),
'eventid'=>$event["id"],
'eventtype'=> $eventtype,
);
}
break;
case 'expires':
if(mktime(23,59,59, $end[1], $end[2], $end[0]) > time()) {
$documents = $dms->getDocumentsExpired($this->params['end']);
foreach ($documents as $document){
$arr[] = array(
'start'=>date('Y-m-d', $document->getExpires()),
'allDay'=>true,
'color'=>'#ff4455',
'title'=>$document->getName()."\nexpires",
'documentid'=> $document->getID(),
'eventtype'=> $eventtype,
);
}
}
break;
case 'action':
@ -217,7 +238,8 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
'version'=> isset($item['version']) ? (int) $item['version'] : '',
'statusid'=> isset($item['statusid']) ? (int) $item['statusid'] : '',
'statuslogid'=> isset($item['statuslogid']) ? (int) $item['statuslogid'] : '',
'fileid'=> isset($item['fileid']) ? (int) $item['fileid'] : ''
'fileid'=> isset($item['fileid']) ? (int) $item['fileid'] : '',
'eventtype'=> $eventtype,
);
}
}
@ -271,18 +293,27 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
// if (!confirm("Are you sure about this change?")) {
// revertFunc();
// }
$.post("../op/op.EditEvent.php", "formtoken=<?php echo createFormKey('editevent'); ?>&eventid="+event.eventid+"&from="+event.start.format()+"&ajax=1", function(response) {
noty({
text: response.message,
type: response.success === true ? 'success' : 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
$('#calendar').fullCalendar('refetchEvents');
}, "json");
var fd = new FormData();
fd.append('formtoken', '<?php echo createFormKey('editevent'); ?>');
fd.append('eventid', event.eventid);
fd.append('documentid', event.documentid);
fd.append('from', event.start.format());
fd.append('ajax', 1);
fd.append('eventtype', event.eventtype);
$.post("../op/op.EditEvent.php",
// fd,
"formtoken=<?php echo createFormKey('editevent'); ?>&eventid="+event.eventid+"&documentid="+event.documentid+"&from="+event.start.format()+"&ajax=1&eventtype="+event.eventtype,
function(response) {
noty({
text: response.message,
type: response.success === true ? 'success' : 'error',
dismissQueue: true,
layout: 'topRight',
theme: 'defaultTheme',
timeout: 1500,
});
$('#calendar').fullCalendar('refetchEvents');
}, "json");
},
eventSources: [
{
@ -293,6 +324,10 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
{
url: 'out.Calendar.php?action=events&eventtype=action',
editable: false
},
{
url: 'out.Calendar.php?action=events&eventtype=expires',
editable: true
}
],
eventClick: function(event, element) {