mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
major overhaul, replace inProcess paramter by listtype
most list where not correct and the code was way to complicated
This commit is contained in:
parent
8126d6d3fe
commit
4fa95bcd48
|
@ -37,9 +37,9 @@ if ($user->isGuest()) {
|
|||
|
||||
// Check to see if the user wants to see only those documents that are still
|
||||
// in the review / approve stages.
|
||||
$showInProcess = false;
|
||||
if (isset($_GET["inProcess"]) && strlen($_GET["inProcess"])>0 && $_GET["inProcess"]!=0) {
|
||||
$showInProcess = true;
|
||||
$listtype = '';
|
||||
if (isset($_GET["list"])) {
|
||||
$listtype = $_GET['list'];
|
||||
}
|
||||
|
||||
$orderby='n';
|
||||
|
@ -55,7 +55,7 @@ if($view) {
|
|||
$view->setParam('orderby', $orderby);
|
||||
$view->setParam('orderdir', $orderdir);
|
||||
$view->setParam('showtree', showtree());
|
||||
$view->setParam('showinprocess', $showInProcess);
|
||||
$view->setParam('listtype', $listtype);
|
||||
$view->setParam('workflowmode', $settings->_workflowMode);
|
||||
$view->setParam('cachedir', $settings->_cacheDir);
|
||||
$view->setParam('previewWidthList', $settings->_previewWidthList);
|
||||
|
|
|
@ -54,6 +54,49 @@ $(document).ready( function() {
|
|||
<?php
|
||||
} /* }}} */
|
||||
|
||||
protected function printList($resArr, $previewer, $order=false) { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$orderby = $this->params['orderby'];
|
||||
$orderdir = $this->params['orderdir'];
|
||||
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
if($order)
|
||||
print "<th><a data-action=\"".$order."\" data-orderby=\"n\" data-orderdir=\"".($orderdir == 'desc' ? '' : 'desc')."\">".getMLText("name")."</a> ".($orderby == 'n' || $orderby == '' ? ($orderdir == 'desc' ? '<i class="icon-arrow-up"></i>' : '<i class="icon-arrow-down"></i>') : '')." · <a data-action=\"".$order."\" data-orderby=\"u\" data-orderdir=\"".($orderdir == 'desc' ? '' : 'desc')."\">".getMLText("last_update")."</a> ".($orderby == 'u' ? ($orderdir == 'desc' ? '<i class="icon-arrow-up"></i>' : '<i class="icon-arrow-down"></i>') : '')." · <a data-action=\"".$order."\" data-orderby=\"e\" data-orderdir=\"".($orderdir == 'desc' ? '' : 'desc')."\">".getMLText("expires")."</a> ".($orderby == 'e' ? ($orderdir == 'desc' ? '<i class="icon-arrow-up"></i>' : '<i class="icon-arrow-down"></i>') : '')."</th>\n";
|
||||
else
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
if($order)
|
||||
print "<th><a data-action=\"".$order."\" data-orderby=\"s\" data-orderdir=\"".($orderdir == 'desc' ? '' : 'desc')."\">".getMLText("status")."</a>".($orderby == 's' ? " ".($orderdir == 'desc' ? '<i class="icon-arrow-up"></i>' : '<i class="icon-arrow-down"></i>') : '')."</th>\n";
|
||||
else
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
$noaccess = 0;
|
||||
foreach ($resArr as $res) {
|
||||
$document = $dms->getDocument($res["id"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
|
||||
echo $this->documentListRow($document, $previewer, false, $res['version']);
|
||||
} else {
|
||||
$noaccess++;
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</tbody>\n</table>";
|
||||
|
||||
if($noaccess) {
|
||||
$this->warningMsg(getMLText('list_contains_no_access_docs', array('count'=>$noaccess)));
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
function listReviews() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
|
@ -67,95 +110,40 @@ $(document).ready( function() {
|
|||
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||
$previewer->setConverters($previewconverters);
|
||||
|
||||
// Get document list for the current user.
|
||||
$reviewStatus = $user->getReviewStatus();
|
||||
|
||||
$resArr = $dms->getDocumentList('AppRevByMe', $user, $orderby, $orderdir);
|
||||
$resArr = $dms->getDocumentList('ReviewByMe', $user, false, $orderby, $orderdir);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
$this->contentHeading(getMLText("warning"));
|
||||
$this->contentContainer(getMLText("internal_error_exit"));
|
||||
$this->htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
|
||||
$this->contentHeading(getMLText("documents_to_review"));
|
||||
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) {
|
||||
$docIdx[$res["id"]][$res["version"]] = $res;
|
||||
}
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
// List the documents for which a review has been requested.
|
||||
$this->contentHeading(getMLText("documents_to_review"));
|
||||
$printheader=true;
|
||||
$iRev = array();
|
||||
$dList = array();
|
||||
foreach ($reviewStatus["indstatus"] as $st) {
|
||||
|
||||
if ( $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) ) {
|
||||
$dList[] = $st["documentID"];
|
||||
$document = $dms->getDocument($st["documentID"]);
|
||||
foreach ($resArr as $res) {
|
||||
$document = $dms->getDocument($res["id"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $st['version']);
|
||||
echo $this->documentListRow($document, $previewer, false, $res['version']);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($reviewStatus["grpstatus"] as $st) {
|
||||
|
||||
if (!in_array($st["documentID"], $iRev) && $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) /* && $docIdx[$st["documentID"]][$st["version"]]['owner'] != $user->getId() */) {
|
||||
$dList[] = $st["documentID"];
|
||||
$document = $dms->getDocument($st["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $st['version']);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$printheader){
|
||||
echo "</tbody>\n</table>";
|
||||
}else{
|
||||
printMLText("no_docs_to_review");
|
||||
}
|
||||
echo "</tbody>\n</table>\n";
|
||||
} else {
|
||||
$this->contentHeading(getMLText("documents_to_review"));
|
||||
$this->contentContainerStart();
|
||||
printMLText("no_review_needed");
|
||||
$this->contentContainerEnd();
|
||||
printMLText("no_docs_to_review");
|
||||
}
|
||||
|
||||
} /* }}} */
|
||||
|
@ -173,93 +161,40 @@ $(document).ready( function() {
|
|||
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||
$previewer->setConverters($previewconverters);
|
||||
|
||||
$approvalStatus = $user->getApprovalStatus();
|
||||
|
||||
$resArr = $dms->getDocumentList('AppRevByMe', $user, $orderby, $orderdir);
|
||||
$resArr = $dms->getDocumentList('ApproveByMe', $user, false, $orderby, $orderdir);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
$this->contentHeading(getMLText("warning"));
|
||||
$this->contentContainer(getMLText("internal_error_exit"));
|
||||
$this->htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
$this->contentHeading(getMLText("documents_to_approve"));
|
||||
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) {
|
||||
$docIdx[$res["id"]][$res["version"]] = $res;
|
||||
}
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
// List the documents for which an approval has been requested.
|
||||
$this->contentHeading(getMLText("documents_to_approve"));
|
||||
$printheader=true;
|
||||
|
||||
foreach ($approvalStatus["indstatus"] as $st) {
|
||||
|
||||
if ( $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && $docIdx[$st["documentID"]][$st["version"]]['status'] == S_DRAFT_APP) {
|
||||
$document = $dms->getDocument($st["documentID"]);
|
||||
foreach ($resArr as $res) {
|
||||
$document = $dms->getDocument($res["id"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $st['version']);
|
||||
echo $this->documentListRow($document, $previewer, false, $res['version']);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($approvalStatus["grpstatus"] as $st) {
|
||||
|
||||
if (!in_array($st["documentID"], $iRev) && $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && $docIdx[$st["documentID"]][$st["version"]]['status'] == S_DRAFT_APP /* && $docIdx[$st["documentID"]][$st["version"]]['owner'] != $user->getId() */) {
|
||||
$document = $dms->getDocument($st["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
if ($printheader){
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $st['version']);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$printheader){
|
||||
echo "</tbody>\n</table>\n";
|
||||
}else{
|
||||
} else {
|
||||
printMLText("no_docs_to_approve");
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->contentHeading(getMLText("documents_to_approve"));
|
||||
$this->contentContainerStart();
|
||||
printMLText("no_approval_needed");
|
||||
$this->contentContainerEnd();
|
||||
}
|
||||
|
||||
} /* }}} */
|
||||
|
||||
function listDocsToLookAt() { /* {{{ */
|
||||
|
@ -280,7 +215,7 @@ $(document).ready( function() {
|
|||
/* Get list of documents owned by current user that are
|
||||
* pending review or pending approval.
|
||||
*/
|
||||
$resArr = $dms->getDocumentList('AppRevOwner', $user, $orderby, $orderdir);
|
||||
$resArr = $dms->getDocumentList('AppRevOwner', $user, false, $orderby, $orderdir);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
$this->contentHeading(getMLText("warning"));
|
||||
$this->contentContainer(getMLText("internal_error_exit"));
|
||||
|
@ -289,33 +224,13 @@ $(document).ready( function() {
|
|||
}
|
||||
|
||||
$this->contentHeading(getMLText("documents_user_requiring_attention"));
|
||||
if (count($resArr)>0) {
|
||||
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>";
|
||||
print "<th><a data-action=\"listDocsToLookAt\" data-orderby=\"n\" data-orderdir=\"".($orderdir == 'desc' ? '' : 'desc')."\">".getMLText("name")."</a> ".($orderby == 'n' || $orderby == '' ? ($orderdir == 'desc' ? '<i class="icon-arrow-up"></i>' : '<i class="icon-arrow-down"></i>') : '')." / <a data-action=\"listDocsToLookAt\" data-orderby=\"u\" data-orderdir=\"".($orderdir == 'desc' ? '' : 'desc')."\">".getMLText("last_update")."</a> ".($orderby == 'u' ? ($orderdir == 'desc' ? '<i class="icon-arrow-up"></i>' : '<i class="icon-arrow-down"></i>') : '')." / <a data-action=\"listDocsToLookAt\" data-orderby=\"e\" data-orderdir=\"".($orderdir == 'desc' ? '' : 'desc')."\">".getMLText("expires")."</a> ".($orderby == 'e' ? ($orderdir == 'desc' ? '<i class="icon-arrow-up"></i>' : '<i class="icon-arrow-down"></i>') : '')."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
foreach ($resArr as $res) {
|
||||
$document = $dms->getDocument($res["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $res['version']);
|
||||
}
|
||||
}
|
||||
print "</tbody></table>";
|
||||
|
||||
}
|
||||
else printMLText("no_docs_to_look_at");
|
||||
if ($resArr) {
|
||||
$this->printList($resArr, $previewer, 'listDocsToLookAt');
|
||||
} else {
|
||||
$resArr = $dms->getDocumentList('WorkflowOwner', $user, $orderby, $orderdir);
|
||||
printMLText("no_docs_to_look_at");
|
||||
}
|
||||
} else {
|
||||
$resArr = $dms->getDocumentList('WorkflowOwner', $user, false, $orderby, $orderdir);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
$this->contentHeading(getMLText("warning"));
|
||||
$this->contentContainer("Internal error. Unable to complete request. Exiting.");
|
||||
|
@ -324,29 +239,8 @@ $(document).ready( function() {
|
|||
}
|
||||
|
||||
$this->contentHeading(getMLText("documents_user_requiring_attention"));
|
||||
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("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
foreach ($resArr as $res) {
|
||||
$document = $dms->getDocument($res["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $res['version']);
|
||||
}
|
||||
}
|
||||
print "</tbody></table>";
|
||||
|
||||
if($resArr) {
|
||||
$this->printList($resArr, $previewer);
|
||||
}
|
||||
else printMLText("no_docs_to_look_at");
|
||||
}
|
||||
|
@ -367,7 +261,7 @@ $(document).ready( function() {
|
|||
$previewer->setConverters($previewconverters);
|
||||
|
||||
/* Get list of documents owned by current user */
|
||||
$resArr = $dms->getDocumentList('MyDocs', $user, $orderby, $orderdir);
|
||||
$resArr = $dms->getDocumentList('MyDocs', $user, false, $orderby, $orderdir);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
$this->contentHeading(getMLText("warning"));
|
||||
$this->contentContainer(getMLText("internal_error_exit"));
|
||||
|
@ -376,29 +270,8 @@ $(document).ready( function() {
|
|||
}
|
||||
|
||||
$this->contentHeading(getMLText("all_documents"));
|
||||
|
||||
if (count($resArr)>0) {
|
||||
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>";
|
||||
print "<th><a data-action=\"listMyDocs\" data-orderby=\"n\" data-orderdir=\"".($orderdir == 'desc' ? '' : 'desc')."\">".getMLText("name")."</a> ".($orderby == 'n' || $orderby == '' ? ($orderdir == 'desc' ? '<i class="icon-arrow-up"></i>' : '<i class="icon-arrow-down"></i>') : '')." / <a data-action=\"listMyDocs\" data-orderby=\"u\" data-orderdir=\"".($orderdir == 'desc' ? '' : 'desc')."\">".getMLText("last_update")."</a> ".($orderby == 'u' ? ($orderdir == 'desc' ? '<i class="icon-arrow-up"></i>' : '<i class="icon-arrow-down"></i>') : '')." / <a data-action=\"listMyDocs\" data-orderby=\"e\" data-orderdir=\"".($orderdir == 'desc' ? '' : 'desc')."\">".getMLText("expires")."</a> ".($orderby == 'e' ? ($orderdir == 'desc' ? '<i class="icon-arrow-up"></i>' : '<i class="icon-arrow-down"></i>') : '')."</th>\n";
|
||||
print "<th><a data-action=\"listMyDocs\" data-orderby=\"s\">".getMLText("status")."</a></th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
foreach ($resArr as $res) {
|
||||
$document = $dms->getDocument($res["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $res['version']);
|
||||
}
|
||||
}
|
||||
print "</tbody></table>";
|
||||
if($resArr) {
|
||||
$this->printList($resArr, $previewer, 'listMyDocs');
|
||||
}
|
||||
else printMLText("empty_notify_list");
|
||||
} /* }}} */
|
||||
|
@ -419,7 +292,7 @@ $(document).ready( function() {
|
|||
// Get document list for the current user.
|
||||
$workflowStatus = $user->getWorkflowStatus();
|
||||
|
||||
$resArr = $dms->getDocumentList('WorkflowByMe', $user, $orderby, $orderdir);
|
||||
$resArr = $dms->getDocumentList('WorkflowByMe', $user, false, $orderby, $orderdir);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
$this->contentHeading(getMLText("warning"));
|
||||
$this->contentContainer(getMLText("internal_error_exit"));
|
||||
|
@ -520,92 +393,20 @@ $(document).ready( function() {
|
|||
// Get document list for the current user.
|
||||
$revisionStatus = $user->getRevisionStatus();
|
||||
|
||||
$resArr = $dms->getDocumentList('ReviseByMe', $user, $orderby, $orderdir);
|
||||
$resArr = $dms->getDocumentList('ReviseByMe', $user, false, $orderby, $orderdir);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
$this->contentHeading(getMLText("warning"));
|
||||
$this->contentContainer(getMLText("internal_error_exit"));
|
||||
$this->htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
|
||||
$this->contentHeading(getMLText("documents_to_revise"));
|
||||
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) {
|
||||
$docIdx[$res["id"]][$res["version"]] = $res;
|
||||
}
|
||||
|
||||
$this->contentHeading(getMLText("documents_to_revise"));
|
||||
$printheader=true;
|
||||
$iRev = array();
|
||||
$dList = array();
|
||||
foreach ($revisionStatus["indstatus"] as $st) {
|
||||
|
||||
if ( $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) ) {
|
||||
$dList[] = $st["documentID"];
|
||||
$document = $dms->getDocument($st["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $st['version']);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($revisionStatus["grpstatus"] as $st) {
|
||||
|
||||
if (!in_array($st["documentID"], $iRev) && $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) && $docIdx[$st["documentID"]][$st["version"]]['owner'] != $user->getId()) {
|
||||
$dList[] = $st["documentID"];
|
||||
$document = $dms->getDocument($st["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $st['version']);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$printheader){
|
||||
echo "</tbody>\n</table>";
|
||||
}else{
|
||||
$this->printList($resArr, $previewer);
|
||||
} else {
|
||||
printMLText("no_docs_to_revise");
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->contentHeading(getMLText("documents_to_revise"));
|
||||
$this->contentContainerStart();
|
||||
printMLText("no_revision_needed");
|
||||
$this->contentContainerEnd();
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
function listReceipts() { /* {{{ */
|
||||
|
@ -621,93 +422,20 @@ $(document).ready( function() {
|
|||
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
||||
$previewer->setConverters($previewconverters);
|
||||
|
||||
$receiptStatus = $user->getReceiptStatus();
|
||||
$resArr = $dms->getDocumentList('ReceiptByMe', $user, $orderby, $orderdir);
|
||||
$resArr = $dms->getDocumentList('ReceiptByMe', $user, false, $orderby, $orderdir);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
$this->contentHeading(getMLText("warning"));
|
||||
$this->contentContainer(getMLText("internal_error_exit"));
|
||||
$this->htmlEndPage();
|
||||
exit;
|
||||
}
|
||||
|
||||
$this->contentHeading(getMLText("documents_to_receipt"));
|
||||
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) {
|
||||
$docIdx[$res["id"]][$res["version"]] = $res;
|
||||
}
|
||||
$this->contentHeading(getMLText("documents_to_receipt"));
|
||||
$printheader=true;
|
||||
$iRev = array();
|
||||
$dList = array();
|
||||
foreach ($receiptStatus["indstatus"] as $st) {
|
||||
|
||||
if ( $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) ) {
|
||||
$dList[] = $st["documentID"];
|
||||
$document = $dms->getDocument($st["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $st['version']);
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($receiptStatus["grpstatus"] as $st) {
|
||||
|
||||
if (!in_array($st["documentID"], $iRev) && $st["status"]==0 && isset($docIdx[$st["documentID"]][$st["version"]]) && !in_array($st["documentID"], $dList) && $docIdx[$st["documentID"]][$st["version"]]['owner'] != $user->getId()) {
|
||||
$dList[] = $st["documentID"];
|
||||
$document = $dms->getDocument($st["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
if ($printheader){
|
||||
print "<table class=\"table table-condensed\">";
|
||||
print "<thead>\n<tr>\n";
|
||||
print "<th></th>\n";
|
||||
print "<th>".getMLText("name")."</th>\n";
|
||||
print "<th>".getMLText("status")."</th>\n";
|
||||
print "<th>".getMLText("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
$printheader=false;
|
||||
}
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $st['version']);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$printheader){
|
||||
echo "</tbody>\n</table>";
|
||||
}else{
|
||||
$this->printList($resArr, $previewer);
|
||||
} else {
|
||||
printMLText("no_docs_to_receipt");
|
||||
}
|
||||
}
|
||||
else {
|
||||
$this->contentHeading(getMLText("documents_to_receipt"));
|
||||
$this->contentContainerStart();
|
||||
printMLText("no_receipt_needed");
|
||||
$this->contentContainerEnd();
|
||||
}
|
||||
|
||||
} /* }}} */
|
||||
|
||||
|
@ -727,7 +455,7 @@ $(document).ready( function() {
|
|||
/* Get list of documents owned by current user that has
|
||||
* been rejected.
|
||||
*/
|
||||
$resArr = $dms->getDocumentList('RejectOwner', $user, $orderby, $orderdir);
|
||||
$resArr = $dms->getDocumentList('RejectOwner', $user, false, $orderby, $orderdir);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
$this->contentHeading(getMLText("warning"));
|
||||
$this->contentContainer(getMLText("internal_error_exit"));
|
||||
|
@ -735,30 +463,11 @@ $(document).ready( function() {
|
|||
exit;
|
||||
}
|
||||
|
||||
if (count($resArr)>0) {
|
||||
$this->contentHeading(getMLText("documents_user_rejected"));
|
||||
|
||||
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("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
foreach ($resArr as $res) {
|
||||
$document = $dms->getDocument($res["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $res['version']);
|
||||
}
|
||||
}
|
||||
print "</tbody></table>";
|
||||
if ($resArr) {
|
||||
$this->printList($resArr, $previewer);
|
||||
}
|
||||
else printMLText("no_docs_rejected");
|
||||
|
||||
} /* }}} */
|
||||
|
||||
|
@ -776,7 +485,7 @@ $(document).ready( function() {
|
|||
$previewer->setConverters($previewconverters);
|
||||
|
||||
/* Get list of documents locked by current user */
|
||||
$resArr = $dms->getDocumentList('LockedByMe', $user, $orderby, $orderdir);
|
||||
$resArr = $dms->getDocumentList('LockedByMe', $user, false, $orderby, $orderdir);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
$this->contentHeading(getMLText("warning"));
|
||||
$this->contentContainer(getMLText("internal_error_exit"));
|
||||
|
@ -785,29 +494,8 @@ $(document).ready( function() {
|
|||
}
|
||||
|
||||
$this->contentHeading(getMLText("documents_locked_by_you"));
|
||||
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("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
foreach ($resArr as $res) {
|
||||
$document = $dms->getDocument($res["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $res['version']);
|
||||
}
|
||||
}
|
||||
print "</tbody></table>";
|
||||
|
||||
if ($resArr) {
|
||||
$this->printList($resArr, $previewer);
|
||||
}
|
||||
else printMLText("no_docs_locked");
|
||||
|
||||
|
@ -827,7 +515,7 @@ $(document).ready( function() {
|
|||
$previewer->setConverters($previewconverters);
|
||||
|
||||
/* Get list of documents checked out by current user */
|
||||
$resArr = $dms->getDocumentList('CheckedOutByMe', $user, $orderby, $orderdir);
|
||||
$resArr = $dms->getDocumentList('CheckedOutByMe', $user, false, $orderby, $orderdir);
|
||||
if (is_bool($resArr) && !$resArr) {
|
||||
$this->contentHeading(getMLText("warning"));
|
||||
$this->contentContainer(getMLText("internal_error_exit"));
|
||||
|
@ -836,34 +524,10 @@ $(document).ready( function() {
|
|||
}
|
||||
|
||||
$this->contentHeading(getMLText("documents_checked_out_by_you"));
|
||||
// $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("action")."</th>\n";
|
||||
print "</tr>\n</thead>\n<tbody>\n";
|
||||
|
||||
foreach ($resArr as $res) {
|
||||
$document = $dms->getDocument($res["documentID"]);
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
$txt = $this->callHook('documentListItem', $document, $previewer);
|
||||
if(is_string($txt))
|
||||
echo $txt;
|
||||
else {
|
||||
echo $this->documentListRow($document, $previewer, false, $res['version']);
|
||||
}
|
||||
}
|
||||
print "</tbody></table>";
|
||||
|
||||
if ($resArr) {
|
||||
$this->printList($resArr, $previewer);
|
||||
}
|
||||
else printMLText("no_docs_checked_out");
|
||||
|
||||
// $this->contentContainerEnd();
|
||||
} /* }}} */
|
||||
|
||||
function show() { /* {{{ */
|
||||
|
@ -871,7 +535,7 @@ $(document).ready( function() {
|
|||
$user = $this->params['user'];
|
||||
$orderby = $this->params['orderby'];
|
||||
$orderdir = $this->params['orderdir'];
|
||||
$showInProcess = $this->params['showinprocess'];
|
||||
$listtype = $this->params['listtype'];
|
||||
$cachedir = $this->params['cachedir'];
|
||||
$workflowmode = $this->params['workflowmode'];
|
||||
$previewwidth = $this->params['previewWidthList'];
|
||||
|
@ -887,25 +551,24 @@ $(document).ready( function() {
|
|||
$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">';
|
||||
$resArr = $dms->getDocumentList('MyDocs', $user);
|
||||
echo '<li class=""><a data-href="#all_documents" data-action="listMyDocs"><span class="badge '.($resArr ? 'badge-info ' : '').'badge-right">'.count($resArr).'</span>'.getMLText("all_documents").'</a></li>';
|
||||
if($workflowmode == 'traditional') {
|
||||
$resArr = $dms->getDocumentList('AppRevByMe', $user);
|
||||
$resArr = $dms->getDocumentList('AppRevOwner', $user);
|
||||
echo '<li class=""><a data-href="#documents_user_requiring_attention" data-action="listDocsToLookAt"><span class="badge '.($resArr ? 'badge-info ' : '').'badge-right">'.count($resArr).'</span>'.getMLText("documents_user_requiring_attention").'</a></li>';
|
||||
$resArr = $dms->getDocumentList('ReviewByMe', $user);
|
||||
echo '<li class=""><a data-href="#documents_to_review" data-action="listReviews"><span class="badge '.($resArr ? 'badge-info ' : '').'badge-right">'.count($resArr).'</span>'.getMLText("documents_to_review").'</a></li>';
|
||||
}
|
||||
if($workflowmode == 'traditional' || $workflowmode == 'traditional_only_approval') {
|
||||
$resArr = $dms->getDocumentList('AppRevByMe', $user);
|
||||
$resArr = $dms->getDocumentList('ApproveByMe', $user);
|
||||
echo '<li class=""><a data-href="#documents_to_approve" data-action="listApprovals"><span class="badge '.($resArr ? 'badge-info ' : '').'badge-right">'.count($resArr).'</span>'.getMLText("documents_to_approve").'</a></li>';
|
||||
} else {
|
||||
$resArr = $dms->getDocumentList('WorkflowByMe', $user);
|
||||
echo '<li class=""><a data-href="#documents_to_process" data-action="listWorkflow"><span class="badge '.($resArr ? 'badge-info ' : '').'badge-right">'.count($resArr).'</span>'.getMLText("documents_to_process").'</a></li>';
|
||||
}
|
||||
$resArr = $dms->getDocumentList('AppRevOwner', $user);
|
||||
echo '<li class=""><a data-href="#documents_user_requiring_attention" data-action="listDocsToLookAt"><span class="badge '.($resArr ? 'badge-info ' : '').'badge-right">'.count($resArr).'</span>'.getMLText("documents_user_requiring_attention").'</a></li>';
|
||||
$resArr = $dms->getDocumentList('ReviseByMe', $user);
|
||||
echo '<li class=""><a data-href="#documents_to_revise" data-action="listRevisions"><span class="badge '.($resArr ? 'badge-info ' : '').'badge-right">'.count($resArr).'</span>'.getMLText("documents_to_revise").'</a></li>';
|
||||
$resArr = $dms->getDocumentList('ReceiptByMe', $user);
|
||||
|
@ -920,13 +583,10 @@ $(document).ready( function() {
|
|||
echo '</div>';
|
||||
echo '<div class="span9">';
|
||||
|
||||
echo '<div id="kkkk" class="ajax" data-view="MyDocuments" data-action="listReviews"></div>';
|
||||
echo '<div id="kkkk" class="ajax" data-view="MyDocuments" data-action="'.($listtype ? $listtype : 'listDocsToLookAt').'"></div>';
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo '<div class="ajax" data-view="MyDocuments" data-action="listMyDocs"></div>';
|
||||
}
|
||||
|
||||
$this->contentEnd();
|
||||
$this->htmlEndPage();
|
||||
|
|
Loading…
Reference in New Issue
Block a user