mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 12:41:30 +00:00
fix getRevisionStatus()
it didn't always return the last entry of the revision log
This commit is contained in:
parent
40956e9501
commit
b07cd2d442
|
@ -461,18 +461,24 @@ class SeedDMS_Core_Group { /* {{{ */
|
||||||
|
|
||||||
$status = array();
|
$status = array();
|
||||||
|
|
||||||
|
if (!$db->createTemporaryTable("ttcontentid")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// See if the group is assigned as a revisor.
|
// See if the group is assigned as a revisor.
|
||||||
$queryStr = "SELECT `tblDocumentRevisors`.*, `tblDocumentRevisionLog`.`status`, ".
|
$queryStr = "SELECT `tblDocumentRevisors`.*, `tblDocumentRevisionLog`.`status`, ".
|
||||||
"`tblDocumentRevisionLog`.`comment`, `tblDocumentRevisionLog`.`date`, ".
|
"`tblDocumentRevisionLog`.`comment`, `tblDocumentRevisionLog`.`date`, ".
|
||||||
"`tblDocumentRevisionLog`.`userID` ".
|
"`tblDocumentRevisionLog`.`userID` ".
|
||||||
"FROM `tblDocumentRevisors` ".
|
"FROM `tblDocumentRevisors` ".
|
||||||
"LEFT JOIN `tblDocumentRevisionLog` USING (`revisionID`) ".
|
"LEFT JOIN `tblDocumentRevisionLog` USING (`revisionID`) ".
|
||||||
|
"LEFT JOIN `ttcontentid` ON `ttcontentid`.`maxVersion` = `tblDocumentRevisors`.`version` AND `ttcontentid`.`document` = `tblDocumentRevisors`.`documentID` ".
|
||||||
"WHERE `tblDocumentRevisors`.`type`='1' ".
|
"WHERE `tblDocumentRevisors`.`type`='1' ".
|
||||||
($documentID==null ? "" : "AND `tblDocumentRevisors`.`documentID` = '". (int) $documentID ."' ").
|
($documentID==null ? "" : "AND `tblDocumentRevisors`.`documentID` = '". (int) $documentID ."' ").
|
||||||
($version==null ? "" : "AND `tblDocumentRevisors`.`version` = '". (int) $version ."' ").
|
($version==null ? "" : "AND `tblDocumentRevisors`.`version` = '". (int) $version ."' ").
|
||||||
"AND `tblDocumentRevisors`.`required`='". $this->_id ."' ";
|
($documentID==null && $version==null ? "AND `ttcontentid`.`maxVersion` = `tblDocumentRevisors`.`version` " : "").
|
||||||
|
"AND `tblDocumentRevisors`.`required`='". $this->_id ."' ".
|
||||||
|
"ORDER BY `tblDocumentRevisionLog`.`revisionLogID` DESC";
|
||||||
$resArr = $db->getResultArray($queryStr);
|
$resArr = $db->getResultArray($queryStr);
|
||||||
if (is_bool($resArr) && $resArr == false)
|
if ($resArr === false)
|
||||||
return false;
|
return false;
|
||||||
if (count($resArr)>0) {
|
if (count($resArr)>0) {
|
||||||
$status['status'] = array();
|
$status['status'] = array();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user