From a31524df0981876e79640c000a34e67c9fa61c5f Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 15 May 2020 08:05:46 +0200 Subject: [PATCH] delRevisor() returns -4 if user has placed revision already --- SeedDMS_Core/Core/inc.ClassDocument.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 025018690..3d591f393 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -879,10 +879,13 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */ * Check if latest content of the document has a scheduled * revision workflow. * The method will update the document status log database table - * if needed. + * if needed and set the revisiondate of the content to $next. * * FIXME: This method does not check if there are any revisors left. Even * if all revisors have been removed, it will still start the revision workflow! + * NOTE: This seems not the case anymore. The status of each revision is + * checked. Only if at least one status is S_LOG_SLEEPING the revision will be + * started. This wouldn't be the case if all revisors had been removed. * * @param object $user user requesting the possible automatic change * @param string $next next date for review @@ -5495,7 +5498,10 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ if ($indstatus["status"] != S_LOG_WAITING && $indstatus["status"] != S_LOG_SLEEPING) { // User has already submitted a revision or has already been deleted; // return an error. - return -3; + if($indstatus["status"] == S_LOG_USER_REMOVED) + return -3; + else + return -4; } $queryStr = "INSERT INTO `tblDocumentRevisionLog` (`revisionID`, `status`, `comment`, `date`, `userID`) ".