Bug 33737: Link from patron bookings to biblio bookings

Signed-off-by: Esther Melander <esther@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Martin Renvoize 2023-08-18 11:38:53 +01:00 committed by Katrin Fischer
parent a8bf78d32e
commit f46453cd89
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 12 additions and 4 deletions

View File

@ -41,6 +41,8 @@
title = '<a href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=' + encodeURIComponent(biblio.biblio_id) + '" class="title">' + title + '</a>';
} else if (config.link === 'isbd') {
title = '<a href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=' + encodeURIComponent(biblio.biblio_id) + '" class="title">' + title + '</a>';
} else if (config.link === 'bookings') {
title = '<a href="/cgi-bin/koha/bookings/list.pl?biblionumber=' + encodeURIComponent(biblio.biblio_id) + '" class="title">' + title + '</a>';
} else {
title = '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' + encodeURIComponent(biblio.biblio_id) + '" class="title">' + title + '</a>';
}

View File

@ -747,8 +747,8 @@
[% END %]
[% Asset.js("js/holds.js") | $raw %]
[% INCLUDE 'calendar.inc' %]
[% Asset.js("js/bookings.js") | $raw %]
[% Asset.js("js/cancel_booking_modal.js") | $raw %]
[% INCLUDE 'js-biblio-format.inc' %]
[% INCLUDE 'str/members-menu.inc' %]
[% Asset.js("js/members-menu.js") | $raw %]
[% Asset.js("js/recalls.js") | $raw %]
@ -804,7 +804,9 @@
"searchable": true,
"orderable": true,
"render": function(data,type,row,meta) {
return row.biblio.title;
return $biblio_to_html(row.biblio, {
link: 'bookings'
});
}
},
{
@ -815,7 +817,7 @@
"defaultContent": "Any item",
"render": function(data,type,row,meta) {
if ( row.item ) {
return row.item.external_id;
return row.item.external_id + " (" + row.booking_id + ")";
} else {
return null;
}
@ -842,10 +844,14 @@
{
"data": "",
"title": "Actions",
"class": "actions",
"searchable": false,
"orderable": false,
"render": function(data, type, row, meta) {
var result = '<button type="button" class="btn btn-default btn-xs cancel-action" data-toggle="modal" data-target="#cancelBookingModal" data-booking="'+row.booking_id+'"><i class="fa fa-trash" aria-hidden="true"></i> '+_("Cancel")+'</button>';
let result = "";
[% IF CAN_user_circulate_manage_bookings %]
result += '<button type="button" class="btn btn-default btn-xs cancel-action" data-toggle="modal" data-target="#cancelBookingModal" data-booking="'+row.booking_id+'"><i class="fa fa-trash" aria-hidden="true"></i> '+_("Cancel")+'</button>';
[% END %]
return result;
}
}]