diff --git a/templates/components/itilobject/actors/field.html.twig b/templates/components/itilobject/actors/field.html.twig index ba6197b978d..05333288178 100644 --- a/templates/components/itilobject/actors/field.html.twig +++ b/templates/components/itilobject/actors/field.html.twig @@ -73,325 +73,311 @@ {{ include('components/itilobject/actors/assign_to_me.html.twig') }} {% endif %} - + // intercept event for edit notification button + document.addEventListener('click', event => { + if (event.target.closest("#actor_{{ rand }} + .select2 .edit-notify-user")) { + return openNotifyModal(event); + } + // if a click on assign info is detected prevent opening of select2 + if (event.target.closest("#actor_{{ rand }} + .select2 .assign_infos")) { + event.stopPropagation(); + } + }, {capture: true}) + document.addEventListener('keydown', event => { + if (event.target.closest("#actor_{{ rand }} + .select2 .edit-notify-user") + && event.key == "Enter") { + return openNotifyModal(event); + } + }, {capture: true}) + + {% if itiltemplate.isHiddenField('_users_id_' ~ actortype) %} + $(".actor_entry[data-itemtype=\"User\"][data-actortype=\"{{ actortype }}\"]").parent().css("display", "none"); + {% endif %} + {% if itiltemplate.isHiddenField('_groups_id_' ~ actortype) %} + $(".actor_entry[data-itemtype=\"Group\"][data-actortype=\"{{ actortype }}\"]").parent().css("display", "none"); + {% endif %} + {% endif %}