mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-01 14:37:20 +00:00
rename getLastWorkflowTransition() to getLastWorkflowLow(), returns a log even after the workflow was ended
This commit is contained in:
parent
cffad48b61
commit
ec1f99229e
|
@ -5352,30 +5352,33 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the latest logged transition for the document content within the
|
* Get the latest workflow log entry for the document content within the
|
||||||
* workflow
|
* workflow. Even after finishing the workflow (when the document content
|
||||||
|
* does not have workflow set anymore) this function returns the last
|
||||||
|
* log entry.
|
||||||
*
|
*
|
||||||
* @return array list of operations
|
* @return object
|
||||||
*/
|
*/
|
||||||
function getLastWorkflowTransition() { /* {{{ */
|
function getLastWorkflowLog() { /* {{{ */
|
||||||
$db = $this->_document->getDMS()->getDB();
|
$db = $this->_document->getDMS()->getDB();
|
||||||
|
|
||||||
|
/*
|
||||||
if(!$this->_workflow)
|
if(!$this->_workflow)
|
||||||
$this->getWorkflow();
|
$this->getWorkflow();
|
||||||
|
|
||||||
if(!$this->_workflow)
|
if(!$this->_workflow)
|
||||||
return false;
|
return false;
|
||||||
|
*/
|
||||||
$queryStr=
|
$queryStr=
|
||||||
"SELECT * FROM `tblWorkflowLog` WHERE `version`='".$this->_version ."' AND `document` = '". $this->_document->getID() ."' AND `workflow` = ". $this->_workflow->getID();
|
"SELECT * FROM `tblWorkflowLog` WHERE `version`='".$this->_version ."' AND `document` = '". $this->_document->getID() ."'"; // AND `workflow` = ". $this->_workflow->getID();
|
||||||
$queryStr .= " ORDER BY `id` DESC LIMIT 1";
|
$queryStr .= " ORDER BY `id` DESC LIMIT 1";
|
||||||
$resArr = $db->getResultArray($queryStr);
|
$resArr = $db->getResultArray($queryStr);
|
||||||
if (is_bool($resArr) && !$resArr)
|
if (is_bool($resArr) && !$resArr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$workflowlogs = array();
|
$i = 0;
|
||||||
$i = 0;
|
$workflow = $this->_document->getDMS()->getWorkflow($resArr[$i]["workflow"]);
|
||||||
$workflowlog = new SeedDMS_Core_Workflow_Log($resArr[$i]["id"], $this->_document->getDMS()->getDocument($resArr[$i]["document"]), $resArr[$i]["version"], $this->_workflow, $this->_document->getDMS()->getUser($resArr[$i]["userid"]), $this->_workflow->getTransition($resArr[$i]["transition"]), $resArr[$i]["date"], $resArr[$i]["comment"]);
|
$workflowlog = new SeedDMS_Core_Workflow_Log($resArr[$i]["id"], $this->_document->getDMS()->getDocument($resArr[$i]["document"]), $resArr[$i]["version"], $workflow, $this->_document->getDMS()->getUser($resArr[$i]["userid"]), $workflow->getTransition($resArr[$i]["transition"]), $resArr[$i]["date"], $resArr[$i]["comment"]);
|
||||||
$workflowlog->setDMS($this);
|
$workflowlog->setDMS($this);
|
||||||
|
|
||||||
return $workflowlog;
|
return $workflowlog;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user