Conditionals consolidated
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 25 Mar 2010 19:41:05 +0000 (19:41 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 25 Mar 2010 19:41:05 +0000 (19:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15990 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm

index b14154c..22d9afa 100644 (file)
@@ -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 ];
 }