|
Lines 61-66
Link Here
|
| 61 |
</span> |
61 |
</span> |
| 62 |
<button class="btn btn-link SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</button> |
62 |
<button class="btn btn-link SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</button> |
| 63 |
<button class="btn btn-link ClearAll" data-tab="[% tab | html %]"><i class="fa fa-times"></i> Clear all</button> |
63 |
<button class="btn btn-link ClearAll" data-tab="[% tab | html %]"><i class="fa fa-times"></i> Clear all</button> |
|
|
64 |
<button class="btn btn-link GroupByStatus" data-tab="[% tab | html %]"><i class="fa fa-object-group"></i> Group by status</button> |
| 64 |
<span class="itemselection_actions"> |
65 |
<span class="itemselection_actions"> |
| 65 |
| Actions: |
66 |
| Actions: |
| 66 |
[% IF CAN_user_tools_items_batchdel %] |
67 |
[% IF CAN_user_tools_items_batchdel %] |
|
Lines 249-255
Link Here
|
| 249 |
[%# FIXME The X-Base-Total-Count will be the number of items of the biblios %] |
250 |
[%# FIXME The X-Base-Total-Count will be the number of items of the biblios %] |
| 250 |
[%# In case or SeparateHoldings we may need to display the number of biblios in each tab %] |
251 |
[%# In case or SeparateHoldings we may need to display the number of biblios in each tab %] |
| 251 |
[%# Do we need separate/new endpoints or do we hack the somewhere client-side? %] |
252 |
[%# Do we need separate/new endpoints or do we hack the somewhere client-side? %] |
| 252 |
let item_table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; |
|
|
| 253 |
let embed = ["+strings,_status,home_library,holding_library,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk"]; |
253 |
let embed = ["+strings,_status,home_library,holding_library,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk"]; |
| 254 |
[% IF Koha.Preference('LocalCoverImages') %] |
254 |
[% IF Koha.Preference('LocalCoverImages') %] |
| 255 |
embed.push('cover_image_ids'); |
255 |
embed.push('cover_image_ids'); |
|
Lines 290-295
Link Here
|
| 290 |
holdings: "[% PROCESS 'build_table' tab="holdings" | collapse | $tojson %]", |
290 |
holdings: "[% PROCESS 'build_table' tab="holdings" | collapse | $tojson %]", |
| 291 |
otherholdings: "[% PROCESS 'build_table' tab="otherholdings" | collapse | $tojson %]", |
291 |
otherholdings: "[% PROCESS 'build_table' tab="otherholdings" | collapse | $tojson %]", |
| 292 |
}; |
292 |
}; |
|
|
293 |
|
| 294 |
let group_by_status_values = { |
| 295 |
holdings: false, |
| 296 |
otherholdings: false, |
| 297 |
}; |
| 298 |
$(".GroupByStatus").on("click",function(e){ |
| 299 |
e.preventDefault(); |
| 300 |
let tab_id = $(this).data("tab"); |
| 301 |
let was_grouped = group_by_status_values[tab_id]; |
| 302 |
group_by_status_values[tab_id] = !was_grouped; |
| 303 |
|
| 304 |
build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback ); |
| 305 |
|
| 306 |
if ( was_grouped ) { |
| 307 |
$(this).html('<i class="fa fa-object-group"></i> Group by status</button>'); |
| 308 |
} else { |
| 309 |
$(this).html('<i class="fa fa-object-ungroup"></i> Ungroup by status</button>'); |
| 310 |
} |
| 311 |
}); |
| 312 |
|
| 293 |
function build_items_table (tab_id, add_filters, dt_options, drawcallback) { |
313 |
function build_items_table (tab_id, add_filters, dt_options, drawcallback) { |
| 294 |
|
314 |
|
| 295 |
let table_dt; |
315 |
let table_dt; |
|
Lines 335-342
Link Here
|
| 335 |
[offset+7] : () => all_statuses, |
355 |
[offset+7] : () => all_statuses, |
| 336 |
}; |
356 |
}; |
| 337 |
|
357 |
|
|
|
358 |
let group_by_status = function(){ |
| 359 |
if ( group_by_status_values[tab_id] ) { |
| 360 |
return 'group_by_status=1'; |
| 361 |
} |
| 362 |
return ''; |
| 363 |
} |
| 364 |
|
| 338 |
var items_table = $("#" + tab_id + '_table').kohaTable({ |
365 |
var items_table = $("#" + tab_id + '_table').kohaTable({ |
| 339 |
ajax: { url: item_table_url }, |
366 |
ajax: { url: "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?" + group_by_status() }, |
| 340 |
order: [], |
367 |
order: [], |
| 341 |
embed, |
368 |
embed, |
| 342 |
autoWidth: false, |
369 |
autoWidth: false, |
| 343 |
- |
|
|