mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
getReviewersStatus() and getReceiptStatus() only return last version
the return lists will no longer include a revision, receipt for version of a document not being the last version
This commit is contained in:
parent
c63f994a5f
commit
db22c3f348
|
@ -1223,6 +1223,9 @@ class SeedDMS_Core_User { /* {{{ */
|
|||
$status = array("indstatus"=>array(), "grpstatus"=>array());
|
||||
|
||||
// See if the user is assigned as an individual reviewer.
|
||||
/* FIXME: See query of getRevisionStatus() because it also restricts on
|
||||
* latest version. This may be needed here too.
|
||||
*/
|
||||
$queryStr = "SELECT `tblDocumentReviewers`.*, `tblDocumentReviewLog`.`status`, ".
|
||||
"`tblDocumentReviewLog`.`comment`, `tblDocumentReviewLog`.`date`, ".
|
||||
"`tblDocumentReviewLog`.`userID` ".
|
||||
|
@ -1310,6 +1313,9 @@ class SeedDMS_Core_User { /* {{{ */
|
|||
$db = $this->_dms->getDB();
|
||||
|
||||
$status = array("indstatus"=>array(), "grpstatus"=>array());
|
||||
/* FIXME: See query of getRevisionStatus() because it also restricts on
|
||||
* latest version. This may be needed here too.
|
||||
*/
|
||||
$queryStr =
|
||||
"SELECT `tblDocumentApprovers`.*, `tblDocumentApproveLog`.`status`, ".
|
||||
"`tblDocumentApproveLog`.`comment`, `tblDocumentApproveLog`.`date`, ".
|
||||
|
@ -1390,15 +1396,22 @@ class SeedDMS_Core_User { /* {{{ */
|
|||
|
||||
$status = array("indstatus"=>array(), "grpstatus"=>array());
|
||||
|
||||
if (!$db->createTemporaryTable("ttcontentid")) {
|
||||
return false;
|
||||
}
|
||||
// See if the user is assigned as an individual recipient.
|
||||
// left join with ttcontentid to restrict result on latest version of document
|
||||
// unless a document and version is given
|
||||
$queryStr = "SELECT `tblDocumentRecipients`.*, `tblDocumentReceiptLog`.`status`, ".
|
||||
"`tblDocumentReceiptLog`.`comment`, `tblDocumentReceiptLog`.`date`, ".
|
||||
"`tblDocumentReceiptLog`.`userID` ".
|
||||
"FROM `tblDocumentRecipients` ".
|
||||
"LEFT JOIN `tblDocumentReceiptLog` USING (`receiptID`) ".
|
||||
"LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentRecipients`.`version` AND `ttcontentid`.`document` = `tblDocumentRecipients`.`documentID` ".
|
||||
"WHERE `tblDocumentRecipients`.`type`='0' ".
|
||||
($documentID==null ? "" : "AND `tblDocumentRecipients`.`documentID` = '". (int) $documentID ."' ").
|
||||
($version==null ? "" : "AND `tblDocumentRecipients`.`version` = '". (int) $version ."' ").
|
||||
($documentID==null && $version==null ? "AND `ttcontentid`.`maxVersion` = `tblDocumentRecipients`.`version` " : "").
|
||||
"AND `tblDocumentRecipients`.`required`='". $this->_id ."' ".
|
||||
"ORDER BY `tblDocumentReceiptLog`.`receiptLogID` DESC";
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
|
@ -1423,10 +1436,12 @@ class SeedDMS_Core_User { /* {{{ */
|
|||
"`tblDocumentReceiptLog`.`userID` ".
|
||||
"FROM `tblDocumentRecipients` ".
|
||||
"LEFT JOIN `tblDocumentReceiptLog` USING (`receiptID`) ".
|
||||
"LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentRecipients`.`version` AND `ttcontentid`.`document` = `tblDocumentRecipients`.`documentID` ".
|
||||
"LEFT JOIN `tblGroupMembers` ON `tblGroupMembers`.`groupID` = `tblDocumentRecipients`.`required` ".
|
||||
"WHERE `tblDocumentRecipients`.`type`='1' ".
|
||||
($documentID==null ? "" : "AND `tblDocumentRecipients`.`documentID` = '". (int) $documentID ."' ").
|
||||
($version==null ? "" : "AND `tblDocumentRecipients`.`version` = '". (int) $version ."' ").
|
||||
($documentID==null && $version==null ? "AND `ttcontentid`.`maxVersion` = `tblDocumentRecipients`.`version` " : "").
|
||||
"AND `tblGroupMembers`.`userID`='". $this->_id ."' ".
|
||||
"ORDER BY `tblDocumentReceiptLog`.`receiptLogID` DESC";
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
|
@ -1470,15 +1485,22 @@ class SeedDMS_Core_User { /* {{{ */
|
|||
|
||||
$status = array("indstatus"=>array(), "grpstatus"=>array());
|
||||
|
||||
if (!$db->createTemporaryTable("ttcontentid")) {
|
||||
return false;
|
||||
}
|
||||
// See if the user is assigned as an individual revisor.
|
||||
// left join with ttcontentid to restrict result on latest version of document
|
||||
// unless a document and version is given
|
||||
$queryStr = "SELECT `tblDocumentRevisors`.*, `tblDocumentRevisionLog`.`status`, ".
|
||||
"`tblDocumentRevisionLog`.`comment`, `tblDocumentRevisionLog`.`date`, ".
|
||||
"`tblDocumentRevisionLog`.`userID` ".
|
||||
"FROM `tblDocumentRevisors` ".
|
||||
"LEFT JOIN `tblDocumentRevisionLog` USING (`revisionID`) ".
|
||||
"LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentRevisors`.`version` AND `ttcontentid`.`document` = `tblDocumentRevisors`.`documentID` ".
|
||||
"WHERE `tblDocumentRevisors`.`type`='0' ".
|
||||
($documentID==null ? "" : "AND `tblDocumentRevisors`.`documentID` = '". (int) $documentID ."' ").
|
||||
($version==null ? "" : "AND `tblDocumentRevisors`.`version` = '". (int) $version ."' ").
|
||||
($documentID==null && $version==null ? "AND `ttcontentid`.`maxVersion` = `tblDocumentRevisors`.`version` " : "").
|
||||
"AND `tblDocumentRevisors`.`required`='". $this->_id ."' ".
|
||||
"ORDER BY `tblDocumentRevisionLog`.`revisionLogID` DESC";
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
|
@ -1505,10 +1527,12 @@ class SeedDMS_Core_User { /* {{{ */
|
|||
"`tblDocumentRevisionLog`.`userID` ".
|
||||
"FROM `tblDocumentRevisors` ".
|
||||
"LEFT JOIN `tblDocumentRevisionLog` USING (`revisionID`) ".
|
||||
"LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentRevisors`.`version` AND `ttcontentid`.`document` = `tblDocumentRevisors`.`documentID` ".
|
||||
"LEFT JOIN `tblGroupMembers` ON `tblGroupMembers`.`groupID` = `tblDocumentRevisors`.`required` ".
|
||||
"WHERE `tblDocumentRevisors`.`type`='1' ".
|
||||
($documentID==null ? "" : "AND `tblDocumentRevisors`.`documentID` = '". (int) $documentID ."' ").
|
||||
($version==null ? "" : "AND `tblDocumentRevisors`.`version` = '". (int) $version ."' ").
|
||||
($documentID==null && $version==null ? "AND `ttcontentid`.`maxVersion` = `tblDocumentRevisors`.`version` " : "").
|
||||
"AND `tblGroupMembers`.`userID`='". $this->_id ."' ".
|
||||
"ORDER BY `tblDocumentRevisionLog`.`revisionLogID` DESC";
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
|
|
Loading…
Reference in New Issue
Block a user