Bugzilla – Attachment 151511 Details for
Bug 33786
ILL requests table pagination in patron ILL history is transposing for different patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33786: ILL requests table id
Bug-33786-ILL-requests-table-id.patch (text/plain), 2.74 KB, created by
Pedro Amorim
on 2023-05-22 11:40:23 UTC
(
hide
)
Description:
Bug 33786: ILL requests table id
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-05-22 11:40:23 UTC
Size:
2.74 KB
patch
obsolete
>From 8f961a9eb58d25505b055bc3cf2078a522d6b89b Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Mon, 22 May 2023 10:49:08 +0000 >Subject: [PATCH] Bug 33786: ILL requests table id > >Make sure requests table is unique when visiting patron ILL history so the table state is not shared unintentionally >--- > .../prog/en/includes/ill-list-table.inc | 4 ++++ > .../intranet-tmpl/prog/js/ill-list-table.js | 16 ++++++++++++---- > 2 files changed, 16 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc >index c0d75cc27b..910f3a4f2a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-list-table.inc >@@ -1,4 +1,8 @@ >+[% IF patron.borrowernumber %] >+<table id="ill-requests-patron-[% patron.borrowernumber | html %]"> >+[% ELSE %] > <table id="ill-requests"> >+[% END %] > <thead> > <tr id="ill_requests_header"> > <th scope="col">Request ID</th> >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 8a358015ac..13ddbe2aff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >@@ -78,9 +78,7 @@ $(document).ready(function() { > return { "=": branchcode } > }, > "me.borrowernumber": function(){ >- let borrowernumber_pre_filter = additional_prefilters.find(e => e.key === 'borrowernumber'); >- if ( additional_prefilters.length == 0 || typeof borrowernumber_pre_filter === undefined) return ""; >- return { "=": borrowernumber_pre_filter["value"] } >+ return (borrower_prefilter_value = get_prefilter_value('borrowernumber')) ? { "=": borrower_prefilter_value } : ""; > }, > "-or": function(){ > let patron = $("#illfilter_patron").val(); >@@ -178,7 +176,12 @@ $(document).ready(function() { > } > }; > >- var ill_requests_table = $("#ill-requests").kohaTable({ >+ let table_id = "#ill-requests"; >+ if (borrower_prefilter_value = get_prefilter_value('borrowernumber')) { >+ table_id += "-patron-" + borrower_prefilter_value; >+ } >+ >+ var ill_requests_table = $(table_id).kohaTable({ > "ajax": { > "url": '/api/v1/ill/requests' > }, >@@ -494,4 +497,9 @@ $(document).ready(function() { > clearSearch(); > }); > >+ function get_prefilter_value(prefilter_key) { >+ let pre_filter = additional_prefilters.find(e => e.key === prefilter_key); >+ return additional_prefilters.length != 0 && typeof pre_filter !== "undefined" ? pre_filter['value'] : null; >+ } >+ > }); >-- >2.30.2
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 33786
:
151487
|
151506
|
151511
|
151670
|
151773
|
151776
|
151777
|
151791
|
152036