use C4::Koha;
use C4::Members;
use C4::Reserves;
-use C4::Items qw( GetBarcodeFromItemnumber GetItemnumbersForBiblio);
use C4::Auth qw(checkpw);
+use Koha::Items;
use Koha::Libraries;
use Koha::Patrons;
my $self = shift;
my $item_arr = $self->x_items('hold_items', @_);
foreach my $item (@{$item_arr}) {
- $item->{barcode} = GetBarcodeFromItemnumber($item->{itemnumber});
+ my $item_obj = Koha::Items->find($item->{itemnumber});
+ $item->{barcode} = $item_obj ? $item_obj->barcode : undef;
}
return $item_arr;
}
return "Please contact library staff";
}
+=head2 update_lastseen
+
+ $patron->update_lastseen();
+
+ Patron method to update lastseen field in borrower
+ to record that patron has been seen via sip connection
+
+=cut
+
+sub update_lastseen {
+ my $self = shift;
+ my $kohaobj = Koha::Patrons->find( $self->{borrowernumber} );
+ $kohaobj->track_login if $kohaobj; # track_login checks the pref
+}
+
sub _get_address {
my $patron = shift;
while ( my $hold = $holds->next ) {
my $item;
if ($hold->itemnumber) {
- $item = $hold->itemnumber;
+ $item = $hold->item;
}
else {
# We need to return a barcode for the biblio so the client
# can request the biblio info
- $item = ( GetItemnumbersForBiblio($hold->biblionumber) )->[0];
+ my $items = $hold->biblio->items;
+ $item = $items->count ? $item->next : undef;
}
my $unblessed_hold = $hold->unblessed;
- $unblessed_hold->{barcode} = GetBarcodeFromItemnumber($item);
+
+ $unblessed_hold->{barcode} = $item ? $item->barcode : undef;
+
push @holds, $unblessed_hold;
}
return \@holds;