View | Details | Raw Unified | Return to bug 30063
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_30063.pl (+14 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "30063",
5
    description => "Fix DefaultPatronSearchFields order",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        $dbh->do(q{
10
            UPDATE systempreferences SET value="firstname,surname,othernames,cardnumber,userid"
11
            WHERE variable="DefaultPatronSearchFields" AND value="surname,firstname,othernames,cardnumber,userid"
12
        });
13
    },
14
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 167-173 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
167
('DefaultLongOverdueChargeValue', '', NULL, "Charge a lost item to the borrower's account when the LOST value of the item changes to n.", 'integer'),
167
('DefaultLongOverdueChargeValue', '', NULL, "Charge a lost item to the borrower's account when the LOST value of the item changes to n.", 'integer'),
168
('DefaultLongOverdueDays', '', NULL, "Set the LOST value of an item when the item has been overdue for more than n days.", 'integer'),
168
('DefaultLongOverdueDays', '', NULL, "Set the LOST value of an item when the item has been overdue for more than n days.", 'integer'),
169
('DefaultLongOverdueLostValue', '', NULL, "Set the LOST value of an item to n when the item has been overdue for more than defaultlongoverduedays days.", 'integer'),
169
('DefaultLongOverdueLostValue', '', NULL, "Set the LOST value of an item to n when the item has been overdue for more than defaultlongoverduedays days.", 'integer'),
170
('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'),
170
('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'),
171
('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'),
171
('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'),
172
('defaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'),
172
('defaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'),
173
('defaultSortOrder','dsc','asc|dsc|az|za','Specify the default sort order','Choice'),
173
('defaultSortOrder','dsc','asc|dsc|az|za','Specify the default sort order','Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc (-1 / +1 lines)
Lines 24-30 Link Here
24
        <p><label for="searchfieldstype">Search fields:</label>
24
        <p><label for="searchfieldstype">Search fields:</label>
25
            <select name="searchfieldstype" id="searchfieldstype">
25
            <select name="searchfieldstype" id="searchfieldstype">
26
              [% pref_fields = Koha.Preference('DefaultPatronSearchFields').split(',') %]
26
              [% pref_fields = Koha.Preference('DefaultPatronSearchFields').split(',') %]
27
              [% default_fields = [ 'surname,firstname,othernames,cardnumber,userid', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %]
27
              [% default_fields = [ 'firstname,surname,othernames,cardnumber,userid', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %]
28
              [% search_options = default_fields.merge(pref_fields).unique %]
28
              [% search_options = default_fields.merge(pref_fields).unique %]
29
              [% FOREACH s_o IN search_options %]
29
              [% FOREACH s_o IN search_options %]
30
                  [% display_name = PROCESS patron_fields name=s_o %]
30
                  [% display_name = PROCESS patron_fields name=s_o %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (-2 / +2 lines)
Lines 61-67 Link Here
61
                            <label for="searchfieldstype_filter">Search field:</label>
61
                            <label for="searchfieldstype_filter">Search field:</label>
62
                            <select name="searchfieldstype" id="searchfieldstype_filter">
62
                            <select name="searchfieldstype" id="searchfieldstype_filter">
63
                                [% pref_fields = Koha.Preference('DefaultPatronSearchFields').split(',') %]
63
                                [% pref_fields = Koha.Preference('DefaultPatronSearchFields').split(',') %]
64
                                [% default_fields = [ 'surname,firstname,othernames,cardnumber,userid', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %]
64
                                [% default_fields = [ 'firstname,surname,othernames,cardnumber,userid', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %]
65
                                [% search_options = default_fields.merge(pref_fields).unique %]
65
                                [% search_options = default_fields.merge(pref_fields).unique %]
66
                                [% FOREACH s_o IN search_options %]
66
                                [% FOREACH s_o IN search_options %]
67
                                    [% display_name = PROCESS patron_fields name=s_o %]
67
                                    [% display_name = PROCESS patron_fields name=s_o %]
Lines 298-304 Link Here
298
                    let search_type = $("#searchtype_filter").val() || "contain";
298
                    let search_type = $("#searchtype_filter").val() || "contain";
299
                    let search_fields = $("#searchfieldstype_filter").val();
299
                    let search_fields = $("#searchfieldstype_filter").val();
300
                    if ( !search_fields ) {
300
                    if ( !search_fields ) {
301
                        search_fields = "[% Koha.Preference('DefaultPatronSearchFields') || 'surname,firstname,othernames,cardnumber,userid' | html %]";
301
                        search_fields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,surname,othernames,cardnumber,userid' | html %]";
302
                    }
302
                    }
303
                    search_fields.split(',').forEach(function(e,i){
303
                    search_fields.split(',').forEach(function(e,i){
304
                        filters.push({["me."+e]:{"like":"%"+filter+(search_type == "contain" ? "%" : "" )}});
304
                        filters.push({["me."+e]:{"like":"%"+filter+(search_type == "contain" ? "%" : "" )}});
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc (-1 / +1 lines)
Lines 1-6 Link Here
1
[%- BLOCK patron_fields -%]
1
[%- BLOCK patron_fields -%]
2
     [%- SWITCH name -%]
2
     [%- SWITCH name -%]
3
     [%- CASE 'surname,firstname,othernames,cardnumber,userid' -%]<span>Standard</span>
3
     [%- CASE 'firstname,surname,othernames,cardnumber,userid' -%]<span>Standard</span>
4
     [%- CASE 'borrowernumber' -%]<span>Borrowernumber</span>
4
     [%- CASE 'borrowernumber' -%]<span>Borrowernumber</span>
5
     [%- CASE 'cardnumber' -%]<span>Card number</span>
5
     [%- CASE 'cardnumber' -%]<span>Card number</span>
6
     [%- CASE 'surname' -%]<span>Surname</span>
6
     [%- CASE 'surname' -%]<span>Surname</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-2 / +1 lines)
Lines 48-54 Patrons: Link Here
48
         - "Comma separated list defining the default fields to be used during a patron search using the \"standard\" option:"
48
         - "Comma separated list defining the default fields to be used during a patron search using the \"standard\" option:"
49
         - pref: DefaultPatronSearchFields
49
         - pref: DefaultPatronSearchFields
50
           class: multi
50
           class: multi
51
         - "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."
51
         - "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."
52
     -
52
     -
53
         - "Show the following fields from the items database table as columns on the statistics tab on the patron record: "
53
         - "Show the following fields from the items database table as columns on the statistics tab on the patron record: "
54
         - pref: StatisticsFields
54
         - pref: StatisticsFields
55
- 

Return to bug 30063