Lines 25-30
use warnings;
Link Here
|
25 |
use C4::Biblio; |
25 |
use C4::Biblio; |
26 |
use C4::Context; |
26 |
use C4::Context; |
27 |
use C4::Koha; |
27 |
use C4::Koha; |
|
|
28 |
use Koha::Biblios; |
28 |
use Koha::Libraries; |
29 |
use Koha::Libraries; |
29 |
|
30 |
|
30 |
use vars qw(@ISA @EXPORT @EXPORT_OK); |
31 |
use vars qw(@ISA @EXPORT @EXPORT_OK); |
Lines 220-233
sub GetShelfInfo {
Link Here
|
220 |
my $marcflavour = C4::Context->preference("marcflavour"); |
221 |
my $marcflavour = C4::Context->preference("marcflavour"); |
221 |
my @valid_items; |
222 |
my @valid_items; |
222 |
for my $item ( @items ) { |
223 |
for my $item ( @items ) { |
223 |
my $this_biblio = GetBibData($item->{biblionumber}); |
224 |
my $biblio = Koha::Biblios->find( $item->{biblionumber} ); |
224 |
next unless defined $this_biblio; |
225 |
next unless defined $biblio; |
225 |
$item->{'title'} = $this_biblio->{'title'}; |
226 |
|
226 |
$item->{'subtitle'} = $this_biblio->{'subtitle'}, |
227 |
$item->{biblio_object} = $biblio; |
227 |
$item->{'medium'} = $this_biblio->{'medium'}; |
228 |
$item->{biblionumber} = $biblio->biblionumber; |
228 |
$item->{'part_number'} = $this_biblio->{'part_number'}; |
229 |
$item->{title} = $biblio->title; |
229 |
$item->{'part_name'} = $this_biblio->{'part_name'}; |
230 |
$item->{subtitle} = $biblio->subtitle; |
230 |
my $this_record = GetMarcBiblio({ biblionumber => $this_biblio->{'biblionumber'} }); |
231 |
$item->{medium} = $biblio->medium; |
|
|
232 |
$item->{part_number} = $biblio->part_number; |
233 |
$item->{part_name} = $biblio->part_name; |
234 |
my $this_record = GetMarcBiblio({ biblionumber => $biblio->biblionumber }); |
231 |
$item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour); |
235 |
$item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour); |
232 |
$item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour); |
236 |
$item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour); |
233 |
$item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour); |
237 |
$item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour); |
Lines 237-251
sub GetShelfInfo {
Link Here
|
237 |
return @valid_items; |
241 |
return @valid_items; |
238 |
} |
242 |
} |
239 |
|
243 |
|
240 |
# Fetches some basic biblio data needed by the shelf stuff |
|
|
241 |
sub GetBibData { |
242 |
my ($bibnum) = @_; |
243 |
|
244 |
my $dbh = C4::Context->dbh; |
245 |
my $sth = $dbh->prepare("SELECT biblionumber, title, subtitle, medium, part_number, part_name FROM biblio WHERE biblionumber=?"); |
246 |
$sth->execute($bibnum); |
247 |
my $bib = $sth->fetchrow_hashref(); |
248 |
return $bib; |
249 |
} |
250 |
|
251 |
1; |
244 |
1; |