mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
verifyStatus() returns new status (or old status if not changed)
This commit is contained in:
parent
fbe091eaf6
commit
43e98643ee
|
@ -2966,7 +2966,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
unset($this->_status);
|
||||
$st=$this->getStatus();
|
||||
|
||||
if (!$ignorecurrentstatus && ($st["status"]==S_OBSOLETE || $st["status"]==S_REJECTED || $st["status"]==S_EXPIRED )) return;
|
||||
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
|
||||
$hasworkflow = $this->getWorkflow() ? true : false;
|
||||
|
@ -3006,10 +3006,11 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
|||
}
|
||||
|
||||
/* First check for a running workflow or open reviews or approvals. */
|
||||
if ($hasworkflow) $this->setStatus(S_IN_WORKFLOW,$msg,$user);
|
||||
elseif ($pendingReview) $this->setStatus(S_DRAFT_REV,$msg,$user);
|
||||
elseif ($pendingApproval) $this->setStatus(S_DRAFT_APP,$msg,$user);
|
||||
else $this->setStatus(S_RELEASED,$msg,$user);
|
||||
if ($hasworkflow) { $newstatus = S_IN_WORKFLOW; $ret = $this->setStatus(S_IN_WORKFLOW,$msg,$user); }
|
||||
elseif ($pendingReview) { $newstatus = S_DRAFT_REV; $ret = $this->setStatus(S_DRAFT_REV,$msg,$user); }
|
||||
elseif ($pendingApproval) { $newstatus = S_DRAFT_APP; $ret = $this->setStatus(S_DRAFT_APP,$msg,$user); }
|
||||
else { $newstatus = S_RELEASED; $ret = $this->setStatus(S_RELEASED,$msg,$user); }
|
||||
return $ret ? $newstatus : $ret;
|
||||
} /* }}} */
|
||||
|
||||
function __construct($id, $document, $version, $comment, $date, $userID, $dir, $orgFileName, $fileType, $mimeType, $fileSize=0, $checksum='') { /* {{{ */
|
||||
|
|
Loading…
Reference in New Issue
Block a user