+sub _get_address {
+ my $patron = shift;
+
+ my $address = $patron->{streetnumber} || q{};
+ for my $field (qw( roaddetails address address2 city state zipcode country))
+ {
+ next unless $patron->{$field};
+ if ($address) {
+ $address .= q{ };
+ $address .= $patron->{$field};
+ }
+ else {
+ $address .= $patron->{$field};
+ }
+ }
+ return $address;
+}
+
+sub _get_outstanding_holds {
+ my $borrowernumber = shift;
+
+ my $patron = Koha::Patrons->find( $borrowernumber );
+ my $holds = $patron->holds->search( { -or => [ { found => undef }, { found => { '!=' => 'W' } } ] } );
+ my @holds;
+ while ( my $hold = $holds->next ) {
+ my $item;
+ if ($hold->itemnumber) {
+ $item = $hold->itemnumber;
+ }
+ else {
+ # We need to return a barcode for the biblio so the client
+ # can request the biblio info
+ $item = ( GetItemnumbersForBiblio($hold->biblionumber) )->[0];
+ }
+ my $unblessed_hold = $hold->unblessed;
+ $unblessed_hold->{barcode} = GetBarcodeFromItemnumber($item);
+ push @holds, $unblessed_hold;
+ }
+ return \@holds;
+}
+