pass number of days to getDocumentList('DueRevisions')

This commit is contained in:
Uwe Steinmann 2021-04-03 07:53:12 +02:00
parent c9faef81f7
commit aa045478dd
2 changed files with 19 additions and 5 deletions

View File

@ -1116,7 +1116,8 @@ class SeedDMS_Core_DMS {
* 'ReviewByMe', 'ApproveByMe', 'AppRevByMe', 'ReviseByMe', 'ReceiptByMe'
* will also return documents which the reviewer, approver, etc.
* has already taken care of. If set to false only
* untouched documents will be returned. In case of 'ExpiredOwner' this
* untouched documents will be returned. In case of 'ExpiredOwner',
* 'SleepingReviseByMe' this
* parameter contains the number of days (a negative number is allowed)
* relativ to the current date or a date in format 'yyyy-mm-dd'
* (even in the past).
@ -1542,6 +1543,12 @@ class SeedDMS_Core_DMS {
if (!$this->db->createTemporaryTable("ttrevisionid")) {
return false;
}
$dayoffset = 0;
if(is_int($param2)) {
$dayoffset = (int) $param2;
}
$user = $param1;
$orderby = $param3;
if($param4 == 'desc')
@ -1564,10 +1571,9 @@ class SeedDMS_Core_DMS {
if($groups)
$queryStr .= "OR `tblDocumentRevisors`.`type` = 1 AND `tblDocumentRevisors`.`required` IN (".implode(',', $groups).")";
$queryStr .= ") ";
$queryStr .= "AND `tblDocumentContent`.`revisiondate` IS NOT NULL AND `tblDocumentContent`.`revisiondate` <= ".$this->db->getCurrentDatetime(14)." ";
$queryStr .= "AND `tblDocumentContent`.`revisiondate` IS NOT NULL AND `tblDocumentContent`.`revisiondate` <= ".$this->db->getCurrentDatetime($dayoffset)." ";
$queryStr .= "AND `tblDocumentStatusLog`.`status` = ".S_RELEASED." ";
if(!$param2)
$queryStr .= " AND `tblDocumentRevisionLog`.`status` = -3 ";
$queryStr .= " AND `tblDocumentRevisionLog`.`status` = -3 ";
if ($orderby=='e') $queryStr .= "ORDER BY `expires`";
else if ($orderby=='u') $queryStr .= "ORDER BY `statusDate`";
else if ($orderby=='s') $queryStr .= "ORDER BY `tblDocumentStatusLog`.`status`";
@ -1578,6 +1584,12 @@ class SeedDMS_Core_DMS {
if (!$this->db->createTemporaryTable("ttrevisionid")) {
return false;
}
$dayoffset = 0;
if(is_int($param2)) {
$dayoffset = (int) $param2;
}
$user = $param1;
$orderby = $param3;
if($param4 == 'desc')
@ -1586,7 +1598,7 @@ class SeedDMS_Core_DMS {
$orderdir = 'ASC';
$selectStr .= ", `tblDocumentContent`.`revisiondate` ";
$queryStr .= "WHERE `tblDocumentContent`.`revisiondate` IS NOT NULL AND `tblDocumentContent`.`revisiondate` <= ".$this->db->getCurrentDatetime()." ";
$queryStr .= "WHERE `tblDocumentContent`.`revisiondate` IS NOT NULL AND `tblDocumentContent`.`revisiondate` <= ".$this->db->getCurrentDatetime($dayoffset)." ";
$queryStr .= "AND `tblDocumentStatusLog`.`status` = ".S_RELEASED." ";
if ($orderby=='e') $queryStr .= "ORDER BY `expires`";
else if ($orderby=='u') $queryStr .= "ORDER BY `statusDate`";

View File

@ -28,6 +28,8 @@
- expired documents can be skipped from counting in countTasks()
- SeedDMS_Core_DMS::getDocumentList() uses ambiguous column name when sorting by status
- add list type SleepingReviseByMe to SeedDMS_Core_DMS::getDocumentList()
- parameter 2 of SeedDMS_Core_DMS::getDocumentList() is treated as number of
days for list DueRevisions
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">