View | Details | Raw Unified | Return to bug 18262
Collapse All | Expand All

(-)a/C4/Acquisition.pm (-12 / +14 lines)
Lines 287-303 sub GetBasketAsCSV { Link Here
287
287
288
    my @rows;
288
    my @rows;
289
    foreach my $order (@orders) {
289
    foreach my $order (@orders) {
290
        my $bd = GetBiblioData( $order->{'biblionumber'} );
290
        my $biblio = Koha::Biblios->find( $order->{biblionumber} );
291
        my $biblioitem = $biblio->biblioitem;
291
        my $row = {
292
        my $row = {
292
            contractname => $contract->{'contractname'},
293
            contractname => $contract->{'contractname'},
293
            ordernumber => $order->{'ordernumber'},
294
            ordernumber => $order->{'ordernumber'},
294
            entrydate => $order->{'entrydate'},
295
            entrydate => $order->{'entrydate'},
295
            isbn => $order->{'isbn'},
296
            isbn => $order->{'isbn'},
296
            author => $bd->{'author'},
297
            author => $biblio->author,
297
            title => $bd->{'title'},
298
            title => $biblio->title,
298
            publicationyear => $bd->{'publicationyear'},
299
            publicationyear => $biblioitem->publicationyear,
299
            publishercode => $bd->{'publishercode'},
300
            publishercode => $biblioitem->publishercode,
300
            collectiontitle => $bd->{'collectiontitle'},
301
            collectiontitle => $biblioitem->collectiontitle,
301
            notes => $order->{'order_vendornote'},
302
            notes => $order->{'order_vendornote'},
302
            quantity => $order->{'quantity'},
303
            quantity => $order->{'quantity'},
303
            rrp => $order->{'rrp'},
304
            rrp => $order->{'rrp'},
Lines 355-370 sub GetBasketGroupAsCSV { Link Here
355
        my $basketgroup = GetBasketgroup( $$basket{basketgroupid} );
356
        my $basketgroup = GetBasketgroup( $$basket{basketgroupid} );
356
357
357
        foreach my $order (@orders) {
358
        foreach my $order (@orders) {
358
            my $bd = GetBiblioData( $order->{'biblionumber'} );
359
            my $biblio = Koha::Biblios->find( $order->{biblionumber} );
360
            my $biblioitem = $biblio->biblioitem;
359
            my $row = {
361
            my $row = {
360
                clientnumber => $bookseller->accountnumber,
362
                clientnumber => $bookseller->accountnumber,
361
                basketname => $basket->{basketname},
363
                basketname => $basket->{basketname},
362
                ordernumber => $order->{ordernumber},
364
                ordernumber => $order->{ordernumber},
363
                author => $bd->{author},
365
                author => $biblio->author,
364
                title => $bd->{title},
366
                title => $biblio->title,
365
                publishercode => $bd->{publishercode},
367
                publishercode => $bibioitem->publishercode,
366
                publicationyear => $bd->{publicationyear},
368
                publicationyear => $biblioitem->publicationyear,
367
                collectiontitle => $bd->{collectiontitle},
369
                collectiontitle => $biblioitem->collectiontitle,
368
                isbn => $order->{isbn},
370
                isbn => $order->{isbn},
369
                quantity => $order->{quantity},
371
                quantity => $order->{quantity},
370
                rrp_tax_included => $order->{rrp_tax_included},
372
                rrp_tax_included => $order->{rrp_tax_included},
(-)a/C4/Biblio.pm (-5 / +6 lines)
Lines 3710-3721 sub UpdateTotalIssues { Link Here
3710
        carp "UpdateTotalIssues could not get biblio record";
3710
        carp "UpdateTotalIssues could not get biblio record";
3711
        return;
3711
        return;
3712
    }
3712
    }
3713
    my $data = GetBiblioData($biblionumber);
3713
    my $biblio = Koha::Biblios->find( $biblionumber );
3714
    unless ($data) {
3714
    unless ($biblio) {
3715
        carp "UpdateTotalIssues could not get datas of biblio";
3715
        carp "UpdateTotalIssues could not get datas of biblio";
3716
        return;
3716
        return;
3717
    }
3717
    }
3718
    my ($totalissuestag, $totalissuessubfield) = GetMarcFromKohaField('biblioitems.totalissues', $data->{'frameworkcode'});
3718
    my $biblioitem = $biblio->biblioitem;
3719
    my ($totalissuestag, $totalissuessubfield) = GetMarcFromKohaField('biblioitems.totalissues', $biblio->frameworkcode);
3719
    unless ($totalissuestag) {
3720
    unless ($totalissuestag) {
3720
        return 1; # There is nothing to do
3721
        return 1; # There is nothing to do
3721
    }
3722
    }
Lines 3723-3729 sub UpdateTotalIssues { Link Here
3723
    if (defined $value) {
3724
    if (defined $value) {
3724
        $totalissues = $value;
3725
        $totalissues = $value;
3725
    } else {
3726
    } else {
3726
        $totalissues = $data->{'totalissues'} + $increase;
3727
        $totalissues = $biblioitem->totalissues + $increase;
3727
    }
3728
    }
3728
3729
3729
     my $field = $record->field($totalissuestag);
3730
     my $field = $record->field($totalissuestag);
Lines 3735-3741 sub UpdateTotalIssues { Link Here
3735
         $record->insert_grouped_field($field);
3736
         $record->insert_grouped_field($field);
3736
     }
3737
     }
3737
3738
3738
     return ModBiblio($record, $biblionumber, $data->{'frameworkcode'});
3739
     return ModBiblio($record, $biblionumber, $biblio->frameworkcode);
3739
}
3740
}
3740
3741
3741
=head2 RemoveAllNsb
3742
=head2 RemoveAllNsb
(-)a/C4/Circulation.pm (-2 / +2 lines)
Lines 1832-1839 sub AddReturn { Link Here
1832
    my $itemnumber = $item->{ itemnumber };
1832
    my $itemnumber = $item->{ itemnumber };
1833
1833
1834
    my $item_level_itypes = C4::Context->preference("item-level_itypes");
1834
    my $item_level_itypes = C4::Context->preference("item-level_itypes");
1835
    my $biblio   = $item_level_itypes ? undef : GetBiblioData( $item->{ biblionumber } ); # don't get bib data unless we need it
1835
    my $biblio   = $item_level_itypes ? undef : Koha::Biblios->find( $item->{ biblionumber } ); # don't get bib data unless we need it
1836
    my $itemtype = $item_level_itypes ? $item->{itype} : $biblio->{itemtype};
1836
    my $itemtype = $item_level_itypes ? $item->{itype} : $biblio->biblioitem->itemtype;
1837
1837
1838
    my $issue  = GetItemIssue($itemnumber);
1838
    my $issue  = GetItemIssue($itemnumber);
1839
    if ($issue and $issue->{borrowernumber}) {
1839
    if ($issue and $issue->{borrowernumber}) {
(-)a/C4/HoldsQueue.pm (-2 / +2 lines)
Lines 678-685 sub CreatePicklistFromItemMap { Link Here
678
        my $firstname = $borrower->{'firstname'};
678
        my $firstname = $borrower->{'firstname'};
679
        my $phone = $borrower->{'phone'};
679
        my $phone = $borrower->{'phone'};
680
680
681
        my $bib = GetBiblioData($biblionumber);
681
        my $biblio = Koha::Biblios->find( $biblionumber );
682
        my $title = $bib->{title};
682
        my $title = $biblio->title;
683
683
684
        $sth_load->execute($biblionumber, $itemnumber, $barcode, $surname, $firstname, $phone, $borrowernumber,
684
        $sth_load->execute($biblionumber, $itemnumber, $barcode, $surname, $firstname, $phone, $borrowernumber,
685
                           $cardnumber, $reservedate, $title, $itemcallnumber,
685
                           $cardnumber, $reservedate, $title, $itemcallnumber,
(-)a/C4/Reserves.pm (-2 / +3 lines)
Lines 36-41 use C4::Members qw(); Link Here
36
use C4::Letters;
36
use C4::Letters;
37
use C4::Log;
37
use C4::Log;
38
38
39
use Koha::Biblios;
39
use Koha::DateUtils;
40
use Koha::DateUtils;
40
use Koha::Calendar;
41
use Koha::Calendar;
41
use Koha::Database;
42
use Koha::Database;
Lines 468-474 sub CanItemBeReserved { Link Here
468
    # we retrieve borrowers and items informations #
469
    # we retrieve borrowers and items informations #
469
    # item->{itype} will come for biblioitems if necessery
470
    # item->{itype} will come for biblioitems if necessery
470
    my $item       = GetItem($itemnumber);
471
    my $item       = GetItem($itemnumber);
471
    my $biblioData = C4::Biblio::GetBiblioData( $item->{biblionumber} );
472
    my $biblio     = Koha::Biblios->find( $item->{biblionumber} );
472
    my $borrower   = C4::Members::GetMember( 'borrowernumber' => $borrowernumber );
473
    my $borrower   = C4::Members::GetMember( 'borrowernumber' => $borrowernumber );
473
474
474
    # If an item is damaged and we don't allow holds on damaged items, we can stop right here
475
    # If an item is damaged and we don't allow holds on damaged items, we can stop right here
Lines 478-484 sub CanItemBeReserved { Link Here
478
479
479
    # Check for the age restriction
480
    # Check for the age restriction
480
    my ( $ageRestriction, $daysToAgeRestriction ) =
481
    my ( $ageRestriction, $daysToAgeRestriction ) =
481
      C4::Circulation::GetAgeRestriction( $biblioData->{agerestriction}, $borrower );
482
      C4::Circulation::GetAgeRestriction( $biblio->biblioitem->agerestriction, $borrower );
482
    return 'ageRestricted' if $daysToAgeRestriction && $daysToAgeRestriction > 0;
483
    return 'ageRestricted' if $daysToAgeRestriction && $daysToAgeRestriction > 0;
483
484
484
    # Check that the patron doesn't have an item level hold on this item already
485
    # Check that the patron doesn't have an item level hold on this item already
(-)a/C4/XISBN.pm (-3 / +4 lines)
Lines 26-31 use C4::External::Syndetics qw(get_syndetics_editions); Link Here
26
use LWP::UserAgent;
26
use LWP::UserAgent;
27
use HTTP::Request::Common;
27
use HTTP::Request::Common;
28
28
29
use Koha::Biblios;
29
use Koha::SearchEngine;
30
use Koha::SearchEngine;
30
use Koha::SearchEngine::Search;
31
use Koha::SearchEngine::Search;
31
32
Lines 74-82 sub _get_biblio_from_xisbn { Link Here
74
    my $biblionumber = C4::Biblio::get_koha_field_from_marc('biblio', 'biblionumber', $record, '');
75
    my $biblionumber = C4::Biblio::get_koha_field_from_marc('biblio', 'biblionumber', $record, '');
75
    return unless $biblionumber;
76
    return unless $biblionumber;
76
77
77
    my $xbiblio = GetBiblioData($biblionumber);
78
    my $biblio = Koha::Biblios->find( $biblionumber );
78
    return unless $xbiblio;
79
    return unless $biblio;
79
    $xbiblio->{normalized_isbn} = GetNormalizedISBN($xbiblio->{isbn});
80
    $xbiblio->{normalized_isbn} = GetNormalizedISBN($biblio->biblioitem->isbn);
80
    return $xbiblio;
81
    return $xbiblio;
81
}
82
}
82
83
(-)a/acqui/basketgroup.pl (-2 / +3 lines)
Lines 55-60 use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsBy Link Here
55
use C4::Members qw/GetMember/;
55
use C4::Members qw/GetMember/;
56
use Koha::EDI qw/create_edi_order get_edifact_ean/;
56
use Koha::EDI qw/create_edi_order get_edifact_ean/;
57
57
58
use Koha::Biblioitems;
58
use Koha::Acquisition::Booksellers;
59
use Koha::Acquisition::Booksellers;
59
60
60
our $input=new CGI;
61
our $input=new CGI;
Lines 173-179 sub printbasketgrouppdf{ Link Here
173
            $ord->{total_tax_included} = $ord->{ecost_tax_included} * $ord->{quantity};
174
            $ord->{total_tax_included} = $ord->{ecost_tax_included} * $ord->{quantity};
174
            $ord->{total_tax_excluded} = $ord->{ecost_tax_excluded} * $ord->{quantity};
175
            $ord->{total_tax_excluded} = $ord->{ecost_tax_excluded} * $ord->{quantity};
175
176
176
            my $bib = GetBiblioData($ord->{biblionumber});
177
            my $biblioitem = Koha::Biblioitems->search({ biblionumber => $ord->{biblionumber} })->next;
177
            my $itemtypes = GetItemTypes();
178
            my $itemtypes = GetItemTypes();
178
179
179
            #FIXME DELETE ME
180
            #FIXME DELETE ME
Lines 195-201 sub printbasketgrouppdf{ Link Here
195
                }
196
                }
196
            }
197
            }
197
198
198
            $ord->{itemtype} = ( $ord->{itemtype} and $bib->{itemtype} ) ? $itemtypes->{$bib->{itemtype}}->{description} : undef;
199
            $ord->{itemtype} = ( $ord->{itemtype} and $biblioitem->itemtype ) ? $itemtypes->{$biblioitem->itemtype}->{description} : undef;
199
            $ord->{en} = $en ? $en : undef;
200
            $ord->{en} = $en ? $en : undef;
200
            $ord->{edition} = $edition ? $edition : undef;
201
            $ord->{edition} = $edition ? $edition : undef;
201
202
(-)a/cataloguing/moveitem.pl (-2 / +4 lines)
Lines 31-36 use C4::Koha; Link Here
31
use C4::ClassSource;
31
use C4::ClassSource;
32
use C4::Acquisition qw/GetOrderFromItemnumber ModOrder GetOrder/;
32
use C4::Acquisition qw/GetOrderFromItemnumber ModOrder GetOrder/;
33
33
34
use Koha::Biblios;
35
34
use Date::Calc qw(Today);
36
use Date::Calc qw(Today);
35
37
36
use MARC::File::XML;
38
use MARC::File::XML;
Lines 55-62 my ($template, $loggedinuser, $cookie) = get_template_and_user( Link Here
55
57
56
58
57
59
58
my $biblio = GetBiblioData($biblionumber);
60
my $biblio = Koha::Biblios->find( $biblionumber );
59
$template->param(bibliotitle => $biblio->{'title'});
61
$template->param(bibliotitle => $biblio->title);
60
$template->param(biblionumber => $biblionumber);
62
$template->param(biblionumber => $biblionumber);
61
63
62
# If we already have the barcode of the item to move and the biblionumber to move the item to
64
# If we already have the barcode of the item to move and the biblionumber to move the item to
(-)a/labels/label-item-search.pl (-1 lines)
Lines 128-134 if ($show_results) { Link Here
128
    my @items =();
128
    my @items =();
129
    # This code needs to be refactored using these subs...
129
    # This code needs to be refactored using these subs...
130
    #my @items = &GetItemsInfo( $biblio->{biblionumber}, 'intra' );
130
    #my @items = &GetItemsInfo( $biblio->{biblionumber}, 'intra' );
131
    #my $dat = &GetBiblioData( $biblio->{biblionumber} );
132
    for ( my $i = 0 ; $i < $hits ; $i++ ) {
131
    for ( my $i = 0 ; $i < $hits ; $i++ ) {
133
        my @row_data= ();
132
        my @row_data= ();
134
        #DEBUG Notes: Decode the MARC record from each resulting MARC record...
133
        #DEBUG Notes: Decode the MARC record from each resulting MARC record...
(-)a/misc/migration_tools/bulkmarcimport.pl (-1 / +4 lines)
Lines 31-36 use Getopt::Long; Link Here
31
use IO::File;
31
use IO::File;
32
use Pod::Usage;
32
use Pod::Usage;
33
33
34
use Koha::Biblios;
34
use Koha::SearchEngine;
35
use Koha::SearchEngine;
35
use Koha::SearchEngine::Search;
36
use Koha::SearchEngine::Search;
36
37
Lines 417-423 RECORD: while ( ) { Link Here
417
			}
418
			}
418
					# create biblio, unless we already have it ( either match or isbn )
419
					# create biblio, unless we already have it ( either match or isbn )
419
            if ($biblionumber) {
420
            if ($biblionumber) {
420
                eval{$biblioitemnumber=GetBiblioData($biblionumber)->{biblioitemnumber};};
421
                eval{
422
                    $biblioitemnumber = Koha::Biblios->find( $biblionumber )->biblioitem->biblioitemnumber;
423
                };
421
                if ($update) {
424
                if ($update) {
422
                    eval { ( $biblionumber, $biblioitemnumber ) = ModBiblio( $record, $biblionumber, GetFrameworkCode($biblionumber) ) };
425
                    eval { ( $biblionumber, $biblioitemnumber ) = ModBiblio( $record, $biblionumber, GetFrameworkCode($biblionumber) ) };
423
                    if ($@) {
426
                    if ($@) {
(-)a/misc/migration_tools/import_lexile.pl (-7 / +9 lines)
Lines 34-39 use Text::CSV; Link Here
34
use C4::Context;
34
use C4::Context;
35
use C4::Biblio;
35
use C4::Biblio;
36
use C4::Koha qw( GetVariationsOfISBN );
36
use C4::Koha qw( GetVariationsOfISBN );
37
38
use Koha::Biblios;
37
use Koha::Database;
39
use Koha::Database;
38
40
39
binmode STDOUT, ':encoding(UTF-8)';
41
binmode STDOUT, ':encoding(UTF-8)';
Lines 156-168 while ( my $row = $csv->getline_hr($fh) ) { Link Here
156
            say "Found matching record! Biblionumber: $biblionumber";
158
            say "Found matching record! Biblionumber: $biblionumber";
157
159
158
            if ( $verbose > 2 ) {
160
            if ( $verbose > 2 ) {
159
                my $biblio = GetBiblioData($biblionumber);
161
                my $biblio = Koha::Biblios->find( $biblionumber );
160
                say "Title from record: " . $biblio->{title}
162
                say "Title from record: " . $biblio->title
161
                  if ( $biblio->{title} );
163
                  if $biblio->title;
162
                say "Author from record: " . $biblio->{author}
164
                say "Author from record: " . $biblio->author
163
                  if ( $biblio->{author} );
165
                  if $biblio->author;
164
                say "ISBN from record: " . $biblio->{isbn}
166
                say "ISBN from record: " . $biblio->biblioitem->isbn
165
                  if ( $biblio->{isbn} );
167
                  if $biblio->biblioitem->isbn;
166
            }
168
            }
167
            say "Title: " . $row->{Title};
169
            say "Title: " . $row->{Title};
168
            say "Author: " . $row->{Author};
170
            say "Author: " . $row->{Author};
(-)a/opac/opac-MARCdetail.pl (-2 / +4 lines)
Lines 57-62 use C4::Members; Link Here
57
use C4::Acquisition;
57
use C4::Acquisition;
58
use C4::Koha;
58
use C4::Koha;
59
use List::MoreUtils qw( any uniq );
59
use List::MoreUtils qw( any uniq );
60
61
use Koha::Biblios;
60
use Koha::RecordProcessor;
62
use Koha::RecordProcessor;
61
63
62
my $query = new CGI;
64
my $query = new CGI;
Lines 89-95 if (scalar @all_items >= 1) { Link Here
89
my $framework = &GetFrameworkCode( $biblionumber );
91
my $framework = &GetFrameworkCode( $biblionumber );
90
my $tagslib = &GetMarcStructure( 0, $framework );
92
my $tagslib = &GetMarcStructure( 0, $framework );
91
my ($tag_itemnumber,$subtag_itemnumber) = &GetMarcFromKohaField('items.itemnumber',$framework);
93
my ($tag_itemnumber,$subtag_itemnumber) = &GetMarcFromKohaField('items.itemnumber',$framework);
92
my $biblio = GetBiblioData($biblionumber);
94
my $biblio = Koha::Biblios->find( $biblionumber );
93
95
94
my $record_processor = Koha::RecordProcessor->new({
96
my $record_processor = Koha::RecordProcessor->new({
95
    filters => 'ViewPolicy',
97
    filters => 'ViewPolicy',
Lines 113-119 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
113
115
114
my ($bt_tag,$bt_subtag) = GetMarcFromKohaField('biblio.title',$framework);
116
my ($bt_tag,$bt_subtag) = GetMarcFromKohaField('biblio.title',$framework);
115
$template->param(
117
$template->param(
116
    bibliotitle => $biblio->{title},
118
    bibliotitle => $biblio->title,
117
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
119
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
118
     $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8;   # except -8;
120
     $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} > -8;   # except -8;
119
121
(-)a/opac/opac-addbybiblionumber.pl (-3 / +4 lines)
Lines 25-30 use C4::Biblio; Link Here
25
use C4::Output;
25
use C4::Output;
26
use C4::Auth;
26
use C4::Auth;
27
27
28
use Koha::Biblios;
28
use Koha::Virtualshelves;
29
use Koha::Virtualshelves;
29
30
30
my $query           = new CGI;
31
my $query           = new CGI;
Lines 141-152 if ($newvirtualshelf) { Link Here
141
142
142
if ($authorized) {
143
if ($authorized) {
143
    for my $biblionumber (@biblionumbers) {
144
    for my $biblionumber (@biblionumbers) {
144
        my $data = GetBiblioData($biblionumber);
145
        my $biblio = Koha::Biblios->fin( $biblionumber );
145
        push(
146
        push(
146
            @biblios,
147
            @biblios,
147
            {   biblionumber => $biblionumber,
148
            {   biblionumber => $biblionumber,
148
                title        => $data->{'title'},
149
                title        => $biblio->title,
149
                author       => $data->{'author'},
150
                author       => $biblio->author;
150
            }
151
            }
151
        );
152
        );
152
    }
153
    }
(-)a/opac/opac-detail.pl (-6 / +8 lines)
Lines 47-52 use C4::Images; Link Here
47
use Koha::DateUtils;
47
use Koha::DateUtils;
48
use C4::HTML5Media;
48
use C4::HTML5Media;
49
use C4::CourseReserves qw(GetItemCourseReservesInfo);
49
use C4::CourseReserves qw(GetItemCourseReservesInfo);
50
51
use Koha::Biblios;
50
use Koha::RecordProcessor;
52
use Koha::RecordProcessor;
51
use Koha::AuthorisedValues;
53
use Koha::AuthorisedValues;
52
use Koha::Virtualshelves;
54
use Koha::Virtualshelves;
Lines 430-451 if ($session->param('busc')) { Link Here
430
    $numberBiblioPaging = $paging{'previous'}->{biblionumber};
432
    $numberBiblioPaging = $paging{'previous'}->{biblionumber};
431
    if ($numberBiblioPaging) {
433
    if ($numberBiblioPaging) {
432
        $template->param( 'previousBiblionumber' => $numberBiblioPaging );
434
        $template->param( 'previousBiblionumber' => $numberBiblioPaging );
433
        $dataBiblioPaging = GetBiblioData($numberBiblioPaging);
435
        $dataBiblioPaging = Koha::Biblios->find( $numberBiblioPaging );
434
        $template->param('previousTitle' => $dataBiblioPaging->{'title'}) if ($dataBiblioPaging);
436
        $template->param('previousTitle' => $dataBiblioPaging->title) if $dataBiblioPaging);
435
    }
437
    }
436
    # Next biblio
438
    # Next biblio
437
    $numberBiblioPaging = $paging{'next'}->{biblionumber};
439
    $numberBiblioPaging = $paging{'next'}->{biblionumber};
438
    if ($numberBiblioPaging) {
440
    if ($numberBiblioPaging) {
439
        $template->param( 'nextBiblionumber' => $numberBiblioPaging );
441
        $template->param( 'nextBiblionumber' => $numberBiblioPaging );
440
        $dataBiblioPaging = GetBiblioData($numberBiblioPaging);
442
        $dataBiblioPaging = Koha::Biblios->find( $numberBiblioPaging );
441
        $template->param('nextTitle' => $dataBiblioPaging->{'title'}) if ($dataBiblioPaging);
443
        $template->param('nextTitle' => $dataBiblioPaging->title) if $dataBiblioPaging;
442
    }
444
    }
443
    # Partial list of biblio results
445
    # Partial list of biblio results
444
    my @listResults;
446
    my @listResults;
445
    for (my $j = 0; $j < @arrBiblios; $j++) {
447
    for (my $j = 0; $j < @arrBiblios; $j++) {
446
        next unless ($arrBiblios[$j]);
448
        next unless ($arrBiblios[$j]);
447
        $dataBiblioPaging = GetBiblioData($arrBiblios[$j]) if ($arrBiblios[$j] != $biblionumber);
449
        $dataBiblioPaging = Koha::Biblios->find( $arrBiblios[$j] ) if ($arrBiblios[$j] != $biblionumber);
448
        push @listResults, {index => $j + 1 + $offset, biblionumber => $arrBiblios[$j], title => ($arrBiblios[$j] == $biblionumber)?'':$dataBiblioPaging->{title}, author => ($arrBiblios[$j] != $biblionumber && $dataBiblioPaging->{author})?$dataBiblioPaging->{author}:'', url => ($arrBiblios[$j] == $biblionumber)?'':'opac-detail.pl?biblionumber=' . $arrBiblios[$j]};
450
        push @listResults, {index => $j + 1 + $offset, biblionumber => $arrBiblios[$j], title => ($arrBiblios[$j] == $biblionumber)?'':$dataBiblioPaging->title, author => ($arrBiblios[$j] != $biblionumber && $dataBiblioPaging->author)?$dataBiblioPaging->author:'', url => ($arrBiblios[$j] == $biblionumber)?'':'opac-detail.pl?biblionumber=' . $arrBiblios[$j]};
449
    }
451
    }
450
    $template->param('listResults' => \@listResults) if (@listResults);
452
    $template->param('listResults' => \@listResults) if (@listResults);
451
    $template->param('indexPag' => 1 + $offset, 'totalPag' => $arrParamsBusc{'total'}, 'indexPagEnd' => scalar(@arrBiblios) + $offset);
453
    $template->param('indexPag' => 1 + $offset, 'totalPag' => $arrParamsBusc{'total'}, 'indexPagEnd' => scalar(@arrBiblios) + $offset);
(-)a/opac/opac-reserve.pl (-1 / +3 lines)
Lines 32-37 use C4::Context; Link Here
32
use C4::Members;
32
use C4::Members;
33
use C4::Overdues;
33
use C4::Overdues;
34
use C4::Debug;
34
use C4::Debug;
35
36
use Koha::Biblios;
35
use Koha::DateUtils;
37
use Koha::DateUtils;
36
use Koha::Libraries;
38
use Koha::Libraries;
37
use Koha::Patrons;
39
use Koha::Patrons;
Lines 518-524 foreach my $biblioNum (@biblionumbers) { Link Here
518
        if ( $itemInfo->{biblionumber} ne $biblioNum ) {
520
        if ( $itemInfo->{biblionumber} ne $biblioNum ) {
519
            $biblioLoopIter{hostitemsflag}    = 1;
521
            $biblioLoopIter{hostitemsflag}    = 1;
520
            $itemLoopIter->{hostbiblionumber} = $itemInfo->{biblionumber};
522
            $itemLoopIter->{hostbiblionumber} = $itemInfo->{biblionumber};
521
            $itemLoopIter->{hosttitle}        = GetBiblioData( $itemInfo->{biblionumber} )->{title};
523
            $itemLoopIter->{hosttitle}        = Koha::Biblios->find( $itemInfo->{biblionumber} )->title;
522
        }
524
        }
523
525
524
        # If there is no loan, return and transfer, we show a checkbox.
526
        # If there is no loan, return and transfer, we show a checkbox.
(-)a/opac/opac-review.pl (-2 / +4 lines)
Lines 25-30 use C4::Output; Link Here
25
use C4::Biblio;
25
use C4::Biblio;
26
use C4::Scrubber;
26
use C4::Scrubber;
27
use C4::Debug;
27
use C4::Debug;
28
29
use Koha::Biblios;
28
use Koha::DateUtils;
30
use Koha::DateUtils;
29
use Koha::Review;
31
use Koha::Review;
30
use Koha::Reviews;
32
use Koha::Reviews;
Lines 45-51 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
45
# FIXME: need to allow user to delete their own comment(s)
47
# FIXME: need to allow user to delete their own comment(s)
46
48
47
my ( $clean, @errors, $savedreview );
49
my ( $clean, @errors, $savedreview );
48
my $biblio = GetBiblioData($biblionumber);
50
my $biblio = Koha::Biblios->find( $biblionumber );
49
51
50
if( !$biblio ) {
52
if( !$biblio ) {
51
    push @errors, { nobiblio => 1 };
53
    push @errors, { nobiblio => 1 };
Lines 101-107 $template->param( Link Here
101
    'borrowernumber' => $borrowernumber,
103
    'borrowernumber' => $borrowernumber,
102
    'review'         => $review,
104
    'review'         => $review,
103
    'reviewid'       => $reviewid || 0,
105
    'reviewid'       => $reviewid || 0,
104
    'title'          => $biblio->{'title'},
106
    'title'          => $biblio->title,
105
);
107
);
106
108
107
output_html_with_http_headers $query, $cookie, $template->output;
109
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/opac/opac-search.pl (-1 / +1 lines)
Lines 46-52 use C4::Auth qw(:DEFAULT get_session); Link Here
46
use C4::Languages qw(getLanguages);
46
use C4::Languages qw(getLanguages);
47
use C4::Search;
47
use C4::Search;
48
use C4::Search::History;
48
use C4::Search::History;
49
use C4::Biblio;  # GetBiblioData
49
use C4::Biblio; # Unused here?
50
use C4::Koha;
50
use C4::Koha;
51
use C4::Tags qw(get_tags);
51
use C4::Tags qw(get_tags);
52
use C4::SocialData;
52
use C4::SocialData;
(-)a/opac/opac-showreviews.pl (-10 / +11 lines)
Lines 89-95 my $i = 0; Link Here
89
my $latest_comment_date;
89
my $latest_comment_date;
90
for my $result (@$reviews){
90
for my $result (@$reviews){
91
    my $biblionumber = $result->{biblionumber};
91
    my $biblionumber = $result->{biblionumber};
92
	my $bib = &GetBiblioData($biblionumber);
92
    my $biblio = Koha::Biblios->find( $biblionumber );
93
    my $biblioitem = $biblio->biblioitem;
93
    my $record = GetMarcBiblio($biblionumber);
94
    my $record = GetMarcBiblio($biblionumber);
94
    my $frameworkcode = GetFrameworkCode($biblionumber);
95
    my $frameworkcode = GetFrameworkCode($biblionumber);
95
    my ( $borr ) = GetMember( borrowernumber => $result->{borrowernumber} );
96
    my ( $borr ) = GetMember( borrowernumber => $result->{borrowernumber} );
Lines 97-112 for my $result (@$reviews){ Link Here
97
	$result->{normalized_ean} = GetNormalizedEAN($record,$marcflavour);
98
	$result->{normalized_ean} = GetNormalizedEAN($record,$marcflavour);
98
	$result->{normalized_oclc} = GetNormalizedOCLCNumber($record,$marcflavour);
99
	$result->{normalized_oclc} = GetNormalizedOCLCNumber($record,$marcflavour);
99
	$result->{normalized_isbn} = GetNormalizedISBN(undef,$record,$marcflavour);
100
	$result->{normalized_isbn} = GetNormalizedISBN(undef,$record,$marcflavour);
100
	$result->{title} = $bib->{'title'};
101
	$result->{title} = $biblio->title;
101
	$result->{subtitle} = GetRecordValue('subtitle', $record, $frameworkcode);
102
	$result->{subtitle} = GetRecordValue('subtitle', $record, $frameworkcode);
102
	$result->{author} = $bib->{'author'};
103
	$result->{author} = $biblio->author;
103
	$result->{place} = $bib->{'place'};
104
	$result->{place} = $biblioitem->place;
104
	$result->{publishercode} = $bib->{'publishercode'};
105
	$result->{publishercode} = $biblioitem->publishercode;
105
	$result->{copyrightdate} = $bib->{'copyrightdate'};
106
	$result->{copyrightdate} = $biblio->copyrightdate;
106
	$result->{pages} = $bib->{'pages'};
107
	$result->{pages} = $biblioitem->pages;
107
	$result->{size} = $bib->{'size'};
108
	$result->{size} = $biblioitem->size;
108
	$result->{notes} = $bib->{'notes'};
109
	$result->{notes} = $biblioitem->notes;
109
	$result->{timestamp} = $bib->{'timestamp'};
110
	$result->{timestamp} = $biblioitem->timestamp;
110
    $result->{borrtitle} = $borr->{'title'};
111
    $result->{borrtitle} = $borr->{'title'};
111
	$result->{firstname} = $borr->{'firstname'};
112
	$result->{firstname} = $borr->{'firstname'};
112
	$result->{surname} = $borr->{'surname'};
113
	$result->{surname} = $borr->{'surname'};
(-)a/opac/opac-tags.pl (-3 / +5 lines)
Lines 46-51 use C4::XSLT; Link Here
46
46
47
use Data::Dumper;
47
use Data::Dumper;
48
48
49
use Koha::Biblios;
50
49
my %newtags = ();
51
my %newtags = ();
50
my @deltags = ();
52
my @deltags = ();
51
my %counts  = ();
53
my %counts  = ();
Lines 229-239 if ($loggedinuser) { Link Here
229
    $my_tags = get_tag_rows({borrowernumber=>$loggedinuser});
231
    $my_tags = get_tag_rows({borrowernumber=>$loggedinuser});
230
    my $my_approved_tags = get_approval_rows({ approved => 1 });
232
    my $my_approved_tags = get_approval_rows({ approved => 1 });
231
    foreach my $tag (@$my_tags) {
233
    foreach my $tag (@$my_tags) {
232
        my $biblio = GetBiblioData($tag->{biblionumber});
234
        my $biblio = Koha::Biblios->find( $tag->{biblionumber} );
233
        my $record = &GetMarcBiblio( $tag->{biblionumber} );
235
        my $record = &GetMarcBiblio( $tag->{biblionumber} );
234
        $tag->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $tag->{biblionumber} ) );
236
        $tag->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $tag->{biblionumber} ) );
235
        $tag->{title} = $biblio->{title};
237
        $tag->{title} = $biblio->title;
236
        $tag->{author} = $biblio->{author};
238
        $tag->{author} = $biblio->author;
237
239
238
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay');
240
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay');
239
        my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
241
        my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
(-)a/reserve/request.pl (-9 / +11 lines)
Lines 42-47 use Koha::DateUtils; Link Here
42
use C4::Utils::DataTables::Members;
42
use C4::Utils::DataTables::Members;
43
use C4::Members;
43
use C4::Members;
44
use C4::Search;		# enabled_staff_search_views
44
use C4::Search;		# enabled_staff_search_views
45
46
use Koha::Biblios;
45
use Koha::DateUtils;
47
use Koha::DateUtils;
46
use Koha::Holds;
48
use Koha::Holds;
47
use Koha::Libraries;
49
use Koha::Libraries;
Lines 211-217 foreach my $biblionumber (@biblionumbers) { Link Here
211
213
212
    my %biblioloopiter = ();
214
    my %biblioloopiter = ();
213
215
214
    my $dat = GetBiblioData($biblionumber);
216
    my $biblio = Koha::Biblios->find( $biblionumber );
215
217
216
    my $canReserve = CanBookBeReserved( $borrowerinfo->{borrowernumber}, $biblionumber );
218
    my $canReserve = CanBookBeReserved( $borrowerinfo->{borrowernumber}, $biblionumber );
217
    $canReserve //= '';
219
    $canReserve //= '';
Lines 372-382 foreach my $biblionumber (@biblionumbers) { Link Here
372
                $item->{holdingbranch} = $item->{holdingbranch};
374
                $item->{holdingbranch} = $item->{holdingbranch};
373
            }
375
            }
374
376
375
		if($item->{biblionumber} ne $biblionumber){
377
            if($item->{biblionumber} ne $biblionumber){
376
			$item->{hostitemsflag}=1;
378
                $item->{hostitemsflag} = 1;
377
		        $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
379
                $item->{hosttitle} = Koha::Biblios->find( $item->{biblionumber} )->title;
378
		}
380
            }
379
		
381
380
            # if the item is currently on loan, we display its return date and
382
            # if the item is currently on loan, we display its return date and
381
            # change the background color
383
            # change the background color
382
            my $issues= GetItemIssue($itemnumber);
384
            my $issues= GetItemIssue($itemnumber);
Lines 602-609 foreach my $biblionumber (@biblionumbers) { Link Here
602
                     date              => $date,
604
                     date              => $date,
603
                     biblionumber      => $biblionumber,
605
                     biblionumber      => $biblionumber,
604
                     findborrower      => $findborrower,
606
                     findborrower      => $findborrower,
605
                     title             => $dat->{title},
607
                     title             => $biblio->title,
606
                     author            => $dat->{author},
608
                     author            => $biblio->author,
607
                     holdsview => 1,
609
                     holdsview => 1,
608
                     C4::Search::enabled_staff_search_views,
610
                     C4::Search::enabled_staff_search_views,
609
                    );
611
                    );
Lines 612-618 foreach my $biblionumber (@biblionumbers) { Link Here
612
    }
614
    }
613
615
614
    $biblioloopiter{biblionumber} = $biblionumber;
616
    $biblioloopiter{biblionumber} = $biblionumber;
615
    $biblioloopiter{title} = $dat->{title};
617
    $biblioloopiter{title} = $biblio->title;
616
    $biblioloopiter{rank} = $fixedRank;
618
    $biblioloopiter{rank} = $fixedRank;
617
    $biblioloopiter{reserveloop} = \@reserveloop;
619
    $biblioloopiter{reserveloop} = \@reserveloop;
618
620
(-)a/reviews/reviewswaiting.pl (-2 / +4 lines)
Lines 23-28 use C4::Output; Link Here
23
use C4::Context;
23
use C4::Context;
24
use C4::Members;
24
use C4::Members;
25
use C4::Biblio;
25
use C4::Biblio;
26
27
use Koha::Biblios;
26
use Koha::Reviews;
28
use Koha::Reviews;
27
29
28
my $query = new CGI;
30
my $query = new CGI;
Lines 69-77 my $reviews = Koha::Reviews->search( Link Here
69
foreach ( @$reviews ) {
71
foreach ( @$reviews ) {
70
    my $borrowernumber = $_->{borrowernumber};
72
    my $borrowernumber = $_->{borrowernumber};
71
    my $borrowerData   = GetMember('borrowernumber' => $borrowernumber);
73
    my $borrowerData   = GetMember('borrowernumber' => $borrowernumber);
72
    my $biblioData     = GetBiblioData($_->{biblionumber});
74
    my $biblio         = Koha::Biblios->find( $_->{biblionumber} );
73
    # setting some borrower info into this hash
75
    # setting some borrower info into this hash
74
    $_->{bibliotitle} = $biblioData->{'title'};
76
    $_->{bibliotitle} = $biblio->title;
75
    $_->{surname}     = $borrowerData->{'surname'};
77
    $_->{surname}     = $borrowerData->{'surname'};
76
    $_->{firstname}   = $borrowerData->{'firstname'};
78
    $_->{firstname}   = $borrowerData->{'firstname'};
77
}
79
}
(-)a/serials/serials-edit.pl (-2 / +2 lines)
Lines 164-170 foreach my $serialid (@serialids) { Link Here
164
        $processedserialid{$serialid} = 1;
164
        $processedserialid{$serialid} = 1;
165
    }
165
    }
166
}
166
}
167
my $biblio = GetBiblioData( $serialdatalist[0]->{'biblionumber'} );
167
my $biblio = Koha::Biblios->find( $serialdatalist[0]->{biblionumber} );
168
168
169
my @newserialloop;
169
my @newserialloop;
170
my @subscriptionloop;
170
my @subscriptionloop;
Lines 425-431 $template->param( Link Here
425
    serialsadditems => $serialdatalist[0]->{'serialsadditems'},
425
    serialsadditems => $serialdatalist[0]->{'serialsadditems'},
426
    callnumber	     => $serialdatalist[0]->{'callnumber'},
426
    callnumber	     => $serialdatalist[0]->{'callnumber'},
427
    internalnotes   => $serialdatalist[0]->{'internalnotes'},
427
    internalnotes   => $serialdatalist[0]->{'internalnotes'},
428
    bibliotitle     => $biblio->{'title'},
428
    bibliotitle     => $biblio->title,
429
    biblionumber    => $serialdatalist[0]->{'biblionumber'},
429
    biblionumber    => $serialdatalist[0]->{'biblionumber'},
430
    serialslist     => \@serialdatalist,
430
    serialslist     => \@serialdatalist,
431
    default_bib_view => $default_bib_view,
431
    default_bib_view => $default_bib_view,
(-)a/serials/subscription-add.pl (-3 / +4 lines)
Lines 31-36 use C4::Serials::Frequency; Link Here
31
use C4::Serials::Numberpattern;
31
use C4::Serials::Numberpattern;
32
use C4::Letters;
32
use C4::Letters;
33
use Koha::AdditionalField;
33
use Koha::AdditionalField;
34
use Koha::Biblios;
34
use Koha::DateUtils;
35
use Koha::DateUtils;
35
use Carp;
36
use Carp;
36
37
Lines 180-189 if ($op eq 'addsubscription') { Link Here
180
181
181
    my $new_biblionumber = $query->param('biblionumber_for_new_subscription');
182
    my $new_biblionumber = $query->param('biblionumber_for_new_subscription');
182
    if (defined $new_biblionumber) {
183
    if (defined $new_biblionumber) {
183
        my $bib = GetBiblioData($new_biblionumber);
184
        my $biblio = Koha::Biblios->find( $new_biblionumber );
184
        if (defined $bib) {
185
        if (defined $biblio) {
185
            $template->param(bibnum      => $new_biblionumber);
186
            $template->param(bibnum      => $new_biblionumber);
186
            $template->param(bibliotitle => $bib->{title});
187
            $template->param(bibliotitle => $biblio->title);
187
        }
188
        }
188
    }
189
    }
189
190
(-)a/tools/batchMod.pl (-5 / +5 lines)
Lines 563-573 sub BuildItemsData{ Link Here
563
563
564
            # grab title, author, and ISBN to identify bib that the item
564
            # grab title, author, and ISBN to identify bib that the item
565
            # belongs to in the display
565
            # belongs to in the display
566
			 my $biblio=GetBiblioData($$itemdata{biblionumber});
566
            my $biblio = Koha::Biblios->find( $itemdata->{biblionumber} );
567
            $this_row{title} = $biblio->{title};
567
            $this_row{title}        = $biblio->title;
568
            $this_row{author} = $biblio->{author};
568
            $this_row{author}       = $biblio->author;
569
            $this_row{isbn} = $biblio->{isbn};
569
            $this_row{isbn}         = $biblio->biblioitem->isbn;
570
            $this_row{biblionumber} = $biblio->{biblionumber};
570
            $this_row{biblionumber} = $biblio->biblionumber;
571
571
572
			if (%this_row) {
572
			if (%this_row) {
573
				push(@big_array, \%this_row);
573
				push(@big_array, \%this_row);
(-)a/tools/inventory.pl (-3 / +5 lines)
Lines 35-40 use C4::Koha; Link Here
35
use C4::Circulation;
35
use C4::Circulation;
36
use C4::Reports::Guided;    #_get_column_defs
36
use C4::Reports::Guided;    #_get_column_defs
37
use C4::Charset;
37
use C4::Charset;
38
39
use Koha::Biblios;
38
use Koha::DateUtils;
40
use Koha::DateUtils;
39
use Koha::AuthorisedValues;
41
use Koha::AuthorisedValues;
40
use Koha::BiblioFrameworks;
42
use Koha::BiblioFrameworks;
Lines 337-345 if ( $compareinv2barcd ) { Link Here
337
}
339
}
338
340
339
for my $item ( @items_with_problems ) {
341
for my $item ( @items_with_problems ) {
340
    my $biblio = C4::Biblio::GetBiblioData($item->{biblionumber});
342
    my $biblio = Koha::Biblios->find( $item->{biblionumber} );
341
    $item->{title} = $biblio->{title};
343
    $item->{title} = $biblio->title;
342
    $item->{author} = $biblio->{author};
344
    $item->{author} = $biblio->author;
343
}
345
}
344
346
345
# If a barcode file is given, we want to show problems, else all items
347
# If a barcode file is given, we want to show problems, else all items
(-)a/tools/showdiffmarc.pl (-2 / +4 lines)
Lines 31-36 use C4::Auth; Link Here
31
use C4::Biblio;
31
use C4::Biblio;
32
use C4::ImportBatch;
32
use C4::ImportBatch;
33
33
34
use Koha::Biblios;
35
34
# Input params
36
# Input params
35
my $input        = new CGI;
37
my $input        = new CGI;
36
my $biblionumber = $input->param('id');
38
my $biblionumber = $input->param('id');
Lines 60-67 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
60
$recordBiblionumber = GetMarcBiblio($biblionumber, 'embed_items');
62
$recordBiblionumber = GetMarcBiblio($biblionumber, 'embed_items');
61
if( $recordBiblionumber ) {
63
if( $recordBiblionumber ) {
62
    $formatted1 = $recordBiblionumber->as_formatted;
64
    $formatted1 = $recordBiblionumber->as_formatted;
63
    my $data = GetBiblioData($biblionumber);
65
    my $biblio = Koha::Biblios->find( $biblionumber );
64
    $biblioTitle = $data->{title};
66
    $biblioTitle = $biblio->title;
65
} else {
67
} else {
66
    $errorFormatted1 = 1;
68
    $errorFormatted1 = 1;
67
}
69
}
(-)a/virtualshelves/addbybiblionumber.pl (-4 / +4 lines)
Lines 63-68 use C4::Biblio; Link Here
63
use C4::Output;
63
use C4::Output;
64
use C4::Auth;
64
use C4::Auth;
65
65
66
use Koha::Biblios;
66
use Koha::Virtualshelves;
67
use Koha::Virtualshelves;
67
68
68
my $query           = new CGI;
69
my $query           = new CGI;
Lines 184-195 if ($newvirtualshelf) { Link Here
184
185
185
my @biblios;
186
my @biblios;
186
for my $biblionumber (@biblionumbers) {
187
for my $biblionumber (@biblionumbers) {
187
    my $data = GetBiblioData($biblionumber);
188
    my $biblio = Koha::Biblios->find( $biblionumber );
188
    push(
189
    push(
189
        @biblios,
190
        @biblios,
190
        {   biblionumber => $biblionumber,
191
        {   biblionumber => $biblionumber,
191
            title        => $data->{'title'},
192
            title        => $biblio->title,
192
            author       => $data->{'author'},
193
            author       => $biblio->author,
193
        }
194
        }
194
    );
195
    );
195
}
196
}
196
- 

Return to bug 18262