@@ -, +, @@ --- Koha/REST/V1/Illrequests.pm | 10 +++++++++- ill/ill-requests.pl | 5 ++--- koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 4 ++++ 3 files changed, 15 insertions(+), 4 deletions(-) --- a/Koha/REST/V1/Illrequests.pm +++ a/Koha/REST/V1/Illrequests.pm @@ -52,7 +52,15 @@ sub list { } # Get all requests - my @requests = Koha::Illrequests->as_list; + # If necessary, only get those from a specified patron + my @requests; + if ($args->{borrowernumber}) { + @requests = Koha::Illrequests->search( + { borrowernumber => $args->{borrowernumber} } + ); + } else { + @requests = Koha::Illrequests->as_list; + } # Identify patrons & branches that # we're going to need and get them --- a/ill/ill-requests.pl +++ a/ill/ill-requests.pl @@ -236,13 +236,12 @@ if ( $backends_available ) { my $active_filters = []; foreach my $filter(@{$possible_filters}) { if ($params->{$filter}) { - push @{$active_filters}, - { name => $filter, value => $params->{$filter}}; + push @{$active_filters}, "$filter=$params->{$filter}"; } } if (scalar @{$active_filters} > 0) { $template->param( - prefilters => $active_filters + prefilters => join(",", @{$active_filters}) ); } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -37,6 +37,8 @@ 'patron' ]; + var prefilters = '[% prefilters %]'; + // Expanded fields // This is auto populated var expanded = {}; @@ -246,8 +248,10 @@ // Get our data from the API and process it prior to passing // it to datatables + var filterParam = prefilters ? '&' + prefilters : ''; var ajax = $.ajax( '/api/v1/illrequests?embed=metadata,patron,capabilities,library,comments' + + filterParam ).done(function() { var data = JSON.parse(ajax.responseText); // Make a copy, we'll be removing columns next and need --