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-229
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 |
my $this_record = GetMarcBiblio({ biblionumber => $this_biblio->{'biblionumber'} }); |
227 |
$item->{biblio_object} = $biblio; |
|
|
228 |
$item->{biblionumber} = $biblio->biblionumber; |
229 |
$item->{title} = $biblio->title; |
230 |
my $this_record = GetMarcBiblio({ biblionumber => $biblio->biblionumber }); |
227 |
$item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour); |
231 |
$item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour); |
228 |
$item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour); |
232 |
$item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour); |
229 |
$item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour); |
233 |
$item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour); |
Lines 234-248
sub GetShelfInfo {
Link Here
|
234 |
return @valid_items; |
238 |
return @valid_items; |
235 |
} |
239 |
} |
236 |
|
240 |
|
237 |
# Fetches some basic biblio data needed by the shelf stuff |
|
|
238 |
sub GetBibData { |
239 |
my ($bibnum) = @_; |
240 |
|
241 |
my $dbh = C4::Context->dbh; |
242 |
my $sth = $dbh->prepare("SELECT biblionumber, title FROM biblio WHERE biblionumber=?"); |
243 |
$sth->execute($bibnum); |
244 |
my $bib = $sth->fetchrow_hashref(); |
245 |
return $bib; |
246 |
} |
247 |
|
248 |
1; |
241 |
1; |