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