mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°7157 - Allow users to unsubscribe from notification channels (#611)
* N°7157 - Allow users to unsubscribe from notification channels * Fix type hinting * Add missing dict entries * Allows to subscribe/unsubscribe from notifications individually * Refactor NotificationsService to singleton pattern * Refactor NotificationsRepository to singleton pattern and rename methods to a more functional naming * Add PHPDoc and type hints * Dump autoloaders * Replace modals with toasts * Add dict entry --------- Co-authored-by: Molkobain <lajarige.guillaume@free.fr>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<div class="option ibo-input-select--autocomplete-item" role="option" >
|
||||
|
||||
{# Image #}
|
||||
<span class="ibo-input-select--autocomplete-item-image" data-template-condition="has_image" data-template-css-background-image="picture_url" data-template-text="initials"></span>
|
||||
<span class="ibo-input-select--autocomplete-item-image" data-template-add-class="class" data-template-condition="has_image" data-template-css-background-image="picture_url" data-template-text="initials"></span>
|
||||
|
||||
{# Desc #}
|
||||
<span class="ibo-input-select--autocomplete-item-txt">
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<div class="item ibo-input-select--notification-item" role="item" >
|
||||
|
||||
{# Image #}
|
||||
<span class="ibo-input-select--autocomplete-item-image" data-template-add-class="class" data-template-condition="has_image" data-template-css-background-image="picture_url" data-template-text="initials"></span>
|
||||
|
||||
{# Desc #}
|
||||
<span class="ibo-input-select--autocomplete-item-txt">
|
||||
|
||||
{# Friendly name #}
|
||||
<span data-template-text="friendlyname"></span>
|
||||
|
||||
{# Additional content #}
|
||||
{% block additional_content %}
|
||||
{% endblock %}
|
||||
|
||||
<span class="ibo-input-select--notification-item--mixed-value" data-template-condition="mixed">
|
||||
<span data-template-text="mixed_value"></span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
@@ -7,6 +7,9 @@
|
||||
name="{{ oUIBlock.GetName() }}"
|
||||
multiple
|
||||
style="display: none;"
|
||||
{% if oUIBlock.IsDisabled() == true %}
|
||||
disabled
|
||||
{% endif %}
|
||||
>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -49,6 +49,14 @@ let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
|
||||
{% if oUIBlock.HasRemoveItemButton() %}
|
||||
'remove_button' : {},
|
||||
{% endif %}
|
||||
|
||||
{# PLUGIN min items #}
|
||||
{% if oUIBlock.GetMinItems() is not empty %}
|
||||
'combodo_min_items' : {
|
||||
minItems: {{ oUIBlock.GetMinItems() }},
|
||||
errorMessage: '{{ 'UI:Component:Input:Set:MinimumItems'|dict_format(oUIBlock.GetMinItems()) }}'
|
||||
},
|
||||
{% endif %}
|
||||
},
|
||||
|
||||
{# Max items you can select #}
|
||||
@@ -197,6 +205,31 @@ let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
|
||||
'data-tooltip-html-enabled': true
|
||||
});
|
||||
CombodoTooltip.InitTooltipFromMarkup($item);
|
||||
|
||||
{% if oUIBlock.GetOnItemAddJs() is not null %}
|
||||
{{ oUIBlock.GetOnItemAddJs()|raw }}
|
||||
{% endif %}
|
||||
},
|
||||
|
||||
{# On item remove #}
|
||||
onItemRemove: function(value, $item){
|
||||
{% if oUIBlock.GetOnItemRemoveJs() is not null %}
|
||||
{{ oUIBlock.GetOnItemRemoveJs()|raw }}
|
||||
{% endif %}
|
||||
},
|
||||
|
||||
{# On option remove #}
|
||||
onOptionRemove: function(value, $item){
|
||||
{% if oUIBlock.GetOnOptionRemoveJs() is not null %}
|
||||
{{ oUIBlock.GetOnOptionRemoveJs()|raw }}
|
||||
{% endif %}
|
||||
},
|
||||
|
||||
{# On option add #}
|
||||
onOptionAdd: function(value, $item){
|
||||
{% if oUIBlock.GetOnOptionAddJs() is not null %}
|
||||
{{ oUIBlock.GetOnOptionAddJs()|raw }}
|
||||
{% endif %}
|
||||
},
|
||||
|
||||
{# plugin combodo_add_button #}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
{# @copyright Copyright (C) 2010-2023 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
<div class="option simple-option-renderer" role="option">
|
||||
|
||||
<div class="simple-option-renderer--container" data-template-add-class="class">
|
||||
|
||||
<img class="simple-option-renderer--container--icon" src="" data-template-attr-src="img">
|
||||
|
||||
<span class="simple-option-renderer--container--label" data-template-text="label">
|
||||
</span>
|
||||
|
||||
<span class="simple-option-renderer--container--complementary" data-template-text="complementary-text">
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user