Bugzilla – Attachment 170625 Details for
Bug 34608
Add sort1 and sort2 to patron search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34608: (follow-up) Display authorized values if used
Bug-34608-follow-up-Display-authorized-values-if-u.patch (text/plain), 3.09 KB, created by
Owen Leonard
on 2024-08-23 11:15:07 UTC
(
hide
)
Description:
Bug 34608: (follow-up) Display authorized values if used
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-08-23 11:15:07 UTC
Size:
3.09 KB
patch
obsolete
>From 2a70b2cd50925ac953c801a36077aecbb1e8bbbd Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 1 Nov 2023 17:19:09 +0000 >Subject: [PATCH] Bug 34608: (follow-up) Display authorized values if used > >This patch shamelessly steals from Bug 33568 in order to allow the >correct authorized value description to be shown in the JS-generated >table of results for values of borrowers sort1 and sort2. > >To test, apply the patch and go to Administration -> Authorized values. > >- Add some values, if necessary, to both the 'Bsort1' and 'Bsort2' > categories. >- Locate some patron records to edit, and set the patron's "Sort 1" and > "Sort 2" fields. >- Perform a patron search which will return those patron records. > - Confirm that the correct authorized value description is shown > instead of the authorized value code. >- Delete all values from the 'Bsort1' and 'Bsort2' authorized value > categories. >- Return to your patron search and confirm that "Sort 1" and "Sort 2" > values are still being shown, though now it's the "raw" code. >--- > .../intranet-tmpl/prog/en/includes/patron-search.inc | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >index 97fa549628..7a6c5df85f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -6,7 +6,7 @@ > [% USE raw %] > [% USE Asset %] > [% USE To %] >- >+[% USE AuthorisedValues %] > [% SET search_results_block_id = 'searchresults' %] > > [%# Display a simple form %] >@@ -308,6 +308,10 @@ > [% CASE %] > let patron_search_url = '/api/v1/patrons'; > [% END %] >+ >+ const av_bsort1= new Map([% To.json(AuthorisedValues.Get('Bsort1')) | $raw %].map( av => [av.authorised_value, av.lib])); >+ const av_bsort2= new Map([% To.json(AuthorisedValues.Get('Bsort2')) | $raw %].map( av => [av.authorised_value, av.lib])); >+ > $(document).ready(function(){ > > let parent_block = $("#[% search_results_block_id | html %]"); >@@ -623,7 +627,8 @@ > "searchable": true, > "orderable": true, > "render": function( data, type, row, meta ) { >- return escape_str(data); >+ let bsort2_lib = av_bsort2.get( data.toString() ) || data; >+ return escape_str( bsort2_lib ); > } > } > >@@ -633,7 +638,8 @@ > "searchable": true, > "orderable": true, > "render": function( data, type, row, meta ) { >- return escape_str(data); >+ let bsort1_lib = av_bsort1.get( data.toString() ) || data; >+ return escape_str( bsort1_lib ); > } > } > >-- >2.39.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 34608
:
154729
|
155343
|
158194
|
159544
|
159545
|
159561
|
162592
|
162593
|
165260
|
165360
|
165375
|
167789
|
170624
|
170625
|
170626
|
170809
|
170810
|
170811
|
170812
|
170936
|
170937