mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
in removeWorkflow() remove records from tblWorkflowLog before tblWorkflowDocumentContent
This commit is contained in:
parent
3a26fc3e2a
commit
fa8356d729
|
@ -4617,15 +4617,6 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
$currentstate = $this->getWorkflowState();
|
||||
if(!$currentstate || SeedDMS_Core_DMS::checkIfEqual($this->_workflow->getInitState(), $currentstate) || $unlink == true) {
|
||||
$db->startTransaction();
|
||||
$queryStr=
|
||||
"DELETE FROM `tblWorkflowDocumentContent` WHERE "
|
||||
."`version`='".$this->_version."' "
|
||||
." AND `document` = '". $this->_document->getID() ."' "
|
||||
." AND `workflow` = '". $this->_workflow->getID() ."' ";
|
||||
if (!$db->getResult($queryStr)) {
|
||||
$db->rollbackTransaction();
|
||||
return false;
|
||||
}
|
||||
if(!$unlink) {
|
||||
$queryStr=
|
||||
"DELETE FROM `tblWorkflowLog` WHERE "
|
||||
|
@ -4637,6 +4628,15 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
return false;
|
||||
}
|
||||
}
|
||||
$queryStr=
|
||||
"DELETE FROM `tblWorkflowDocumentContent` WHERE "
|
||||
."`version`='".$this->_version."' "
|
||||
." AND `document` = '". $this->_document->getID() ."' "
|
||||
." AND `workflow` = '". $this->_workflow->getID() ."' ";
|
||||
if (!$db->getResult($queryStr)) {
|
||||
$db->rollbackTransaction();
|
||||
return false;
|
||||
}
|
||||
$this->_workflow = null;
|
||||
$this->_workflowState = null;
|
||||
$this->verifyStatus(false, $user, 'Workflow removed');
|
||||
|
|
Loading…
Reference in New Issue
Block a user