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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc (-1 / +1 lines)
Lines 69-75 Link Here
69
[% END %]
69
[% END %]
70
70
71
<script>
71
<script>
72
    var defaultPatronSearchFields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' | html %]";
72
    var defaultPatronSearchFields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname|middle_name|surname|othernames|cardnumber|userid' | html %]";
73
    var defaultPatronSearchMethod = "[% Koha.Preference('DefaultPatronSearchMethod') || 'contains' | html %]";
73
    var defaultPatronSearchMethod = "[% Koha.Preference('DefaultPatronSearchMethod') || 'contains' | html %]";
74
    var extendedPatronAttributes = "[% Koha.Preference('ExtendedPatronAttributes') | html %]";
74
    var extendedPatronAttributes = "[% Koha.Preference('ExtendedPatronAttributes') | html %]";
75
    var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]';
75
    var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]';
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc (-1 / +2 lines)
Lines 86-92 Link Here
86
        <label for="searchfieldstype_filter">Search field:</label>
86
        <label for="searchfieldstype_filter">Search field:</label>
87
        <select name="searchfieldstype" id="searchfieldstype_filter">
87
        <select name="searchfieldstype" id="searchfieldstype_filter">
88
    [% END %]
88
    [% END %]
89
        [% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' %]
89
        [% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname|middle_name|surname|othernames|cardnumber|userid' %]
90
        [% standard.replace('|', ',') %]
90
        [% SET full_address = 'streetnumber,streettype,address,address2,city,state,zipcode,country' %]
91
        [% SET full_address = 'streetnumber,streettype,address,address2,city,state,zipcode,country' %]
91
        [% SET all_emails = 'email,emailpro,B_email' %]
92
        [% SET all_emails = 'email,emailpro,B_email' %]
92
        [% SET all_phones = 'phone,phonepro,B_phone,altcontactphone,mobile' %]
93
        [% SET all_phones = 'phone,phonepro,B_phone,altcontactphone,mobile' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js (-3 / +2 lines)
Lines 557-563 function buildPatronSearchQuery(term, options) { Link Here
557
    let pattern_subquery_and = [];
557
    let pattern_subquery_and = [];
558
    patterns.forEach(function (pattern, i) {
558
    patterns.forEach(function (pattern, i) {
559
            let pattern_subquery_or = [];
559
            let pattern_subquery_or = [];
560
            search_fields.split(',').forEach(function (field, i) {
560
            search_fields.split('|').forEach(function (field, i) {
561
                pattern_subquery_or.push(
561
                pattern_subquery_or.push(
562
                    { ["me." + field]: { 'like': leading_wildcard + pattern + '%' } }
562
                    { ["me." + field]: { 'like': leading_wildcard + pattern + '%' } }
563
                );
563
                );
Lines 576-582 function buildPatronSearchQuery(term, options) { Link Here
576
576
577
    // Add full search term for each search field
577
    // Add full search term for each search field
578
    let term_subquery_or = [];
578
    let term_subquery_or = [];
579
    search_fields.split(',').forEach(function (field, i) {
579
    search_fields.split('|').forEach(function (field, i) {
580
        term_subquery_or.push(
580
        term_subquery_or.push(
581
            { ["me." + field]: { 'like': leading_wildcard + term + '%' } }
581
            { ["me." + field]: { 'like': leading_wildcard + term + '%' } }
582
        );
582
        );
583
- 

Return to bug 29822