Bugzilla – Attachment 179356 Details for
Bug 30200
Add customizable tabs to interlibrary loan requests list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30200: Add custom tabs to View ILL requests page
Bug-30200-Add-custom-tabs-to-View-ILL-requests-pag.patch (text/plain), 7.00 KB, created by
Lari Taskula
on 2025-03-14 21:18:44 UTC
(
hide
)
Description:
Bug 30200: Add custom tabs to View ILL requests page
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2025-03-14 21:18:44 UTC
Size:
7.00 KB
patch
obsolete
>From 087993786eb54c41b57bde4cec5bd62ff3489398 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Thu, 3 Mar 2022 02:18:58 +0000 >Subject: [PATCH] Bug 30200: Add custom tabs to View ILL requests page > >Prereqs: >1: Make sure you have enabled an ILL backend and enabled system > preferecnce ILLModule. For more information see > https://koha-community.org/manual/21.11/en/html/ILL_requests.html > >To test: >1: Note, the following branchcodes, statuses and backends depend > on your test environment and which ILL backend you are using. > This example is for Libris backend. > >Set system preference ILLRequestsTabs: >- name: tab1 > status: > - IN_REM >- name: tab2 > status: > - IN_UTEL > - IN_LEV >- name: tab3 > status: > - IN_ANK > >2. Add at least 4 ILL requests with the following SQL: >INSERT INTO `illrequests` (borrowernumber, branchcode, status, backend) VALUES (1, 'CPL', 'IN_REM', 'Libris'); >INSERT INTO `illrequests` (borrowernumber, branchcode, status, backend) VALUES (1, 'CPL', 'IN_UTEL', 'Libris'); >INSERT INTO `illrequests` (borrowernumber, branchcode, status, backend) VALUES (1, 'CPL', 'IN_LEV', 'Libris'); >INSERT INTO `illrequests` (borrowernumber, branchcode, status, backend) VALUES (1, 'CPL', 'IN_ANK', 'Libris'); > >Note: Change values to whatever your test environment has set up. > >3. Go to cgi-bin/koha/ill/ill-requests.pl >4. After the page loads, you should now see 4 different tabs: > "All", "tab1", "tab2" and "tab3" >5. Confirm all ILL requests are present under "All" tab >6. Confirm only ILL requests with the statuses you defined in > system preference ILLRequestsTabs are under tabs 1, 2 and 3 >7. Clear system preference ILLRequestsTabs >8. Observe only one tab "All" under which correct ILL requests > are presented >9. Try some other status values in ILLRequestsTabs and observe > expected behavior >--- > ill/ill-requests.pl | 1 + > .../prog/en/includes/ill-filter.inc | 2 +- > .../prog/en/includes/ill-list-table-strings.inc | 1 - > .../prog/en/modules/ill/ill-requests.tt | 12 ++++++++++++ > .../intranet-tmpl/prog/js/ill-list-table.js | 16 ++++++++++++---- > 5 files changed, 26 insertions(+), 6 deletions(-) > >diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl >index 761d877ef6b..675239acecb 100755 >--- a/ill/ill-requests.pl >+++ b/ill/ill-requests.pl >@@ -477,6 +477,7 @@ $template->param( > types => [ "Book", "Article", "Journal" ], > op => $op, > branches => Koha::Libraries->search, >+ illreq_tabs => C4::Context->yaml_preference('ILLRequestsTabs'), > ); > > output_html_with_http_headers( $cgi, $cookie, $template->output ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-filter.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-filter.inc >index 4d3a2e0ca8d..5302020f024 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-filter.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-filter.inc >@@ -19,7 +19,7 @@ > </li> > <li> > <label for="illfilter_status">Status:</label> >- <select name="illfilter_status" id="illfilter_status"> </select> >+ <select name="illfilter_status" id="illfilter_status" multiple="multiple" style="height:auto"> </select> > </li> > <li> > <label for="illfilter_dateplaced_start">Date placed between:</label> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table-strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table-strings.inc >index f0b0d8194e1..7a7989b3311 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table-strings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table-strings.inc >@@ -3,7 +3,6 @@ > var ill_borrower_details = _("View patron details"); > var ill_manage = _("Manage request"); > var ill_manage_select_backend_first = _("Select a backend first"); >- var ill_all_statuses = _("All statuses"); > var ill_all_status_aliases = _("All status aliases"); > var ill_no_status_alias = _("No status alias"); > var ill_status_aliases = _("Status aliases"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >index f78c53d363f..2b98df3471f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt >@@ -766,6 +766,18 @@ > [% END %] > </h1> > <div id="results" class="page-section"> >+ [% WRAPPER tabs id= "ill-list-tabs" %] >+ [% WRAPPER tabs_nav %] >+ [% WRAPPER tab_item tabname= "ill-list-tab-all" bt_active= 1 %] >+ <span>All</span> >+ [% END %] >+ [% FOREACH illreq_tab IN illreq_tabs %] >+ [% WRAPPER tab_item tabname= "ill-list-tab-${loop.index}" %] >+ <span data-statuses="[% illreq_tab.status.join('|') | html %]">[% illreq_tab.name | html %]</span> >+ [% END %] >+ [% END %] >+ [% END # /WRAPPER tabs_nav %] >+ [% END %] > <h2>Details for all requests</h2> > [% INCLUDE 'ill-list-table.inc' %] > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >index 0fc313a2213..01ac75cf452 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >@@ -17,6 +17,17 @@ $(document).ready(function () { > $("#addcomment").toggleClass("content_hidden"); > }); > >+ $("div#ill-list-tabs a[id^='ill-list-tab'").on("click", function (e) { >+ e.preventDefault(); >+ if ($(this).children('span').attr("data-statuses")) { >+ console.log($(this).children('span').attr("data-statuses").split('|')); >+ $("#illfilter_status").val($(this).children('span').attr("data-statuses").split('|')).trigger("change"); >+ } else { >+ $("#illfilter_status").val("").trigger("change"); >+ } >+ filter(); >+ }); >+ > // Filter partner list > // Record the list of all options > var ill_partner_options = $("#partners > option"); >@@ -116,7 +127,7 @@ $(document).ready(function () { > subquery_and.push(patronquery); > } > >- if (status) { >+ if (status && status.length > 0) { > subquery_and.push({ "me.status": { "=": status } }); > } > if (status_alias) { >@@ -540,9 +551,6 @@ $(document).ready(function () { > > function addStatusOptions(statuses) { > $("#illfilter_status").children().remove(); >- $("#illfilter_status").append( >- '<option value="">' + ill_all_statuses + "</option>" >- ); > statuses > .sort((a, b) => a.str.localeCompare(b.str)) > .forEach(function (status) { >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30200
:
131305
|
131306
|
131307
|
131959
|
131960
|
134466
|
134467
|
138863
|
138864
|
138865
|
138866
|
141338
|
141339
|
141340
|
141341
|
179356
|
179357
|
179358
|
179359
|
179436
|
179437
|
179438
|
179439
|
179442
|
179443
|
179444
|
179910
|
179911
|
179912
|
179913
|
182025
|
182026
|
182027
|
182028
|
182029