@@ -, +, @@
preferecnce ILLModule. For more information see
https://koha-community.org/manual/21.11/en/html/ILL_requests.html
on your test environment and which ILL backend you are using.
This example is for Libris backend.
- name: tab1
status:
- IN_REM
- name: tab2
status:
- IN_UTEL
- IN_LEV
- name: tab3
status:
- IN_ANK
"All", "tab1", "tab2" and "tab3"
system preference ILLRequestsTabs are under tabs 1, 2 and 3
now have only one tab "All" under which correct ILL requests
are presented
expected behavior
---
ill/ill-requests.pl | 1 +
.../prog/en/includes/ill-list-table.inc | 2 +-
.../prog/en/modules/ill/ill-requests.tt | 15 +++++--
.../prog/en/modules/members/ill-requests.tt | 13 +++++-
koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js | 50 ++++++++++++++++++++++
members/ill-requests.pl | 1 +
6 files changed, 77 insertions(+), 5 deletions(-)
--- a/ill/ill-requests.pl
+++ a/ill/ill-requests.pl
@@ -427,6 +427,7 @@ if ( $backends_available ) {
$template->param(
backends => $backends,
+ illreq_tabs => C4::Context->yaml_preference('ILLRequestsTabs'),
types => [ "Book", "Article", "Journal" ],
query_type => $op,
branches => Koha::Libraries->search,
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc
@@ -1,4 +1,4 @@
-
+
[% IF prefilters.length > 0 %]
[% ELSE %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
@@ -779,9 +779,18 @@
[% ELSIF query_type == 'illlist' %]
View ILL requests
-
-
Details for all requests
- [% INCLUDE 'ill-list-table.inc' %]
+
+
+ [% INCLUDE 'ill-list-table.inc' %]
[% ELSIF query_type == 'availability' %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/ill-requests.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/ill-requests.tt
@@ -39,7 +39,18 @@
[% INCLUDE 'members-toolbar.inc' %]
ILL requests history
- [% INCLUDE 'ill-list-table.inc' %]
+
+
+ [% INCLUDE 'ill-list-table.inc' %]
--- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js
+++ a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js
@@ -317,6 +317,50 @@ $(document).ready(function() {
}
};
+ var tabsInit = function( ui, illtable_el ) {
+ localStorage.setItem(
+ "illrequests_activetab",
+ $( "#ill-requests-tabs" ).tabs( "option", "active" )
+ );
+
+ var ill_dt = illtable_el.DataTable();
+ $.fn.dataTable.ext.search.pop();
+ ill_dt.draw();
+
+ if ( $( "#ill-requests-tabs" ).tabs( "option", "active" ) > 0 ) {
+ // Initializing some other tab than "All"
+ var ill_tab_statuses = $("#ill-requests-tabs>ul>li.ui-tabs-active>a").attr('data-statuses');
+ ill_tab_statuses = ill_tab_statuses.split("|");
+
+ // Only show rows having the status defined in ILLRequestsTabs system
+ // preference in this tab
+ $.fn.dataTable.ext.search.push(
+ function(settings, data, dataIndex) {
+ return ill_tab_statuses.indexOf(ill_dt.row(dataIndex).data().status) >= 0;
+ }
+ );
+ ill_dt.draw();
+ }
+ };
+
+ $('#ill-requests-tabs').tabs({
+ create: function(event,ui) {
+ if ( $.fn.dataTable.isDataTable( 'table#ill-requests' ) ) {
+ tabsInit(ui, $("table#ill-requests"));
+ }
+ },
+ activate: function(event,ui) {
+ if ( $.fn.dataTable.isDataTable( 'table#ill-requests' ) ) {
+ tabsInit(ui, $("table#ill-requests"));
+ }
+ }
+ });
+
+ var activeTab = localStorage.getItem("illrequests_activetab");
+ if( activeTab ){
+ $("#ill-requests-tabs").tabs("option","active", activeTab );
+ }
+
// Display the modal containing request supplier metadata
$('#ill-request-display-log').on('click', function(e) {
e.preventDefault();
@@ -523,6 +567,12 @@ $(document).ready(function() {
});
+ if( activeTab ){
+ if ( $.fn.dataTable.isDataTable( 'table#ill-requests' ) ) {
+ tabsInit(null, $("table#ill-requests"));
+ }
+ }
+
});
} //END if window.location.search.length == 0
--- a/members/ill-requests.pl
+++ a/members/ill-requests.pl
@@ -42,6 +42,7 @@ my $patron = Koha::Patrons->find( $borrowernumber );
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
$template->param(
+ illreq_tabs => C4::Context->yaml_preference('ILLRequestsTabs'),
prefilters => "borrowernumber=$borrowernumber",
patron => $patron,
illview => 1,
--