the checkout info is not related to substituted user

This commit is contained in:
Uwe Steinmann 2024-04-23 12:18:34 +02:00
parent 15ee5357a5
commit 55aa6fe170

View File

@ -414,17 +414,10 @@ $(document).ready( function() {
if(is_string($txt)) {
echo $txt;
} elseif($infos = $document->getCheckOutInfo()) {
$session = $this->params['session'];
if($session->getSu()) {
$origuser = $dms->getUser($session->getUser());
$checkoutpath = sprintf($checkoutdir, preg_replace('/[^A-Za-z0-9_-]/', '', $origuser->getLogin()));
} else {
$origuser = $user;
$checkoutpath = sprintf($checkoutdir, preg_replace('/[^A-Za-z0-9_-]/', '', $user->getLogin()));
}
foreach($infos as $info) {
foreach($infos as $i=>$info) {
$checkoutuser = $dms->getUser($info['userID']);
$checkoutstatus = $document->checkOutStatus();
$checkoutpath = sprintf($checkoutdir, preg_replace('/[^A-Za-z0-9_-]/', '', $checkoutuser->getLogin()));
$checkoutstatus = $document->checkOutStatus($i);
echo "<div class=\"alert alert-info\">";
echo "<a href=\"file://".$info['filename']."\">".getMLText('copied_to_checkout_as', array('date'=>getLongReadableDate(makeTsFromLongDate($info['date'])), 'filename'=>substr($info['filename'], strlen($checkoutpath)+1), 'username'=>($checkoutuser ? $checkoutuser->getFullName() : '')))."</a>";
echo "</div>";