Do not limit to 10 PO lineitems by default user/berick/acq-sort-po
authorBill Erickson <berick@esilibrary.com>
Wed, 31 Aug 2011 18:20:50 +0000 (14:20 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 31 Aug 2011 18:20:50 +0000 (14:20 -0400)
For back-compat, return all PO items from newly formatted lineitem
search API call when no limit is present.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm

index f328abd..f87889b 100644 (file)
@@ -353,7 +353,6 @@ my $LI_SEARCH_JSON_QUERY = {
     where => {'+jub' => {}},
     order_by => {acqlia => {attr_value => {direction => 'asc'}}}, 
     distinct => 1,
-    limit => 10,
     offset => 0
 };
 
@@ -370,13 +369,13 @@ sub lineitem_search {
     my $sort_attr_type = $$options{sort_attr_type} || 'lineitem_marc_attr_definition';
     my $sort_dir = $$options{sort_dir} || 'asc';
     my $offset = $$options{offset} || 0;
-    my $limit = $$options{limit} || 10;
+    my $limit = $$options{limit};
 
     $LI_SEARCH_JSON_QUERY->{where}->{'+jub'} = $where;
     $LI_SEARCH_JSON_QUERY->{from}->{jub}->{acqlia}->{filter}->{attr_name} = $sort_attr;
     $LI_SEARCH_JSON_QUERY->{from}->{jub}->{acqlia}->{filter}->{attr_type} = $sort_attr_type;
     $LI_SEARCH_JSON_QUERY->{order_by}->{acqlia}->{attr_value}->{direction} = $sort_dir;
-    $LI_SEARCH_JSON_QUERY->{limit} = $limit;
+    $LI_SEARCH_JSON_QUERY->{limit} = $limit if $limit;
     $LI_SEARCH_JSON_QUERY->{offset} = $offset;
 
     my $li_ids = $e->json_query($LI_SEARCH_JSON_QUERY);