From e82000f636f41b12b36814a8356aae7109cfa3f3 Mon Sep 17 00:00:00 2001 From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4> Date: Thu, 11 Mar 2010 16:07:42 +0000 Subject: [PATCH] some extra options for the acq user request retrieval methods git-svn-id: svn://svn.open-ils.org/ILS/trunk@15795 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm index bddfa09f8d..b5f1d39bd6 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Order.pm @@ -2166,6 +2166,7 @@ __PACKAGE__->register_method ( Retrieve fleshed user requests and related data for a given user or users. @param authtoken Login session key @param owner Id or array of id's for the pertinent users. + @param options Allows one to override the query's 'order_by', 'limit', and 'offset'. And the 'state' of the lineitem in the search. / ); @@ -2177,6 +2178,7 @@ __PACKAGE__->register_method ( Retrieve fleshed user requests and related data for a given org unit or units. @param authtoken Login session key @param owner Id or array of id's for the pertinent org units. + @param options Allows one to override the query's 'order_by', 'limit', and 'offset'. And the 'state' of the lineitem in the search. / ); @@ -2200,6 +2202,15 @@ sub user_requests { "order_by"=>[{"class"=>"aur", "field"=>"request_date", "direction"=>"desc"}] }; + if ($options && defined $options->{'order_by'}) { + $query->{'order_by'} = $options->{'order_by'}; + } + if ($options && defined $options->{'limit'}) { + $query->{'limit'} = $options->{'limit'}; + } + if ($options && defined $options->{'offset'}) { + $query->{'offset'} = $options->{'offset'}; + } if ($options && defined $options->{'state'}) { $query->{'where'}->{'+jub'}->{'-or'}->[1]->{'state'} = $options->{'state'}; } -- 2.11.0