check if !workflow instead of isset(workflow)

This commit is contained in:
Uwe Steinmann 2022-02-18 18:00:50 +01:00
parent d805de5035
commit d91787bf44

View File

@ -3019,7 +3019,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
if (!$ignorecurrentstatus && ($st["status"]==S_OBSOLETE || $st["status"]==S_REJECTED || $st["status"]==S_EXPIRED )) return $st['status']; if (!$ignorecurrentstatus && ($st["status"]==S_OBSOLETE || $st["status"]==S_REJECTED || $st["status"]==S_EXPIRED )) return $st['status'];
unset($this->_workflow); // force to be reloaded from DB $this->_workflow = null; // force to be reloaded from DB
$hasworkflow = $this->getWorkflow() ? true : false; $hasworkflow = $this->getWorkflow() ? true : false;
/* $pendingReview will be set when there are still open reviews */ /* $pendingReview will be set when there are still open reviews */
@ -4763,7 +4763,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
function getWorkflow() { /* {{{ */ function getWorkflow() { /* {{{ */
$db = $this->_document->getDMS()->getDB(); $db = $this->_document->getDMS()->getDB();
if (!isset($this->_workflow)) { if (!$this->_workflow) {
$queryStr= $queryStr=
"SELECT b.* FROM `tblWorkflowDocumentContent` a LEFT JOIN `tblWorkflows` b ON a.`workflow` = b.`id` WHERE a.`version`='".$this->_version "SELECT b.* FROM `tblWorkflowDocumentContent` a LEFT JOIN `tblWorkflows` b ON a.`workflow` = b.`id` WHERE a.`version`='".$this->_version
."' AND a.`document` = '". $this->_document->getID() ."' " ."' AND a.`document` = '". $this->_document->getID() ."' "
@ -4831,7 +4831,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
$this->getWorkflow(); $this->getWorkflow();
if (!isset($this->_workflow)) { if (!$this->_workflow) {
return true; return true;
} }
@ -4872,7 +4872,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
$this->getWorkflow(); $this->getWorkflow();
if (!isset($this->_workflow)) { if (!$this->_workflow) {
return true; return true;
} }
@ -4988,7 +4988,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
if(!$this->_workflow) if(!$this->_workflow)
return false; return false;
if (isset($this->_workflow)) { if ($this->_workflow) {
$db->startTransaction(); $db->startTransaction();
$queryStr= $queryStr=