From 5a96788ccce1c6a455c43a206a5282f0294e3ede Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sat, 13 May 2023 12:07:47 +0200 Subject: [PATCH] number of days to look back on dashboard can be configured --- inc/inc.ClassSettings.php | 4 ++++ op/op.Settings.php | 1 + out/out.Dashboard.php | 1 + views/bootstrap/class.Calendar.php | 17 ++++++++++++++++- views/bootstrap/class.Dashboard.php | 9 ++++++--- views/bootstrap/class.Settings.php | 1 + 6 files changed, 29 insertions(+), 4 deletions(-) diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index 7172bda3c..f89343c40 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -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); diff --git a/op/op.Settings.php b/op/op.Settings.php index b2a6b23f7..339a409c9 100644 --- a/op/op.Settings.php +++ b/op/op.Settings.php @@ -144,6 +144,7 @@ if ($action == "saveSettings") setBoolValue("enableFolderTree"); setBoolValue("enableRecursiveCount"); setIntValue("maxRecursiveCount"); + setIntValue("daysPastDashboard"); setBoolValue("enableLanguageSelector"); setBoolValue("enableHelp"); setBoolValue("enableThemeSelector"); diff --git a/out/out.Dashboard.php b/out/out.Dashboard.php index b4a183519..8a72456fd 100644 --- a/out/out.Dashboard.php +++ b/out/out.Dashboard.php @@ -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); diff --git a/views/bootstrap/class.Calendar.php b/views/bootstrap/class.Calendar.php index 667856e55..1b93f3b37 100644 --- a/views/bootstrap/class.Calendar.php +++ b/views/bootstrap/class.Calendar.php @@ -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); ?>
+
+'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 " ".getMLText($item['text']).""; + } +?> +
columnEnd(); $this->columnStart(4); diff --git a/views/bootstrap/class.Dashboard.php b/views/bootstrap/class.Dashboard.php index ca288b762..dc567dd52 100644 --- a/views/bootstrap/class.Dashboard.php +++ b/views/bootstrap/class.Dashboard.php @@ -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); } diff --git a/views/bootstrap/class.Settings.php b/views/bootstrap/class.Settings.php index 1b1354832..ad15d680f 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -370,6 +370,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk)) showConfigOption('settings_expandFolderTree', 'expandFolderTree', array(' 0'=>'settings_expandFolderTree_val0', ' 1'=>'settings_expandFolderTree_val1', ' 2'=>'settings_expandFolderTree_val2'), false, true); ?> showConfigCheckbox('settings_enableRecursiveCount', 'enableRecursiveCount'); ?> showConfigText('settings_maxRecursiveCount', 'maxRecursiveCount'); ?> +showConfigText('settings_daysPastDashboard', 'daysPastDashboard'); ?> showConfigCheckbox('settings_enableLanguageSelector', 'enableLanguageSelector'); ?> showConfigCheckbox('settings_enableHelp', 'enableHelp'); ?> showConfigCheckbox('settings_enableThemeSelector', 'enableThemeSelector'); ?>