add methods getApproveLog() and getReviewLog()

This commit is contained in:
Uwe Steinmann 2021-05-19 20:40:45 +02:00
parent 1d4bd6d1f0
commit 24be00ccd1

View File

@ -3468,6 +3468,27 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
return $this->_reviewStatus;
} /* }}} */
/**
* Get the latest entries from the review log of the document content
*
* @param integer $limit the number of log entries returned, defaults to 1
* @return array list of review log entries
*/
function getReviewLog($limit=1) { /* {{{ */
$db = $this->_document->getDMS()->getDB();
if (!is_numeric($limit)) return false;
$queryStr=
"SELECT * FROM `tblDocumentReviewLog` LEFT JOIN `tblDocumentReviewers` ON `tblDocumentReviewLog`.`reviewID` = `tblDocumentReviewers`.`reviewID` WHERE `version`='".$this->_version
."' AND `documentID` = '". $this->_document->getID() ."' "
."ORDER BY `tblDocumentReviewLog`.`reviewLogID` DESC LIMIT ".(int) $limit;
$recs = $db->getResultArray($queryStr);
if (is_bool($recs) && !$recs)
return false;
return($recs);
} /* }}} */
/**
* Rewrites the complete review log
*
@ -3625,6 +3646,27 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
return $this->_approvalStatus;
} /* }}} */
/**
* Get the latest entries from the approval log of the document content
*
* @param integer $limit the number of log entries returned, defaults to 1
* @return array list of approval log entries
*/
function getApproveLog($limit=1) { /* {{{ */
$db = $this->_document->getDMS()->getDB();
if (!is_numeric($limit)) return false;
$queryStr=
"SELECT * FROM `tblDocumentApproveLog` LEFT JOIN `tblDocumentApprovers` ON `tblDocumentApproveLog`.`approveID` = `tblDocumentApprovers`.`approveID` WHERE `version`='".$this->_version
."' AND `documentID` = '". $this->_document->getID() ."' "
."ORDER BY `tblDocumentApproveLog`.`approveLogID` DESC LIMIT ".(int) $limit;
$recs = $db->getResultArray($queryStr);
if (is_bool($recs) && !$recs)
return false;
return($recs);
} /* }}} */
/**
* Rewrites the complete approval log
*