Bugzilla – Attachment 153392 Details for
Bug 34058
ILL - Left filters not considering all terms in input
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34058: Use buildSearchPatronQuery when searching for patrons on left side filters
Bug-34058-Use-buildSearchPatronQuery-when-searchin.patch (text/plain), 3.37 KB, created by
Martin Renvoize (ashimema)
on 2023-07-13 08:34:08 UTC
(
hide
)
Description:
Bug 34058: Use buildSearchPatronQuery when searching for patrons on left side filters
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-07-13 08:34:08 UTC
Size:
3.37 KB
patch
obsolete
>From 77399dce73448b9fabb58baf1846eb6c5095b1bd Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Tue, 27 Jun 2023 09:08:52 +0000 >Subject: [PATCH] Bug 34058: Use buildSearchPatronQuery when searching for > patrons on left side filters > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../intranet-tmpl/prog/js/ill-list-table.js | 29 ++++++++++--------- > 1 file changed, 15 insertions(+), 14 deletions(-) > >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 61ed8aaa45..4dcaee4252 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js >@@ -82,26 +82,19 @@ $(document).ready(function() { > let patron = $("#illfilter_patron").val(); > let status = $("#illfilter_status").val(); > let filters = []; >- let patron_sub_or = []; > let status_sub_or = []; > let subquery_and = []; > > if (!patron && !status) return ""; > > if(patron){ >- const patron_search_fields = "me.borrowernumber,patron.cardnumber,patron.firstname,patron.surname"; >- patron_search_fields.split(',').forEach(function(attr){ >- let operator = "="; >- let patron_data = patron; >- if ( attr != "me.borrowernumber" && attr != "patron.cardnumber") { >- operator = "like"; >- patron_data = "%" + patron + "%"; >+ let patronquery = buildPatronSearchQuery( >+ patron, >+ { >+ table_prefix: 'patron', > } >- patron_sub_or.push({ >- [attr]:{[operator]: patron_data } >- }); >- }); >- subquery_and.push(patron_sub_or); >+ ); >+ subquery_and.push(patronquery); > } > > if(status){ >@@ -150,7 +143,7 @@ $(document).ready(function() { > let filters = []; > let subquery_and = []; > >- const search_fields = "me.illrequest_id,me.borrowernumber,me.biblio_id,me.due_date,me.branchcode,library.name,me.status,me.status_alias,me.placed,me.replied,me.updated,me.completed,me.medium,me.accessurl,me.cost,me.price_paid,me.notesopac,me.notesstaff,me.orderid,me.backend,patron.firstname,patron.surname"; >+ const search_fields = "me.illrequest_id,me.biblio_id,me.due_date,me.branchcode,library.name,me.status,me.status_alias,me.placed,me.replied,me.updated,me.completed,me.medium,me.accessurl,me.cost,me.price_paid,me.notesopac,me.notesstaff,me.orderid,me.backend"; > let sub_or = []; > search_fields.split(',').forEach(function(attr){ > sub_or.push({ >@@ -160,6 +153,14 @@ $(document).ready(function() { > subquery_and.push(sub_or); > filters.push({"-and": subquery_and}); > >+ let patronquery = buildPatronSearchQuery( >+ keyword, >+ { >+ table_prefix: 'patron', >+ } >+ ); >+ filters.push(patronquery); >+ > const extended_attributes = "title,type,author,article_title,pages,issue,volume,year"; > let extended_sub_or = []; > subquery_and = []; >-- >2.41.0
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 34058
:
152701
|
152709
|
152710
|
152867
|
152868
|
153391
|
153392
|
156375
|
156376
|
156732
|
156733
|
158396
|
158397
|
158743
|
158744