|
Lines 1-5
Link Here
|
| 1 |
[% USE To %] |
1 |
[% USE To %] |
| 2 |
[% USE Koha %] |
2 |
[% USE Koha %] |
|
|
3 |
[% USE Branches %] |
| 3 |
[% USE AuthorisedValues %] |
4 |
[% USE AuthorisedValues %] |
| 4 |
[% USE raw %] |
5 |
[% USE raw %] |
| 5 |
|
6 |
|
|
Lines 164-169
Link Here
|
| 164 |
[% END %] |
165 |
[% END %] |
| 165 |
|
166 |
|
| 166 |
|
167 |
|
|
|
168 |
const all_libraries = [% To.json(Branches.all) | $raw %]; |
| 169 |
const libraries_filters = all_libraries.map(e => { |
| 170 |
e["_id"] = e["branchcode"]; |
| 171 |
e["_str"] = e["branchname"]; |
| 172 |
return e; |
| 173 |
}); |
| 174 |
|
| 167 |
const can_edit_items_from = [% To.json(can_edit_items_from || {}) | $raw %]; |
175 |
const can_edit_items_from = [% To.json(can_edit_items_from || {}) | $raw %]; |
| 168 |
const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %]; |
176 |
const item_type_image_locations = [% To.json(item_type_image_locations) | $raw %]; |
| 169 |
const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib])); |
177 |
const av_loc = new Map([% To.json(AuthorisedValues.Get('LOC')) | $raw %].map( av => [av.authorised_value, av.lib])); |
|
Lines 185-191
Link Here
|
| 185 |
[%# Do we need separate/new endpoints or do we hack the somewhere client-side? %] |
193 |
[%# Do we need separate/new endpoints or do we hack the somewhere client-side? %] |
| 186 |
let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; |
194 |
let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; |
| 187 |
let embed = ["+strings,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk,item_type"]; |
195 |
let embed = ["+strings,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk,item_type"]; |
| 188 |
embed.push('home_library', 'holding_library'); |
|
|
| 189 |
[% IF Koha.Preference('LocalCoverImages') %] |
196 |
[% IF Koha.Preference('LocalCoverImages') %] |
| 190 |
embed.push('cover_image_ids'); |
197 |
embed.push('cover_image_ids'); |
| 191 |
[% END %] |
198 |
[% END %] |
|
Lines 248-253
Link Here
|
| 248 |
if ( !items_selection.hasOwnProperty(tab_id) ){ |
255 |
if ( !items_selection.hasOwnProperty(tab_id) ){ |
| 249 |
items_selection[tab_id] = []; |
256 |
items_selection[tab_id] = []; |
| 250 |
} |
257 |
} |
|
|
258 |
|
| 259 |
let filters_options = { |
| 260 |
3: () => all_libraries, |
| 261 |
4: () => all_libraries, |
| 262 |
}; |
| 251 |
var items_table = $("#" + tab_id + '_table').kohaTable({ |
263 |
var items_table = $("#" + tab_id + '_table').kohaTable({ |
| 252 |
ajax: { url: item_table_url }, |
264 |
ajax: { url: item_table_url }, |
| 253 |
order: [[ 0, "asc" ]], |
265 |
order: [[ 0, "asc" ]], |
|
Lines 320-326
Link Here
|
| 320 |
}, |
332 |
}, |
| 321 |
[% END %] |
333 |
[% END %] |
| 322 |
{ |
334 |
{ |
| 323 |
data: "me.holding_library_id:holding_library.name", |
335 |
data: "me.holding_library_id", |
| 324 |
className: "location", |
336 |
className: "location", |
| 325 |
searchable: true, |
337 |
searchable: true, |
| 326 |
orderable: true, |
338 |
orderable: true, |
|
Lines 329-335
Link Here
|
| 329 |
} |
341 |
} |
| 330 |
}, |
342 |
}, |
| 331 |
{ |
343 |
{ |
| 332 |
data: "me.home_library_id:home_library.name", |
344 |
data: "me.home_library_id", |
| 333 |
className: "homebranch", |
345 |
className: "homebranch", |
| 334 |
searchable: true, |
346 |
searchable: true, |
| 335 |
orderable: true, |
347 |
orderable: true, |
|
Lines 768-773
Link Here
|
| 768 |
items_table_settings[tab_id], |
780 |
items_table_settings[tab_id], |
| 769 |
add_filters, |
781 |
add_filters, |
| 770 |
default_filters, |
782 |
default_filters, |
|
|
783 |
filters_options, |
| 771 |
); |
784 |
); |
| 772 |
|
785 |
|
| 773 |
return items_table; |
786 |
return items_table; |