mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-21 00:02:17 +02:00
N°1386 - Advanced Search: Navigation in list - Browse this list - back from run_query
This commit is contained in:
7
templates/base/components/datatable/basket.ready.js.twig
Normal file
7
templates/base/components/datatable/basket.ready.js.twig
Normal file
@@ -0,0 +1,7 @@
|
||||
{# @copyright Copyright (C) 2010-2023 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
$("form[id^='basket']").each(function () {
|
||||
$(this).append($('<input/>')
|
||||
.attr({'type': 'hidden', 'name': 'back_posted_fields', 'value': '{{ oUIBlock.GetPostedFieldsForBackUrl()|raw }}'})
|
||||
);
|
||||
});
|
||||
@@ -7,12 +7,3 @@ oSelectedItems{{ oUIBlock.GetOption('sListId')|sanitize(constant('utils::ENUM_SA
|
||||
|
||||
var bSelectAllowed{{ oUIBlock.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_VARIABLE_NAME')) }} = false;
|
||||
|
||||
$('body').append($('<form/>')
|
||||
.attr({'method': 'post', 'id': 'basket{{ oUIBlock.GetId() }}'})
|
||||
.append($('<input/>')
|
||||
.attr({'type': 'hidden', 'name': 'filter', 'value': "{{ oUIBlock.GetFilter()|raw }}"})
|
||||
)
|
||||
.append($('<input/>')
|
||||
.attr({'type': 'hidden', 'name': 'back_url', 'value': window.location.href})
|
||||
)
|
||||
);
|
||||
@@ -462,6 +462,16 @@ if ($('#datatable_dlg_{{ oUIBlock.GetId() }}').hasClass('itop-datatable'))
|
||||
}
|
||||
$('#datatable_dlg_{{ oUIBlock.GetId() }}').DataTableSettings(aOptions{{ sListIDForVarSuffix }});
|
||||
|
||||
$('body').append($('<form/>')
|
||||
.attr({'method': 'post', 'id': 'basket{{ oUIBlock.GetId() }}'})
|
||||
.append($('<input/>')
|
||||
.attr({'type': 'hidden', 'name': 'filter', 'value': "{{ oUIBlock.GetFilter()|raw }}"})
|
||||
)
|
||||
.append($('<input/>')
|
||||
.attr({'type': 'hidden', 'name': 'back_url', 'value': window.location.href})
|
||||
)
|
||||
);
|
||||
|
||||
if (window.ResizeObserver)
|
||||
{
|
||||
let oTable{{ sListIDForVarSuffix }}ResizeTimeout = null;
|
||||
@@ -476,4 +486,4 @@ if (window.ResizeObserver)
|
||||
|
||||
{% if oUIBlock.HasRowActions() %}
|
||||
{% include 'base/components/datatable/row-actions/handler.js.twig' %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
@@ -1,26 +1,27 @@
|
||||
{# @copyright Copyright (C) 2010-2021 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
<div id="{{ oUIBlock.GetId() }}"
|
||||
class="{{ oUIBlock.GetBlocksInheritanceCSSClassesAsString() }} {{ oUIBlock.GetAdditionalCSSClassesAsString() }} {{ oUIBlock.GetCSSColorClass() }} {% if oUIBlock.IsHidden() %}ibo-is-hidden{% endif %} ibo-is-opened" data-role="ibo-navigation">
|
||||
{% block iboNavigation %}
|
||||
<form id="ibo-form-navigation" class="ibo-navigation-form" method="post">
|
||||
<input type="hidden" name="list_navigation" value="{{ oUIBlock.GetList() }}"/>
|
||||
<input type="hidden" name="filter" value="{{ oUIBlock.GetFilter() }}"/>
|
||||
<input type="hidden" name="back_url" value="{{ oUIBlock.GetBackUrl()|raw }}"/>
|
||||
<div class="ibo-form-navigation--nav fas fa-angle-up" id="{{ oUIBlock.GetId() }}-back"></div>
|
||||
{% if oUIBlock.HasPrec() %}
|
||||
<div class="ibo-form-navigation--nav fas fa-angle-double-left" id="{{ oUIBlock.GetId() }}-first"></div>
|
||||
<div class="ibo-form-navigation--nav fas fa-angle-left" id="{{ oUIBlock.GetId() }}-prev"></div>
|
||||
{% else %}
|
||||
   
|
||||
{% endif %}
|
||||
<div class="ibo-form-navigation--total">{{ oUIBlock.GetIdx() }} / {{ oUIBlock.GetCount() }}</div>
|
||||
{% if oUIBlock.HasNext() %}
|
||||
<div class="ibo-form-navigation--nav fas fa-angle-right" id="{{ oUIBlock.GetId() }}-next"></div>
|
||||
<div class="ibo-form-navigation--nav fas fa-angle-double-right" id="{{ oUIBlock.GetId() }}-last"></div>
|
||||
{% else %}
|
||||
   
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
<div id='{{ oUIBlock.GetId() }}'
|
||||
class='{{ oUIBlock.GetBlocksInheritanceCSSClassesAsString() }} {{ oUIBlock.GetAdditionalCSSClassesAsString() }} {{ oUIBlock.GetCSSColorClass() }} {% if oUIBlock.IsHidden() %}ibo-is-hidden{% endif %} ibo-is-opened' data-role='ibo-navigation'>
|
||||
{% block iboNavigation %}
|
||||
<form id='ibo-form-navigation' class='ibo-navigation-form' method='post'>
|
||||
<input type='hidden' name='list_navigation' value='{{ oUIBlock.GetList() }}'/>
|
||||
<input type='hidden' name='filter' value='{{ oUIBlock.GetFilter() }}'/>
|
||||
<input type='hidden' name='back_posted_fields' value='{{ oUIBlock.GetPostedFields()|raw }}'/>
|
||||
<input type='hidden' name='back_url' value='{{ oUIBlock.GetBackUrl()|raw }}'/>
|
||||
<div class='ibo-form-navigation--nav fas fa-angle-up' id='{{ oUIBlock.GetId() }}-back'></div>
|
||||
{% if oUIBlock.HasPrec() %}
|
||||
<div class='ibo-form-navigation--nav fas fa-angle-double-left' id='{{ oUIBlock.GetId() }}-first'></div>
|
||||
<div class='ibo-form-navigation--nav fas fa-angle-left' id='{{ oUIBlock.GetId() }}-prev'></div>
|
||||
{% else %}
|
||||
   
|
||||
{% endif %}
|
||||
<div class='ibo-form-navigation--total'>{{ oUIBlock.GetIdx() }} / {{ oUIBlock.GetCount() }}</div>
|
||||
{% if oUIBlock.HasNext() %}
|
||||
<div class='ibo-form-navigation--nav fas fa-angle-right' id='{{ oUIBlock.GetId() }}-next'></div>
|
||||
<div class='ibo-form-navigation--nav fas fa-angle-double-right' id='{{ oUIBlock.GetId() }}-last'></div>
|
||||
{% else %}
|
||||
   
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
</div>
|
||||
@@ -2,7 +2,13 @@
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
$('#{{ oUIBlock.GetId() }}-back').on('click', function () {
|
||||
window.location = '{{ oUIBlock.GetBackUrl()|raw }}';
|
||||
$('#ibo-form-navigation').attr('action', ' {{ oUIBlock.GetBackUrl() | raw }} ');
|
||||
|
||||
JSON.parse('{{ oUIBlock.GetPostedFields() | raw }}', (key, value) => {
|
||||
$('#ibo-form-navigation').append($('<input/>').attr({'type': 'hidden', 'name': key, 'value': value}));
|
||||
});
|
||||
|
||||
$('#ibo-form-navigation').submit();
|
||||
});
|
||||
|
||||
$('#{{ oUIBlock.GetId() }}-first').on('click', function () {
|
||||
|
||||
Reference in New Issue
Block a user