mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
add methods SeedDMS_Core_DocumentContent::getReviewers() and SeedDMS_Core_DocumentContent::getApprovers()
This commit is contained in:
parent
1ac8f31105
commit
e5159ca7f9
|
@ -3382,6 +3382,35 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
return M_NONE;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return a list of all reviewers separated by individuals and groups
|
||||
*
|
||||
* @return array|bool|null
|
||||
*/
|
||||
function getReviewers() { /* {{{ */
|
||||
$dms = $this->_document->getDMS();
|
||||
$db = $dms->getDB();
|
||||
|
||||
$queryStr=
|
||||
"SELECT * FROM `tblDocumentReviewers` WHERE `version`='".$this->_version
|
||||
."' AND `documentID` = '". $this->_document->getID() ."' ";
|
||||
|
||||
$recs = $db->getResultArray($queryStr);
|
||||
if (is_bool($recs))
|
||||
return false;
|
||||
$reviewers = array('i'=>array(), 'g'=>array());
|
||||
foreach($recs as $rec) {
|
||||
if($rec['type'] == 0) {
|
||||
if($u = $dms->getUser($rec['required']))
|
||||
$reviewers['i'][] = $u;
|
||||
} elseif($rec['type'] == 1) {
|
||||
if($g = $dms->getGroup($rec['required']))
|
||||
$reviewers['g'][] = $g;
|
||||
}
|
||||
}
|
||||
return $reviewers;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get the current review status of the document content
|
||||
* The review status is a list of reviews and its current status
|
||||
|
@ -3510,6 +3539,35 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
return true;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return a list of all approvers separated by individuals and groups
|
||||
*
|
||||
* @return array|bool|null
|
||||
*/
|
||||
function getApprovers() { /* {{{ */
|
||||
$dms = $this->_document->getDMS();
|
||||
$db = $dms->getDB();
|
||||
|
||||
$queryStr=
|
||||
"SELECT * FROM `tblDocumentApprovers` WHERE `version`='".$this->_version
|
||||
."' AND `documentID` = '". $this->_document->getID() ."' ";
|
||||
|
||||
$recs = $db->getResultArray($queryStr);
|
||||
if (is_bool($recs))
|
||||
return false;
|
||||
$approvers = array('i'=>array(), 'g'=>array());
|
||||
foreach($recs as $rec) {
|
||||
if($rec['type'] == 0) {
|
||||
if($u = $dms->getUser($rec['required']))
|
||||
$approvers['i'][] = $u;
|
||||
} elseif($rec['type'] == 1) {
|
||||
if($g = $dms->getGroup($rec['required']))
|
||||
$approvers['g'][] = $g;
|
||||
}
|
||||
}
|
||||
return $approvers;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get the current approval status of the document content
|
||||
* The approval status is a list of approvals and its current status
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||
<notes>
|
||||
- SeedDMS_Core_DMS::getTimeline() uses status log instead of document content
|
||||
- add methods SeedDMS_Core_DocumentContent::getReviewers() and SeedDMS_Core_DocumentContent::getApprovers()
|
||||
</notes>
|
||||
<contents>
|
||||
<dir baseinstalldir="SeedDMS" name="/">
|
||||
|
|
Loading…
Reference in New Issue
Block a user