mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
N°6219 - 1:n Read: tooltip, modal title and message on Add-Edit-Remove-Delete
This commit is contained in:
@@ -935,6 +935,8 @@ JS;
|
||||
/** bool to perform a creation of a new object of this type in a modal */
|
||||
'creation_in_modal_tooltip',
|
||||
/** creation in modal button tooltip */
|
||||
'creation_in_modal_form_title',
|
||||
/** creation in modal form title */
|
||||
'creation_in_modal_js_handler',
|
||||
/** Handler to call when trying to create a new object in modal */
|
||||
'creation_disallowed',
|
||||
|
||||
@@ -43,8 +43,10 @@ abstract class AbstractBlockLinkSetViewTable extends UIContentBlock
|
||||
];
|
||||
|
||||
// Dictionnary entries
|
||||
public const BUTTON_TOOLTIP = 'UI:Links:Add:Button+';
|
||||
public const DICT_ADD_BUTTON_TOOLTIP = 'UI:Links:Add:Button+';
|
||||
public const DICT_ADD_MODAL_TITLE = 'UI:Links:Add:Modal:Title';
|
||||
public const DICT_CREATE_BUTTON_TOOLTIP = 'UI:Links:Create:Button+';
|
||||
public const DICT_CREATE_MODAL_TITLE = 'UI:Links:Create:Modal:Title';
|
||||
public const DICT_MODIFY_LINK_BUTTON_TOOLTIP = 'UI:Links:ModifyLink:Button+';
|
||||
public const DICT_MODIFY_LINK_MODAL_TITLE = 'UI:Links:ModifyLink:Modal:Title';
|
||||
public const DICT_MODIFY_OBJECT_BUTTON_TOOLTIP = 'UI:Links:ModifyObject:Button+';
|
||||
|
||||
@@ -53,7 +53,8 @@ class BlockDirectLinkSetViewTable extends AbstractBlockLinkSetViewTable
|
||||
&& $this->oAttDef->GetEditMode() != LINKSET_EDITMODE_NONE
|
||||
&& $this->bIsAllowCreate) {
|
||||
$aExtraParams['creation_in_modal'] = true;
|
||||
$aExtraParams['creation_in_modal_tooltip'] = $this->GetDictionaryEntry(static::DICT_CREATE_BUTTON_TOOLTIP);
|
||||
$aExtraParams['creation_in_modal_tooltip'] = $this->oAttDef->GetEditMode() == LINKSET_EDITMODE_ADDREMOVE ? $this->GetDictionaryEntry(static::DICT_ADD_BUTTON_TOOLTIP) : $this->GetDictionaryEntry(static::DICT_CREATE_BUTTON_TOOLTIP);
|
||||
$aExtraParams['creation_in_modal_form_title'] = $this->oAttDef->GetEditMode() == LINKSET_EDITMODE_ADDREMOVE ? $this->GetDictionaryEntry(static::DICT_ADD_MODAL_TITLE) : $this->GetDictionaryEntry(static::DICT_CREATE_MODAL_TITLE);
|
||||
$aExtraParams['creation_in_modal_js_handler'] = "{$this->GetWidgetName()}.links_view_table('CreateLinkedObject');";
|
||||
} else {
|
||||
$aExtraParams['creation_disallowed'] = true;
|
||||
@@ -111,13 +112,13 @@ class BlockDirectLinkSetViewTable extends AbstractBlockLinkSetViewTable
|
||||
'color' => Button::ENUM_COLOR_SCHEME_DESTRUCTIVE,
|
||||
'js_row_action' => "{$this->GetWidgetName()}.links_view_table('DeleteLinkedObject', aRowData['{$this->oAttDef->GetLinkedClass()}/_key_/raw'], oTrElement);",
|
||||
'confirmation' => [
|
||||
'title' => $this->GetDictionaryEntry(static::DICT_DELETE_MODAL_TITLE),
|
||||
'message' => $this->GetDictionaryEntry(static::DICT_DELETE_MODAL_MESSAGE),
|
||||
'confirm_button_class' => 'ibo-is-danger',
|
||||
'row_data' => "{$this->sTargetClass}/hyperlink",
|
||||
'do_not_show_again_pref_key' => $this->GetDoNotShowAgainPreferenceKey(),
|
||||
],
|
||||
);
|
||||
'title' => $this->GetDictionaryEntry(static::DICT_DELETE_MODAL_TITLE),
|
||||
'message' => $this->GetDictionaryEntry(static::DICT_DELETE_MODAL_MESSAGE),
|
||||
'confirm_button_class' => 'ibo-is-danger',
|
||||
'row_data' => "{$this->sTargetClass}/hyperlink",
|
||||
'do_not_show_again_pref_key' => $this->GetDoNotShowAgainPreferenceKey(),
|
||||
],
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -63,7 +63,8 @@ class BlockIndirectLinkSetViewTable extends AbstractBlockLinkSetViewTable
|
||||
if (!$this->oAttDef->GetReadOnly()
|
||||
&& $this->bIsAllowCreate) {
|
||||
$aExtraParams['creation_in_modal'] = true;
|
||||
$aExtraParams['creation_in_modal_tooltip'] = $this->GetDictionaryEntry(static::BUTTON_TOOLTIP);
|
||||
$aExtraParams['creation_in_modal_tooltip'] = $this->GetDictionaryEntry(static::DICT_ADD_BUTTON_TOOLTIP);
|
||||
$aExtraParams['creation_in_modal_form_title'] = $this->GetDictionaryEntry(static::DICT_ADD_MODAL_TITLE);
|
||||
$aExtraParams['creation_in_modal_js_handler'] = "{$this->GetWidgetName()}.links_view_table('CreateLinkedObject');";
|
||||
} else {
|
||||
$aExtraParams['creation_disallowed'] = true;
|
||||
|
||||
Reference in New Issue
Block a user