|
Lines 175-183
Link Here
|
| 175 |
[% CASE 'address-library' %] |
175 |
[% CASE 'address-library' %] |
| 176 |
<th>Address</th> |
176 |
<th>Address</th> |
| 177 |
[% CASE 'branch' %] |
177 |
[% CASE 'branch' %] |
| 178 |
<th data-filter="libraries">Library</th> |
178 |
<th>Library</th> |
| 179 |
[% CASE 'category' %] |
179 |
[% CASE 'category' %] |
| 180 |
<th data-filter="categories">Category</th> |
180 |
<th>Category</th> |
| 181 |
[% CASE 'dateexpiry' %] |
181 |
[% CASE 'dateexpiry' %] |
| 182 |
<th>Expires on</th> |
182 |
<th>Expires on</th> |
| 183 |
[% CASE 'borrowernotes' %] |
183 |
[% CASE 'borrowernotes' %] |
|
Lines 189-205
Link Here
|
| 189 |
[% CASE 'account_balance' %] |
189 |
[% CASE 'account_balance' %] |
| 190 |
<th>Fines</th> |
190 |
<th>Fines</th> |
| 191 |
[% CASE 'sort1' %] |
191 |
[% CASE 'sort1' %] |
| 192 |
[% IF av_bsort1.size %] |
192 |
<th>Sort 1</th> |
| 193 |
<th data-filter="av_bsort1">Sort 1</th> |
|
|
| 194 |
[% ELSE %] |
| 195 |
<th>Sort 1</th> |
| 196 |
[% END %] |
| 197 |
[% CASE 'sort2' %] |
193 |
[% CASE 'sort2' %] |
| 198 |
[% IF av_bsort2.size %] |
194 |
<th>Sort 2</th> |
| 199 |
<th data-filter="av_bsort2">Sort 2</th> |
|
|
| 200 |
[% ELSE %] |
| 201 |
<th>Sort 2</th> |
| 202 |
[% END %] |
| 203 |
[% CASE 'action' %] |
195 |
[% CASE 'action' %] |
| 204 |
<th class="no-export"> </th> |
196 |
<th class="no-export"> </th> |
| 205 |
[% END %] |
197 |
[% END %] |
|
Lines 244-252
Link Here
|
| 244 |
</script> |
236 |
</script> |
| 245 |
[% END %] |
237 |
[% END %] |
| 246 |
<script> |
238 |
<script> |
| 247 |
[% SET libraries = Branches.all %] |
239 |
var categories = [% To.json(Categories.all.unblessed) | $raw %].map(e => { |
| 248 |
[% SET categories = Categories.all.unblessed %] |
|
|
| 249 |
var categories = [% To.json(categories) | $raw %].map(e => { |
| 250 |
e['_id'] = e.categorycode.toLowerCase(); |
240 |
e['_id'] = e.categorycode.toLowerCase(); |
| 251 |
e['_str'] = e.description; |
241 |
e['_str'] = e.description; |
| 252 |
return e; |
242 |
return e; |
|
Lines 255-261
Link Here
|
| 255 |
map[e._id] = e; |
245 |
map[e._id] = e; |
| 256 |
return map; |
246 |
return map; |
| 257 |
}, {}); |
247 |
}, {}); |
| 258 |
var libraries = [% To.json(libraries) | $raw %].map(e => { |
248 |
var libraries = [% To.json(Branches.all) | $raw %].map(e => { |
| 259 |
e['_id'] = e.branchcode; |
249 |
e['_id'] = e.branchcode; |
| 260 |
e['_str'] = e.branchname; |
250 |
e['_str'] = e.branchname; |
| 261 |
return e; |
251 |
return e; |
|
Lines 285-290
Link Here
|
| 285 |
return map; |
275 |
return map; |
| 286 |
}, {}); |
276 |
}, {}); |
| 287 |
|
277 |
|
|
|
278 |
let filters_options = { |
| 279 |
libraries, |
| 280 |
categories, |
| 281 |
av_bsort1, |
| 282 |
av_bsort2, |
| 283 |
}; |
| 284 |
|
| 288 |
[% IF Koha.Preference('ExtendedPatronAttributes') %] |
285 |
[% IF Koha.Preference('ExtendedPatronAttributes') %] |
| 289 |
[% SET extended_attribute_types = ExtendedAttributeTypes.codes( staff_searchable => 1, searched_by_default => 1 ) %] |
286 |
[% SET extended_attribute_types = ExtendedAttributeTypes.codes( staff_searchable => 1, searched_by_default => 1 ) %] |
| 290 |
[% IF ( extended_attribute_types ) %][% extended_attribute_types = [ extended_attribute_types ] %][% END %] |
287 |
[% IF ( extended_attribute_types ) %][% extended_attribute_types = [ extended_attribute_types ] %][% END %] |
|
Lines 626-635
Link Here
|
| 626 |
} |
623 |
} |
| 627 |
[% CASE 'branch' %] |
624 |
[% CASE 'branch' %] |
| 628 |
{ |
625 |
{ |
| 629 |
"data": "library.name:me.library_id", |
626 |
data: "library.name:me.library_id", |
| 630 |
"searchable": true, |
627 |
dataFilter: "libraries", |
| 631 |
"orderable": true, |
628 |
searchable: true, |
| 632 |
"render": function( data, type, row, meta ) { |
629 |
orderable: true, |
|
|
630 |
render: function( data, type, row, meta ) { |
| 633 |
if( !singleBranchMode && row.library.library_id == logged_in_library_id ) { |
631 |
if( !singleBranchMode && row.library.library_id == logged_in_library_id ) { |
| 634 |
return "<span class=\"currentlibrary\">" + escape_str(row.library.name) + "</span>"; |
632 |
return "<span class=\"currentlibrary\">" + escape_str(row.library.name) + "</span>"; |
| 635 |
} else { |
633 |
} else { |
|
Lines 639-648
Link Here
|
| 639 |
} |
637 |
} |
| 640 |
[% CASE 'category' %] |
638 |
[% CASE 'category' %] |
| 641 |
{ |
639 |
{ |
| 642 |
"data": "category_id", |
640 |
data: "category_id", |
| 643 |
"searchable": true, |
641 |
dataFilter: "categories", |
| 644 |
"orderable": true, |
642 |
searchable: true, |
| 645 |
"render": function( data, type, row, meta ) { |
643 |
orderable: true, |
|
|
644 |
render: function( data, type, row, meta ) { |
| 646 |
return escape_str(categories_map[data.toLowerCase()].description); |
645 |
return escape_str(categories_map[data.toLowerCase()].description); |
| 647 |
} |
646 |
} |
| 648 |
} |
647 |
} |
|
Lines 710-719
Link Here
|
| 710 |
|
709 |
|
| 711 |
[% CASE 'sort1' %] |
710 |
[% CASE 'sort1' %] |
| 712 |
{ |
711 |
{ |
| 713 |
"data": "statistics_1", |
712 |
data: "statistics_1", |
| 714 |
"searchable": true, |
713 |
[% IF av_bsort1.size %] |
| 715 |
"orderable": true, |
714 |
dataFilter: "av_bsort1", |
| 716 |
"render": function( data, type, row, meta ) { |
715 |
[% END %] |
|
|
716 |
searchable: true, |
| 717 |
orderable: true, |
| 718 |
render: function( data, type, row, meta ) { |
| 717 |
if (data === null) return ''; |
719 |
if (data === null) return ''; |
| 718 |
let bsort1 = av_bsort1_map[data.toString()]; |
720 |
let bsort1 = av_bsort1_map[data.toString()]; |
| 719 |
return escape_str(bsort1 ? bsort1.lib : data); |
721 |
return escape_str(bsort1 ? bsort1.lib : data); |
|
Lines 722-731
Link Here
|
| 722 |
|
724 |
|
| 723 |
[% CASE 'sort2' %] |
725 |
[% CASE 'sort2' %] |
| 724 |
{ |
726 |
{ |
| 725 |
"data": "statistics_2", |
727 |
data: "statistics_2", |
| 726 |
"searchable": true, |
728 |
[% IF av_bsort2.size %] |
| 727 |
"orderable": true, |
729 |
dataFilter: "av_bsort2", |
| 728 |
"render": function( data, type, row, meta ) { |
730 |
[% END %] |
|
|
731 |
searchable: true, |
| 732 |
orderable: true, |
| 733 |
render: function( data, type, row, meta ) { |
| 729 |
if (data === null) return ''; |
734 |
if (data === null) return ''; |
| 730 |
let bsort2 = av_bsort2_map[data.toString()]; |
735 |
let bsort2 = av_bsort2_map[data.toString()]; |
| 731 |
return escape_str(bsort2 ? bsort2.lib : data); |
736 |
return escape_str(bsort2 ? bsort2.lib : data); |
|
Lines 782-788
Link Here
|
| 782 |
}, |
787 |
}, |
| 783 |
[% END %] |
788 |
[% END %] |
| 784 |
fixedHeader: false, |
789 |
fixedHeader: false, |
| 785 |
}, typeof table_settings !== 'undefined' ? table_settings : null, 1, additional_filters, undefined, external_filter_nodes, parent_block.find(".search_description"), additional_search_descriptions ); |
790 |
}, typeof table_settings !== 'undefined' ? table_settings : null, 1, additional_filters, filters_options, external_filter_nodes, parent_block.find(".search_description"), additional_search_descriptions ); |
| 786 |
|
791 |
|
| 787 |
patron_search_form.on('submit', filter); |
792 |
patron_search_form.on('submit', filter); |
| 788 |
patron_search_form.on('submit', update_search_type); |
793 |
patron_search_form.on('submit', update_search_type); |