projects
/
srvgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug 30055: (QA follow-up) Minor QA fixes
[srvgit]
/
koha-tmpl
/
intranet-tmpl
/
prog
/
en
/
modules
/
members
/
search.tt
diff --git
a/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt
b/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt
index
c1b16a8
..
7422381
100644
(file)
--- a/
koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt
+++ b/
koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt
@@
-76,7
+76,7
@@
</div>
<div id="info" class="dialog message" style="display: none;"></div>
</div>
<div id="info" class="dialog message" style="display: none;"></div>
- <div id="error" class="dialog alert" style="dispay: none;"></div>
+ <div id="error" class="dialog alert" style="disp
l
ay: none;"></div>
<input type="hidden" id="firstletter_filter" value="" />
<div id="searchresults" style="display:none;">
<input type="hidden" id="firstletter_filter" value="" />
<div id="searchresults" style="display:none;">
@@
-165,21
+165,25
@@
if (!start_with) return "";
return { "like": start_with + "%" }
},
if (!start_with) return "";
return { "like": start_with + "%" }
},
- [% IF Koha.Preference('ExtendedPatronAttributes') %]
- "-or": function(){
+ "-and": function(){
let filter = $("#searchmember_filter").val();
if (!filter) return "";
let filter = $("#searchmember_filter").val();
if (!filter) return "";
+ [% SET search_fields = Koha.Preference('DefaultPatronSearchFields') || 'surname,firstname,othernames,cardnumber,userid' %]
return [
return [
+ [% FOR search_field IN search_fields.split(',') %]
+ {"me.[% search_field | html %]":{"like":"%"+filter+"%"}},
+ [% END %]
+ [% IF Koha.Preference('ExtendedPatronAttributes') %]
{
{
- "extended_attributes.value": { "like": "%" + filter + "%" }
- },
- {
+ "extended_attributes.value": { "like": "%" + filter + "%" },
"extended_attributes.code": extended_attribute_types
}
"extended_attributes.code": extended_attribute_types
}
+ [% END %]
];
},
];
},
- [% END %]
};
};
+ [% SET default_sort_column = "name" %]
+ [% SET order_column_index = 0 %]
patrons_table = $("#memberresultst").kohaTable({
"ajax": {
[% SWITCH filter %]
patrons_table = $("#memberresultst").kohaTable({
"ajax": {
[% SWITCH filter %]
@@
-196,10
+200,12
@@
[% END %]
},
embed: ['extended_attributes'],
[% END %]
},
embed: ['extended_attributes'],
- "order": [[ 1, "asc" ]],
"iDeferLoading": 0,
"columns": [
[% FOR column IN columns %]
"iDeferLoading": 0,
"columns": [
[% FOR column IN columns %]
+ [% IF default_sort_column == column %]
+ [% order_column_index = loop.count - 1%]
+ [% END %]
[% SWITCH column %]
[% CASE 'cardnumber' %]
{
[% SWITCH column %]
[% CASE 'cardnumber' %]
{
@@
-227,7
+233,7
@@
}
[% CASE 'name' %]
{
}
[% CASE 'name' %]
{
- "data": "me.firstname:me.surname",
+ "data": "me.firstname:me.surname
:me.othernames
",
"searchable": true,
"orderable": true,
"render": function( data, type, row, meta ) {
"searchable": true,
"orderable": true,
"render": function( data, type, row, meta ) {
@@
-287,6
+293,7
@@
[% UNLESS loop.last %],[% END %]
[% END %]
],
[% UNLESS loop.last %],[% END %]
[% END %]
],
+ "order": [[ [% order_column_index | html %], "asc" ]],
'bAutoWidth': false,
'sPaginationType': 'full_numbers',
"iDisplayLength": [% Koha.Preference('PatronsPerPage') | html %],
'bAutoWidth': false,
'sPaginationType': 'full_numbers',
"iDisplayLength": [% Koha.Preference('PatronsPerPage') | html %],
@@
-337,14
+344,14
@@
[% CASE 'branch' %]
let library_id = $("#branchcode_filter").val();
patrons_table.find('thead tr:eq(1) th[data-filter="libraries"] select').val(library_id);
[% CASE 'branch' %]
let library_id = $("#branchcode_filter").val();
patrons_table.find('thead tr:eq(1) th[data-filter="libraries"] select').val(library_id);
- table_dt.column([% loop.count - 1 %]).search(library_id);
+ table_dt.column([% loop.count - 1 %]).search(library_id
? '^'+library_id+'$' : ''
);
[% CASE 'category' %]
let category_id = $("#categorycode_filter").val();
patrons_table.find('thead tr:eq(1) th[data-filter="categories"] select').val(category_id);
[% CASE 'category' %]
let category_id = $("#categorycode_filter").val();
patrons_table.find('thead tr:eq(1) th[data-filter="categories"] select').val(category_id);
- table_dt.column([% loop.count - 1 %]).search(category_id);
+ table_dt.column([% loop.count - 1 %]).search(category_id
? '^'+category_id+'$' : ''
);
[% END %]
[% END %]
[% END %]
[% END %]
- table_dt.search(
$("#searchmember_filter").val()
);
+ table_dt.search(
""
);
table_dt.draw();
return false;
}
table_dt.draw();
return false;
}