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 554-560 function buildPatronSearchQuery(term, options) { Link Here
554
    let pattern_subquery_and = [];
554
    let pattern_subquery_and = [];
555
    patterns.forEach(function (pattern, i) {
555
    patterns.forEach(function (pattern, i) {
556
            let pattern_subquery_or = [];
556
            let pattern_subquery_or = [];
557
            defaultPatronSearchFields.split(',').forEach(function (field, i) {
557
            defaultPatronSearchFields.split('|').forEach(function (field, i) {
558
                pattern_subquery_or.push(
558
                pattern_subquery_or.push(
559
                    { ["me." + field]: { 'like': leading_wildcard + pattern + '%' } }
559
                    { ["me." + field]: { 'like': leading_wildcard + pattern + '%' } }
560
                );
560
                );
Lines 573-579 function buildPatronSearchQuery(term, options) { Link Here
573
573
574
    // Add full search term for each search field
574
    // Add full search term for each search field
575
    let term_subquery_or = [];
575
    let term_subquery_or = [];
576
    defaultPatronSearchFields.split(',').forEach(function (field, i) {
576
    defaultPatronSearchFields.split('|').forEach(function (field, i) {
577
        term_subquery_or.push(
577
        term_subquery_or.push(
578
            { ["me." + field]: { 'like': leading_wildcard + term + '%' } }
578
            { ["me." + field]: { 'like': leading_wildcard + term + '%' } }
579
        );
579
        );
580
- 

Return to bug 29822