diff --git a/circ/pendingbookings.pl b/circ/pendingbookings.pl index 677925268d..5cb4b1eb0c 100755 --- a/circ/pendingbookings.pl +++ b/circ/pendingbookings.pl @@ -21,8 +21,10 @@ use Modern::Perl; use CGI qw ( -utf8 ); +use C4::Context; + use C4::Output qw( output_html_with_http_headers ); -use C4::Auth qw( get_template_and_user ); +use C4::Auth qw( get_template_and_user ); use Koha::DateUtils qw(dt_from_string); @@ -36,14 +38,17 @@ my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( } ); -my $today = dt_from_string(); +my $today = dt_from_string(); my $startdate = $today->truncate( to => 'day' ); -my $enddate = $startdate->clone->add( days => 7 ); +my $enddate = $startdate->clone->add( days => 7 ); +my $branchcode = + defined( $input->param('library') ) ? $input->param('library') : C4::Context->userenv->{'branch'}; $template->param( - todaysdate => $today, - from => $startdate, - to => $enddate + todaysdate => $today, + from => $startdate, + to => $enddate, + branchcode => $branchcode ); output_html_with_http_headers $input, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt index 4d3c403340..8a787ee3d9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt @@ -1,5 +1,6 @@ [% USE raw %] [% USE Asset %] +[% USE Branches %] [% USE Koha %] [% USE KohaDates %] [% USE TablesSettings %] @@ -50,7 +51,7 @@ - +
@@ -106,7 +124,11 @@ } return { '>=': isoFrom, '<=': isoTo }; - } + }, + 'item.holding_library_id': function() { + let library = $("#library").find(":selected").val(); + return library; + }, }; var bookings_table_url = '/api/v1/bookings?'; @@ -117,7 +139,8 @@ "embed": [ "biblio", "item", - "patron" + "patron", + "pickup_library" ], "order": [[ 1, "asc" ]], "columns": [{ @@ -125,6 +148,12 @@ "title": "Booking ID", "visible": false }, + { + "data": "pickup_library.name", + "title": "Pickup library", + "searchable": true, + "orderable": true, + }, { "data": "biblio.title", "title": "Title",