From 84ff9e48feb257654955c36736b0717b06951242 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 28 Mar 2024 18:22:08 +0100 Subject: [PATCH] start and end date can be specified --- out/out.ExpiredDocuments.php | 17 +++++++ views/bootstrap/class.ExpiredDocuments.php | 56 +++++++++++++++++++--- 2 files changed, 67 insertions(+), 6 deletions(-) diff --git a/out/out.ExpiredDocuments.php b/out/out.ExpiredDocuments.php index 70355aff4..da268637b 100644 --- a/out/out.ExpiredDocuments.php +++ b/out/out.ExpiredDocuments.php @@ -46,11 +46,28 @@ if (isset($_GET["orderdir"]) && strlen($_GET["orderdir"])==1 ) { $orderdir=$_GET["orderdir"]; } +$days = null; +$starts = null; +$endts = null; +if(isset($_GET['days']) && is_numeric($_GET['days'])) { + $days = (int) $_GET['days']; +} else { + if(isset($_GET['startdate'])) { + $startts = makeTsFromDate($_GET['startdate']); + } + if(isset($_GET['enddate'])) { + $endts = makeTsFromDate($_GET['enddate']); + } +} + if($view) { $view->setParam('conversionmgr', $conversionmgr); $view->setParam('showtree', showtree()); $view->setParam('orderby', $orderby); $view->setParam('orderdir', $orderdir); + $view->setParam('days', $days); + $view->setParam('startts', $startts); + $view->setParam('endts', $endts); $view->setParam('cachedir', $settings->_cacheDir); $view->setParam('previewWidthList', $settings->_previewWidthList); $view->setParam('timeout', $settings->_cmdTimeout); diff --git a/views/bootstrap/class.ExpiredDocuments.php b/views/bootstrap/class.ExpiredDocuments.php index 915cc6473..61669d117 100644 --- a/views/bootstrap/class.ExpiredDocuments.php +++ b/views/bootstrap/class.ExpiredDocuments.php @@ -53,6 +53,9 @@ class SeedDMS_View_ExpiredDocuments extends SeedDMS_Theme_Style { $timeout = $this->params['timeout']; $xsendfile = $this->params['xsendfile']; $order = $orderby.$orderdir; + $days = $this->params['days']; + $startts = $this->params['startts']; + $endts = $this->params['endts']; $db = $dms->getDB(); $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); @@ -64,17 +67,57 @@ class SeedDMS_View_ExpiredDocuments extends SeedDMS_Theme_Style { $this->contentStart(); $this->pageNavigation(getMLText("expired_documents"), "admin_tools"); + $this->rowStart(); + $this->columnStart(4); $this->contentHeading(getMLText("expired_documents")); -// $this->contentContainerStart(); +?> +
+formField( + getMLText("days"), + array( + 'element'=>'input', + 'type'=>'number', + 'name'=>'days', + 'id'=>'days', + 'value'=>$days + ) + ); + $this->formField( + getMLText("startdate"), + $this->getDateChooser(getReadableDate($startts), "startdate", $this->params['session']->getLanguage(), '', '') + ); + $this->formField( + getMLText("enddate"), + $this->getDateChooser(getReadableDate($endts), "enddate", $this->params['session']->getLanguage(), '', '') + ); + $this->formSubmit(" ".getMLText('update')); +?> +
+columnEnd(); + $this->columnStart(8); - if($docs = $dms->getDocumentsExpired(-1400, null, $orderby, $orderdir, true)) { + if(is_numeric($days)) { + $docs = $dms->getDocumentsExpired($days, null, $orderby, $orderdir, true); + $this->contentHeading(''.$days); + } else { + $d = []; + if($startts) + $d['start'] = $startts; + if($endts) + $d['end'] = $endts; + $docs = $dms->getDocumentsExpired($d, null, $orderby, $orderdir, true); + $this->contentHeading(getReadableDate($startts)." - ".getReadableDate($endts)); + } + if($docs) { - print ""; + print "
"; print "\n\n"; print ""; print "\n"; print "\n"; print "\n"; @@ -87,7 +130,8 @@ class SeedDMS_View_ExpiredDocuments extends SeedDMS_Theme_Style { } else $this->infoMsg(getMLText("no_docs_expired")); -// $this->contentContainerEnd(); + $this->columnEnd(); + $this->rowEnd(); $this->contentEnd(); $this->htmlEndPage();
".getMLText("name"); - print " ".($order=="na"?' ':($order=="nd"?' ':' ')).""; - print " ".($order=="ea"?' ':($order=="ed"?' ':' ')).""; + print " ".($order=="na"?' ':($order=="nd"?' ':' ')).""; + print " ".($order=="ea"?' ':($order=="ed"?' ':' ')).""; print "".getMLText("status")."".getMLText("action")."