From a7579f47aef8265b6d8fc6d2f6edf67191493f34 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 13 Mar 2023 10:23:36 +0100 Subject: [PATCH] show message if document may not be checked in --- views/bootstrap/class.CheckInDocument.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/views/bootstrap/class.CheckInDocument.php b/views/bootstrap/class.CheckInDocument.php index 154311499..62c96d2a8 100644 --- a/views/bootstrap/class.CheckInDocument.php +++ b/views/bootstrap/class.CheckInDocument.php @@ -104,6 +104,21 @@ $(document).ready(function() { print ""; } + $checkoutinfo = $document->getCheckOutInfo(); + if(!$checkoutinfo) { + $this->errorMsg(getMLText('error_occured')); + $this->contentEnd(); + $this->htmlEndPage(); + exit; + } + $info = $checkoutinfo[0]; + if($user->getID() != $info['userID'] && $document->getAccessMode($user) < M_ALL) { + $this->errorMsg(getMLText('access_denied')); + $this->contentEnd(); + $this->htmlEndPage(); + exit; + } + if ($checkoutstatus = $document->checkOutStatus()) { switch($checkoutstatus) { case 1: @@ -117,7 +132,6 @@ $(document).ready(function() { break; } } - $checkoutinfo = $document->getCheckOutInfo(); $this->rowStart(); if($checkoutstatus == 0) {