better documentation of SeedDMS_Core_DocumentContent::verifyStatus

This commit is contained in:
Uwe Steinmann 2019-10-17 07:09:08 +02:00
parent 6ae87d4fe0
commit f2e7063a56

View File

@ -2752,20 +2752,31 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
/**
* Recalculate the status of a document
*
* The methods checks the review and approval status and sets the
* status of the document accordingly.
* If status is S_RELEASED and version has workflow set status
* to S_IN_WORKFLOW
* If status is S_RELEASED and there are reviewers set status S_DRAFT_REV
* If status is S_RELEASED or S_DRAFT_REV and there are approvers set
*
* If status is S_RELEASED and the version has a workflow, then set
* the status to S_IN_WORKFLOW
* If status is S_RELEASED and there are reviewers => set status S_DRAFT_REV
* If status is S_RELEASED or S_DRAFT_REV and there are approvers => set
* status S_DRAFT_APP
* If status is draft and there are no approver and no reviewers set
* If status is draft and there are no approver and no reviewers => set
* status to S_RELEASED
* The status of a document with the current status S_OBSOLETE, S_REJECTED,
* or S_EXPIRED will not be changed unless the parameter
* $ignorecurrentstatus is set to true.
*
* This method may not be called after a negative approval or review to
* recalculated the status, because
* it doesn't take a defeating approval or review into account. It will
* just check for a pending workflow, approval or review and set the status
* accordingly, e.g. after the list of reviewers or appovers has been
* modified. If there is not pending workflow, approval or review the
* status will be set to S_RELEASED.
*
* This method will call {@see SeedDMS_Core_DocumentContent::setStatus()}
* which checks if the state has actually changed. This is, why this
* which checks if the status has actually changed. This is, why this
* function can be called at any time without harm to the status log.
*
* @param boolean $ignorecurrentstatus ignore the current status and
@ -2806,8 +2817,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
}
}
unset($this->_workflow); // force to be reloaded from DB
if ($this->getWorkflow()) $this->setStatus(S_IN_WORKFLOW,$msg,$user);
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);