diff --git a/SeedDMS_Core/Core/inc.ClassDMS.php b/SeedDMS_Core/Core/inc.ClassDMS.php index b6bbb7d58..37eb6f9e8 100644 --- a/SeedDMS_Core/Core/inc.ClassDMS.php +++ b/SeedDMS_Core/Core/inc.ClassDMS.php @@ -619,7 +619,7 @@ class SeedDMS_Core_DMS { * [statusName] => name of user who has initiated the status change * * @param string $listtype type of document list, can be 'AppRevByMe', - * 'AppRevOwner', 'LockedByMe', 'MyDocs' + * 'AppRevOwner', 'ReceiptByMe', 'LockedByMe', 'MyDocs' * @param object $param1 user * @param string $param2 sort list if listtype='MyDocs' * @return array list of documents @@ -691,6 +691,36 @@ class SeedDMS_Core_DMS { $queryStr = ''; } break; + case 'ReiptByMe': // Documents I have to receipt + $user = $param1; + // Get document list for the current user. + $receiptStatus = $user->getReceiptStatus(); + + // Create a comma separated list of all the documentIDs whose information is + // required. + $dList = array(); + foreach ($receiptStatus["indstatus"] as $st) { + if (!in_array($st["documentID"], $dList)) { + $dList[] = $st["documentID"]; + } + } + foreach ($receiptStatus["grpstatus"] as $st) { + if (!in_array($st["documentID"], $dList)) { + $dList[] = $st["documentID"]; + } + } + $docCSV = ""; + foreach ($dList as $d) { + $docCSV .= (strlen($docCSV)==0 ? "" : ", ")."'".$d."'"; + } + + if (strlen($docCSV)>0) { + $queryStr .= "AND `tblDocuments`.`id` IN (" . $docCSV . ") ". + "ORDER BY `statusDate` DESC"; + } else { + $queryStr = ''; + } + break; case 'AppRevOwner': // Documents waiting for review/approval I'm owning $user = $param1; $queryStr .= "AND `tblDocuments`.`owner` = '".$user->getID()."' ".