diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 1563c7a22..4cf051859 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -5342,6 +5342,20 @@ EOF $sJSOk = json_encode(Dict::S('UI:Button:Ok')); $oPage->add_ready_script( <<').dialog({ + title: $sJSTitle, + modal: true, + autoOpen: false, + minWidth: 600, + buttons:[{ + text: $sJSOk, + class: 'ibo-is-alternative', + click: function() { $(this).dialog('close'); } + }], + close: function() { $(this).dialog('close'); } + }); + // Start periodic handler let hOwnershipLockHandlerInterval = window.setInterval(function() { if (window.bInSubmit || window.bInCancel) return; @@ -5351,18 +5365,8 @@ EOF if ($('.lock_owned').length == 0) { $('.ui-layout-content').prepend('
'+data.message+'
'); - $('
'+data.popup_message+'
').dialog({ - title: $sJSTitle, - modal: true, - autoOpen: true, - minWidth: 600, - buttons:[{ - text: {$sJSOk}, - class: 'ibo-is-alternative', - click: function() { $(this).dialog('close'); } - }], - close: function() { $(this).remove(); } - }); + oOwnershipLockModal.text(data.popup_message); + oOwnershipLockModal.dialog('open'); } $('.object-details form .ibo-toolbar .ibo-button:not([name="cancel"])').prop('disabled', true); clearInterval(hOwnershipLockHandlerInterval); @@ -5372,18 +5376,8 @@ EOF if ($('.lock_owned').length == 0) { $('.ui-layout-content').prepend('
'+data.message+'
'); - $('
'+data.popup_message+'
').dialog({ - title: $sJSTitle, - modal: true, - autoOpen: true, - minWidth: 600, - buttons:[{ - text: $sJSOk, - class: 'ibo-is-alternative', - click: function() { $(this).dialog('close'); } - }], - close: function() { $(this).remove(); } - }); + oOwnershipLockModal.text(data.popup_message); + oOwnershipLockModal.dialog('open'); } $('.object-details form .ibo-toolbar .ibo-button:not([name="cancel"])').prop('disabled', true); clearInterval(hOwnershipLockHandlerInterval);