mirror of
https://github.com/Combodo/iTop.git
synced 2026-09-29 21:09:10 +02:00
N°9557 - Small improvement to shortcut preferences
This commit is contained in:
@@ -109,10 +109,18 @@ $('#shortcut_rename_dlg').dialog({
|
||||
modal: true,
|
||||
title: '$sDialogTitle',
|
||||
buttons: [
|
||||
{ text: "$sOkButtonLabel", click: ShortcutRenameOK},
|
||||
{ text: "$sCancelButtonLabel", click: function() {
|
||||
$(this).dialog( "close" ); $(this).remove();
|
||||
} },
|
||||
{
|
||||
text: "$sCancelButtonLabel",
|
||||
click: function() {
|
||||
$(this).dialog( "close" ); $(this).remove();
|
||||
},
|
||||
'class': 'ibo-button ibo-is-alternative ibo-is-neutral action cancel'
|
||||
},
|
||||
{
|
||||
text: "$sOkButtonLabel",
|
||||
click: ShortcutRenameOK,
|
||||
'class': 'ibo-is-regular ibo-is-primary'
|
||||
},
|
||||
],
|
||||
close: function() { $(this).remove(); }
|
||||
});
|
||||
|
||||
@@ -1239,13 +1239,31 @@ JS
|
||||
$oSearch = new DBObjectSearch('Shortcut');
|
||||
$aShortcuts = utils::ReadMultipleSelection($oSearch);
|
||||
$iShortcut = $aShortcuts[0];
|
||||
$oShortcut = MetaModel::GetObject('Shortcut', $iShortcut);
|
||||
$oShortcutSearch = new DBObjectSearch('Shortcut');
|
||||
$oShortcutSearch->AddCondition('user_id', UserRights::GetUserId(), '=');
|
||||
$oShortcutSearch->AddCondition('id', $iShortcut, '=');
|
||||
$oShortcutSet = new CMDBObjectSet($oShortcutSearch);
|
||||
if ($oShortcutSet->Count() === 0) {
|
||||
throw new SecurityException(Dict::S('UI:ObjectDoesNotExist'));
|
||||
}
|
||||
|
||||
$oShortcut = $oShortcutSet->Fetch();
|
||||
|
||||
$oShortcut->StartRenameDialog($oPage);
|
||||
break;
|
||||
|
||||
case 'shortcut_rename_go':
|
||||
$iShortcut = utils::ReadParam('id', 0);
|
||||
$oShortcut = MetaModel::GetObject('Shortcut', $iShortcut);
|
||||
|
||||
$oShortcutSearch = new DBObjectSearch('Shortcut');
|
||||
$oShortcutSearch->AddCondition('user_id', UserRights::GetUserId(), '=');
|
||||
$oShortcutSearch->AddCondition('id', $iShortcut, '=');
|
||||
$oShortcutSet = new CMDBObjectSet($oShortcutSearch);
|
||||
if ($oShortcutSet->Count() === 0) {
|
||||
throw new SecurityException(Dict::S('UI:ObjectDoesNotExist'));
|
||||
}
|
||||
|
||||
$oShortcut = $oShortcutSet->Fetch();
|
||||
|
||||
$sName = utils::ReadParam('attr_name', '', false, 'raw_data');
|
||||
if (strlen($sName) > 0) {
|
||||
|
||||
@@ -243,7 +243,7 @@ JS
|
||||
);
|
||||
$oShortcutsToolBar->AddSubBlock($oShortcutsRenameButton);
|
||||
// - Delete button
|
||||
$oShortcutsDeleteButton = ButtonUIBlockFactory::MakeForSecondaryAction(
|
||||
$oShortcutsDeleteButton = ButtonUIBlockFactory::MakeForDestructiveAction(
|
||||
Dict::S('UI:Button:Delete'),
|
||||
null,
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user