getDocumentList() returns only documents I haven't touched

The lists AppRevByMe, ReviseByMe and ReceiptByMe will only return
those documents in its initial review/approval/receipt/revision
status (0).
This commit is contained in:
Uwe Steinmann 2015-07-09 18:25:55 +02:00
parent 59fd3c7170
commit 9bc675873d

View File

@ -679,9 +679,11 @@ class SeedDMS_Core_DMS {
* [statusName] => name of user who has initiated the status change * [statusName] => name of user who has initiated the status change
* *
* @param string $listtype type of document list, can be 'AppRevByMe', * @param string $listtype type of document list, can be 'AppRevByMe',
* 'AppRevOwner', 'ReceiptByMe', 'LockedByMe', 'MyDocs' * 'AppRevOwner', 'ReceiptByMe', 'ReviseByMe', 'LockedByMe', 'MyDocs'
* @param object $param1 user * @param object $param1 user
* @param string $param2 sort list if listtype='MyDocs' * @param string $param2 sort list if listtype='MyDocs', set to true
* if 'AppRevByMe', 'ReviseByMe', 'ReceiptByMe' shall return even documents
* І have already taken care of.
* @return array list of documents * @return array list of documents
*/ */
function getDocumentList($listtype, $param1=null, $param2='') { /* {{{ */ function getDocumentList($listtype, $param1=null, $param2='') { /* {{{ */
@ -720,22 +722,22 @@ class SeedDMS_Core_DMS {
// Take only those documents into account which hasn't be touched by the user // Take only those documents into account which hasn't be touched by the user
$dList = array(); $dList = array();
foreach ($reviewStatus["indstatus"] as $st) { foreach ($reviewStatus["indstatus"] as $st) {
if ($st["status"]==0 && !in_array($st["documentID"], $dList)) { if (($st["status"]==0 || $param2) && !in_array($st["documentID"], $dList)) {
$dList[] = $st["documentID"]; $dList[] = $st["documentID"];
} }
} }
foreach ($reviewStatus["grpstatus"] as $st) { foreach ($reviewStatus["grpstatus"] as $st) {
if ($st["status"]==0 && !in_array($st["documentID"], $dList)) { if (($st["status"]==0 || $param2) && !in_array($st["documentID"], $dList)) {
$dList[] = $st["documentID"]; $dList[] = $st["documentID"];
} }
} }
foreach ($approvalStatus["indstatus"] as $st) { foreach ($approvalStatus["indstatus"] as $st) {
if ($st["status"]==0 && !in_array($st["documentID"], $dList)) { if (($st["status"]==0 || $param2) && !in_array($st["documentID"], $dList)) {
$dList[] = $st["documentID"]; $dList[] = $st["documentID"];
} }
} }
foreach ($approvalStatus["grpstatus"] as $st) { foreach ($approvalStatus["grpstatus"] as $st) {
if ($st["status"]==0 && !in_array($st["documentID"], $dList)) { if (($st["status"]==0 || $param2) && !in_array($st["documentID"], $dList)) {
$dList[] = $st["documentID"]; $dList[] = $st["documentID"];
} }
} }
@ -761,12 +763,12 @@ class SeedDMS_Core_DMS {
// required. // required.
$dList = array(); $dList = array();
foreach ($receiptStatus["indstatus"] as $st) { foreach ($receiptStatus["indstatus"] as $st) {
if (!in_array($st["documentID"], $dList)) { if (($st["status"]==0 || $param2) && !in_array($st["documentID"], $dList)) {
$dList[] = $st["documentID"]; $dList[] = $st["documentID"];
} }
} }
foreach ($receiptStatus["grpstatus"] as $st) { foreach ($receiptStatus["grpstatus"] as $st) {
if (!in_array($st["documentID"], $dList)) { if (($st["status"]==0 || $param2) && !in_array($st["documentID"], $dList)) {
$dList[] = $st["documentID"]; $dList[] = $st["documentID"];
} }
} }
@ -791,12 +793,12 @@ class SeedDMS_Core_DMS {
// required. // required.
$dList = array(); $dList = array();
foreach ($revisionStatus["indstatus"] as $st) { foreach ($revisionStatus["indstatus"] as $st) {
if (!in_array($st["documentID"], $dList)) { if (($st["status"]==0 || $param2) && !in_array($st["documentID"], $dList)) {
$dList[] = $st["documentID"]; $dList[] = $st["documentID"];
} }
} }
foreach ($revisionStatus["grpstatus"] as $st) { foreach ($revisionStatus["grpstatus"] as $st) {
if (!in_array($st["documentID"], $dList)) { if (($st["status"]==0 || $param2) && !in_array($st["documentID"], $dList)) {
$dList[] = $st["documentID"]; $dList[] = $st["documentID"];
} }
} }