mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
Issue/5074 - Routage, Block UI relations, Links row actions (#369)
* datatable row actions
Below is a sample of extra param to enable feature:
$aExtraParams['row_actions'] = [
[
'tooltip' => 'remove an element',
'icon_css_class' => 'fa-minus',
'js_row_action' => 'console.log("You clicked the remove button");',
'confirmation' => [
'message' => 'UI:ConfirmationMessage',
'message_row_data' => "name",
'remember_choice_pref_key' => 'remove_do_not_show_again',
],
],
[
'tooltip' => 'open in new tab',
'icon_css_class' => 'fa-external-link-square-alt',
'on_action_js' => 'window.open("http://localhost/itop-branchs/dev/pages/UI.php?operation=details&class=UserRequest&id=" + aData.id + "&c[menu]=UserRequest%3AOpenRequests");',
],
[
'tooltip' => 'other actions',
'icon_css_class' => 'fa-ellipsis-v',
'on_action_js' => 'console.log(event);',
],
];
* Contrôleur pour la suppression et le détachement de liens
* Block UI pour l'édition des relations
* Block UI pour la visualisation des relations
* Boutons d'actions pour la suppression et le détachement de liens
* Gestion dialogue de confirmation pour les row actions
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
{# @copyright Copyright (C) 2010-2021 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
{% apply spaceless %}
|
||||
oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }} = new LinksWidget(
|
||||
'{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}',
|
||||
'{{ oUIBlock.oUILinksWidget.GetClass() }}',
|
||||
'{{ oUIBlock.oUILinksWidget.GetAttCode() }}',
|
||||
'{{ oUIBlock.oUILinksWidget.GetInputId() }}',
|
||||
'{{ oUIBlock.oUILinksWidget.GetNameSuffix() }}',
|
||||
{{ oUIBlock.sDuplicates }},
|
||||
{{ oUIBlock.sWizHelper }},
|
||||
'{{ oUIBlock.oUILinksWidget.GetExternalKeyToRemote() }}',
|
||||
{{ oUIBlock.sJSDoSearch }},
|
||||
{{ oUIBlock.iMaxAddedId }},
|
||||
{{ oUIBlock.aRemoved | json_encode | raw }}
|
||||
);
|
||||
oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.Init();
|
||||
{% endapply %}
|
||||
@@ -1,18 +0,0 @@
|
||||
{# @copyright Copyright (C) 2010-2021 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
{% apply spaceless %}
|
||||
oWidget{{ oUIBlock.iInputId }} = new LinksWidget(
|
||||
'{{ oUIBlock.sLinkedSetId }}',
|
||||
'{{ oUIBlock.sClass }}',
|
||||
'{{ oUIBlock.sAttCode }}',
|
||||
'{{ oUIBlock.iInputId }}',
|
||||
'{{ oUIBlock.sNameSuffix }}',
|
||||
{{ oUIBlock.bDuplicates }},
|
||||
{{ oUIBlock.oWizHelper }},
|
||||
'{{ oUIBlock.sExtKeyToRemote }}',
|
||||
{{ oUIBlock.bJSDoSearch }},
|
||||
{{ oUIBlock.iMaxAddedId }},
|
||||
{{ oUIBlock.aRemoved | json_encode | raw }}
|
||||
);
|
||||
oWidget{{ oUIBlock.iInputId }}.Init();
|
||||
{% endapply %}
|
||||
@@ -2,13 +2,13 @@
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
{% apply spaceless %}
|
||||
|
||||
$('#dlg_{{ oUIBlock.sLinkedSetId }}').dialog({
|
||||
$('#dlg_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}').dialog({
|
||||
width: $(window).width()*0.8,
|
||||
height: $(window).height()*0.8,
|
||||
title:"{{ 'UI:AddObjectsOf_Class_LinkedWith_Class'|dict_format(oUIBlock.sLinkedClassName, oUIBlock.sClassName) }}" ,
|
||||
title:"{{ 'UI:AddObjectsOf_Class_LinkedWith_Class'|dict_format(oUIBlock.oUILinksWidget.GetLinkedClass(), oUIBlock.oUILinksWidget.GetClass()) }}" ,
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
resizeStop: oWidget{{ oUIBlock.iInputId }}.UpdateSizes,
|
||||
resizeStop: oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.UpdateSizes,
|
||||
buttons: [
|
||||
{
|
||||
text: "{{ 'UI:Button:Cancel'| dict_s }}",
|
||||
@@ -20,16 +20,16 @@ $('#dlg_{{ oUIBlock.sLinkedSetId }}').dialog({
|
||||
{
|
||||
text: "{{ 'UI:Button:Add'| dict_s }}",
|
||||
class: "ibo-is-regular ibo-is-primary",
|
||||
id: "btn_ok_{{ oUIBlock.sLinkedSetId }}",
|
||||
id: "btn_ok_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}",
|
||||
click: function() {
|
||||
return oWidget{{ oUIBlock.iInputId }}.DoAddObjects();
|
||||
return oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.DoAddObjects();
|
||||
}
|
||||
},
|
||||
],
|
||||
|
||||
});
|
||||
|
||||
$('#SearchFormToAdd_{{ oUIBlock.sLinkedSetId }} form').bind('submit.uilinksWizard', oWidget{{ oUIBlock.iInputId }}.SearchObjectsToAdd);
|
||||
$('#SearchFormToAdd_{{ oUIBlock.sLinkedSetId }}').resize(oWidget{{ oUIBlock.iInputId }}.UpdateSizes);
|
||||
$('#SearchFormToAdd_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }} form').bind('submit.uilinksWizard', oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.SearchObjectsToAdd);
|
||||
$('#SearchFormToAdd_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}').resize(oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.UpdateSizes);
|
||||
|
||||
{% endapply %}
|
||||
Reference in New Issue
Block a user