From 38c6f8c76f74cf92831ebce24fbcfc6e3e022da0 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 18 Feb 2021 14:32:36 +0100 Subject: [PATCH] =?UTF-8?q?Concurrent=20lock:=20Fix=20ownership=20handler?= =?UTF-8?q?=20in=20the=20backoffice=20-=20Lost=20lock=20message=20will=20o?= =?UTF-8?q?nly=20be=20displayed=20once=20instead=20of=20being=20stacked=20?= =?UTF-8?q?every=2060s=20=F0=9F=A4=AA=20-=20Action=20buttons=20(except=20"?= =?UTF-8?q?Cancel")=20are=20disabled=20when=20the=20lock=20expires=20(regr?= =?UTF-8?q?ession=20from=203.0.0)=20-=20Modal=20window=20is=20now=20larger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/cmdbabstract.class.inc.php | 16 +++++++++------- pages/ajax.render.php | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index bdff79a5f..798066e86 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -5137,8 +5137,8 @@ EOF $sJSTitle = json_encode(Dict::S('UI:DisconnectedDlgTitle')); $sJSOk = json_encode(Dict::S('UI:Button:Ok')); $oPage->add_ready_script( - <<'+data.message+''); - $('
'+data.popup_message+'
').dialog({title: $sJSTitle, modal: true, autoOpen: true, buttons:[ {text: $sJSOk, click: function() { $(this).dialog('close'); } }], close: function() { $(this).remove(); }}); + $('
'+data.popup_message+'
').dialog({title: $sJSTitle, modal: true, autoOpen: true, minWidth: 600, buttons:[ {text: $sJSOk, click: function() { $(this).dialog('close'); } }], close: function() { $(this).remove(); }}); } - $('.wizContainer form button.action:not(.cancel)').prop('disabled', true); + $('.object-details form .ibo-toolbar .ibo-button:not([name="cancel"])').prop('disabled', true); + clearInterval(hOwnershipLockHandlerInterval); } else if ((data.operation == 'lost') || (data.operation == 'expired')) { if ($('.lock_owned').length == 0) { $('.ui-layout-content').prepend('
'+data.message+'
'); - $('
'+data.popup_message+'
').dialog({title: $sJSTitle, modal: true, autoOpen: true, buttons:[ {text: $sJSOk, click: function() { $(this).dialog('close'); } }], close: function() { $(this).remove(); }}); + $('
'+data.popup_message+'
').dialog({title: $sJSTitle, modal: true, autoOpen: true, minWidth: 600, buttons:[ {text: $sJSOk, click: function() { $(this).dialog('close'); } }], close: function() { $(this).remove(); }}); } - $('.wizContainer form button.action:not(.cancel)').prop('disabled', true); + $('.object-details form .ibo-toolbar .ibo-button:not([name="cancel"])').prop('disabled', true); + clearInterval(hOwnershipLockHandlerInterval); } }, 'json'); }, $iInterval); -EOF +JS ); } diff --git a/pages/ajax.render.php b/pages/ajax.render.php index b66d7196f..90e8b01ce 100644 --- a/pages/ajax.render.php +++ b/pages/ajax.render.php @@ -2394,6 +2394,7 @@ EOF } } } + $oPage->SetContentType('application/json'); $oPage->add(json_encode($aResult)); break;