number of days to look back on dashboard can be configured

This commit is contained in:
Uwe Steinmann 2023-05-13 12:07:47 +02:00
parent 24c918e698
commit 5a96788ccc
6 changed files with 29 additions and 4 deletions

View File

@ -251,6 +251,8 @@ class Settings { /* {{{ */
var $_enableRecursiveCount = false;
// maximum number of documents or folders when counted recursively
var $_maxRecursiveCount = 10000;
// number of days in the past of the dashboard
var $_daysPastDashboard = 7;
// enable/disable help
var $_enableHelp = true;
// enable/disable language selection menu
@ -529,6 +531,7 @@ class Settings { /* {{{ */
$this->_enableFolderTree = Settings::boolVal($tab["enableFolderTree"]);
$this->_enableRecursiveCount = Settings::boolVal($tab["enableRecursiveCount"]);
$this->_maxRecursiveCount = intval($tab["maxRecursiveCount"]);
$this->_daysPastDashboard = intval($tab["daysPastDashboard"]);
$this->_enableHelp = Settings::boolVal($tab["enableHelp"]);
$this->_enableLanguageSelector = Settings::boolVal($tab["enableLanguageSelector"]);
$this->_enableThemeSelector = Settings::boolVal($tab["enableThemeSelector"]);
@ -914,6 +917,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "enableFolderTree", $this->_enableFolderTree);
$this->setXMLAttributValue($node, "enableRecursiveCount", $this->_enableRecursiveCount);
$this->setXMLAttributValue($node, "maxRecursiveCount", $this->_maxRecursiveCount);
$this->setXMLAttributValue($node, "daysPastDashboard", $this->_daysPastDashboard);
$this->setXMLAttributValue($node, "enableHelp", $this->_enableHelp);
$this->setXMLAttributValue($node, "enableLanguageSelector", $this->_enableLanguageSelector);
$this->setXMLAttributValue($node, "enableThemeSelector", $this->_enableThemeSelector);

View File

@ -144,6 +144,7 @@ if ($action == "saveSettings")
setBoolValue("enableFolderTree");
setBoolValue("enableRecursiveCount");
setIntValue("maxRecursiveCount");
setIntValue("daysPastDashboard");
setBoolValue("enableLanguageSelector");
setBoolValue("enableHelp");
setBoolValue("enableThemeSelector");

View File

@ -24,6 +24,7 @@ if($view) {
$view->setParam('previewConverters', isset($settings->_converters['preview']) ? $settings->_converters['preview'] : array());
$view->setParam('convertToPdf', $settings->_convertToPdf);
$view->setParam('timeout', $settings->_cmdTimeout);
$view->setParam('dayspastdashboard', (int) $settings->_daysPastDashboard);
$view->setParam('accessobject', $accessop);
$view->setParam('xsendfile', $settings->_enableXsendfile);
$view($_GET);

View File

@ -265,7 +265,7 @@ class SeedDMS_View_Calendar extends SeedDMS_Theme_Style {
if ($item['document']->getAccessMode($user) >= M_READ)
$arr[] = array(
'start'=>$item['date'],
'title'=>$item['document']->getName()." (".$item['version'].")\n".getOverallStatusText($item['status']), //$item['msg'],
'title'=>$item['document']->getName().(isset($item['version']) ? " (".$item['version'].")" : "").(isset($item['status']) ? "\n".getOverallStatusText($item['status']) : ''),
'allDay'=>false,
'color'=>$color,
'type'=>$item['type'],
@ -473,6 +473,21 @@ $(document).ready(function() {
$this->columnStart(8);
?>
<div id="calendar" style="margin-bottom: 20px;"></div>
<div id="cal_legend">
<?php
$legend = [];
$legend[] = ['color'=>'ff4455', 'text'=>'expired'];
$legend[] = ['color'=>'20a820', 'text'=>'updated'];
$legend[] = ['color'=>'c3bf00', 'text'=>'timeline_add_file'];
$legend[] = ['color'=>'129a02', 'text'=>'released'];
$legend[] = ['color'=>'a8a8a8', 'text'=>'status_change'];
$legend[] = ['color'=>'20a8a8', 'text'=>'undefined'];
$legend[] = ['color'=>'3a87ad', 'text'=>'event'];
foreach($legend as $item) {
echo "<span style='margin-right: 1em;'><i class='fa fa-circle' style='color: #".$item['color'].";'></i> ".getMLText($item['text'])."</span>";
}
?>
</div>
<?php
$this->columnEnd();
$this->columnStart(4);

View File

@ -66,6 +66,7 @@ class SeedDMS_View_Dashboard extends SeedDMS_Theme_Style {
$previewwidth = $this->params['previewWidthList'];
$previewconverters = $this->params['previewConverters'];
$timeout = $this->params['timeout'];
$dayspastdashboard = $this->params['dayspastdashboard'];
$xsendfile = $this->params['xsendfile'];
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile);
@ -75,7 +76,7 @@ class SeedDMS_View_Dashboard extends SeedDMS_Theme_Style {
$previewer->setConverters($previewconverters);
echo $this->contentHeading(getMLText('new_documents'));
$documents = $dms->getLatestChanges('newdocuments', mktime(0, 0, 0)-7*86400, time());
$documents = $dms->getLatestChanges('newdocuments', mktime(0, 0, 0)-$dayspastdashboard*86400, time());
if (count($documents) > 0) {
$this->printList($documents, $previewer);
}
@ -89,6 +90,7 @@ class SeedDMS_View_Dashboard extends SeedDMS_Theme_Style {
$previewwidth = $this->params['previewWidthList'];
$previewconverters = $this->params['previewConverters'];
$timeout = $this->params['timeout'];
$dayspastdashboard = $this->params['dayspastdashboard'];
$xsendfile = $this->params['xsendfile'];
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile);
@ -98,7 +100,7 @@ class SeedDMS_View_Dashboard extends SeedDMS_Theme_Style {
$previewer->setConverters($previewconverters);
echo $this->contentHeading(getMLText('updated_documents'));
$documents = $dms->getLatestChanges('updateddocuments', mktime(0, 0, 0)-7*86400, time());
$documents = $dms->getLatestChanges('updateddocuments', mktime(0, 0, 0)-$dayspastdashboard*86400, time());
if (count($documents) > 0) {
$this->printList($documents, $previewer);
}
@ -112,6 +114,7 @@ class SeedDMS_View_Dashboard extends SeedDMS_Theme_Style {
$previewwidth = $this->params['previewWidthList'];
$previewconverters = $this->params['previewConverters'];
$timeout = $this->params['timeout'];
$dayspastdashboard = $this->params['dayspastdashboard'];
$xsendfile = $this->params['xsendfile'];
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile);
@ -121,7 +124,7 @@ class SeedDMS_View_Dashboard extends SeedDMS_Theme_Style {
$previewer->setConverters($previewconverters);
echo $this->contentHeading(getMLText('status_change'));
$documents = $dms->getLatestChanges('statuschange', mktime(0, 0, 0)-7*86400, time());
$documents = $dms->getLatestChanges('statuschange', mktime(0, 0, 0)-$dayspastdashboard*86400, time());
if (count($documents) > 0) {
$this->printList($documents, $previewer);
}

View File

@ -370,6 +370,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
<?php $this->showConfigOption('settings_expandFolderTree', 'expandFolderTree', array(' 0'=>'settings_expandFolderTree_val0', ' 1'=>'settings_expandFolderTree_val1', ' 2'=>'settings_expandFolderTree_val2'), false, true); ?>
<?php $this->showConfigCheckbox('settings_enableRecursiveCount', 'enableRecursiveCount'); ?>
<?php $this->showConfigText('settings_maxRecursiveCount', 'maxRecursiveCount'); ?>
<?php $this->showConfigText('settings_daysPastDashboard', 'daysPastDashboard'); ?>
<?php $this->showConfigCheckbox('settings_enableLanguageSelector', 'enableLanguageSelector'); ?>
<?php $this->showConfigCheckbox('settings_enableHelp', 'enableHelp'); ?>
<?php $this->showConfigCheckbox('settings_enableThemeSelector', 'enableThemeSelector'); ?>