2015-09-21 14:46:17 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Implementation of Timeline view
|
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Include parent class
|
|
|
|
*/
|
2021-04-18 05:08:00 +00:00
|
|
|
//require_once("class.Bootstrap.php");
|
2015-09-21 14:46:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class which outputs the html page for Timeline view
|
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
2021-04-18 05:08:00 +00:00
|
|
|
class SeedDMS_View_Timeline extends SeedDMS_Theme_Style {
|
2015-10-19 11:14:14 +00:00
|
|
|
|
|
|
|
function iteminfo() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$document = $this->params['document'];
|
2015-11-16 07:35:06 +00:00
|
|
|
$version = $this->params['version'];
|
|
|
|
$cachedir = $this->params['cachedir'];
|
2022-09-07 15:09:57 +00:00
|
|
|
$conversionmgr = $this->params['conversionmgr'];
|
|
|
|
$previewconverters = $this->params['previewConverters'];
|
2015-11-16 07:35:06 +00:00
|
|
|
$previewwidthlist = $this->params['previewWidthList'];
|
|
|
|
$previewwidthdetail = $this->params['previewWidthDetail'];
|
2016-02-15 09:57:37 +00:00
|
|
|
$timeout = $this->params['timeout'];
|
2019-01-18 12:07:39 +00:00
|
|
|
$xsendfile = $this->params['xsendfile'];
|
2016-02-15 09:57:37 +00:00
|
|
|
|
2016-03-23 08:09:17 +00:00
|
|
|
if($document && $version) {
|
2022-01-03 18:14:35 +00:00
|
|
|
print $this->folderListHeader();
|
|
|
|
print "<tbody>\n";
|
2019-01-18 12:07:39 +00:00
|
|
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail, $timeout, $xsendfile);
|
2022-09-07 15:09:57 +00:00
|
|
|
if($conversionmgr)
|
|
|
|
$previewer->setConversionMgr($conversionmgr);
|
|
|
|
else
|
|
|
|
$previewer->setConverters($previewconverters);
|
2021-04-27 15:06:19 +00:00
|
|
|
$extracontent = array();
|
|
|
|
$extracontent['below_title'] = $this->getListRowPath($document);
|
|
|
|
echo $this->documentListRow($document, $previewer, 0, false, $extracontent);
|
2016-11-03 10:44:08 +00:00
|
|
|
|
|
|
|
echo "</tbody>\n</table>\n";
|
2015-10-20 16:15:08 +00:00
|
|
|
}
|
2015-10-19 11:14:14 +00:00
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
function data() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$skip = $this->params['skip'];
|
|
|
|
$fromdate = $this->params['fromdate'];
|
|
|
|
$todate = $this->params['todate'];
|
|
|
|
|
|
|
|
if($fromdate) {
|
|
|
|
$from = makeTsFromLongDate($fromdate.' 00:00:00');
|
|
|
|
} else {
|
|
|
|
$from = time()-7*86400;
|
|
|
|
}
|
|
|
|
|
|
|
|
if($todate) {
|
2015-11-19 06:16:46 +00:00
|
|
|
$to = makeTsFromLongDate($todate.' 23:59:59');
|
2015-10-19 11:14:14 +00:00
|
|
|
} else {
|
|
|
|
$to = time()-7*86400;
|
|
|
|
}
|
|
|
|
|
2015-11-19 05:43:36 +00:00
|
|
|
if($data = $dms->getTimeline($from, $to)) {
|
2015-11-19 06:16:46 +00:00
|
|
|
foreach($data as $i=>$item) {
|
2015-11-19 05:43:36 +00:00
|
|
|
switch($item['type']) {
|
|
|
|
case 'add_version':
|
|
|
|
$msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName()), 'version'=> $item['version']));
|
|
|
|
break;
|
|
|
|
case 'add_file':
|
|
|
|
$msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName())));
|
|
|
|
break;
|
|
|
|
case 'status_change':
|
|
|
|
$msg = getMLText('timeline_full_'.$item['type'], array('document'=>htmlspecialchars($item['document']->getName()), 'version'=> $item['version'], 'status'=> getOverallStatusText($item['status'])));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$msg = '???';
|
|
|
|
}
|
2015-11-19 06:16:46 +00:00
|
|
|
$data[$i]['msg'] = $msg;
|
2015-10-19 11:14:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$jsondata = array();
|
|
|
|
foreach($data as $item) {
|
|
|
|
if($item['type'] == 'status_change')
|
|
|
|
$classname = $item['type']."_".$item['status'];
|
|
|
|
else
|
|
|
|
$classname = $item['type'];
|
|
|
|
if(!$skip || !in_array($classname, $skip)) {
|
|
|
|
$d = makeTsFromLongDate($item['date']);
|
|
|
|
$jsondata[] = array(
|
|
|
|
'start'=>date('c', $d),
|
|
|
|
'content'=>$item['msg'],
|
|
|
|
'className'=>$classname,
|
|
|
|
'docid'=>$item['document']->getID(),
|
|
|
|
'version'=>isset($item['version']) ? $item['version'] : '',
|
|
|
|
'statusid'=>isset($item['statusid']) ? $item['statusid'] : '',
|
|
|
|
'statuslogid'=>isset($item['statuslogid']) ? $item['statuslogid'] : '',
|
|
|
|
'fileid'=>isset($item['fileid']) ? $item['fileid'] : ''
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2016-02-05 16:31:29 +00:00
|
|
|
header('Content-Type: application/json');
|
2015-10-19 11:14:14 +00:00
|
|
|
echo json_encode($jsondata);
|
|
|
|
} /* }}} */
|
2015-09-21 14:46:17 +00:00
|
|
|
|
2015-12-16 06:14:04 +00:00
|
|
|
function js() { /* {{{ */
|
2016-02-08 09:40:29 +00:00
|
|
|
$fromdate = $this->params['fromdate'];
|
|
|
|
$todate = $this->params['todate'];
|
|
|
|
$skip = $this->params['skip'];
|
|
|
|
|
|
|
|
if($fromdate) {
|
|
|
|
$from = makeTsFromLongDate($fromdate.' 00:00:00');
|
|
|
|
} else {
|
|
|
|
$from = time()-7*86400;
|
|
|
|
}
|
|
|
|
|
|
|
|
if($todate) {
|
|
|
|
$to = makeTsFromLongDate($todate.' 23:59:59');
|
|
|
|
} else {
|
|
|
|
$to = time();
|
|
|
|
}
|
|
|
|
|
2021-03-10 14:58:22 +00:00
|
|
|
header('Content-Type: application/javascript; charset=UTF-8');
|
2020-05-13 11:30:12 +00:00
|
|
|
parent::jsTranslations(array('cancel', 'splash_move_document', 'confirm_move_document', 'move_document', 'confirm_transfer_link_document', 'transfer_content', 'link_document', 'splash_move_folder', 'confirm_move_folder', 'move_folder'));
|
2015-12-16 06:14:04 +00:00
|
|
|
?>
|
|
|
|
$(document).ready(function () {
|
|
|
|
$('#update').click(function(ev){
|
|
|
|
ev.preventDefault();
|
|
|
|
$.getJSON(
|
|
|
|
'out.Timeline.php?action=data&' + $('#form1').serialize(),
|
|
|
|
function(data) {
|
|
|
|
$.each( data, function( key, val ) {
|
|
|
|
val.start = new Date(val.start);
|
|
|
|
});
|
|
|
|
timeline.setData(data);
|
|
|
|
timeline.redraw();
|
|
|
|
// timeline.setVisibleChartRange(0,0);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
2022-09-07 14:43:49 +00:00
|
|
|
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});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-12-16 06:14:04 +00:00
|
|
|
<?php
|
2016-11-03 10:44:08 +00:00
|
|
|
$this->printDeleteDocumentButtonJs();
|
2015-12-16 06:14:04 +00:00
|
|
|
$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)));
|
2022-09-07 14:43:49 +00:00
|
|
|
$this->printTimelineJs($timelineurl, 550, ''/*date('Y-m-d', $from)*/, ''/*date('Y-m-d', $to+1)*/, $skip, 'onselect');
|
2020-03-10 16:10:19 +00:00
|
|
|
$this->printClickDocumentJs();
|
2015-12-16 06:14:04 +00:00
|
|
|
} /* }}} */
|
|
|
|
|
2017-04-11 08:10:54 +00:00
|
|
|
function css() { /* {{{ */
|
|
|
|
?>
|
|
|
|
#timeline {
|
|
|
|
font-size: 12px;
|
|
|
|
line-height: 14px;
|
|
|
|
}
|
|
|
|
div.timeline-event-content {
|
|
|
|
margin: 3px 5px;
|
|
|
|
}
|
|
|
|
div.timeline-frame {
|
|
|
|
border-radius: 4px;
|
|
|
|
border-color: #e3e3e3;
|
|
|
|
}
|
|
|
|
|
2021-05-07 09:45:23 +00:00
|
|
|
div.add_file {
|
|
|
|
background-color: #E5D5F5;
|
|
|
|
border-color: #AA9ABA;
|
|
|
|
}
|
|
|
|
|
2017-04-11 08:10:54 +00:00
|
|
|
div.status_change_2 {
|
|
|
|
background-color: #DAF6D5;
|
|
|
|
border-color: #AAF897;
|
|
|
|
}
|
|
|
|
|
|
|
|
div.status_change_-1 {
|
|
|
|
background-color: #F6D5D5;
|
|
|
|
border-color: #F89797;
|
|
|
|
}
|
|
|
|
|
2021-05-07 09:45:23 +00:00
|
|
|
div.status_change_-2 {
|
|
|
|
background-color: #eee;
|
|
|
|
border-color: #ccc;
|
|
|
|
}
|
|
|
|
|
|
|
|
div.status_change_-3 {
|
|
|
|
background-color: #eee;
|
|
|
|
border-color: #ccc;
|
|
|
|
}
|
|
|
|
|
2017-04-11 08:10:54 +00:00
|
|
|
div.timeline-event-selected {
|
|
|
|
background-color: #fff785;
|
|
|
|
border-color: #ffc200;
|
|
|
|
z-index: 999;
|
|
|
|
}
|
|
|
|
<?php
|
|
|
|
header('Content-Type: text/css');
|
|
|
|
} /* }}} */
|
|
|
|
|
2015-09-21 14:46:17 +00:00
|
|
|
function show() { /* {{{ */
|
2015-10-19 11:14:14 +00:00
|
|
|
$dms = $this->params['dms'];
|
2015-09-21 14:46:17 +00:00
|
|
|
$user = $this->params['user'];
|
2015-10-19 11:14:14 +00:00
|
|
|
$fromdate = $this->params['fromdate'];
|
|
|
|
$todate = $this->params['todate'];
|
2015-09-23 12:12:30 +00:00
|
|
|
$skip = $this->params['skip'];
|
2015-09-21 14:46:17 +00:00
|
|
|
|
2015-10-19 11:14:14 +00:00
|
|
|
if($fromdate) {
|
|
|
|
$from = makeTsFromLongDate($fromdate.' 00:00:00');
|
|
|
|
} else {
|
|
|
|
$from = time()-7*86400;
|
|
|
|
}
|
|
|
|
|
|
|
|
if($todate) {
|
2015-11-19 06:16:46 +00:00
|
|
|
$to = makeTsFromLongDate($todate.' 23:59:59');
|
2015-10-19 11:14:14 +00:00
|
|
|
} else {
|
|
|
|
$to = time();
|
|
|
|
}
|
|
|
|
|
2021-04-18 05:08:00 +00:00
|
|
|
$this->htmlAddHeader('<link href="../styles/bootstrap/timeline/timeline.css" rel="stylesheet">'."\n", 'css');
|
|
|
|
$this->htmlAddHeader('<script type="text/javascript" src="../styles/bootstrap/timeline/timeline-min.js"></script>'."\n", 'js');
|
|
|
|
$this->htmlAddHeader('<script type="text/javascript" src="../styles/bootstrap/timeline/timeline-locales.js"></script>'."\n", 'js');
|
2015-09-21 14:46:17 +00:00
|
|
|
|
|
|
|
$this->htmlStartPage(getMLText("timeline"));
|
|
|
|
$this->globalNavigation();
|
|
|
|
$this->contentStart();
|
|
|
|
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
|
|
|
|
|
2020-10-08 05:57:23 +00:00
|
|
|
$this->rowStart();
|
2021-04-27 15:06:19 +00:00
|
|
|
$this->columnStart(4);
|
2015-12-16 06:14:04 +00:00
|
|
|
$this->contentHeading(getMLText("timeline"));
|
2018-04-26 06:50:44 +00:00
|
|
|
$this->contentContainerStart();
|
2015-09-21 14:46:17 +00:00
|
|
|
?>
|
2021-04-27 15:06:19 +00:00
|
|
|
<form action="../out/out.Timeline.php" class="form form-horizontal" name="form1" id="form1">
|
2018-04-26 06:50:44 +00:00
|
|
|
<?php
|
2018-06-21 16:24:51 +00:00
|
|
|
$this->formField(
|
|
|
|
getMLText("from"),
|
2020-12-17 12:41:00 +00:00
|
|
|
$this->getDateChooser(getReadableDate($from), 'fromdate', $this->params['session']->getLanguage())
|
2018-06-21 16:24:51 +00:00
|
|
|
);
|
|
|
|
$this->formField(
|
|
|
|
getMLText("to"),
|
2020-12-17 12:41:00 +00:00
|
|
|
$this->getDateChooser(getReadableDate($to), 'todate', $this->params['session']->getLanguage())
|
2018-06-21 16:24:51 +00:00
|
|
|
);
|
2018-04-26 06:50:44 +00:00
|
|
|
$html = '
|
|
|
|
<input type="checkbox" name="skip[]" value="add_file" '.(($skip && in_array('add_file', $skip)) ? 'checked' : '').'> '.getMLText('timeline_skip_add_file').'<br />
|
|
|
|
<input type="checkbox" name="skip[]" value="status_change_0" '.(($skip && in_array('status_change_0', $skip)) ? 'checked' : '').'> '.getMLText('timeline_skip_status_change_0').'<br />
|
|
|
|
<input type="checkbox" name="skip[]" value="status_change_1" '.(($skip && in_array('status_change_1', $skip)) ? 'checked' : '').'> '.getMLText('timeline_skip_status_change_1').'<br />
|
|
|
|
<input type="checkbox" name="skip[]" value="status_change_2" '.(($skip && in_array('status_change_2', $skip)) ? 'checked' : '').'> '.getMLText('timeline_skip_status_change_2').'<br />
|
|
|
|
<input type="checkbox" name="skip[]" value="status_change_3" '.(($skip && in_array('status_change_3', $skip)) ? 'checked' : '').'> '.getMLText('timeline_skip_status_change_3').'<br />
|
|
|
|
<input type="checkbox" name="skip[]" value="status_change_-1" '.(($skip && in_array('status_change_-1', $skip)) ? 'checked' : '').'> '.getMLText('timeline_skip_status_change_-1').'<br />
|
2021-05-07 09:45:23 +00:00
|
|
|
<input type="checkbox" name="skip[]" value="status_change_-2" '.(($skip && in_array('status_change_-2', $skip)) ? 'checked' : '').'> '.getMLText('timeline_skip_status_change_-2').'<br />
|
2018-04-26 06:50:44 +00:00
|
|
|
<input type="checkbox" name="skip[]" value="status_change_-3" '.(($skip && in_array('status_change_-3', $skip)) ? 'checked' : '').'> '.getMLText('timeline_skip_status_change_-3').'<br />';
|
|
|
|
$this->formField(
|
|
|
|
getMLText("exclude_items"),
|
|
|
|
$html
|
|
|
|
);
|
2020-08-27 05:52:52 +00:00
|
|
|
$this->formSubmit('<i class="fa fa-search"></i> '.getMLText('update'), 'update');
|
2018-04-26 06:50:44 +00:00
|
|
|
?>
|
2015-09-21 14:46:17 +00:00
|
|
|
</form>
|
2015-10-19 11:14:14 +00:00
|
|
|
<?php
|
2018-04-26 06:50:44 +00:00
|
|
|
$this->contentContainerEnd();
|
2015-12-16 06:14:04 +00:00
|
|
|
echo "<div class=\"ajax\" data-view=\"Timeline\" data-action=\"iteminfo\" ></div>";
|
2020-10-08 05:57:23 +00:00
|
|
|
$this->columnEnd();
|
2021-04-27 15:06:19 +00:00
|
|
|
$this->columnStart(8);
|
2015-12-16 06:14:04 +00:00
|
|
|
$this->contentHeading(getMLText("timeline"));
|
|
|
|
$this->printTimelineHtml(550);
|
2020-10-08 05:57:23 +00:00
|
|
|
$this->columnEnd();
|
|
|
|
$this->rowEnd();
|
2015-12-16 06:14:04 +00:00
|
|
|
|
|
|
|
$this->contentContainerEnd();
|
2016-03-15 07:30:53 +00:00
|
|
|
$this->contentEnd();
|
2015-12-16 06:14:04 +00:00
|
|
|
$this->htmlEndPage();
|
2015-09-21 14:46:17 +00:00
|
|
|
} /* }}} */
|
|
|
|
}
|
|
|
|
?>
|