Bugzilla – Attachment 154729 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: Add sort1 and sort2 to patron search results
Bug-34608-Add-sort1-and-sort2-to-patron-search-res.patch (text/plain), 5.63 KB, created by
Owen Leonard
on 2023-08-24 11:22:01 UTC
(
hide
)
Description:
Bug 34608: Add sort1 and sort2 to patron search results
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-08-24 11:22:01 UTC
Size:
5.63 KB
patch
obsolete
>From 5a9bd492bde7b9feb7e40879e3ce203040774058 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 24 Aug 2023 10:57:37 +0000 >Subject: [PATCH] Bug 34608: Add sort1 and sort2 to patron search results > >This patch adds the option of displaying patron "sort1" and >"sort2" statistical fields in the patron module's main search >results. The fields are hidden by default in the updated table >configuration. > >To test, apply the patch and restart services. > >- Go to Patrons and perform a search. >- You should not see columns for sort1 and sort2. >- Under the "Columns" button you should see options to display sort1 and > sort2. Confirm that they work to show and hide the columns. >- Confirm that the sort1 and sort2 columns are sortable and searchable. > >- Go to Administration -> Table settings. >- Under Patrons -> member, toggle the sort1 and sort1 "hidden by > default" checkboxes and save the configuration. >- Return to patron search results to confirm that the columns are now > shown by default. >--- > admin/columns_settings.yml | 6 +++++ > .../prog/en/includes/patron-search.inc | 26 ++++++++++++++++++- > .../prog/en/modules/members/member.tt | 2 +- > 3 files changed, 32 insertions(+), 2 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 90fb535472..a899bf52be 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -988,6 +988,12 @@ modules: > columnname: fines > - > columnname: circ_notes >+ - >+ columnname: sort1 >+ is_hidden: 1 >+ - >+ columnname: sort2 >+ is_hidden: 1 > - > columnname: actions > cannot_be_toggled: 1 >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 8f13fa0374..75270c723e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -161,6 +161,8 @@ > [% CASE 'phone' %]<th>Phone</th> > [% CASE 'checkouts' %]<th>Checkouts</th> > [% CASE 'account_balance' %]<th>Fines</th> >+ [% CASE 'sort1' %]<th>Sort 1</th> >+ [% CASE 'sort2' %]<th>Sort 2</th> > [% CASE 'action' %]<th> </th> > [% END %] > [% END %] >@@ -199,7 +201,7 @@ > [%# - redirect_if_attribute_equal: Name of the attribute to use for the redirect. Query using this attribute, before the normal search %] > [%# filter: Same as patron_search_table %] > [%# open_on_row_click: boolean, default off. Will allow to select a patron by clicking on the whole tr element %] >-[%# columns: list of columns that will be displayed. Possible values are: 'checkbox', 'cardnumber', 'dateofbirth', 'address', 'name', 'name-address', 'branch', 'category', 'dateexpiry', 'borrowernotes, 'phone', 'checkouts', 'account_balance', 'action' %] >+[%# columns: list of columns that will be displayed. Possible values are: 'checkbox', 'cardnumber', 'dateofbirth', 'address', 'name', 'name-address', 'branch', 'category', 'dateexpiry', 'borrowernotes, 'phone', 'checkouts', 'account_balance', 'sort1', 'sort2', 'action' %] > [%# preview_on_name_click: Open a modal window with patron's info when the name is clicked %] > [%# actions: list of buttons to display in the action column. Possible values are: 'select', 'add', 'edit', 'checkout' %] > [%# sticky_header and sticky_to: If we need a sticky header %] >@@ -610,6 +612,28 @@ > } > } > >+ >+ [% CASE 'sort1' %] >+ { >+ "data": "statistics_1", >+ "searchable": true, >+ "orderable": true, >+ "render": function( data, type, row, meta ) { >+ return escape_str(data); >+ } >+ } >+ >+ [% CASE 'sort2' %] >+ { >+ "data": "statistics_2", >+ "searchable": true, >+ "orderable": true, >+ "render": function( data, type, row, meta ) { >+ return escape_str(data); >+ } >+ } >+ >+ > [% CASE 'action' %] > { > "data": function( row, type, val, meta ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >index 53670d10e0..dfdfda51e9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt >@@ -8,7 +8,7 @@ > [% PROCESS 'patronfields.inc' %] > [% SET libraries = Branches.all %] > [% SET categories = Categories.all.unblessed %] >-[% SET columns = ['cardnumber', 'name-address', 'dateofbirth', 'branch', 'category', 'dateexpiry', 'checkouts', 'account_balance', 'borrowernotes', 'action'] %] >+[% SET columns = ['cardnumber', 'name-address', 'dateofbirth', 'branch', 'category', 'dateexpiry', 'checkouts', 'account_balance', 'borrowernotes', 'sort1', 'sort2', 'action'] %] > [% SET searchtype = Koha.Preference('DefaultPatronSearchMethod') %] > [% PROCESS 'patron-search.inc' %] > [% INCLUDE 'doc-head-open.inc' %] >-- >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 34608
:
154729
|
155343
|
158194
|
159544
|
159545
|
159561
|
162592
|
162593
|
165260
|
165360
|
165375
|
167789
|
170624
|
170625
|
170626
|
170809
|
170810
|
170811
|
170812
|
170936
|
170937