Lines 227-232
Link Here
|
227 |
[% IF Koha.Preference('UseCourseReserves') %] |
227 |
[% IF Koha.Preference('UseCourseReserves') %] |
228 |
const av_courses_term = new Map([% To.json(AuthorisedValues.Get('TERM')) | $raw %].map( av => [av.authorised_value, av.lib])); |
228 |
const av_courses_term = new Map([% To.json(AuthorisedValues.Get('TERM')) | $raw %].map( av => [av.authorised_value, av.lib])); |
229 |
[% END %] |
229 |
[% END %] |
|
|
230 |
|
231 |
const coded_values = { |
232 |
library: new Map(all_libraries.map( l => [l.branchname, l.branchcode] )), |
233 |
item_type: new Map(all_item_types.map( i => [i.itemtype, i.translated_description] )), |
234 |
collection_code: new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.ccode' })) | $raw %].map( av => [av.lib, av.authorised_value])), |
235 |
}; |
236 |
|
230 |
[% IF Koha.Preference('URLLinkText') %] |
237 |
[% IF Koha.Preference('URLLinkText') %] |
231 |
const url_link_text = "[% Koha.Preference('URLLinkText') | html %]"; |
238 |
const url_link_text = "[% Koha.Preference('URLLinkText') | html %]"; |
232 |
[% ELSE %] |
239 |
[% ELSE %] |
Lines 236-242
Link Here
|
236 |
[%# In case or SeparateHoldings we may need to display the number of biblios in each tab %] |
243 |
[%# In case or SeparateHoldings we may need to display the number of biblios in each tab %] |
237 |
[%# Do we need separate/new endpoints or do we hack the somewhere client-side? %] |
244 |
[%# Do we need separate/new endpoints or do we hack the somewhere client-side? %] |
238 |
let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; |
245 |
let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; |
239 |
let embed = ["+strings,home_library,holding_library,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk"]; |
246 |
let embed = ["+strings,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk"]; |
240 |
[% IF Koha.Preference('LocalCoverImages') %] |
247 |
[% IF Koha.Preference('LocalCoverImages') %] |
241 |
embed.push('cover_image_ids'); |
248 |
embed.push('cover_image_ids'); |
242 |
[% END %] |
249 |
[% END %] |
Lines 278-283
Link Here
|
278 |
}; |
285 |
}; |
279 |
function build_items_table (tab_id, add_filters, dt_options, drawcallback) { |
286 |
function build_items_table (tab_id, add_filters, dt_options, drawcallback) { |
280 |
|
287 |
|
|
|
288 |
let table_dt; |
281 |
if ( dt_options && dt_options.hasOwnProperty('destroy') ) { |
289 |
if ( dt_options && dt_options.hasOwnProperty('destroy') ) { |
282 |
// Keep a copy of the user settings, the destroy is going to trigger the column-visibility.dt event for all columns |
290 |
// Keep a copy of the user settings, the destroy is going to trigger the column-visibility.dt event for all columns |
283 |
let user_colvis_bak= Object.assign({}, user_colvis[tab_id]); |
291 |
let user_colvis_bak= Object.assign({}, user_colvis[tab_id]); |
Lines 366-371
Link Here
|
366 |
[% IF ( item_level_itypes ) %] |
374 |
[% IF ( item_level_itypes ) %] |
367 |
{ |
375 |
{ |
368 |
data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype |
376 |
data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype |
|
|
377 |
datatype: "coded_value:item_type", |
369 |
className: "itype", |
378 |
className: "itype", |
370 |
searchable: true, |
379 |
searchable: true, |
371 |
orderable: true, |
380 |
orderable: true, |
Lines 384-390
Link Here
|
384 |
}, |
393 |
}, |
385 |
[% END %] |
394 |
[% END %] |
386 |
{ |
395 |
{ |
387 |
data: "holding_library.name:me.holding_library_id", |
396 |
data: "me.holding_library_id", |
388 |
className: "location", |
397 |
className: "location", |
389 |
searchable: true, |
398 |
searchable: true, |
390 |
orderable: true, |
399 |
orderable: true, |
Lines 393-399
Link Here
|
393 |
} |
402 |
} |
394 |
}, |
403 |
}, |
395 |
{ |
404 |
{ |
396 |
data: "home_library.name:me.home_library_id", |
405 |
data: "me.home_library_id", |
|
|
406 |
datatype: "coded_value:library", |
397 |
className: "homebranch", |
407 |
className: "homebranch", |
398 |
searchable: true, |
408 |
searchable: true, |
399 |
orderable: true, |
409 |
orderable: true, |
Lines 416-421
Link Here
|
416 |
}, |
426 |
}, |
417 |
{ |
427 |
{ |
418 |
data: "me.collection_code", |
428 |
data: "me.collection_code", |
|
|
429 |
datatype: "coded_value:collection_code", |
419 |
searchable: true, |
430 |
searchable: true, |
420 |
orderable: true, |
431 |
orderable: true, |
421 |
render: function (data, type, row, meta) { |
432 |
render: function (data, type, row, meta) { |
Lines 871-877
Link Here
|
871 |
filters_options, |
882 |
filters_options, |
872 |
); |
883 |
); |
873 |
|
884 |
|
874 |
let table_dt = items_table.DataTable(); |
885 |
table_dt = items_table.DataTable(); |
875 |
table_dt.on("column-visibility.dt", function(e, settings, column, state, recalc ){ |
886 |
table_dt.on("column-visibility.dt", function(e, settings, column, state, recalc ){ |
876 |
if (recalc === false) return; |
887 |
if (recalc === false) return; |
877 |
|
888 |
|