@@ -, +, @@ --- 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 --- a/installer/data/mysql/atomicupdate/bug_30063.pl +++ a/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" + }); + }, +}; --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/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'), --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc @@ -24,7 +24,7 @@

[% 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" ? "%" : "" )}}); --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc @@ -1,6 +1,6 @@ [%- BLOCK patron_fields -%] [%- SWITCH name -%] - [%- CASE 'surname,firstname,othernames,cardnumber,userid' -%]Standard + [%- CASE 'firstname,surname,othernames,cardnumber,userid' -%]Standard [%- CASE 'borrowernumber' -%]Borrowernumber [%- CASE 'cardnumber' -%]Card number [%- CASE 'surname' -%]Surname --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/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 --