Bugzilla – Attachment 179442 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), 9.92 KB, created by
Lari Taskula
on 2025-03-18 11:13:25 UTC
(
hide
)
Description:
Bug 30200: Add custom tabs to View ILL requests page
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2025-03-18 11:13:25 UTC
Size:
9.92 KB
patch
obsolete
>From b67d8064353f4357d3c353ee27039cffa9c6f199 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 > >To test: >0: yarn css:build:prod >1. Set system preference ILLRequestsTabs: >- name: New > status: > - NEW >- name: Requested or reverted > status: > - REQ > - REQREV >- name: Queued > status: > - QUEUED >- name: Empty > status: > - NONEXISTENT > >2. Add some ILL requests with the following SQL: >INSERT INTO `illrequests` (borrowernumber, branchcode, status, backend) VALUES (1, 'CPL', 'NEW', 'Standard'); >INSERT INTO `illrequests` (borrowernumber, branchcode, status, backend) VALUES (1, 'CPL', 'NEW', 'Standard'); >INSERT INTO `illrequests` (borrowernumber, branchcode, status, backend) VALUES (1, 'CPL', 'REQ', 'Standard'); >INSERT INTO `illrequests` (borrowernumber, branchcode, status, backend) VALUES (1, 'CPL', 'REQREV', 'Standard'); >INSERT INTO `illrequests` (borrowernumber, branchcode, status, backend) VALUES (1, 'CPL', 'QUEUED', 'Standard'); >INSERT INTO `illrequests` (borrowernumber, branchcode, status, backend) VALUES (1, 'CPL', 'KILL', 'Standard'); > >3. Go to cgi-bin/koha/ill/ill-requests.pl >4. After the page loads, you should now see 4 different > tabs: > "All", "New", "Requested or reverted", "Queued", and > "Empty" >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 > "New", "Requested or reverted" and "Queued" >7. Confirm no ILL requests are under tab "Empty" >8. Clear system preference ILLRequestsTabs >9. Observe only one tab "All" under which correct ILL > requests are presented >10. Try some other status values in ILLRequestsTabs and > observe expected behavior >--- > .gitignore | 2 ++ > ill/ill-requests.pl | 1 + > .../prog/css/src/ill-requests.scss | 16 ++++++++++ > .../prog/en/includes/ill-filter.inc | 2 +- > .../en/includes/ill-list-table-strings.inc | 1 - > .../prog/en/modules/ill/ill-requests.tt | 15 +++++++++ > .../intranet-tmpl/prog/js/ill-list-table.js | 32 ++++++++++++++++--- > 7 files changed, 63 insertions(+), 6 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/css/src/ill-requests.scss > >diff --git a/.gitignore b/.gitignore >index e70d5ac8841..a316adf1e55 100644 >--- a/.gitignore >+++ b/.gitignore >@@ -19,6 +19,8 @@ koha-tmpl/intranet-tmpl/prog/css/calendar.css > koha-tmpl/intranet-tmpl/prog/css/calendar-rtl.css > koha-tmpl/intranet-tmpl/prog/css/holds.css > koha-tmpl/intranet-tmpl/prog/css/holds-rtl.css >+koha-tmpl/intranet-tmpl/prog/css/ill-requests.css >+koha-tmpl/intranet-tmpl/prog/css/ill-requests-rtl.css > koha-tmpl/intranet-tmpl/prog/css/installer.css > koha-tmpl/intranet-tmpl/prog/css/installer-rtl.css > koha-tmpl/intranet-tmpl/prog/css/mainpage.css >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/css/src/ill-requests.scss b/koha-tmpl/intranet-tmpl/prog/css/src/ill-requests.scss >new file mode 100644 >index 00000000000..1433a16583f >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/ill-requests.scss >@@ -0,0 +1,16 @@ >+form#illfilter_form div.ms-parent button.ms-choice span.placeholder { >+ background-color: transparent; >+ cursor: default; >+} >+ >+form#illfilter_form div.ms-parent button.ms-choice { >+ height: calc(1.5em + .75rem + 2px); >+} >+ >+form#illfilter_form div.ms-parent div.ms-drop input[type="checkbox"] { >+ margin-left: -1.25rem >+} >+ >+form#illfilter_form div.ms-parent div.ms-drop ul > li { >+ padding: .25rem 8px; >+} >\ No newline at end of file >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..8c4e48530aa 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"> </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..37227c5274e 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 >@@ -16,6 +16,8 @@ > [% END %]</title > > > [% INCLUDE 'doc-head-close.inc' %] >+[% Asset.css("css/ill-requests.css") | $raw %] >+[% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.min.css") | $raw %] > </head> > > <body id="illrequests" class="ill"> >@@ -766,6 +768,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> >@@ -928,6 +942,7 @@ > [% IF op == 'generic_confirm' && Koha.Preference('ILLCheckAvailability') %] > [% Asset.js("js/ill-availability-partner.js") | $raw %] > [% END %] >+ [% Asset.js("lib/jquery/plugins/multiple-select/multiple-select.min.js") | $raw %] > [% END %] > <!-- prettier-ignore-start --> > [% TRY %] >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..d7e5abd8354 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,26 @@ $(document).ready(function () { > $("#addcomment").toggleClass("content_hidden"); > }); > >+ $("div#ill-list-tabs a[id^='ill-list-tab'").on("click", function (e) { >+ e.preventDefault(); >+ var select_status_el = $("form#illfilter_form select#illfilter_status"); >+ var tab_statuses = $(this).children('span').attr("data-statuses"); >+ if (tab_statuses) { >+ tab_statuses.split('|').forEach((select_status_option) => { >+ if ($("#illfilter_status option[value='"+select_status_option+"']").length === 0) { >+ select_status_el.append($('<option>', { >+ value: select_status_option, >+ text: select_status_option // how to access status.str when no ILL requests with that status exist? >+ })); >+ } >+ }) >+ select_status_el.val(tab_statuses.split('|')).trigger("change"); >+ } else { >+ select_status_el.val("").trigger("change"); >+ } >+ filter(); >+ }); >+ > // Filter partner list > // Record the list of all options > var ill_partner_options = $("#partners > option"); >@@ -116,7 +136,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 +560,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) { >@@ -554,6 +571,13 @@ $(document).ready(function () { > "</option>" > ); > }); >+ $("select#illfilter_status").multipleSelect( { >+ placeholder: _("Please select ..."), >+ selectAllText: _("Select all"), >+ allSelected: _("All selected"), >+ countSelected: _("# of % selected"), >+ noMatchesFound: _("No matches found"), >+ } ); > } > > function addStatusAliasOptions(status_aliases) { >-- >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