mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
add method getWorkflowStatus()
This commit is contained in:
parent
c0a1ed57bb
commit
a8c98b5f72
|
@ -322,6 +322,35 @@ class SeedDMS_Core_Group {
|
|||
return $status;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get a list of documents with a workflow
|
||||
*
|
||||
* @param int $documentID optional document id for which to retrieve the
|
||||
* reviews
|
||||
* @param int $version optional version of the document
|
||||
* @return array list of all workflows
|
||||
*/
|
||||
function getWorkflowStatus($documentID=null, $version=null) { /* {{{ */
|
||||
$db = $this->_dms->getDB();
|
||||
|
||||
$queryStr = 'select distinct d.*, c.groupid from tblWorkflowTransitions a left join tblWorkflows b on a.workflow=b.id left join tblWorkflowTransitionGroups c on a.id=c.transition left join tblWorkflowDocumentContent d on b.id=d.workflow where d.document is not null and a.state=d.state and c.groupid='.$this->_id;
|
||||
if($documentID) {
|
||||
$queryStr .= ' AND d.document='.(int) $documentID;
|
||||
if($version)
|
||||
$queryStr .= ' AND d.version='.(int) $version;
|
||||
}
|
||||
$resArr = $db->getResultArray($queryStr);
|
||||
if (is_bool($resArr) && $resArr == false)
|
||||
return false;
|
||||
$result = array();
|
||||
if (count($resArr)>0) {
|
||||
foreach ($resArr as $res) {
|
||||
$result[] = $res;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Get all notifications of group
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user