new documentList for 'ReceiptByMe'

This commit is contained in:
Uwe Steinmann 2015-05-04 06:11:35 +02:00
parent 3d10f91026
commit a16a57a1f9

View File

@ -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()."' ".