a revision call also be started if some of the revisors have already reviewed the document

This commit is contained in:
Uwe Steinmann 2019-04-04 14:02:46 +02:00
parent d8fb4fa4b0
commit d0cf90032f
2 changed files with 15 additions and 5 deletions

View File

@ -5289,10 +5289,15 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
/* A new revision may only be started if we are not in the middle of
* revision or the user/group has been removed from the workflow
*/
/* Taken out, because it happened that a revision wasn't started for each revisor
* but just for some.
* Checking for each revisor not being sleeping prevented a second start of the
* revision for the remaining revisors still sleeping.
foreach($revisionStatus as $status) {
if($status['status'] != S_LOG_SLEEPING && $status['status'] != S_LOG_USER_REMOVED)
return false;
}
*/
/* Make sure all Logs will be set to the right status, in order to
* prevent inconsistent states. Actually it could be a feature to
@ -5300,6 +5305,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* this may not be possible.
*/
$db->startTransaction();
$startedrev = false;
foreach($revisionStatus as $status) {
if($status['status'] == S_LOG_SLEEPING) {
$queryStr = "INSERT INTO `tblDocumentRevisionLog` (`revisionID`, `status`,
@ -5312,12 +5318,15 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
$db->rollbackTransaction();
return false;
}
$startedrev = true;
}
}
if(!$this->setStatus(S_IN_REVISION, "Started revision", $requestUser)) {
$db->rollbackTransaction();
return false;
}
/* Set status only if at least one revision was started */
if($startedrev)
if(!$this->setStatus(S_IN_REVISION, "Started revision", $requestUser)) {
$db->rollbackTransaction();
return false;
}
$db->commitTransaction();
return true;

View File

@ -12,7 +12,7 @@
<email>uwe@steinmann.cx</email>
<active>yes</active>
</lead>
<date>2018-11-23</date>
<date>2019-04-04</date>
<time>07:31:17</time>
<version>
<release>6.0.7</release>
@ -27,6 +27,7 @@
SeedDMS_Core_Document::getTimeline() returns revision only for latest content
add callback onSetStatus in SeedDMS_Core_DocumentContent::setStatus()
add new list type 'DueRevision' in SeedDMS_Core_DMS::getDocumentList()
a revision can also be started if some revisors have already reviewed the document
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">