|
Lines 132-138
Link Here
|
| 132 |
const analyze = [% analyze ? 1 : 0 | html %]; |
132 |
const analyze = [% analyze ? 1 : 0 | html %]; |
| 133 |
const hidden_count = [% hidden_count ? 1 : 0 | html %]; |
133 |
const hidden_count = [% hidden_count ? 1 : 0 | html %]; |
| 134 |
const bundlesEnabled = [% bundlesEnabled ? 1 : 0 | html %]; |
134 |
const bundlesEnabled = [% bundlesEnabled ? 1 : 0 | html %]; |
| 135 |
addPrefs({ |
135 |
Koha.addPrefs({ |
| 136 |
LocalCoverImages: [% Koha.Preference('LocalCoverImages') ? 1 : 0 | html %], |
136 |
LocalCoverImages: [% Koha.Preference('LocalCoverImages') ? 1 : 0 | html %], |
| 137 |
OPACLocalCoverImages: [% Koha.Preference('OPACLocalCoverImages') ? 1 : 0 | html %], |
137 |
OPACLocalCoverImages: [% Koha.Preference('OPACLocalCoverImages') ? 1 : 0 | html %], |
| 138 |
EnableItemGroups: [% Koha.Preference('EnableItemGroups') ? 1 : 0 | html %], |
138 |
EnableItemGroups: [% Koha.Preference('EnableItemGroups') ? 1 : 0 | html %], |
|
Lines 148-154
Link Here
|
| 148 |
canreservefromotherbranches: [% Koha.Preference('canreservefromotherbranches') ? 1 : 0 | html %], |
148 |
canreservefromotherbranches: [% Koha.Preference('canreservefromotherbranches') ? 1 : 0 | html %], |
| 149 |
SpineLabelShowPrintOnBibDetails: [% Koha.Preference('SpineLabelShowPrintOnBibDetails') ? 1 : 0 | html %], |
149 |
SpineLabelShowPrintOnBibDetails: [% Koha.Preference('SpineLabelShowPrintOnBibDetails') ? 1 : 0 | html %], |
| 150 |
}); |
150 |
}); |
| 151 |
addPermissions({ |
151 |
Koha.addPermissions({ |
| 152 |
CAN_user_editcatalogue_edit_items: [% CAN_user_editcatalogue_edit_items ? 1 : 0 | html %], |
152 |
CAN_user_editcatalogue_edit_items: [% CAN_user_editcatalogue_edit_items ? 1 : 0 | html %], |
| 153 |
}); |
153 |
}); |
| 154 |
const logged_in_branchcode = '[% Branches.GetLoggedInBranchcode() | html %]'; |
154 |
const logged_in_branchcode = '[% Branches.GetLoggedInBranchcode() | html %]'; |
|
Lines 306-332
Link Here
|
| 306 |
// Do we need separate/new endpoints or do we hack the somewhere client-side? |
306 |
// Do we need separate/new endpoints or do we hack the somewhere client-side? |
| 307 |
let item_table_url = `/api/v1/biblios/${biblionumber}/items?`; |
307 |
let item_table_url = `/api/v1/biblios/${biblionumber}/items?`; |
| 308 |
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"]; |
308 |
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"]; |
| 309 |
if (prefs.LocalCoverImages) { |
309 |
if (Koha.prefs.LocalCoverImages) { |
| 310 |
embed.push("cover_image_ids"); |
310 |
embed.push("cover_image_ids"); |
| 311 |
} |
311 |
} |
| 312 |
if (prefs.EnableItemGroups) { |
312 |
if (Koha.prefs.EnableItemGroups) { |
| 313 |
embed.push("item_group_item.item_group.description"); |
313 |
embed.push("item_group_item.item_group.description"); |
| 314 |
} |
314 |
} |
| 315 |
if (is_serial) { |
315 |
if (is_serial) { |
| 316 |
embed.push("serial_item.serial"); |
316 |
embed.push("serial_item.serial"); |
| 317 |
} |
317 |
} |
| 318 |
if (prefs.UseRecalls) { |
318 |
if (Koha.prefs.UseRecalls) { |
| 319 |
embed.push("recall", "recall+strings", "recall.patron"); |
319 |
embed.push("recall", "recall+strings", "recall.patron"); |
| 320 |
} |
320 |
} |
| 321 |
embed.push("in_bundle", "bundle_host", "bundle_host.biblio", "bundle_items_lost+count", "bundle_items_not_lost+count"); |
321 |
embed.push("in_bundle", "bundle_host", "bundle_host.biblio", "bundle_items_lost+count", "bundle_items_not_lost+count"); |
| 322 |
if (prefs.UseCourseReserves) { |
322 |
if (Koha.prefs.UseCourseReserves) { |
| 323 |
embed.push("course_item.course_reserves.course"); |
323 |
embed.push("course_item.course_reserves.course"); |
| 324 |
} |
324 |
} |
| 325 |
if (prefs.ClaimReturnedLostValue) { |
325 |
if (Koha.prefs.ClaimReturnedLostValue) { |
| 326 |
embed.push("return_claims"); |
326 |
embed.push("return_claims"); |
| 327 |
} |
327 |
} |
| 328 |
|
328 |
|
| 329 |
if (prefs.EasyAnalyticalRecords) { |
329 |
if (Koha.prefs.EasyAnalyticalRecords) { |
| 330 |
// For host records |
330 |
// For host records |
| 331 |
embed.push("biblio.title"); |
331 |
embed.push("biblio.title"); |
| 332 |
} |
332 |
} |
|
Lines 350-357
Link Here
|
| 350 |
user_colvis[tab_id] = user_colvis_bak; |
350 |
user_colvis[tab_id] = user_colvis_bak; |
| 351 |
} |
351 |
} |
| 352 |
let default_filters = {}; |
352 |
let default_filters = {}; |
| 353 |
if (prefs.SeparateHoldings) { |
353 |
if (Koha.prefs.SeparateHoldings) { |
| 354 |
let branch = prefs.SeparateHoldingsBranch == "homebranch" ? "me.home_library_id" : "me.holding_library_id"; |
354 |
let branch = Koha.prefs.SeparateHoldingsBranch == "homebranch" ? "me.home_library_id" : "me.holding_library_id"; |
| 355 |
if (tab_id == "holdings") { |
355 |
if (tab_id == "holdings") { |
| 356 |
default_filters[branch] = logged_in_branchcode; |
356 |
default_filters[branch] = logged_in_branchcode; |
| 357 |
} else { |
357 |
} else { |
|
Lines 387-393
Link Here
|
| 387 |
} |
387 |
} |
| 388 |
}, |
388 |
}, |
| 389 |
}, |
389 |
}, |
| 390 |
...(prefs.LocalCoverImages |
390 |
...(Koha.prefs.LocalCoverImages |
| 391 |
? [ |
391 |
? [ |
| 392 |
{ |
392 |
{ |
| 393 |
data: "", |
393 |
data: "", |
|
Lines 419-425
Link Here
|
| 419 |
}, |
419 |
}, |
| 420 |
] |
420 |
] |
| 421 |
: []), |
421 |
: []), |
| 422 |
...(prefs.item_level_itypes |
422 |
...(Koha.prefs.item_level_itypes |
| 423 |
? [ |
423 |
? [ |
| 424 |
{ |
424 |
{ |
| 425 |
data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype |
425 |
data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype |
|
Lines 431-437
Link Here
|
| 431 |
render: function (data, type, row, meta) { |
431 |
render: function (data, type, row, meta) { |
| 432 |
let node = ""; |
432 |
let node = ""; |
| 433 |
let item_type_description = row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id; |
433 |
let item_type_description = row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id; |
| 434 |
if (prefs.noItemTypeImages) { |
434 |
if (Koha.prefs.noItemTypeImages) { |
| 435 |
let image_location = item_type_image_locations[row.item_type_id]; |
435 |
let image_location = item_type_image_locations[row.item_type_id]; |
| 436 |
node += image_location ? '<img class="itemtype-image" src="%s" alt="" /> '.format(escape_str(image_location), escape_str(item_type_description), escape_str(item_type_description)) : ""; |
436 |
node += image_location ? '<img class="itemtype-image" src="%s" alt="" /> '.format(escape_str(image_location), escape_str(item_type_description), escape_str(item_type_description)) : ""; |
| 437 |
} |
437 |
} |
|
Lines 493-499
Link Here
|
| 493 |
return escape_str(row._strings.collection_code ? row._strings.collection_code.str : row.collection_code); |
493 |
return escape_str(row._strings.collection_code ? row._strings.collection_code.str : row.collection_code); |
| 494 |
}, |
494 |
}, |
| 495 |
}, |
495 |
}, |
| 496 |
...(prefs.EnableItemGroups |
496 |
...(Koha.prefs.EnableItemGroups |
| 497 |
? [ |
497 |
? [ |
| 498 |
{ |
498 |
{ |
| 499 |
data: "item_group_item.item_group.description", |
499 |
data: "item_group_item.item_group.description", |
|
Lines 539-545
Link Here
|
| 539 |
} else if (serial && serial.serialseq) { |
539 |
} else if (serial && serial.serialseq) { |
| 540 |
nodes += '<span class="serialseq">%s</span>'.format(escape_str(serial.serialseq)); |
540 |
nodes += '<span class="serialseq">%s</span>'.format(escape_str(serial.serialseq)); |
| 541 |
} |
541 |
} |
| 542 |
if (prefs.DisplayPublishedDate) { |
542 |
if (Koha.prefs.DisplayPublishedDate) { |
| 543 |
if (serial && serial.publisheddate) { |
543 |
if (serial && serial.publisheddate) { |
| 544 |
nodes += ' <span class="pubdate">(%s)</span>'.format($date(serial.publisheddate)); |
544 |
nodes += ' <span class="pubdate">(%s)</span>'.format($date(serial.publisheddate)); |
| 545 |
} |
545 |
} |
|
Lines 619-625
Link Here
|
| 619 |
} else { |
619 |
} else { |
| 620 |
nodes += '<span class="waitingat">%s</span>'.format(_("Waiting at %s since %s.".format(row.first_hold._strings.pickup_library_id.str, $date(row.first_hold.waiting_date)))); |
620 |
nodes += '<span class="waitingat">%s</span>'.format(_("Waiting at %s since %s.".format(row.first_hold._strings.pickup_library_id.str, $date(row.first_hold.waiting_date)))); |
| 621 |
} |
621 |
} |
| 622 |
if (prefs.canreservefromotherbranches) { |
622 |
if (Koha.prefs.canreservefromotherbranches) { |
| 623 |
if (row.first_hold.waiting_date || row.first_hold.priority == 1) { |
623 |
if (row.first_hold.waiting_date || row.first_hold.priority == 1) { |
| 624 |
// Hacky for patron_to_html in case we simply want to display the patron's library name |
624 |
// Hacky for patron_to_html in case we simply want to display the patron's library name |
| 625 |
row.first_hold.patron.library = { name: libraries_names.get(row.first_hold.patron.library_id) }; |
625 |
row.first_hold.patron.library = { name: libraries_names.get(row.first_hold.patron.library_id) }; |
|
Lines 633-639
Link Here
|
| 633 |
} |
633 |
} |
| 634 |
} |
634 |
} |
| 635 |
|
635 |
|
| 636 |
if (prefs.UseRecalls) { |
636 |
if (Koha.prefs.UseRecalls) { |
| 637 |
if (row.recall && row.item_id === row.recall.item_id) { |
637 |
if (row.recall && row.item_id === row.recall.item_id) { |
| 638 |
if (row.recall.waiting_date) { |
638 |
if (row.recall.waiting_date) { |
| 639 |
nodes += '<span class="holding_status recallwaiting">%s</span>'.format( |
639 |
nodes += '<span class="holding_status recallwaiting">%s</span>'.format( |
|
Lines 806-812
Link Here
|
| 806 |
return escape_str(row.internal_notes); |
806 |
return escape_str(row.internal_notes); |
| 807 |
}, |
807 |
}, |
| 808 |
}, |
808 |
}, |
| 809 |
...(prefs.EasyAnalyticalRecords |
809 |
...(Koha.prefs.EasyAnalyticalRecords |
| 810 |
? [ |
810 |
? [ |
| 811 |
{ |
811 |
{ |
| 812 |
data: "biblio.title", |
812 |
data: "biblio.title", |
|
Lines 840-846
Link Here
|
| 840 |
}, |
840 |
}, |
| 841 |
] |
841 |
] |
| 842 |
: []), |
842 |
: []), |
| 843 |
...(prefs.UseCourseReserves |
843 |
...(Koha.prefs.UseCourseReserves |
| 844 |
? [ |
844 |
? [ |
| 845 |
{ |
845 |
{ |
| 846 |
data: "course_item.course_reserves.course.course_name", |
846 |
data: "course_item.course_reserves.course.course_name", |
|
Lines 868-874
Link Here
|
| 868 |
}, |
868 |
}, |
| 869 |
] |
869 |
] |
| 870 |
: []), |
870 |
: []), |
| 871 |
...(prefs.SpineLabelShowPrintOnBibDetails |
871 |
...(Koha.prefs.SpineLabelShowPrintOnBibDetails |
| 872 |
? [ |
872 |
? [ |
| 873 |
{ |
873 |
{ |
| 874 |
data: "", |
874 |
data: "", |
|
Lines 880-892
Link Here
|
| 880 |
}, |
880 |
}, |
| 881 |
] |
881 |
] |
| 882 |
: []), |
882 |
: []), |
| 883 |
...(permissions.CAN_user_editcatalogue_edit_items |
883 |
...(Koha.permissions.CAN_user_editcatalogue_edit_items |
| 884 |
? [ |
884 |
? [ |
| 885 |
{ |
885 |
{ |
| 886 |
data: function (row, type, val, meta) { |
886 |
data: function (row, type, val, meta) { |
| 887 |
let nodes = ""; |
887 |
let nodes = ""; |
| 888 |
if (can_edit_items_from.includes(row.home_library_id) || !can_edit_items_from.length) { |
888 |
if (can_edit_items_from.includes(row.home_library_id) || !can_edit_items_from.length) { |
| 889 |
if (prefs.LocalCoverImages || prefs.OPACLocalCoverImages) { |
889 |
if (Koha.prefs.LocalCoverImages || prefs.OPACLocalCoverImages) { |
| 890 |
nodes += '<div class="btn-group dropup">'; |
890 |
nodes += '<div class="btn-group dropup">'; |
| 891 |
nodes += |
891 |
nodes += |
| 892 |
' <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=%s&itemnumber=%s#edititem"><i class="fa-solid fa-pencil"></i> %s</a><a class="btn btn-default btn-xs dropdown-toggle" data-bs-toggle="dropdown"><span class="caret"></span></a>'.format( |
892 |
' <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=%s&itemnumber=%s#edititem"><i class="fa-solid fa-pencil"></i> %s</a><a class="btn btn-default btn-xs dropdown-toggle" data-bs-toggle="dropdown"><span class="caret"></span></a>'.format( |
|
Lines 963-969
Link Here
|
| 963 |
container.find(".bottom.pager").remove(); |
963 |
container.find(".bottom.pager").remove(); |
| 964 |
} |
964 |
} |
| 965 |
|
965 |
|
| 966 |
if (prefs.SpineLabelShowPrintOnBibDetails) { |
966 |
if (Koha.prefs.SpineLabelShowPrintOnBibDetails) { |
| 967 |
$(".print-label").on("click", function (e) { |
967 |
$(".print-label").on("click", function (e) { |
| 968 |
e.preventDefault(); |
968 |
e.preventDefault(); |
| 969 |
link = $(this).attr("href"); |
969 |
link = $(this).attr("href"); |