mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
N°4171 - Concurrent lock: Fix expiration modal being duplicated sometimes
This commit is contained in:
@@ -5342,6 +5342,20 @@ EOF
|
||||
$sJSOk = json_encode(Dict::S('UI:Button:Ok'));
|
||||
$oPage->add_ready_script(
|
||||
<<<JS
|
||||
// Prepare reusable modal
|
||||
const oOwnershipLockModal = $('<div></div>').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('<div class="header_message message_error lock_owned">'+data.message+'</div>');
|
||||
$('<div>'+data.popup_message+'</div>').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('<div class="header_message message_error lock_owned">'+data.message+'</div>');
|
||||
$('<div>'+data.popup_message+'</div>').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);
|
||||
|
||||
Reference in New Issue
Block a user