mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
add ordering to all list in getDocumentList()
This commit is contained in:
parent
47f43a47ba
commit
2d2ebdc887
|
@ -809,6 +809,12 @@ class SeedDMS_Core_DMS {
|
|||
break; // }}}
|
||||
case 'ReviewByMe': // Documents I have to review {{{
|
||||
$user = $param1;
|
||||
$orderby = $param3;
|
||||
if($param4 == 'desc')
|
||||
$orderdir = 'DESC';
|
||||
else
|
||||
$orderdir = 'ASC';
|
||||
|
||||
// Get document list for the current user.
|
||||
$reviewStatus = $user->getReviewStatus();
|
||||
|
||||
|
@ -834,14 +840,25 @@ class SeedDMS_Core_DMS {
|
|||
|
||||
if (strlen($docCSV)>0) {
|
||||
$queryStr .= "AND `tblDocumentStatusLog`.`status` IN (".S_DRAFT_REV.", ".S_EXPIRED.") ".
|
||||
"AND `tblDocuments`.`id` IN (" . $docCSV . ") ".
|
||||
"ORDER BY `statusDate` DESC";
|
||||
"AND `tblDocuments`.`id` IN (" . $docCSV . ") ";
|
||||
//$queryStr .= "ORDER BY `statusDate` DESC";
|
||||
if ($orderby=='e') $queryStr .= "ORDER BY `expires`";
|
||||
else if ($orderby=='u') $queryStr .= "ORDER BY `statusDate`";
|
||||
else if ($orderby=='s') $queryStr .= "ORDER BY `status`";
|
||||
else $queryStr .= "ORDER BY `name`";
|
||||
$queryStr .= " ".$orderdir;
|
||||
} else {
|
||||
$queryStr = '';
|
||||
}
|
||||
break; // }}}
|
||||
case 'ApproveByMe': // Documents I have to approve {{{
|
||||
$user = $param1;
|
||||
$orderby = $param3;
|
||||
if($param4 == 'desc')
|
||||
$orderdir = 'DESC';
|
||||
else
|
||||
$orderdir = 'ASC';
|
||||
|
||||
// Get document list for the current user.
|
||||
$approvalStatus = $user->getApprovalStatus();
|
||||
|
||||
|
@ -867,8 +884,13 @@ class SeedDMS_Core_DMS {
|
|||
|
||||
if (strlen($docCSV)>0) {
|
||||
$queryStr .= "AND `tblDocumentStatusLog`.`status` IN (".S_DRAFT_APP.", ".S_EXPIRED.") ".
|
||||
"AND `tblDocuments`.`id` IN (" . $docCSV . ") ".
|
||||
"ORDER BY `statusDate` DESC";
|
||||
"AND `tblDocuments`.`id` IN (" . $docCSV . ") ";
|
||||
//$queryStr .= "ORDER BY `statusDate` DESC";
|
||||
if ($orderby=='e') $queryStr .= "ORDER BY `expires`";
|
||||
else if ($orderby=='u') $queryStr .= "ORDER BY `statusDate`";
|
||||
else if ($orderby=='s') $queryStr .= "ORDER BY `status`";
|
||||
else $queryStr .= "ORDER BY `name`";
|
||||
$queryStr .= " ".$orderdir;
|
||||
} else {
|
||||
$queryStr = '';
|
||||
}
|
||||
|
@ -907,6 +929,12 @@ class SeedDMS_Core_DMS {
|
|||
break; // }}}
|
||||
case 'ReviseByMe': // Documents I have to receipt {{{
|
||||
$user = $param1;
|
||||
$orderby = $param3;
|
||||
if($param4 == 'desc')
|
||||
$orderdir = 'DESC';
|
||||
else
|
||||
$orderdir = 'ASC';
|
||||
|
||||
// Get document list for the current user.
|
||||
$revisionStatus = $user->getRevisionStatus();
|
||||
|
||||
|
@ -929,8 +957,13 @@ class SeedDMS_Core_DMS {
|
|||
}
|
||||
|
||||
if (strlen($docCSV)>0) {
|
||||
$queryStr .= "AND `tblDocuments`.`id` IN (" . $docCSV . ") ".
|
||||
"ORDER BY `statusDate` DESC";
|
||||
$queryStr .= "AND `tblDocuments`.`id` IN (" . $docCSV . ") ";
|
||||
//$queryStr .= "ORDER BY `statusDate` DESC";
|
||||
if ($orderby=='e') $queryStr .= "ORDER BY `expires`";
|
||||
else if ($orderby=='u') $queryStr .= "ORDER BY `statusDate`";
|
||||
else if ($orderby=='s') $queryStr .= "ORDER BY `status`";
|
||||
else $queryStr .= "ORDER BY `name`";
|
||||
$queryStr .= " ".$orderdir;
|
||||
} else {
|
||||
$queryStr = '';
|
||||
}
|
||||
|
@ -987,14 +1020,33 @@ class SeedDMS_Core_DMS {
|
|||
break; // }}}
|
||||
case 'RejectOwner': // Documents that has been rejected and I'm owning {{{
|
||||
$user = $param1;
|
||||
$orderby = $param3;
|
||||
if($param4 == 'desc')
|
||||
$orderdir = 'DESC';
|
||||
else
|
||||
$orderdir = 'ASC';
|
||||
$queryStr .= "AND `tblDocuments`.`owner` = '".$user->getID()."' ".
|
||||
"AND `tblDocumentStatusLog`.`status` IN (".S_REJECTED.") ".
|
||||
"ORDER BY `statusDate` DESC";
|
||||
"AND `tblDocumentStatusLog`.`status` IN (".S_REJECTED.") ";
|
||||
//$queryStr .= "ORDER BY `statusDate` DESC";
|
||||
if ($orderby=='e') $queryStr .= "ORDER BY `expires`";
|
||||
else if ($orderby=='u') $queryStr .= "ORDER BY `statusDate`";
|
||||
else if ($orderby=='s') $queryStr .= "ORDER BY `status`";
|
||||
else $queryStr .= "ORDER BY `name`";
|
||||
$queryStr .= " ".$orderdir;
|
||||
break; // }}}
|
||||
case 'LockedByMe': // Documents locked by me {{{
|
||||
$user = $param1;
|
||||
$queryStr .= "AND `tblDocumentLocks`.`userID` = '".$user->getID()."' ".
|
||||
"ORDER BY `statusDate` DESC";
|
||||
$orderby = $param3;
|
||||
if($param4 == 'desc')
|
||||
$orderdir = 'DESC';
|
||||
else
|
||||
$orderdir = 'ASC';
|
||||
$queryStr .= "AND `tblDocumentLocks`.`userID` = '".$user->getID()."' ";
|
||||
if ($orderby=='e') $queryStr .= "ORDER BY `expires`";
|
||||
else if ($orderby=='u') $queryStr .= "ORDER BY `statusDate`";
|
||||
else if ($orderby=='s') $queryStr .= "ORDER BY `status`";
|
||||
else $queryStr .= "ORDER BY `name`";
|
||||
$queryStr .= " ".$orderdir;
|
||||
break; // }}}
|
||||
case 'WorkflowOwner': // Documents waiting for workflow trigger I'm owning {{{
|
||||
$user = $param1;
|
||||
|
@ -1018,6 +1070,11 @@ class SeedDMS_Core_DMS {
|
|||
break; // }}}
|
||||
case 'CheckedOutByMe': // Documents I have checked out {{{
|
||||
$user = $param1;
|
||||
$orderby = $param3;
|
||||
if($param4 == 'desc')
|
||||
$orderdir = 'DESC';
|
||||
else
|
||||
$orderdir = 'ASC';
|
||||
|
||||
$qs = 'SELECT document FROM tblDocumentCheckOuts WHERE userID='.$user->getID();
|
||||
$ra = $this->db->getResultArray($qs);
|
||||
|
@ -1030,8 +1087,12 @@ class SeedDMS_Core_DMS {
|
|||
}
|
||||
|
||||
if ($docs) {
|
||||
$queryStr .= "AND `tblDocuments`.`id` IN (" . implode(',', $docs) . ") ".
|
||||
"ORDER BY `statusDate` DESC";
|
||||
$queryStr .= "AND `tblDocuments`.`id` IN (" . implode(',', $docs) . ") ";
|
||||
if ($orderby=='e') $queryStr .= "ORDER BY `expires`";
|
||||
else if ($orderby=='u') $queryStr .= "ORDER BY `statusDate`";
|
||||
else if ($orderby=='s') $queryStr .= "ORDER BY `status`";
|
||||
else $queryStr .= "ORDER BY `name`";
|
||||
$queryStr .= " ".$orderdir;
|
||||
} else {
|
||||
$queryStr = '';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user