seeddms-code/views/bootstrap/class.ExpiredDocuments.php

141 lines
5.0 KiB
PHP
Raw Permalink Normal View History

2017-10-06 15:59:46 +00:00
<?php
/**
* Implementation of ExpiredDocuments 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
*/
//require_once("class.Bootstrap.php");
2017-10-06 15:59:46 +00:00
/**
* Class which outputs the html page for ExpiredDocuments 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@
*/
class SeedDMS_View_ExpiredDocuments extends SeedDMS_Theme_Style {
2017-10-06 15:59:46 +00:00
2020-05-22 14:26:23 +00:00
function js() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
header('Content-Type: application/javascript; charset=UTF-8');
2020-05-22 14:26:23 +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'));
$this->printDeleteDocumentButtonJs();
/* Add js for catching click on document in one page mode */
$this->printClickDocumentJs();
} /* }}} */
2017-10-06 15:59:46 +00:00
function show() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
$orderby = $this->params['orderby'];
$orderdir = $this->params['orderdir'];
2023-03-11 21:49:41 +00:00
$conversionmgr = $this->params['conversionmgr'];
2017-10-06 15:59:46 +00:00
$cachedir = $this->params['cachedir'];
$previewwidth = $this->params['previewWidthList'];
$timeout = $this->params['timeout'];
2019-01-18 12:07:39 +00:00
$xsendfile = $this->params['xsendfile'];
$order = $orderby.$orderdir;
2024-03-28 17:22:08 +00:00
$days = $this->params['days'];
$startts = $this->params['startts'];
$endts = $this->params['endts'];
2017-10-06 15:59:46 +00:00
$db = $dms->getDB();
2019-01-18 12:07:39 +00:00
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile);
2023-03-11 21:49:41 +00:00
if($conversionmgr)
$previewer->setConversionMgr($conversionmgr);
2017-10-06 15:59:46 +00:00
$this->htmlStartPage(getMLText("expired_documents"));
$this->globalNavigation();
$this->contentStart();
$this->pageNavigation(getMLText("expired_documents"), "admin_tools");
2024-03-28 17:22:08 +00:00
$this->rowStart();
$this->columnStart(4);
2017-10-06 16:05:39 +00:00
$this->contentHeading(getMLText("expired_documents"));
2024-03-28 17:22:08 +00:00
?>
<form class="form-horizontal">
<?php
$this->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("<i class=\"fa fa-refresh\"></i> ".getMLText('update'));
?>
</form>
<?php
$this->columnEnd();
$this->columnStart(8);
2017-10-06 15:59:46 +00:00
2024-03-28 17:22:08 +00:00
if(is_numeric($days)) {
$docs = $dms->getDocumentsExpired($days, null, $orderby, $orderdir, true);
$this->contentHeading(''.$days);
} else {
$d = [];
if($startts)
$d['start'] = $startts;
if($endts)
2024-03-28 17:30:02 +00:00
$d['end'] = $endts+86400;
2024-03-28 17:22:08 +00:00
$docs = $dms->getDocumentsExpired($d, null, $orderby, $orderdir, true);
$this->contentHeading(getReadableDate($startts)." - ".getReadableDate($endts));
}
if($docs) {
2017-10-06 15:59:46 +00:00
2024-03-28 17:22:08 +00:00
print "<table class=\"table table-condensed table-sm\">";
2017-10-06 16:05:39 +00:00
print "<thead>\n<tr>\n";
print "<th></th>";
print "<th>".getMLText("name");
2024-03-28 17:22:08 +00:00
print " <a class=\"order-btn\" href=\"../out/out.ExpiredDocuments.php?".($order=="na"?"&orderby=n&orderdir=d":"&orderby=n&orderdir=a")."&days=".$days."&startdate=".getReadableDate($startts)."&enddate=".getReadableDate($endts)."\" \"title=\"".getMLText("sort_by_name")."\">".($order=="na"?' <i class="fa fa-sort-alpha-asc selected"></i>':($order=="nd"?' <i class="fa fa-sort-alpha-desc selected"></i>':' <i class="fa fa-sort-alpha-asc"></i>'))."</a>";
print " <a class=\"order-btn\" href=\"../out/out.ExpiredDocuments.php?".($order=="ea"?"&orderby=e&orderdir=d":"&orderby=e&orderdir=a")."&days=".$days."&startdate=".getReadableDate($startts)."&enddate=".getReadableDate($endts)."\" \"title=\"".getMLText("sort_by_expiration_date")."\">".($order=="ea"?' <i class="fa fa-sort-numeric-asc selected"></i>':($order=="ed"?' <i class="fa fa-sort-numeric-desc selected"></i>':' <i class="fa fa-sort-numeric-asc"></i>'))."</a>";
print "</th>\n";
2020-05-22 14:26:23 +00:00
print "<th>".getMLText("status")."</th>\n";
print "<th>".getMLText("action")."</th>\n";
2017-10-06 16:05:39 +00:00
print "</tr>\n</thead>\n<tbody>\n";
2017-10-06 15:59:46 +00:00
2017-10-06 16:05:39 +00:00
foreach ($docs as $document) {
2020-05-22 14:26:23 +00:00
echo $this->documentListRow($document, $previewer);
2017-10-06 15:59:46 +00:00
}
2017-10-06 16:05:39 +00:00
print "</tbody></table>";
}
else $this->infoMsg(getMLText("no_docs_expired"));
2017-10-06 16:05:39 +00:00
2024-03-28 17:22:08 +00:00
$this->columnEnd();
$this->rowEnd();
2017-10-06 15:59:46 +00:00
$this->contentEnd();
$this->htmlEndPage();
} /* }}} */
}
?>