mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 20:51:30 +00:00
getDocumentList() returns list of documents without a receiver
This commit is contained in:
parent
544e151135
commit
903a491016
|
@ -1442,6 +1442,40 @@ class SeedDMS_Core_DMS {
|
||||||
$docs[] = $d['documentID'];
|
$docs[] = $d['documentID'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($docs) {
|
||||||
|
$queryStr .= "AND `tblDocuments`.`id` IN (" . implode(',', $docs) . ") ";
|
||||||
|
$queryStr .= "AND `tblDocuments`.`owner` = '".$user->getID()."'";
|
||||||
|
if ($orderby=='e') $queryStr .= "ORDER BY `expires`";
|
||||||
|
else if ($orderby=='u') $queryStr .= "ORDER BY `statusDate`";
|
||||||
|
else if ($orderby=='s') $queryStr .= "ORDER BY `status`";
|
||||||
|
else $queryStr .= "ORDER BY `name`";
|
||||||
|
$queryStr .= " ".$orderdir;
|
||||||
|
} else {
|
||||||
|
$queryStr = '';
|
||||||
|
}
|
||||||
|
break; // }}}
|
||||||
|
case 'NoReceiveOwner': // Documents *not* having a reception I'm owning {{{
|
||||||
|
$queryStr .= "WHERE 1=1 ";
|
||||||
|
|
||||||
|
$user = $param1;
|
||||||
|
$orderby = $param3;
|
||||||
|
if($param4 == 'desc')
|
||||||
|
$orderdir = 'DESC';
|
||||||
|
else
|
||||||
|
$orderdir = 'ASC';
|
||||||
|
|
||||||
|
// $qs = 'SELECT DISTINCT `documentID` FROM `tblDocumentRecipients` LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentRecipients`.`version` AND `ttcontentid`.`document` = `tblDocumentRecipients`.`documentID`';
|
||||||
|
// sql statement without older versions of a document
|
||||||
|
$qs = 'SELECT DISTINCT `document` as `documentID` FROM `ttcontentid` a LEFT JOIN `tblDocumentRecipients` b on a.`document`=b.`documentID` AND a.`maxVersion`=b.`version` WHERE b.`receiptID` IS NULL';
|
||||||
|
$ra = $this->db->getResultArray($qs);
|
||||||
|
if (is_bool($ra) && !$ra) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$docs = array();
|
||||||
|
foreach($ra as $d) {
|
||||||
|
$docs[] = $d['documentID'];
|
||||||
|
}
|
||||||
|
|
||||||
if ($docs) {
|
if ($docs) {
|
||||||
$queryStr .= "AND `tblDocuments`.`id` IN (" . implode(',', $docs) . ") ";
|
$queryStr .= "AND `tblDocuments`.`id` IN (" . implode(',', $docs) . ") ";
|
||||||
$queryStr .= "AND `tblDocuments`.`owner` = '".$user->getID()."'";
|
$queryStr .= "AND `tblDocuments`.`owner` = '".$user->getID()."'";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user