Bugzilla – Attachment 132744 Details for
Bug 30063
Make the main patron search use the /patrons REST API route
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30063: Sort by "Name" firstname,surname
Bug-30063-Sort-by-Name-firstnamesurname.patch (text/plain), 8.65 KB, created by
Jonathan Druart
on 2022-03-31 12:47:47 UTC
(
hide
)
Description:
Bug 30063: Sort by "Name" firstname,surname
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-03-31 12:47:47 UTC
Size:
8.65 KB
patch
obsolete
>From ff990208912d34e64e921b37fa858ba96e8ddb59 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 30 Mar 2022 10:28:34 +0200 >Subject: [PATCH] Bug 30063: Sort by "Name" firstname,surname >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >As it's how it's displayed > >Signed-off-by: Séverine Queune <severine.queune@bulac.fr> >--- > installer/data/mysql/atomicupdate/bug_30063.pl | 14 ++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 2 +- > .../prog/en/includes/patron-search-header.inc | 2 +- > .../prog/en/includes/patron-search.inc | 4 ++-- > .../prog/en/includes/patronfields.inc | 2 +- > .../prog/en/modules/admin/preferences/patrons.pref | 2 +- > 6 files changed, 20 insertions(+), 6 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_30063.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_30063.pl b/installer/data/mysql/atomicupdate/bug_30063.pl >new file mode 100755 >index 00000000000..385883648c3 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_30063.pl >@@ -0,0 +1,14 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "30063", >+ description => "Fix DefaultPatronSearchFields order", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ $dbh->do(q{ >+ UPDATE systempreferences SET value="firstname,surname,othernames,cardnumber,userid" >+ WHERE variable="DefaultPatronSearchFields" AND value="surname,firstname,othernames,cardnumber,userid" >+ }); >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 94e2463434c..9a4cdbf72f2 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -167,7 +167,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('DefaultLongOverdueChargeValue', '', NULL, "Charge a lost item to the borrower's account when the LOST value of the item changes to n.", 'integer'), > ('DefaultLongOverdueDays', '', NULL, "Set the LOST value of an item when the item has been overdue for more than n days.", 'integer'), > ('DefaultLongOverdueLostValue', '', NULL, "Set the LOST value of an item to n when the item has been overdue for more than defaultlongoverduedays days.", 'integer'), >-('DefaultPatronSearchFields', 'surname,firstname,othernames,cardnumber,userid',NULL,'Comma separated list defining the default fields to be used during a patron search using the "standard" option. If empty Koha will default to "surname,firstname,othernames,cardnumber,userid". Additional fields added to this preference will be added as search options in the dropdown menu on the patron search page.','free'), >+('DefaultPatronSearchFields', 'firstname,surname,othernames,cardnumber,userid',NULL,'Comma separated list defining the default fields to be used during a patron search using the "standard" option. If empty Koha will default to "firstname,surname,othernames,cardnumber,userid". Additional fields added to this preference will be added as search options in the dropdown menu on the patron search page.','free'), > ('DefaultSaveRecordFileID','biblionumber','biblionumber|controlnumber','Defines whether the advanced cataloging editor will use the bibliographic record number or control number field to populate the name of the save file','Choice'), > ('defaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), > ('defaultSortOrder','dsc','asc|dsc|az|za','Specify the default sort order','Choice'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc >index e7f794d0187..49f3852fa11 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc >@@ -24,7 +24,7 @@ > <p><label for="searchfieldstype">Search fields:</label> > <select name="searchfieldstype" id="searchfieldstype"> > [% pref_fields = Koha.Preference('DefaultPatronSearchFields').split(',') %] >- [% default_fields = [ 'surname,firstname,othernames,cardnumber,userid', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] >+ [% default_fields = [ 'firstname,surname,othernames,cardnumber,userid', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] > [% search_options = default_fields.merge(pref_fields).unique %] > [% FOREACH s_o IN search_options %] > [% display_name = PROCESS patron_fields name=s_o %] >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 7b68a5940c0..514ced47b1b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -61,7 +61,7 @@ > <label for="searchfieldstype_filter">Search field:</label> > <select name="searchfieldstype" id="searchfieldstype_filter"> > [% pref_fields = Koha.Preference('DefaultPatronSearchFields').split(',') %] >- [% default_fields = [ 'surname,firstname,othernames,cardnumber,userid', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] >+ [% default_fields = [ 'firstname,surname,othernames,cardnumber,userid', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] > [% search_options = default_fields.merge(pref_fields).unique %] > [% FOREACH s_o IN search_options %] > [% display_name = PROCESS patron_fields name=s_o %] >@@ -298,7 +298,7 @@ > let search_type = $("#searchtype_filter").val() || "contain"; > let search_fields = $("#searchfieldstype_filter").val(); > if ( !search_fields ) { >- search_fields = "[% Koha.Preference('DefaultPatronSearchFields') || 'surname,firstname,othernames,cardnumber,userid' | html %]"; >+ search_fields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,surname,othernames,cardnumber,userid' | html %]"; > } > search_fields.split(',').forEach(function(e,i){ > filters.push({["me."+e]:{"like":"%"+filter+(search_type == "contain" ? "%" : "" )}}); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >index 6380e78ecd7..5e1c58f38ee 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >@@ -1,6 +1,6 @@ > [%- BLOCK patron_fields -%] > [%- SWITCH name -%] >- [%- CASE 'surname,firstname,othernames,cardnumber,userid' -%]<span>Standard</span> >+ [%- CASE 'firstname,surname,othernames,cardnumber,userid' -%]<span>Standard</span> > [%- CASE 'borrowernumber' -%]<span>Borrowernumber</span> > [%- CASE 'cardnumber' -%]<span>Card number</span> > [%- CASE 'surname' -%]<span>Surname</span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 9ef410f24cd..9836307229a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -48,7 +48,7 @@ Patrons: > - "Comma separated list defining the default fields to be used during a patron search using the \"standard\" option:" > - pref: DefaultPatronSearchFields > class: multi >- - "If empty Koha will default to \"surname,firstname,othernames,cardnumber,userid\". Additional fields added to this preference will be added as search options in the dropdown menu on the patron search page." >+ - "If empty Koha will default to \"firstname,surname,othernames,cardnumber,userid\". Additional fields added to this preference will be added as search options in the dropdown menu on the patron search page." > - > - "Show the following fields from the items database table as columns on the statistics tab on the patron record: " > - pref: StatisticsFields >-- >2.25.1
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 30063
:
130608
|
130609
|
130610
|
130611
|
130612
|
130613
|
130614
|
130615
|
132387
|
132552
|
132731
|
132732
|
132733
|
132734
|
132735
|
132736
|
132737
|
132738
|
132739
|
132740
|
132741
|
132742
|
132743
|
132744
|
132745
|
132746
|
132747
|
132748
|
132749
|
132759
|
132760
|
132761
|
132762
|
132763
|
132764
|
132765
|
132766
|
132767
|
132768
|
132769
|
132770
|
132771
|
132772
|
132773
|
132774
|
132775
|
132776
|
132777
|
132958