2015-04-22 15:24:58 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Implementation of ReceiptSummary 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-19 17:45:40 +00:00
|
|
|
//require_once("class.Bootstrap.php");
|
2015-04-22 15:24:58 +00:00
|
|
|
|
2018-02-05 07:57:05 +00:00
|
|
|
/**
|
|
|
|
* Include class to preview documents
|
|
|
|
*/
|
|
|
|
require_once("SeedDMS/Preview.php");
|
|
|
|
|
2015-04-22 15:24:58 +00:00
|
|
|
/**
|
|
|
|
* Class which outputs the html page for ReceiptSummary 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-19 17:45:40 +00:00
|
|
|
class SeedDMS_View_ReceiptSummary extends SeedDMS_Theme_Style {
|
2015-04-22 15:24:58 +00:00
|
|
|
|
2019-11-25 10:51:08 +00:00
|
|
|
function js() { /* {{{ */
|
|
|
|
header('Content-Type: application/javascript; charset=UTF-8');
|
|
|
|
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();
|
|
|
|
$this->printClickDocumentJs();
|
|
|
|
} /* }}} */
|
|
|
|
|
2015-04-22 15:24:58 +00:00
|
|
|
function show() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
2016-04-15 11:20:56 +00:00
|
|
|
$cachedir = $this->params['cachedir'];
|
|
|
|
$previewwidth = $this->params['previewWidthList'];
|
2020-07-21 07:26:17 +00:00
|
|
|
$previewconverters = $this->params['previewConverters'];
|
2016-04-15 11:20:56 +00:00
|
|
|
$timeout = $this->params['timeout'];
|
|
|
|
|
|
|
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
|
|
|
$previewer->setConverters($previewconverters);
|
2015-04-22 15:24:58 +00:00
|
|
|
|
|
|
|
$this->htmlStartPage(getMLText("my_documents"));
|
|
|
|
$this->globalNavigation();
|
|
|
|
$this->contentStart();
|
|
|
|
$this->pageNavigation(getMLText("my_documents"), "my_documents");
|
|
|
|
|
2021-04-19 17:45:40 +00:00
|
|
|
$this->rowStart();
|
|
|
|
$this->columnStart(6);
|
2015-04-22 15:24:58 +00:00
|
|
|
$this->contentHeading(getMLText("receipt_summary"));
|
|
|
|
|
|
|
|
// TODO: verificare scadenza
|
|
|
|
|
|
|
|
// Get document list for the current user.
|
|
|
|
$receiptStatus = $user->getReceiptStatus();
|
|
|
|
|
|
|
|
// reverse order
|
|
|
|
$receiptStatus["indstatus"]=array_reverse($receiptStatus["indstatus"],true);
|
|
|
|
$receiptStatus["grpstatus"]=array_reverse($receiptStatus["grpstatus"],true);
|
|
|
|
|
|
|
|
$printheader=true;
|
|
|
|
$iRev = array();
|
|
|
|
foreach ($receiptStatus["indstatus"] as $st) {
|
|
|
|
$document = $dms->getDocument($st['documentID']);
|
|
|
|
if($document)
|
|
|
|
$version = $document->getContentByVersion($st['version']);
|
|
|
|
$moduser = $dms->getUser($st['required']);
|
|
|
|
|
|
|
|
if ($document && $version) {
|
|
|
|
|
|
|
|
if ($printheader){
|
2016-08-11 20:57:53 +00:00
|
|
|
print "<table class=\"table table-condensed\">";
|
2015-04-22 15:24:58 +00:00
|
|
|
print "<thead>\n<tr>\n";
|
2016-04-15 11:20:56 +00:00
|
|
|
print "<th></th>\n";
|
2015-04-22 15:24:58 +00:00
|
|
|
print "<th>".getMLText("name")."</th>\n";
|
|
|
|
print "<th>".getMLText("status")."</th>\n";
|
2016-08-11 20:57:53 +00:00
|
|
|
print "<th>".getMLText("action")."</th>\n";
|
2015-04-22 15:24:58 +00:00
|
|
|
print "<th>".getMLText("last_update")."</th>\n";
|
|
|
|
print "</tr>\n</thead>\n<tbody>\n";
|
|
|
|
$printheader=false;
|
|
|
|
}
|
2016-08-11 20:57:53 +00:00
|
|
|
|
|
|
|
$txt = $this->callHook('documentListItem', $document, $previewer);
|
|
|
|
if(is_string($txt))
|
|
|
|
echo $txt;
|
|
|
|
else {
|
2018-07-13 09:07:05 +00:00
|
|
|
$class = $st['status'] == 1 ? ' success' : ($st['status'] == -1 ? ' error' : ( $st['status'] == -2 ? ' info' : ''));
|
|
|
|
echo "<tr id=\"table-row-document-".$document->getID()."\" class=\"table-row-document".$class."\" rel=\"document_".$document->getID()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
|
2016-08-11 20:57:53 +00:00
|
|
|
echo $this->documentListRow($document, $previewer, true, $st['version']);
|
2018-07-13 09:07:05 +00:00
|
|
|
print "<td><small>".getReceiptStatusText($st['status'])."<br />".$st["date"]."<br />". htmlspecialchars($moduser->getFullName()) ."</small></td>";
|
2016-08-11 20:57:53 +00:00
|
|
|
echo "</tr>";
|
2016-04-15 11:20:56 +00:00
|
|
|
}
|
2015-04-22 15:24:58 +00:00
|
|
|
}
|
|
|
|
if ($st["status"]!=-2) {
|
|
|
|
$iRev[] = $st["documentID"];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!$printheader) {
|
|
|
|
echo "</tbody>\n</table>";
|
|
|
|
} else {
|
|
|
|
printMLText("no_docs_to_receipt");
|
|
|
|
}
|
|
|
|
|
2021-04-19 17:45:40 +00:00
|
|
|
$this->columnEnd();
|
|
|
|
$this->columnStart(6);
|
2015-04-22 15:24:58 +00:00
|
|
|
$this->contentHeading(getMLText("group_receipt_summary"));
|
|
|
|
|
|
|
|
$printheader=true;
|
|
|
|
foreach ($receiptStatus["grpstatus"] as $st) {
|
|
|
|
$document = $dms->getDocument($st['documentID']);
|
|
|
|
if($document)
|
|
|
|
$version = $document->getContentByVersion($st['version']);
|
|
|
|
$modgroup = $dms->getGroup($st['required']);
|
|
|
|
|
|
|
|
if (!in_array($st["documentID"], $iRev) && $document && $version) {
|
|
|
|
|
|
|
|
if ($printheader){
|
2016-08-11 20:57:53 +00:00
|
|
|
print "<table class=\"table table-condensed\">";
|
2015-04-22 15:24:58 +00:00
|
|
|
print "<thead>\n<tr>\n";
|
2016-08-11 20:57:53 +00:00
|
|
|
print "<th></th>\n";
|
2015-04-22 15:24:58 +00:00
|
|
|
print "<th>".getMLText("name")."</th>\n";
|
|
|
|
print "<th>".getMLText("status")."</th>\n";
|
2016-08-11 20:57:53 +00:00
|
|
|
print "<th>".getMLText("action")."</th>\n";
|
2015-04-22 15:24:58 +00:00
|
|
|
print "<th>".getMLText("last_update")."</th>\n";
|
|
|
|
print "</tr>\n</thead>\n<tbody>\n";
|
|
|
|
$printheader=false;
|
|
|
|
}
|
|
|
|
|
2016-08-11 20:57:53 +00:00
|
|
|
$txt = $this->callHook('documentListItem', $document, $previewer);
|
|
|
|
if(is_string($txt))
|
|
|
|
echo $txt;
|
|
|
|
else {
|
2018-07-13 09:07:05 +00:00
|
|
|
$class = $st['status'] == 1 ? ' success' : ($st['status'] == -1 ? ' error' : ( $st['status'] == -2 ? ' info' : ''));
|
|
|
|
echo "<tr id=\"table-row-document-".$document->getID()."\" class=\"table-row-document".$class."\" rel=\"document_".$document->getID()."\" formtoken=\"".createFormKey('movedocument')."\" draggable=\"true\">";
|
2016-08-11 20:57:53 +00:00
|
|
|
echo $this->documentListRow($document, $previewer, true, $st['version']);
|
2019-11-25 08:34:12 +00:00
|
|
|
print "<td><small>".getReceiptStatusText($st['status'])."<br />".$st["date"]."<br />". htmlspecialchars($modgroup->getName()) ."</small></td>";
|
2016-08-11 20:57:53 +00:00
|
|
|
echo "</tr>";
|
|
|
|
}
|
2015-04-22 15:24:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!$printheader) {
|
|
|
|
echo "</tbody>\n</table>";
|
|
|
|
}else{
|
2015-05-08 06:30:35 +00:00
|
|
|
printMLText("no_docs_to_receipt");
|
2015-04-22 15:24:58 +00:00
|
|
|
}
|
|
|
|
|
2021-04-19 17:45:40 +00:00
|
|
|
$this->columnEnd();
|
|
|
|
$this->rowEnd();
|
2016-03-21 05:20:19 +00:00
|
|
|
$this->contentEnd();
|
2015-04-22 15:24:58 +00:00
|
|
|
$this->htmlEndPage();
|
|
|
|
} /* }}} */
|
|
|
|
}
|
|
|
|
?>
|