mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
getDocumentList() can return sleeping revision
This commit is contained in:
parent
0d43c618cd
commit
5ac51f3c89
|
@ -1020,6 +1020,25 @@ class SeedDMS_Core_DMS {
|
|||
$queryStr .= "AND `tblDocumentRevisionLog`.`status` = 0 ";
|
||||
$queryStr .= "AND `tblDocumentStatusLog`.`status` IN (".S_IN_REVISION.") ";
|
||||
break; /* }}} */
|
||||
case 'SleepingReviseByMe': // Documents I have to receipt {{{
|
||||
if (!$this->db->createTemporaryTable("ttrevisionid")) {
|
||||
return false;
|
||||
}
|
||||
$queryStr .=
|
||||
"LEFT JOIN `tblDocumentRevisors` on `ttcontentid`.`document`=`tblDocumentRevisors`.`documentID` AND `ttcontentid`.`maxVersion`=`tblDocumentRevisors`.`version` ".
|
||||
"LEFT JOIN `ttrevisionid` ON `ttrevisionid`.`revisionID` = `tblDocumentRevisors`.`revisionID` ".
|
||||
"LEFT JOIN `tblDocumentRevisionLog` ON `tblDocumentRevisionLog`.`revisionLogID`=`ttrevisionid`.`maxLogID` ";
|
||||
|
||||
if($user) {
|
||||
$queryStr .= "WHERE (`tblDocumentRevisors`.`type` = 0 AND `tblDocumentRevisors`.`required` = ".$user->getID()." ";
|
||||
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 `tblDocumentRevisionLog`.`status` = -3 ";
|
||||
$queryStr .= "AND `tblDocumentStatusLog`.`status` IN (".S_RELEASED.") ";
|
||||
break; /* }}} */
|
||||
case 'NeedsCorrectionOwner': // Documents that need to be corrected {{{
|
||||
$queryStr .=
|
||||
"LEFT JOIN `tblDocuments` ON `tblDocuments`.`id` = `ttcontentid`.`document` ";
|
||||
|
@ -1519,6 +1538,42 @@ class SeedDMS_Core_DMS {
|
|||
}
|
||||
}
|
||||
break; // }}}
|
||||
case 'SleepingReviseByMe': // Documents I have to revise but are still sleeping {{{
|
||||
if (!$this->db->createTemporaryTable("ttrevisionid")) {
|
||||
return false;
|
||||
}
|
||||
$user = $param1;
|
||||
$orderby = $param3;
|
||||
if($param4 == 'desc')
|
||||
$orderdir = 'DESC';
|
||||
else
|
||||
$orderdir = 'ASC';
|
||||
|
||||
$groups = array();
|
||||
$tmp = $user->getGroups();
|
||||
foreach($tmp as $group)
|
||||
$groups[] = $group->getID();
|
||||
|
||||
$selectStr .= ", `tblDocumentRevisionLog`.`date` as `duedate` ";
|
||||
$queryStr .=
|
||||
"LEFT JOIN `tblDocumentRevisors` on `ttcontentid`.`document`=`tblDocumentRevisors`.`documentID` AND `ttcontentid`.`maxVersion`=`tblDocumentRevisors`.`version` ".
|
||||
"LEFT JOIN `ttrevisionid` ON `ttrevisionid`.`revisionID` = `tblDocumentRevisors`.`revisionID` ".
|
||||
"LEFT JOIN `tblDocumentRevisionLog` ON `tblDocumentRevisionLog`.`revisionLogID`=`ttrevisionid`.`maxLogID` ";
|
||||
|
||||
$queryStr .= "WHERE (`tblDocumentRevisors`.`type` = 0 AND `tblDocumentRevisors`.`required` = ".$user->getID()." ";
|
||||
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 `tblDocumentStatusLog`.`status` = ".S_RELEASED." ";
|
||||
if(!$param2)
|
||||
$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`";
|
||||
else $queryStr .= "ORDER BY `name`";
|
||||
$queryStr .= " ".$orderdir;
|
||||
break; // }}}
|
||||
case 'DueRevision': // Documents with a due revision, which is not started {{{
|
||||
if (!$this->db->createTemporaryTable("ttrevisionid")) {
|
||||
return false;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
- add searching for revision date
|
||||
- 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()
|
||||
</notes>
|
||||
<contents>
|
||||
<dir baseinstalldir="SeedDMS" name="/">
|
||||
|
|
Loading…
Reference in New Issue
Block a user