2012-12-14 07:53:13 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Implementation of ApprovalSummary view
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2012-12-14 07:53:13 +00:00
|
|
|
* @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-18 05:08:00 +00:00
|
|
|
//require_once("class.Bootstrap.php");
|
2012-12-14 07:53:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class which outputs the html page for ApprovalSummary view
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2012-12-14 07:53:13 +00:00
|
|
|
* @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-18 05:08:00 +00:00
|
|
|
class SeedDMS_View_ApprovalSummary extends SeedDMS_Theme_Style {
|
2012-12-14 07:53:13 +00:00
|
|
|
|
2019-07-12 14:42:29 +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();
|
2019-11-25 08:51:39 +00:00
|
|
|
$this->printClickDocumentJs();
|
2019-07-12 14:42:29 +00:00
|
|
|
} /* }}} */
|
|
|
|
|
2012-12-14 07:53:13 +00:00
|
|
|
function show() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
2015-07-08 05:24:50 +00:00
|
|
|
$cachedir = $this->params['cachedir'];
|
|
|
|
$previewwidth = $this->params['previewWidthList'];
|
2020-07-21 07:26:17 +00:00
|
|
|
$previewconverters = $this->params['previewConverters'];
|
2016-02-15 09:57:37 +00:00
|
|
|
$timeout = $this->params['timeout'];
|
2019-01-18 12:07:39 +00:00
|
|
|
$xsendfile = $this->params['xsendfile'];
|
2015-07-08 05:24:50 +00:00
|
|
|
|
2019-01-18 12:07:39 +00:00
|
|
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile);
|
2016-04-15 11:20:56 +00:00
|
|
|
$previewer->setConverters($previewconverters);
|
2012-12-14 07:53:13 +00:00
|
|
|
|
|
|
|
$this->htmlStartPage(getMLText("approval_summary"));
|
|
|
|
$this->globalNavigation();
|
|
|
|
$this->contentStart();
|
|
|
|
$this->pageNavigation(getMLText("my_documents"), "my_documents");
|
2020-10-08 05:57:23 +00:00
|
|
|
$this->rowStart();
|
|
|
|
$this->columnStart(6);
|
2012-12-14 07:53:13 +00:00
|
|
|
$this->contentHeading(getMLText("approval_summary"));
|
2018-07-13 06:49:10 +00:00
|
|
|
// $this->contentContainerStart();
|
2012-12-14 07:53:13 +00:00
|
|
|
|
|
|
|
// Get document list for the current user.
|
|
|
|
$approvalStatus = $user->getApprovalStatus();
|
|
|
|
|
|
|
|
// reverse order
|
|
|
|
$approvalStatus["indstatus"]=array_reverse($approvalStatus["indstatus"],true);
|
|
|
|
$approvalStatus["grpstatus"]=array_reverse($approvalStatus["grpstatus"],true);
|
2018-07-13 06:49:10 +00:00
|
|
|
|
2012-12-14 07:53:13 +00:00
|
|
|
$iRev = array();
|
|
|
|
$printheader = true;
|
|
|
|
foreach ($approvalStatus["indstatus"] as $st) {
|
|
|
|
$document = $dms->getDocument($st['documentID']);
|
2015-07-08 05:24:50 +00:00
|
|
|
$version = $document->getContentByVersion($st['version']);
|
2012-12-14 07:53:13 +00:00
|
|
|
$moduser = $dms->getUser($st['required']);
|
|
|
|
|
|
|
|
if ($document && $version) {
|
2018-07-13 06:49:10 +00:00
|
|
|
|
2012-12-14 07:53:13 +00:00
|
|
|
if ($printheader){
|
2021-06-01 08:51:16 +00:00
|
|
|
print "<table class=\"table table-condensed table-sm\">";
|
2012-12-14 07:53:13 +00:00
|
|
|
print "<thead>\n<tr>\n";
|
2015-07-08 05:24:50 +00:00
|
|
|
print "<th></th>\n";
|
2012-12-14 07:53:13 +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";
|
2012-12-14 07:53:13 +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:01:36 +00:00
|
|
|
$class = $st['status'] == 1 ? ' success' : ($st['status'] == -1 ? ' error' : ( $st['status'] == -2 ? ' info' : ''));
|
2019-07-19 13:41:05 +00:00
|
|
|
echo $this->documentListRowStart($document, $class);
|
2016-08-11 20:57:53 +00:00
|
|
|
echo $this->documentListRow($document, $previewer, true, $st['version']);
|
2018-07-13 09:01:36 +00:00
|
|
|
print "<td><small>".getApprovalStatusText($st['status'])."<br />".$st["date"]."<br />". htmlspecialchars($moduser->getFullName()) ."</small></td>";
|
2019-07-19 13:41:05 +00:00
|
|
|
echo $this->documentListRowEnd($document);
|
2015-07-08 05:24:50 +00:00
|
|
|
}
|
2012-12-14 07:53:13 +00:00
|
|
|
}
|
|
|
|
if ($st["status"]!=-2) {
|
|
|
|
$iRev[] = $st["documentID"];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!$printheader) {
|
|
|
|
echo "</tbody>\n</table>\n";
|
|
|
|
}else{
|
|
|
|
printMLText("no_approval_needed");
|
|
|
|
}
|
|
|
|
|
2018-07-13 06:49:10 +00:00
|
|
|
// $this->contentContainerEnd();
|
2020-10-08 05:57:23 +00:00
|
|
|
$this->columnEnd();
|
|
|
|
$this->columnStart(6);
|
2012-12-14 07:53:13 +00:00
|
|
|
$this->contentHeading(getMLText("group_approval_summary"));
|
2018-07-13 06:49:10 +00:00
|
|
|
// $this->contentContainerStart();
|
2012-12-14 07:53:13 +00:00
|
|
|
|
|
|
|
$printheader = true;
|
|
|
|
foreach ($approvalStatus["grpstatus"] as $st) {
|
|
|
|
$document = $dms->getDocument($st['documentID']);
|
2015-07-08 05:24:50 +00:00
|
|
|
$version = $document->getContentByVersion($st['version']);
|
2012-12-14 07:53:13 +00:00
|
|
|
$modgroup = $dms->getGroup($st['required']);
|
|
|
|
|
2021-09-29 13:01:07 +00:00
|
|
|
/* Filter out those documents which already require an approval as an individual */
|
2012-12-14 07:53:13 +00:00
|
|
|
if (!in_array($st["documentID"], $iRev) && $document && $version) {
|
2018-07-13 06:49:10 +00:00
|
|
|
|
2012-12-14 07:53:13 +00:00
|
|
|
if ($printheader){
|
2021-06-01 08:51:16 +00:00
|
|
|
print "<table class=\"table table-condensed table-sm\">";
|
2012-12-14 07:53:13 +00:00
|
|
|
print "<thead>\n<tr>\n";
|
2015-07-08 05:24:50 +00:00
|
|
|
print "<th></th>\n";
|
2012-12-14 07:53:13 +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";
|
2012-12-14 07:53:13 +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:01:36 +00:00
|
|
|
$class = $st['status'] == 1 ? ' success' : ($st['status'] == -1 ? ' error' : ( $st['status'] == -2 ? ' info' : ''));
|
2019-07-12 14:42:29 +00:00
|
|
|
echo $this->documentListRowStart($document, $class);
|
2018-07-13 06:49:10 +00:00
|
|
|
echo $this->documentListRow($document, $previewer, true, $st['version']);
|
2019-11-25 08:34:12 +00:00
|
|
|
print "<td><small>".getApprovalStatusText($st["status"])."<br />".$st["date"]."<br />". htmlspecialchars($modgroup->getName()) ."</small></td>";
|
2019-07-12 14:42:29 +00:00
|
|
|
echo $this->documentListRowEnd($document);
|
2015-07-08 05:24:50 +00:00
|
|
|
}
|
2012-12-14 07:53:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!$printheader) {
|
|
|
|
echo "</tbody>\n</table>\n";
|
|
|
|
}else{
|
2015-05-08 06:32:09 +00:00
|
|
|
printMLText("no_approval_needed");
|
2012-12-14 07:53:13 +00:00
|
|
|
}
|
|
|
|
|
2018-07-13 06:49:10 +00:00
|
|
|
// $this->contentContainerEnd();
|
2020-10-08 05:57:23 +00:00
|
|
|
$this->columnEnd();
|
|
|
|
$this->rowEnd();
|
2016-03-15 07:30:53 +00:00
|
|
|
$this->contentEnd();
|
2012-12-14 07:53:13 +00:00
|
|
|
$this->htmlEndPage();
|
|
|
|
} /* }}} */
|
|
|
|
}
|
|
|
|
?>
|