Bugzilla – Attachment 151804 Details for
Bug 30719
ILL should provide the ability to create batch requests
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), 5.03 KB, created by
Pedro Amorim
on 2023-05-30 16:06:01 UTC
(
hide
)
Description:
Bug 33786: ILL requests table id
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-05-30 16:06:01 UTC
Size:
5.03 KB
patch
obsolete
>From e694c66f0ced888db865a4d5004f79240ff83380 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 30 May 2023 09:20:20 +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 > >Reproduce: >1) Have a borrower with >20 ILL requests in their history >2) Visit cgi-bin/koha/members/ill-requests.pl?borrowernumber=<borrowernumber> >3) On the table, click page 2 >4) Visit a different borrower with <20 ILL requests >5) Verify that no requests are shown, this is because the table is using page 2 from step 3) >6) Go back to original borrower, click table page 1 >7) Now go back to 2nd borrower, verify is now showing page 1 correctly > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >https://bugs.koha-community.org/show_bug.cgi?id=30719 >--- > .../prog/en/includes/ill-list-table.inc | 4 +++ > .../intranet-tmpl/prog/js/ill-list-table.js | 33 ++++++++++--------- > 2 files changed, 21 insertions(+), 16 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..61ed8aaa45 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >@@ -53,19 +53,17 @@ $(document).ready(function() { > > // At the moment, the only prefilter possible is borrowernumber > // see ill/ill-requests.pl and members/ill-requests.pl >- let additional_prefilters = []; >+ let additional_prefilters = {}; > if(prefilters){ >- let prefilters_array = prefilters.split("&"); >- prefilters_array.forEach((prefilter) => { >- let prefilter_split = prefilter.split("="); >- additional_prefilters.push( { >- "key": prefilter_split[0], >- "value": prefilter_split[1] >- } ); >- >- }); >+ let prefilters_array = prefilters.split("&"); >+ prefilters_array.forEach((prefilter) => { >+ let prefilter_split = prefilter.split("="); >+ additional_prefilters[prefilter_split[0]] = prefilter_split[1] >+ }); > } > >+ let borrower_prefilter = additional_prefilters['borrowernumber'] || null; >+ > let additional_filters = { > "me.backend": function(){ > let backend = $("#illfilter_backend").val(); >@@ -78,9 +76,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 ? { "=": borrower_prefilter } : ""; > }, > "-or": function(){ > let patron = $("#illfilter_patron").val(); >@@ -123,7 +119,7 @@ $(document).ready(function() { > return filters; > }, > "me.placed": function(){ >- if ( additional_prefilters.length != 0 && !additional_prefilters.find(e => e.key === 'placed')) return ""; >+ if ( Object.keys(additional_prefilters).length ) return ""; > let placed_start = $('#illfilter_dateplaced_start').get(0)._flatpickr.selectedDates[0]; > let placed_end = $('#illfilter_dateplaced_end').get(0)._flatpickr.selectedDates[0]; > if (!placed_start && !placed_end) return ""; >@@ -133,7 +129,7 @@ $(document).ready(function() { > } > }, > "me.updated": function(){ >- if ( additional_prefilters.length != 0 && !additional_prefilters.find(e => e.key === 'updated')) return ""; >+ if (Object.keys(additional_prefilters).length) return ""; > let updated_start = $('#illfilter_datemodified_start').get(0)._flatpickr.selectedDates[0]; > let updated_end = $('#illfilter_datemodified_end').get(0)._flatpickr.selectedDates[0]; > if (!updated_start && !updated_end) return ""; >@@ -178,7 +174,12 @@ $(document).ready(function() { > } > }; > >- var ill_requests_table = $("#ill-requests").kohaTable({ >+ let table_id = "#ill-requests"; >+ if (borrower_prefilter) { >+ table_id += "-patron-" + borrower_prefilter; >+ } >+ >+ var ill_requests_table = $(table_id).kohaTable({ > "ajax": { > "url": '/api/v1/ill/requests' > }, >-- >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 30719
:
144281
|
144285
|
144286
|
144287
|
144288
|
144289
|
144290
|
144291
|
144292
|
144293
|
144294
|
144295
|
144296
|
144297
|
144298
|
144299
|
144300
|
144301
|
144302
|
145760
|
145869
|
145870
|
145876
|
145934
|
146152
|
147658
|
147929
|
147930
|
147931
|
147932
|
147933
|
147934
|
147952
|
147953
|
147954
|
147955
|
147956
|
151152
|
151153
|
151154
|
151155
|
151156
|
151284
|
151285
|
151286
|
151287
|
151288
|
151303
|
151304
|
151305
|
151306
|
151307
|
151308
|
151309
|
151310
|
151311
|
151312
|
151513
|
151514
|
151515
|
151516
|
151517
|
151519
|
151520
|
151521
|
151522
|
151523
|
151571
|
151572
|
151573
|
151574
|
151575
|
151611
|
151612
|
151613
|
151614
|
151615
|
151804
|
151805
|
151806
|
151807
|
151808
|
151809
|
154046
|
154047
|
154048
|
154049
|
154050
|
154051
|
154052
|
155421
|
155422
|
155423
|
155424
|
155425
|
155426
|
155427
|
155428
|
155429
|
155430
|
155431
|
155432
|
155433
|
155434
|
155435
|
156556
|
156748
|
156749
|
156752
|
156783
|
156785
|
156811
|
156812
|
156827
|
156828