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

This commit is contained in:
Uwe Steinmann 2022-09-07 16:57:46 +02:00
commit 607251e02d
4 changed files with 30 additions and 27 deletions

View File

@ -47,6 +47,8 @@ if(isset($_GET['documentid']) && $_GET['documentid'] && is_numeric($_GET['docume
if($document = $dms->getDocument($_GET["documentid"])) {
if(isset($_GET['version']) && $_GET['version'] && is_numeric($_GET['version'])) {
$content = $document->getContentByVersion($_GET['version']);
} else {
$content = $document->getLatestContent();
}
}
}

View File

@ -3849,7 +3849,7 @@ $(document).ready(function() {
*
* @param object $document document
*/
protected function printTimelineJs($timelineurl, $height=300, $start='', $end='', $skip=array()) { /* {{{ */
protected function printTimelineJs($timelineurl, $height=300, $start='', $end='', $skip=array(), $onselect="") { /* {{{ */
if(!$timelineurl)
return;
?>
@ -3876,21 +3876,16 @@ $(document).ready(function() {
'locale': '<?php echo $this->params['session']->getLanguage() ?>'
};
function onselect() {
var sel = timeline.getSelection();
if (sel.length) {
if (sel[0].row != undefined) {
var row = sel[0].row;
console.log(timeline.getItem(sel[0].row));
item = timeline.getItem(sel[0].row);
$('div.ajax').trigger('update', {documentid: item.docid, version: item.version, statusid: item.statusid, statuslogid: item.statuslogid, fileid: item.fileid});
}
}
}
$(document).ready(function () {
// Instantiate our timeline object.
timeline = new links.Timeline(document.getElementById('timeline'), options);
links.events.addListener(timeline, 'select', onselect);
<?php
if($onselect):
?>
links.events.addListener(timeline, 'select', <?= $onselect ?>);
<?php
endif;
?>
$.getJSON(
'<?php echo $timelineurl ?>',
function(data) {

View File

@ -158,10 +158,21 @@ $(document).ready(function () {
);
});
});
function onselect() {
var sel = timeline.getSelection();
if (sel.length) {
if (sel[0].row != undefined) {
var row = sel[0].row;
console.log(timeline.getItem(sel[0].row));
item = timeline.getItem(sel[0].row);
$('div.ajax').trigger('update', {documentid: item.docid, version: item.version, statusid: item.statusid, statuslogid: item.statuslogid, fileid: item.fileid});
}
}
}
<?php
$this->printDeleteDocumentButtonJs();
$timelineurl = 'out.Timeline.php?action=data&fromdate='.date('Y-m-d', $from).'&todate='.date('Y-m-d', $to).'&skip='.urldecode(http_build_query(array('skip'=>$skip)));
$this->printTimelineJs($timelineurl, 550, ''/*date('Y-m-d', $from)*/, ''/*date('Y-m-d', $to+1)*/, $skip);
$this->printTimelineJs($timelineurl, 550, ''/*date('Y-m-d', $from)*/, ''/*date('Y-m-d', $to+1)*/, $skip, 'onselect');
$this->printClickDocumentJs();
} /* }}} */

View File

@ -3843,7 +3843,7 @@ $(document).ready(function() {
*
* @param object $document document
*/
protected function printTimelineJs($timelineurl, $height=300, $start='', $end='', $skip=array()) { /* {{{ */
protected function printTimelineJs($timelineurl, $height=300, $start='', $end='', $skip=array(), $onselect="") { /* {{{ */
if(!$timelineurl)
return;
?>
@ -3870,21 +3870,16 @@ $(document).ready(function() {
'locale': '<?php echo $this->params['session']->getLanguage() ?>'
};
function onselect() {
var sel = timeline.getSelection();
if (sel.length) {
if (sel[0].row != undefined) {
var row = sel[0].row;
console.log(timeline.getItem(sel[0].row));
item = timeline.getItem(sel[0].row);
$('div.ajax').trigger('update', {documentid: item.docid, version: item.version, statusid: item.statusid, statuslogid: item.statuslogid, fileid: item.fileid});
}
}
}
$(document).ready(function () {
// Instantiate our timeline object.
timeline = new links.Timeline(document.getElementById('timeline'), options);
links.events.addListener(timeline, 'select', onselect);
<?php
if($onselect):
?>
links.events.addListener(timeline, 'select', <?= $onselect ?>);
<?php
endif;
?>
$.getJSON(
'<?php echo $timelineurl ?>',
function(data) {