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 = [ 'firstname,surname,othernames,cardnumber,userid', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] |
64 |
[% default_fields = [ 'firstname,middle_name,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 303-309
Link Here
|
303 |
let search_type = $("#searchtype_filter").val() || "contain"; |
303 |
let search_type = $("#searchtype_filter").val() || "contain"; |
304 |
let search_fields = $("#searchfieldstype_filter").val(); |
304 |
let search_fields = $("#searchfieldstype_filter").val(); |
305 |
if ( !search_fields ) { |
305 |
if ( !search_fields ) { |
306 |
search_fields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,surname,othernames,cardnumber,userid' | html %]"; |
306 |
search_fields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' | html %]"; |
307 |
} |
307 |
} |
308 |
search_fields.split(',').forEach(function(e,i){ |
308 |
search_fields.split(',').forEach(function(e,i){ |
309 |
filters.push({["me."+e]:{"like":(search_type == "contain" ? "%" : "" ) + filter + "%"}}); |
309 |
filters.push({["me."+e]:{"like":(search_type == "contain" ? "%" : "" ) + filter + "%"}}); |
Lines 440-446
Link Here
|
440 |
} |
440 |
} |
441 |
[% CASE 'name-address' %] |
441 |
[% CASE 'name-address' %] |
442 |
{ |
442 |
{ |
443 |
"data": "me.surname:me.firstname:me.othernames:me.street_number:me.address:me.address2:me.city:me.state:me.postal_code:me.country", |
443 |
"data": "me.surname:me.firstname:me.middle_name:me.othernames:me.street_number:me.address:me.address2:me.city:me.state:me.postal_code:me.country", |
444 |
"searchable": true, |
444 |
"searchable": true, |
445 |
"orderable": true, |
445 |
"orderable": true, |
446 |
"render": function( data, type, row, meta ) { |
446 |
"render": function( data, type, row, meta ) { |
Lines 490-496
Link Here
|
490 |
} |
490 |
} |
491 |
[% CASE 'name' %] |
491 |
[% CASE 'name' %] |
492 |
{ |
492 |
{ |
493 |
"data": "me.surname:me.firstname:me.othernames", |
493 |
"data": "me.surname:me.firstname:me.middle_name:me.othernames", |
494 |
"searchable": true, |
494 |
"searchable": true, |
495 |
"orderable": true, |
495 |
"orderable": true, |
496 |
"render": function( data, type, row, meta ) { |
496 |
"render": function( data, type, row, meta ) { |