mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
b558844841
|
@ -231,6 +231,7 @@
|
||||||
- prevent cross site scripting in views/bootstrap/class.DefaultKeywords.php
|
- prevent cross site scripting in views/bootstrap/class.DefaultKeywords.php
|
||||||
- fix possible DoS in op/op.RemoveLog.php
|
- fix possible DoS in op/op.RemoveLog.php
|
||||||
- show only calendar events of logged in user
|
- show only calendar events of logged in user
|
||||||
|
- show expired documents in calendar
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.24
|
Changes in version 5.1.24
|
||||||
|
|
|
@ -113,9 +113,11 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base {
|
||||||
$this->lastpreviewfile = $target.'.pdf';
|
$this->lastpreviewfile = $target.'.pdf';
|
||||||
if($target != '' && (!file_exists($target.'.pdf') || filectime($target.'.pdf') < filectime($infile))) {
|
if($target != '' && (!file_exists($target.'.pdf') || filectime($target.'.pdf') < filectime($infile))) {
|
||||||
if($this->conversionmgr) {
|
if($this->conversionmgr) {
|
||||||
// if($this->conversionmgr->hasService($mimetype, 'application/pdf')) {
|
if(!$this->conversionmgr->convert($infile, $mimetype, 'application/pdf', $target.'.pdf')) {
|
||||||
return $this->conversionmgr->convert($infile, $mimetype, 'application/pdf', $target.'.pdf');
|
$this->lastpreviewfile = '';
|
||||||
// }
|
return false;
|
||||||
|
}
|
||||||
|
$new = true;
|
||||||
} else {
|
} else {
|
||||||
$cmd = '';
|
$cmd = '';
|
||||||
$mimeparts = explode('/', $mimetype, 2);
|
$mimeparts = explode('/', $mimetype, 2);
|
||||||
|
|
|
@ -122,12 +122,10 @@ class SeedDMS_Preview_Previewer extends SeedDMS_Preview_Base {
|
||||||
$this->lastpreviewfile = $target.'.png';
|
$this->lastpreviewfile = $target.'.png';
|
||||||
if($target != '' && (!file_exists($target.'.png') || filectime($target.'.png') < filectime($infile))) {
|
if($target != '' && (!file_exists($target.'.png') || filectime($target.'.png') < filectime($infile))) {
|
||||||
if($this->conversionmgr) {
|
if($this->conversionmgr) {
|
||||||
// if($this->conversionmgr->hasService($mimetype, 'image/png')) {
|
if(!$this->conversionmgr->convert($infile, $mimetype, 'image/png', $target.'.png', array('width'=>$width))) {
|
||||||
if(!$this->conversionmgr->convert($infile, $mimetype, 'image/png', $target.'.png', array('width'=>$width))) {
|
$this->lastpreviewfile = '';
|
||||||
$this->lastpreviewfile = '';
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
// }
|
|
||||||
$new = true;
|
$new = true;
|
||||||
} else {
|
} else {
|
||||||
$cmd = '';
|
$cmd = '';
|
||||||
|
|
|
@ -62,6 +62,12 @@ application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
application/vnd.oasis.opendocument.spreadsheet
|
application/vnd.oasis.opendocument.spreadsheet
|
||||||
unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'
|
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
|
Conversion to png for preview images
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,28 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
|
||||||
case 'regular':
|
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]));
|
$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){
|
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;
|
break;
|
||||||
case 'action':
|
case 'action':
|
||||||
|
@ -217,7 +238,8 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
|
||||||
'version'=> isset($item['version']) ? (int) $item['version'] : '',
|
'version'=> isset($item['version']) ? (int) $item['version'] : '',
|
||||||
'statusid'=> isset($item['statusid']) ? (int) $item['statusid'] : '',
|
'statusid'=> isset($item['statusid']) ? (int) $item['statusid'] : '',
|
||||||
'statuslogid'=> isset($item['statuslogid']) ? (int) $item['statuslogid'] : '',
|
'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?")) {
|
// if (!confirm("Are you sure about this change?")) {
|
||||||
// revertFunc();
|
// revertFunc();
|
||||||
// }
|
// }
|
||||||
$.post("../op/op.EditEvent.php", "formtoken=<?php echo createFormKey('editevent'); ?>&eventid="+event.eventid+"&from="+event.start.format()+"&ajax=1", function(response) {
|
var fd = new FormData();
|
||||||
noty({
|
fd.append('formtoken', '<?php echo createFormKey('editevent'); ?>');
|
||||||
text: response.message,
|
fd.append('eventid', event.eventid);
|
||||||
type: response.success === true ? 'success' : 'error',
|
fd.append('documentid', event.documentid);
|
||||||
dismissQueue: true,
|
fd.append('from', event.start.format());
|
||||||
layout: 'topRight',
|
fd.append('ajax', 1);
|
||||||
theme: 'defaultTheme',
|
fd.append('eventtype', event.eventtype);
|
||||||
timeout: 1500,
|
$.post("../op/op.EditEvent.php",
|
||||||
});
|
// fd,
|
||||||
$('#calendar').fullCalendar('refetchEvents');
|
"formtoken=<?php echo createFormKey('editevent'); ?>&eventid="+event.eventid+"&documentid="+event.documentid+"&from="+event.start.format()+"&ajax=1&eventtype="+event.eventtype,
|
||||||
}, "json");
|
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: [
|
eventSources: [
|
||||||
{
|
{
|
||||||
|
@ -293,6 +324,10 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
|
||||||
{
|
{
|
||||||
url: 'out.Calendar.php?action=events&eventtype=action',
|
url: 'out.Calendar.php?action=events&eventtype=action',
|
||||||
editable: false
|
editable: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: 'out.Calendar.php?action=events&eventtype=expires',
|
||||||
|
editable: true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
eventClick: function(event, element) {
|
eventClick: function(event, element) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user