From c0e7a846981f60aaeaaae1bc2d75e7baad3fd87f Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 25 Mar 2010 19:41:05 +0000 Subject: [PATCH] Conditionals consolidated git-svn-id: svn://svn.open-ils.org/ILS/trunk@15990 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/OpenILS/Application/Circ/Holds.pm | 46 ++++++++++------------ 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index b14154c57..22d9afaeb 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -423,22 +423,19 @@ sub retrieve_holds { ]); } } - - if( ! $self->api_name =~ /id_list/ ) { - for my $hold ( @$holds ) { - $hold->transit( - $e->search_action_hold_transit_copy([ - {hold => $hold->id}, - {order_by => {ahtc => 'id desc'}, limit => 1}])->[0] - ); - } - } - if( $self->api_name =~ /id_list/ ) { - return [ map { $_->id } @$holds ]; - } else { - return $holds; - } + if( ! $self->api_name =~ /id_list/ ) { + for my $hold ( @$holds ) { + $hold->transit( + $e->search_action_hold_transit_copy([ + {hold => $hold->id}, + {order_by => {ahtc => 'id desc'}, limit => 1}])->[0] + ); + } + return $holds; + } + # else id_list + return [ map { $_->id } @$holds ]; } @@ -501,18 +498,15 @@ sub retrieve_holds_by_pickup_lib { fulfillment_time => undef, cancel_time => undef }, - { order_by => { ahr => "request_time" } }); - - - if( ! $self->api_name =~ /id_list/ ) { - flesh_hold_transits($holds); - } + { order_by => { ahr => "request_time" } } + ); - if( $self->api_name =~ /id_list/ ) { - return [ map { $_->id } @$holds ]; - } else { - return $holds; - } + if ( ! $self->api_name =~ /id_list/ ) { + flesh_hold_transits($holds); + return $holds; + } + # else id_list + return [ map { $_->id } @$holds ]; } -- 2.11.0