mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-18 23:51:20 +00:00
add side menu for selecting list
This commit is contained in:
parent
8a50145932
commit
0434caa89a
|
@ -36,33 +36,32 @@ require_once("SeedDMS/Preview.php");
|
||||||
*/
|
*/
|
||||||
class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
function show() { /* {{{ */
|
function js() { /* {{{ */
|
||||||
|
header('Content-Type: application/javascript');
|
||||||
|
?>
|
||||||
|
$(document).ready( function() {
|
||||||
|
$('body').on('click', 'ul.bs-docs-sidenav li a', function(ev){
|
||||||
|
ev.preventDefault();
|
||||||
|
$('#kkkk.ajax').data('action', $(this).data('action'));
|
||||||
|
$('#kkkk.ajax').trigger('update', {userid: $(this).val()});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
<?php
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function listReviews() { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
$orderby = $this->params['orderby'];
|
|
||||||
$showInProcess = $this->params['showinprocess'];
|
|
||||||
$cachedir = $this->params['cachedir'];
|
$cachedir = $this->params['cachedir'];
|
||||||
$workflowmode = $this->params['workflowmode'];
|
|
||||||
$previewwidth = $this->params['previewWidthList'];
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
$previewconverters = $this->params['previewconverters'];
|
$previewconverters = $this->params['previewconverters'];
|
||||||
$timeout = $this->params['timeout'];
|
$timeout = $this->params['timeout'];
|
||||||
|
|
||||||
$db = $dms->getDB();
|
|
||||||
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
$previewer->setConverters($previewconverters);
|
$previewer->setConverters($previewconverters);
|
||||||
|
|
||||||
$this->htmlStartPage(getMLText("my_documents"));
|
|
||||||
$this->globalNavigation();
|
|
||||||
$this->contentStart();
|
|
||||||
$this->pageNavigation(getMLText("my_documents"), "my_documents");
|
|
||||||
|
|
||||||
if ($showInProcess){
|
|
||||||
|
|
||||||
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
|
||||||
|
|
||||||
// Get document list for the current user.
|
// Get document list for the current user.
|
||||||
$reviewStatus = $user->getReviewStatus();
|
$reviewStatus = $user->getReviewStatus();
|
||||||
$approvalStatus = $user->getApprovalStatus();
|
|
||||||
|
|
||||||
$resArr = $dms->getDocumentList('AppRevByMe', $user);
|
$resArr = $dms->getDocumentList('AppRevByMe', $user);
|
||||||
if (is_bool($resArr) && !$resArr) {
|
if (is_bool($resArr) && !$resArr) {
|
||||||
|
@ -92,9 +91,8 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
|
|
||||||
// List the documents for which a review has been requested.
|
// List the documents for which a review has been requested.
|
||||||
if($workflowmode == 'traditional') {
|
|
||||||
$this->contentHeading(getMLText("documents_to_review"));
|
$this->contentHeading(getMLText("documents_to_review"));
|
||||||
$this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
$printheader=true;
|
$printheader=true;
|
||||||
$iRev = array();
|
$iRev = array();
|
||||||
$dList = array();
|
$dList = array();
|
||||||
|
@ -181,9 +179,56 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}else{
|
}else{
|
||||||
printMLText("no_docs_to_review");
|
printMLText("no_docs_to_review");
|
||||||
}
|
}
|
||||||
|
// $this->contentContainerEnd();
|
||||||
|
} else {
|
||||||
|
$this->contentHeading(getMLText("documents_to_review"));
|
||||||
|
$this->contentContainerStart();
|
||||||
|
printMLText("no_review_needed");
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function listApprovals() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$cachedir = $this->params['cachedir'];
|
||||||
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
|
$previewconverters = $this->params['previewconverters'];
|
||||||
|
$timeout = $this->params['timeout'];
|
||||||
|
|
||||||
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
|
$previewer->setConverters($previewconverters);
|
||||||
|
|
||||||
|
$approvalStatus = $user->getApprovalStatus();
|
||||||
|
|
||||||
|
$resArr = $dms->getDocumentList('AppRevByMe', $user);
|
||||||
|
if (is_bool($resArr) && !$resArr) {
|
||||||
|
$this->contentHeading(getMLText("warning"));
|
||||||
|
$this->contentContainer(getMLText("internal_error_exit"));
|
||||||
|
$this->htmlEndPage();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if($resArr) {
|
||||||
|
/* Create an array to hold all of these results, and index the array
|
||||||
|
* by document id. This makes it easier to retrieve document ID
|
||||||
|
* information later on and saves us having to repeatedly poll the
|
||||||
|
* database every time
|
||||||
|
* new document information is required.
|
||||||
|
*/
|
||||||
|
$docIdx = array();
|
||||||
|
foreach ($resArr as $res) {
|
||||||
|
|
||||||
|
/* verify expiry */
|
||||||
|
if ( $res["expires"] && time()>$res["expires"]+24*60*60 ){
|
||||||
|
if ( $res["status"]==S_DRAFT_APP || $res["status"]==S_DRAFT_REV ){
|
||||||
|
$res["status"]=S_EXPIRED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$docIdx[$res["id"]][$res["version"]] = $res;
|
||||||
|
}
|
||||||
|
|
||||||
// List the documents for which an approval has been requested.
|
// List the documents for which an approval has been requested.
|
||||||
$this->contentHeading(getMLText("documents_to_approve"));
|
$this->contentHeading(getMLText("documents_to_approve"));
|
||||||
$this->contentContainerStart();
|
$this->contentContainerStart();
|
||||||
|
@ -272,18 +317,27 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if($workflowmode == 'traditional') {
|
|
||||||
$this->contentHeading(getMLText("documents_to_review"));
|
|
||||||
$this->contentContainerStart();
|
|
||||||
printMLText("no_review_needed");
|
|
||||||
$this->contentContainerEnd();
|
|
||||||
}
|
|
||||||
$this->contentHeading(getMLText("documents_to_approve"));
|
$this->contentHeading(getMLText("documents_to_approve"));
|
||||||
$this->contentContainerStart();
|
$this->contentContainerStart();
|
||||||
printMLText("no_approval_needed");
|
printMLText("no_approval_needed");
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function listDocsToLookAt() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$workflowmode = $this->params['workflowmode'];
|
||||||
|
$cachedir = $this->params['cachedir'];
|
||||||
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
|
$previewconverters = $this->params['previewconverters'];
|
||||||
|
$timeout = $this->params['timeout'];
|
||||||
|
|
||||||
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
|
$previewer->setConverters($previewconverters);
|
||||||
|
|
||||||
|
if($workflowmode != 'advanced') {
|
||||||
/* Get list of documents owned by current user that are
|
/* Get list of documents owned by current user that are
|
||||||
* pending review or pending approval.
|
* pending review or pending approval.
|
||||||
*/
|
*/
|
||||||
|
@ -296,7 +350,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->contentHeading(getMLText("documents_user_requiring_attention"));
|
$this->contentHeading(getMLText("documents_user_requiring_attention"));
|
||||||
$this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
if (count($resArr)>0) {
|
if (count($resArr)>0) {
|
||||||
|
|
||||||
print "<table class=\"table table-condensed\">";
|
print "<table class=\"table table-condensed\">";
|
||||||
|
@ -343,8 +397,152 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
else printMLText("no_docs_to_look_at");
|
else printMLText("no_docs_to_look_at");
|
||||||
|
|
||||||
$this->contentContainerEnd();
|
// $this->contentContainerEnd();
|
||||||
} elseif($workflowmode == 'advanced') {
|
} else {
|
||||||
|
$resArr = $dms->getDocumentList('WorkflowOwner', $user);
|
||||||
|
if (is_bool($resArr) && !$resArr) {
|
||||||
|
$this->contentHeading(getMLText("warning"));
|
||||||
|
$this->contentContainer("Internal error. Unable to complete request. Exiting.");
|
||||||
|
$this->htmlEndPage();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->contentHeading(getMLText("documents_user_requiring_attention"));
|
||||||
|
// $this->contentContainerStart();
|
||||||
|
if (count($resArr)>0) {
|
||||||
|
|
||||||
|
print "<table class=\"table table-condensed\">";
|
||||||
|
print "<thead>\n<tr>\n";
|
||||||
|
print "<th></th>";
|
||||||
|
print "<th>".getMLText("name")."</th>\n";
|
||||||
|
print "<th>".getMLText("status")."</th>\n";
|
||||||
|
print "<th>".getMLText("version")."</th>\n";
|
||||||
|
print "<th>".getMLText("last_update")."</th>\n";
|
||||||
|
print "<th>".getMLText("expires")."</th>\n";
|
||||||
|
print "</tr>\n</thead>\n<tbody>\n";
|
||||||
|
|
||||||
|
foreach ($resArr as $res) {
|
||||||
|
$document = $dms->getDocument($res["documentID"]);
|
||||||
|
$document->verifyLastestContentExpriry();
|
||||||
|
|
||||||
|
// verify expiry
|
||||||
|
if ( $res["expires"] && time()>$res["expires"]+24*60*60 ){
|
||||||
|
if ( $res["status"]==S_DRAFT_APP || $res["status"]==S_DRAFT_REV ){
|
||||||
|
$res["status"]=S_EXPIRED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($content = $document->getContentByVersion($res['version'])) {
|
||||||
|
print "<tr>\n";
|
||||||
|
$previewer->createPreview($content);
|
||||||
|
print "<td><a href=\"../op/op.Download.php?documentid=".$res["documentID"]."&version=".$res["version"]."\">";
|
||||||
|
if($previewer->hasPreview($content)) {
|
||||||
|
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$content->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($content->getMimeType())."\">";
|
||||||
|
} else {
|
||||||
|
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($content->getFileType())."\" title=\"".htmlspecialchars($content->getMimeType())."\">";
|
||||||
|
}
|
||||||
|
print "</a></td>";
|
||||||
|
print "<td><a href=\"out.ViewDocument.php?documentid=".$res["documentID"]."¤ttab=revapp\">" . htmlspecialchars($res["name"]) . "</a></td>\n";
|
||||||
|
print "<td>".getOverallStatusText($res["status"])."</td>";
|
||||||
|
print "<td>".$res["version"]."</td>";
|
||||||
|
print "<td>".$res["statusDate"]." ".htmlspecialchars($res["statusName"])."</td>";
|
||||||
|
print "<td>".(!$res["expires"] ? "-":getReadableDate($res["expires"]))."</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</tbody></table>";
|
||||||
|
|
||||||
|
}
|
||||||
|
else printMLText("no_docs_to_look_at");
|
||||||
|
|
||||||
|
// $this->contentContainerEnd();
|
||||||
|
}
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function listMyDocs() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$orderby = $this->params['orderby'];
|
||||||
|
$cachedir = $this->params['cachedir'];
|
||||||
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
|
$previewconverters = $this->params['previewconverters'];
|
||||||
|
$timeout = $this->params['timeout'];
|
||||||
|
|
||||||
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
|
$previewer->setConverters($previewconverters);
|
||||||
|
|
||||||
|
/* Get list of documents owned by current user */
|
||||||
|
$resArr = $dms->getDocumentList('MyDocs', $user, $orderby);
|
||||||
|
if (is_bool($resArr) && !$resArr) {
|
||||||
|
$this->contentHeading(getMLText("warning"));
|
||||||
|
$this->contentContainer(getMLText("internal_error_exit"));
|
||||||
|
$this->htmlEndPage();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->contentHeading(getMLText("all_documents"));
|
||||||
|
// $this->contentContainerStart();
|
||||||
|
|
||||||
|
if (count($resArr)>0) {
|
||||||
|
|
||||||
|
print "<table class=\"table table-condensed\">";
|
||||||
|
print "<thead>\n<tr>\n";
|
||||||
|
print "<th></th>";
|
||||||
|
print "<th><a href=\"../out/out.MyDocuments.php?orderby=n\">".getMLText("name")."</a></th>\n";
|
||||||
|
print "<th><a href=\"../out/out.MyDocuments.php?orderby=s\">".getMLText("status")."</a></th>\n";
|
||||||
|
print "<th>".getMLText("version")."</th>\n";
|
||||||
|
print "<th><a href=\"../out/out.MyDocuments.php?orderby=u\">".getMLText("last_update")."</a></th>\n";
|
||||||
|
print "<th><a href=\"../out/out.MyDocuments.php?orderby=e\">".getMLText("expires")."</a></th>\n";
|
||||||
|
print "</tr>\n</thead>\n<tbody>\n";
|
||||||
|
|
||||||
|
foreach ($resArr as $res) {
|
||||||
|
$document = $dms->getDocument($res["documentID"]);
|
||||||
|
$document->verifyLastestContentExpriry();
|
||||||
|
|
||||||
|
// verify expiry
|
||||||
|
if ( $res["expires"] && time()>$res["expires"]+24*60*60 ){
|
||||||
|
if ( $res["status"]==S_DRAFT_APP || $res["status"]==S_DRAFT_REV ){
|
||||||
|
$res["status"]=S_EXPIRED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($content = $document->getContentByVersion($res['version'])) {
|
||||||
|
print "<tr>\n";
|
||||||
|
$previewer->createPreview($content);
|
||||||
|
print "<td><a href=\"../op/op.Download.php?documentid=".$res["documentID"]."&version=".$res["version"]."\">";
|
||||||
|
if($previewer->hasPreview($content)) {
|
||||||
|
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$content->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($content->getMimeType())."\">";
|
||||||
|
} else {
|
||||||
|
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($content->getFileType())."\" title=\"".htmlspecialchars($content->getMimeType())."\">";
|
||||||
|
}
|
||||||
|
print "</a></td>";
|
||||||
|
print "<td><a href=\"out.ViewDocument.php?documentid=".$res["documentID"]."\">" . htmlspecialchars($res["name"]) . "</a></td>\n";
|
||||||
|
print "<td>".getOverallStatusText($res["status"])."</td>";
|
||||||
|
print "<td>".$res["version"]."</td>";
|
||||||
|
print "<td>".$res["statusDate"]." ". htmlspecialchars($res["statusName"])."</td>";
|
||||||
|
//print "<td>".(!$res["expires"] ? getMLText("does_not_expire"):getReadableDate($res["expires"]))."</td>";
|
||||||
|
print "<td>".(!$res["expires"] ? "-":getReadableDate($res["expires"]))."</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</tbody></table>";
|
||||||
|
}
|
||||||
|
else printMLText("empty_notify_list");
|
||||||
|
|
||||||
|
// $this->contentContainerEnd();
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function listWorkflow() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$cachedir = $this->params['cachedir'];
|
||||||
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
|
$previewconverters = $this->params['previewconverters'];
|
||||||
|
$timeout = $this->params['timeout'];
|
||||||
|
|
||||||
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
|
$previewer->setConverters($previewconverters);
|
||||||
|
|
||||||
// Get document list for the current user.
|
// Get document list for the current user.
|
||||||
$workflowStatus = $user->getWorkflowStatus();
|
$workflowStatus = $user->getWorkflowStatus();
|
||||||
|
|
||||||
|
@ -376,7 +574,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
// List the documents where a review has been requested.
|
// List the documents where a review has been requested.
|
||||||
$this->contentHeading(getMLText("documents_to_process"));
|
$this->contentHeading(getMLText("documents_to_process"));
|
||||||
$this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
|
|
||||||
$printheader=true;
|
$printheader=true;
|
||||||
$iRev = array();
|
$iRev = array();
|
||||||
|
@ -464,67 +662,21 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}else{
|
}else{
|
||||||
printMLText("no_docs_to_check");
|
printMLText("no_docs_to_check");
|
||||||
}
|
}
|
||||||
$this->contentContainerEnd();
|
// $this->contentContainerEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
$resArr = $dms->getDocumentList('WorkflowOwner', $user);
|
} /* }}} */
|
||||||
if (is_bool($resArr) && !$resArr) {
|
|
||||||
$this->contentHeading(getMLText("warning"));
|
|
||||||
$this->contentContainer("Internal error. Unable to complete request. Exiting.");
|
|
||||||
$this->htmlEndPage();
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->contentHeading(getMLText("documents_user_requiring_attention"));
|
function listRevisions() { /* {{{ */
|
||||||
$this->contentContainerStart();
|
$dms = $this->params['dms'];
|
||||||
if (count($resArr)>0) {
|
$user = $this->params['user'];
|
||||||
|
$cachedir = $this->params['cachedir'];
|
||||||
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
|
$previewconverters = $this->params['previewconverters'];
|
||||||
|
$timeout = $this->params['timeout'];
|
||||||
|
|
||||||
print "<table class=\"table table-condensed\">";
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
print "<thead>\n<tr>\n";
|
$previewer->setConverters($previewconverters);
|
||||||
print "<th></th>";
|
|
||||||
print "<th>".getMLText("name")."</th>\n";
|
|
||||||
print "<th>".getMLText("status")."</th>\n";
|
|
||||||
print "<th>".getMLText("version")."</th>\n";
|
|
||||||
print "<th>".getMLText("last_update")."</th>\n";
|
|
||||||
print "<th>".getMLText("expires")."</th>\n";
|
|
||||||
print "</tr>\n</thead>\n<tbody>\n";
|
|
||||||
|
|
||||||
foreach ($resArr as $res) {
|
|
||||||
$document = $dms->getDocument($res["documentID"]);
|
|
||||||
$document->verifyLastestContentExpriry();
|
|
||||||
|
|
||||||
// verify expiry
|
|
||||||
if ( $res["expires"] && time()>$res["expires"]+24*60*60 ){
|
|
||||||
if ( $res["status"]==S_DRAFT_APP || $res["status"]==S_DRAFT_REV ){
|
|
||||||
$res["status"]=S_EXPIRED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($content = $document->getContentByVersion($res['version'])) {
|
|
||||||
print "<tr>\n";
|
|
||||||
$previewer->createPreview($content);
|
|
||||||
print "<td><a href=\"../op/op.Download.php?documentid=".$res["documentID"]."&version=".$res["version"]."\">";
|
|
||||||
if($previewer->hasPreview($content)) {
|
|
||||||
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$content->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($content->getMimeType())."\">";
|
|
||||||
} else {
|
|
||||||
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($content->getFileType())."\" title=\"".htmlspecialchars($content->getMimeType())."\">";
|
|
||||||
}
|
|
||||||
print "</a></td>";
|
|
||||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$res["documentID"]."¤ttab=revapp\">" . htmlspecialchars($res["name"]) . "</a></td>\n";
|
|
||||||
print "<td>".getOverallStatusText($res["status"])."</td>";
|
|
||||||
print "<td>".$res["version"]."</td>";
|
|
||||||
print "<td>".$res["statusDate"]." ".htmlspecialchars($res["statusName"])."</td>";
|
|
||||||
print "<td>".(!$res["expires"] ? "-":getReadableDate($res["expires"]))."</td>";
|
|
||||||
print "</tr>\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "</tbody></table>";
|
|
||||||
|
|
||||||
}
|
|
||||||
else printMLText("no_docs_to_look_at");
|
|
||||||
|
|
||||||
$this->contentContainerEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get document list for the current user.
|
// Get document list for the current user.
|
||||||
$revisionStatus = $user->getRevisionStatus();
|
$revisionStatus = $user->getRevisionStatus();
|
||||||
|
@ -552,7 +704,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->contentHeading(getMLText("documents_to_revise"));
|
$this->contentHeading(getMLText("documents_to_revise"));
|
||||||
$this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
$printheader=true;
|
$printheader=true;
|
||||||
$iRev = array();
|
$iRev = array();
|
||||||
$dList = array();
|
$dList = array();
|
||||||
|
@ -637,7 +789,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}else{
|
}else{
|
||||||
printMLText("no_docs_to_revise");
|
printMLText("no_docs_to_revise");
|
||||||
}
|
}
|
||||||
$this->contentContainerEnd();
|
// $this->contentContainerEnd();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->contentHeading(getMLText("documents_to_revise"));
|
$this->contentHeading(getMLText("documents_to_revise"));
|
||||||
|
@ -645,6 +797,18 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
printMLText("no_revision_needed");
|
printMLText("no_revision_needed");
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
}
|
}
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function listReceipts() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$cachedir = $this->params['cachedir'];
|
||||||
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
|
$previewconverters = $this->params['previewconverters'];
|
||||||
|
$timeout = $this->params['timeout'];
|
||||||
|
|
||||||
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
|
$previewer->setConverters($previewconverters);
|
||||||
|
|
||||||
$receiptStatus = $user->getReceiptStatus();
|
$receiptStatus = $user->getReceiptStatus();
|
||||||
$resArr = $dms->getDocumentList('ReceiptByMe', $user);
|
$resArr = $dms->getDocumentList('ReceiptByMe', $user);
|
||||||
|
@ -670,7 +834,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
$docIdx[$res["id"]][$res["version"]] = $res;
|
$docIdx[$res["id"]][$res["version"]] = $res;
|
||||||
}
|
}
|
||||||
$this->contentHeading(getMLText("documents_to_receipt"));
|
$this->contentHeading(getMLText("documents_to_receipt"));
|
||||||
$this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
$printheader=true;
|
$printheader=true;
|
||||||
$iRev = array();
|
$iRev = array();
|
||||||
$dList = array();
|
$dList = array();
|
||||||
|
@ -755,7 +919,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}else{
|
}else{
|
||||||
printMLText("no_docs_to_receipt");
|
printMLText("no_docs_to_receipt");
|
||||||
}
|
}
|
||||||
$this->contentContainerEnd();
|
// $this->contentContainerEnd();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->contentHeading(getMLText("documents_to_receipt"));
|
$this->contentHeading(getMLText("documents_to_receipt"));
|
||||||
|
@ -764,6 +928,19 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function listRejects() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$cachedir = $this->params['cachedir'];
|
||||||
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
|
$previewconverters = $this->params['previewconverters'];
|
||||||
|
$timeout = $this->params['timeout'];
|
||||||
|
|
||||||
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
|
$previewer->setConverters($previewconverters);
|
||||||
|
|
||||||
/* Get list of documents owned by current user that has
|
/* Get list of documents owned by current user that has
|
||||||
* been rejected.
|
* been rejected.
|
||||||
*/
|
*/
|
||||||
|
@ -777,7 +954,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
|
|
||||||
if (count($resArr)>0) {
|
if (count($resArr)>0) {
|
||||||
$this->contentHeading(getMLText("documents_user_rejected"));
|
$this->contentHeading(getMLText("documents_user_rejected"));
|
||||||
$this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
|
|
||||||
print "<table class=\"table table-condensed\">";
|
print "<table class=\"table table-condensed\">";
|
||||||
print "<thead>\n<tr>\n";
|
print "<thead>\n<tr>\n";
|
||||||
|
@ -820,9 +997,22 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
print "</tbody></table>";
|
print "</tbody></table>";
|
||||||
|
|
||||||
$this->contentContainerEnd();
|
// $this->contentContainerEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function listLockedDocs() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$cachedir = $this->params['cachedir'];
|
||||||
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
|
$previewconverters = $this->params['previewconverters'];
|
||||||
|
$timeout = $this->params['timeout'];
|
||||||
|
|
||||||
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
|
$previewer->setConverters($previewconverters);
|
||||||
|
|
||||||
/* Get list of documents locked by current user */
|
/* Get list of documents locked by current user */
|
||||||
$resArr = $dms->getDocumentList('LockedByMe', $user);
|
$resArr = $dms->getDocumentList('LockedByMe', $user);
|
||||||
if (is_bool($resArr) && !$resArr) {
|
if (is_bool($resArr) && !$resArr) {
|
||||||
|
@ -833,7 +1023,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->contentHeading(getMLText("documents_locked_by_you"));
|
$this->contentHeading(getMLText("documents_locked_by_you"));
|
||||||
$this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
if (count($resArr)>0) {
|
if (count($resArr)>0) {
|
||||||
|
|
||||||
print "<table class=\"table table-condensed\">";
|
print "<table class=\"table table-condensed\">";
|
||||||
|
@ -879,7 +1069,20 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
else printMLText("no_docs_locked");
|
else printMLText("no_docs_locked");
|
||||||
|
|
||||||
$this->contentContainerEnd();
|
// $this->contentContainerEnd();
|
||||||
|
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function listCheckedoutDocs() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$cachedir = $this->params['cachedir'];
|
||||||
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
|
$previewconverters = $this->params['previewconverters'];
|
||||||
|
$timeout = $this->params['timeout'];
|
||||||
|
|
||||||
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
|
$previewer->setConverters($previewconverters);
|
||||||
|
|
||||||
/* Get list of documents checked out by current user */
|
/* Get list of documents checked out by current user */
|
||||||
$resArr = $dms->getDocumentList('CheckedOutByMe', $user);
|
$resArr = $dms->getDocumentList('CheckedOutByMe', $user);
|
||||||
|
@ -891,7 +1094,7 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->contentHeading(getMLText("documents_checked_out_by_you"));
|
$this->contentHeading(getMLText("documents_checked_out_by_you"));
|
||||||
$this->contentContainerStart();
|
// $this->contentContainerStart();
|
||||||
if (count($resArr)>0) {
|
if (count($resArr)>0) {
|
||||||
|
|
||||||
print "<table class=\"table table-condensed\">";
|
print "<table class=\"table table-condensed\">";
|
||||||
|
@ -937,70 +1140,89 @@ class SeedDMS_View_MyDocuments extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
else printMLText("no_docs_checked_out");
|
else printMLText("no_docs_checked_out");
|
||||||
|
|
||||||
$this->contentContainerEnd();
|
// $this->contentContainerEnd();
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
function show() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$orderby = $this->params['orderby'];
|
||||||
|
$showInProcess = $this->params['showinprocess'];
|
||||||
|
$cachedir = $this->params['cachedir'];
|
||||||
|
$workflowmode = $this->params['workflowmode'];
|
||||||
|
$previewwidth = $this->params['previewWidthList'];
|
||||||
|
$previewconverters = $this->params['previewconverters'];
|
||||||
|
$timeout = $this->params['timeout'];
|
||||||
|
|
||||||
|
$db = $dms->getDB();
|
||||||
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||||
|
$previewer->setConverters($previewconverters);
|
||||||
|
|
||||||
|
$this->htmlStartPage(getMLText("my_documents"));
|
||||||
|
$this->globalNavigation();
|
||||||
|
$this->contentStart();
|
||||||
|
$this->pageNavigation(getMLText("my_documents"), "my_documents");
|
||||||
|
|
||||||
|
if($showInProcess) {
|
||||||
|
echo '<div class="row-fluid">';
|
||||||
|
echo '<div class="span3">';
|
||||||
|
echo '<ul class="nav nav-list bs-docs-sidenav _affix">';
|
||||||
|
if($workflowmode == 'traditional') {
|
||||||
|
$resArr = $dms->getDocumentList('AppRevByMe', $user);
|
||||||
|
echo '<li class=""><a data-href="#documents_to_review" data-action="listReviews"><span class="badge badge-right">'.count($resArr).'</span>'.getMLText("documents_to_review").'</a></li>';
|
||||||
}
|
}
|
||||||
else {
|
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
||||||
|
$resArr = $dms->getDocumentList('AppRevByMe', $user);
|
||||||
/* Get list of documents owned by current user */
|
echo '<li class=""><a data-href="#documents_to_approve" data-action="listApprovals"><span class="badge badge-right">'.count($resArr).'</span>'.getMLText("documents_to_approve").'</a></li>';
|
||||||
$resArr = $dms->getDocumentList('MyDocs', $user, $orderby);
|
|
||||||
if (is_bool($resArr) && !$resArr) {
|
|
||||||
$this->contentHeading(getMLText("warning"));
|
|
||||||
$this->contentContainer(getMLText("internal_error_exit"));
|
|
||||||
$this->htmlEndPage();
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->contentHeading(getMLText("all_documents"));
|
|
||||||
$this->contentContainerStart();
|
|
||||||
|
|
||||||
if (count($resArr)>0) {
|
|
||||||
|
|
||||||
print "<table class=\"table table-condensed\">";
|
|
||||||
print "<thead>\n<tr>\n";
|
|
||||||
print "<th></th>";
|
|
||||||
print "<th><a href=\"../out/out.MyDocuments.php?orderby=n\">".getMLText("name")."</a></th>\n";
|
|
||||||
print "<th><a href=\"../out/out.MyDocuments.php?orderby=s\">".getMLText("status")."</a></th>\n";
|
|
||||||
print "<th>".getMLText("version")."</th>\n";
|
|
||||||
print "<th><a href=\"../out/out.MyDocuments.php?orderby=u\">".getMLText("last_update")."</a></th>\n";
|
|
||||||
print "<th><a href=\"../out/out.MyDocuments.php?orderby=e\">".getMLText("expires")."</a></th>\n";
|
|
||||||
print "</tr>\n</thead>\n<tbody>\n";
|
|
||||||
|
|
||||||
foreach ($resArr as $res) {
|
|
||||||
$document = $dms->getDocument($res["documentID"]);
|
|
||||||
$document->verifyLastestContentExpriry();
|
|
||||||
|
|
||||||
// verify expiry
|
|
||||||
if ( $res["expires"] && time()>$res["expires"]+24*60*60 ){
|
|
||||||
if ( $res["status"]==S_DRAFT_APP || $res["status"]==S_DRAFT_REV ){
|
|
||||||
$res["status"]=S_EXPIRED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($content = $document->getContentByVersion($res['version'])) {
|
|
||||||
print "<tr>\n";
|
|
||||||
$previewer->createPreview($content);
|
|
||||||
print "<td><a href=\"../op/op.Download.php?documentid=".$res["documentID"]."&version=".$res["version"]."\">";
|
|
||||||
if($previewer->hasPreview($content)) {
|
|
||||||
print "<img class=\"mimeicon\" width=\"".$previewwidth."\"src=\"../op/op.Preview.php?documentid=".$document->getID()."&version=".$content->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($content->getMimeType())."\">";
|
|
||||||
} else {
|
} else {
|
||||||
print "<img class=\"mimeicon\" src=\"".$this->getMimeIcon($content->getFileType())."\" title=\"".htmlspecialchars($content->getMimeType())."\">";
|
$resArr = $dms->getDocumentList('WorkflowByMe', $user);
|
||||||
|
echo '<li class=""><a data-href="#documents_to_process" data-action="listWorkflow"><span class="badge badge-right">'.count($resArr).'</span>'.getMLText("documents_to_process").'</a></li>';
|
||||||
}
|
}
|
||||||
print "</a></td>";
|
$resArr = $dms->getDocumentList('AppRevOwner', $user);
|
||||||
print "<td><a href=\"out.ViewDocument.php?documentid=".$res["documentID"]."\">" . htmlspecialchars($res["name"]) . "</a></td>\n";
|
echo '<li class=""><a data-href="#documents_user_requiring_attention" data-action="listDocsToLookAt"><span class="badge badge-right">'.count($resArr).'</span>'.getMLText("documents_user_requiring_attention").'</a></li>';
|
||||||
print "<td>".getOverallStatusText($res["status"])."</td>";
|
$resArr = $dms->getDocumentList('ReviseByMe', $user);
|
||||||
print "<td>".$res["version"]."</td>";
|
echo '<li class=""><a data-href="#documents_to_revise" data-action="listRevisions"><span class="badge badge-right">'.count($resArr).'</span>'.getMLText("documents_to_revise").'</a></li>';
|
||||||
print "<td>".$res["statusDate"]." ". htmlspecialchars($res["statusName"])."</td>";
|
$resArr = $dms->getDocumentList('ReceiptByMe', $user);
|
||||||
//print "<td>".(!$res["expires"] ? getMLText("does_not_expire"):getReadableDate($res["expires"]))."</td>";
|
echo '<li class=""><a data-href="#documents_to_receipt" data-action="listReceipts"><span class="badge badge-right">'.count($resArr).'</span>'.getMLText("documents_to_receipt").'</a></li>';
|
||||||
print "<td>".(!$res["expires"] ? "-":getReadableDate($res["expires"]))."</td>";
|
$resArr = $dms->getDocumentList('RejectOwner', $user);
|
||||||
print "</tr>\n";
|
echo '<li class=""><a data-href="#documents_user_rejected" data-action="listRejects"><span class="badge badge-right">'.count($resArr).'</span>'.getMLText("documents_user_rejected").'</a></li>';
|
||||||
}
|
$resArr = $dms->getDocumentList('LockedByMe', $user);
|
||||||
}
|
echo '<li class=""><a data-href="#documents_locked_by_you" data-action="listLockedDocs"><span class="badge badge-right">'.count($resArr).'</span>'.getMLText("documents_locked_by_you").'</a></li>';
|
||||||
print "</tbody></table>";
|
$resArr = $dms->getDocumentList('CheckedOutByMe', $user);
|
||||||
}
|
echo '<li class=""><a data-href="#documents_checked_out_by_you" data-action="listCheckedoutDocs"><span class="badge badge-right">'.count($resArr).'</span>'.getMLText("documents_checked_out_by_you").'</a></li>';
|
||||||
else printMLText("empty_notify_list");
|
echo '</ul>';
|
||||||
|
echo '</div>';
|
||||||
|
echo '<div class="span9">';
|
||||||
|
|
||||||
$this->contentContainerEnd();
|
echo '<div id="kkkk" class="ajax" data-view="MyDocuments" data-action="listReviews"></div>';
|
||||||
|
|
||||||
|
/*
|
||||||
|
if($workflowmode == 'traditional') {
|
||||||
|
echo '<div id="documents_to_review" class="ajax" data-view="MyDocuments" data-action="listReviews"></div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
||||||
|
echo '<div id="documents_to_approve" class="ajax" data-view="MyDocuments" data-action="listApprovals"></div>';
|
||||||
|
} elseif($workflowmode == 'advanced') {
|
||||||
|
echo '<div id="documents_to_process" class="ajax" data-view="MyDocuments" data-action="listWorkflow"></div>';
|
||||||
|
}
|
||||||
|
echo '<div id="documents_user_requiring_attention" class="ajax" data-view="MyDocuments" data-action="listDocsToLookAt"></div>';
|
||||||
|
|
||||||
|
echo '<div id="documents_to_revise" class="ajax" data-view="MyDocuments" data-action="listRevisions"></div>';
|
||||||
|
|
||||||
|
echo '<div id="documents_to_receipt" class="ajax" data-view="MyDocuments" data-action="listReceipts"></div>';
|
||||||
|
|
||||||
|
echo '<div id="documents_user_rejected" class="ajax" data-view="MyDocuments" data-action="listRejects"></div>';
|
||||||
|
|
||||||
|
echo '<div id="documents_locked_by_you" class="ajax" data-view="MyDocuments" data-action="listLockedDocs"></div>';
|
||||||
|
|
||||||
|
echo '<div id="documents_checked_out_by_you" class="ajax" data-view="MyDocuments" data-action="listCheckedoutDocs"></div>';
|
||||||
|
|
||||||
|
*/
|
||||||
|
echo '</div>';
|
||||||
|
echo '</div>';
|
||||||
|
} else {
|
||||||
|
echo '<div class="ajax" data-view="MyDocuments" data-action="listMyDocs"></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->contentEnd();
|
$this->contentEnd();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user