|
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 627-636
Link Here
|
| 627 |
} |
624 |
} |
| 628 |
[% CASE 'branch' %] |
625 |
[% CASE 'branch' %] |
| 629 |
{ |
626 |
{ |
| 630 |
"data": "library.name:me.library_id", |
627 |
data: "library.name:me.library_id", |
| 631 |
"searchable": true, |
628 |
dataFilter: "libraries", |
| 632 |
"orderable": true, |
629 |
searchable: true, |
| 633 |
"render": function( data, type, row, meta ) { |
630 |
orderable: true, |
|
|
631 |
render: function( data, type, row, meta ) { |
| 634 |
if( !singleBranchMode && row.library.library_id == logged_in_library_id ) { |
632 |
if( !singleBranchMode && row.library.library_id == logged_in_library_id ) { |
| 635 |
return "<span class=\"currentlibrary\">" + escape_str(row.library.name) + "</span>"; |
633 |
return "<span class=\"currentlibrary\">" + escape_str(row.library.name) + "</span>"; |
| 636 |
} else { |
634 |
} else { |
|
Lines 640-649
Link Here
|
| 640 |
} |
638 |
} |
| 641 |
[% CASE 'category' %] |
639 |
[% CASE 'category' %] |
| 642 |
{ |
640 |
{ |
| 643 |
"data": "category_id", |
641 |
data: "category_id", |
| 644 |
"searchable": true, |
642 |
dataFilter: "categories", |
| 645 |
"orderable": true, |
643 |
searchable: true, |
| 646 |
"render": function( data, type, row, meta ) { |
644 |
orderable: true, |
|
|
645 |
render: function( data, type, row, meta ) { |
| 647 |
return escape_str(categories_map[data.toLowerCase()].description); |
646 |
return escape_str(categories_map[data.toLowerCase()].description); |
| 648 |
} |
647 |
} |
| 649 |
} |
648 |
} |
|
Lines 711-720
Link Here
|
| 711 |
|
710 |
|
| 712 |
[% CASE 'sort1' %] |
711 |
[% CASE 'sort1' %] |
| 713 |
{ |
712 |
{ |
| 714 |
"data": "statistics_1", |
713 |
data: "statistics_1", |
| 715 |
"searchable": true, |
714 |
[% IF av_bsort1.size %] |
| 716 |
"orderable": true, |
715 |
dataFilter: "av_bsort1", |
| 717 |
"render": function( data, type, row, meta ) { |
716 |
[% END %] |
|
|
717 |
searchable: true, |
| 718 |
orderable: true, |
| 719 |
render: function( data, type, row, meta ) { |
| 718 |
if (data === null) return ''; |
720 |
if (data === null) return ''; |
| 719 |
let bsort1 = av_bsort1_map[data.toString()]; |
721 |
let bsort1 = av_bsort1_map[data.toString()]; |
| 720 |
return escape_str(bsort1 ? bsort1.lib : data); |
722 |
return escape_str(bsort1 ? bsort1.lib : data); |
|
Lines 723-732
Link Here
|
| 723 |
|
725 |
|
| 724 |
[% CASE 'sort2' %] |
726 |
[% CASE 'sort2' %] |
| 725 |
{ |
727 |
{ |
| 726 |
"data": "statistics_2", |
728 |
data: "statistics_2", |
| 727 |
"searchable": true, |
729 |
[% IF av_bsort2.size %] |
| 728 |
"orderable": true, |
730 |
dataFilter: "av_bsort2", |
| 729 |
"render": function( data, type, row, meta ) { |
731 |
[% END %] |
|
|
732 |
searchable: true, |
| 733 |
orderable: true, |
| 734 |
render: function( data, type, row, meta ) { |
| 730 |
if (data === null) return ''; |
735 |
if (data === null) return ''; |
| 731 |
let bsort2 = av_bsort2_map[data.toString()]; |
736 |
let bsort2 = av_bsort2_map[data.toString()]; |
| 732 |
return escape_str(bsort2 ? bsort2.lib : data); |
737 |
return escape_str(bsort2 ? bsort2.lib : data); |
|
Lines 783-789
Link Here
|
| 783 |
}, |
788 |
}, |
| 784 |
[% END %] |
789 |
[% END %] |
| 785 |
fixedHeader: false, |
790 |
fixedHeader: false, |
| 786 |
}, typeof table_settings !== 'undefined' ? table_settings : null, 1, additional_filters, undefined, external_filter_nodes, parent_block.find(".search_description"), additional_search_descriptions ); |
791 |
}, typeof table_settings !== 'undefined' ? table_settings : null, 1, additional_filters, filters_options, external_filter_nodes, parent_block.find(".search_description"), additional_search_descriptions ); |
| 787 |
|
792 |
|
| 788 |
patron_search_form.on('submit', filter); |
793 |
patron_search_form.on('submit', filter); |
| 789 |
patron_search_form.on('submit', update_search_type); |
794 |
patron_search_form.on('submit', update_search_type); |