|
Lines 231-236
Link Here
|
| 231 |
[% IF Koha.Preference('UseCourseReserves') %] |
231 |
[% IF Koha.Preference('UseCourseReserves') %] |
| 232 |
const av_courses_term = new Map([% To.json(AuthorisedValues.Get('TERM')) | $raw %].map( av => [av.authorised_value, av.lib])); |
232 |
const av_courses_term = new Map([% To.json(AuthorisedValues.Get('TERM')) | $raw %].map( av => [av.authorised_value, av.lib])); |
| 233 |
[% END %] |
233 |
[% END %] |
|
|
234 |
|
| 235 |
const coded_values = { |
| 236 |
library: new Map(all_libraries.map( l => [l.branchname, l.branchcode] )), |
| 237 |
item_type: new Map(all_item_types.map( i => [i.translated_description, i.itemtype] )), |
| 238 |
collection_code: new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.ccode' })) | $raw %].map( av => [av.lib, av.authorised_value])), |
| 239 |
}; |
| 240 |
|
| 234 |
[% IF Koha.Preference('URLLinkText') %] |
241 |
[% IF Koha.Preference('URLLinkText') %] |
| 235 |
const url_link_text = "[% Koha.Preference('URLLinkText') | html %]"; |
242 |
const url_link_text = "[% Koha.Preference('URLLinkText') | html %]"; |
| 236 |
[% ELSE %] |
243 |
[% ELSE %] |
|
Lines 240-246
Link Here
|
| 240 |
[%# In case or SeparateHoldings we may need to display the number of biblios in each tab %] |
247 |
[%# In case or SeparateHoldings we may need to display the number of biblios in each tab %] |
| 241 |
[%# Do we need separate/new endpoints or do we hack the somewhere client-side? %] |
248 |
[%# Do we need separate/new endpoints or do we hack the somewhere client-side? %] |
| 242 |
let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; |
249 |
let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; |
| 243 |
let embed = ["+strings,home_library,holding_library,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk"]; |
250 |
let embed = ["+strings,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk"]; |
| 244 |
[% IF Koha.Preference('LocalCoverImages') %] |
251 |
[% IF Koha.Preference('LocalCoverImages') %] |
| 245 |
embed.push('cover_image_ids'); |
252 |
embed.push('cover_image_ids'); |
| 246 |
[% END %] |
253 |
[% END %] |
|
Lines 282-287
Link Here
|
| 282 |
}; |
289 |
}; |
| 283 |
function build_items_table (tab_id, add_filters, dt_options, drawcallback) { |
290 |
function build_items_table (tab_id, add_filters, dt_options, drawcallback) { |
| 284 |
|
291 |
|
|
|
292 |
let table_dt; |
| 285 |
if ( dt_options && dt_options.hasOwnProperty('destroy') ) { |
293 |
if ( dt_options && dt_options.hasOwnProperty('destroy') ) { |
| 286 |
// Keep a copy of the user settings, the destroy is going to trigger the column-visibility.dt event for all columns |
294 |
// Keep a copy of the user settings, the destroy is going to trigger the column-visibility.dt event for all columns |
| 287 |
let user_colvis_bak= Object.assign({}, user_colvis[tab_id]); |
295 |
let user_colvis_bak= Object.assign({}, user_colvis[tab_id]); |
|
Lines 370-375
Link Here
|
| 370 |
[% IF ( item_level_itypes ) %] |
378 |
[% IF ( item_level_itypes ) %] |
| 371 |
{ |
379 |
{ |
| 372 |
data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype |
380 |
data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype |
|
|
381 |
datatype: "coded_value:item_type", |
| 373 |
className: "itype", |
382 |
className: "itype", |
| 374 |
searchable: true, |
383 |
searchable: true, |
| 375 |
orderable: true, |
384 |
orderable: true, |
|
Lines 388-394
Link Here
|
| 388 |
}, |
397 |
}, |
| 389 |
[% END %] |
398 |
[% END %] |
| 390 |
{ |
399 |
{ |
| 391 |
data: "holding_library.name:me.holding_library_id", |
400 |
data: "me.holding_library_id", |
|
|
401 |
datatype: "coded_value:library", |
| 392 |
className: "location", |
402 |
className: "location", |
| 393 |
searchable: true, |
403 |
searchable: true, |
| 394 |
orderable: true, |
404 |
orderable: true, |
|
Lines 397-403
Link Here
|
| 397 |
} |
407 |
} |
| 398 |
}, |
408 |
}, |
| 399 |
{ |
409 |
{ |
| 400 |
data: "home_library.name:me.home_library_id", |
410 |
data: "me.home_library_id", |
|
|
411 |
datatype: "coded_value:library", |
| 401 |
className: "homebranch", |
412 |
className: "homebranch", |
| 402 |
searchable: true, |
413 |
searchable: true, |
| 403 |
orderable: true, |
414 |
orderable: true, |
|
Lines 427-432
Link Here
|
| 427 |
}, |
438 |
}, |
| 428 |
{ |
439 |
{ |
| 429 |
data: "me.collection_code", |
440 |
data: "me.collection_code", |
|
|
441 |
datatype: "coded_value:collection_code", |
| 430 |
searchable: true, |
442 |
searchable: true, |
| 431 |
orderable: true, |
443 |
orderable: true, |
| 432 |
render: function (data, type, row, meta) { |
444 |
render: function (data, type, row, meta) { |
|
Lines 882-888
Link Here
|
| 882 |
filters_options, |
894 |
filters_options, |
| 883 |
); |
895 |
); |
| 884 |
|
896 |
|
| 885 |
let table_dt = items_table.DataTable(); |
897 |
table_dt = items_table.DataTable(); |
| 886 |
table_dt.on("column-visibility.dt", function(e, settings, column, state, recalc ){ |
898 |
table_dt.on("column-visibility.dt", function(e, settings, column, state, recalc ){ |
| 887 |
if (recalc === false) return; |
899 |
if (recalc === false) return; |
| 888 |
|
900 |
|