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

(-)a/C4/Acquisition.pm (-1 / +1 lines)
Lines 3021-3027 sub NotifyOrderUsers { Link Here
3021
    for my $borrowernumber (@borrowernumbers) {
3021
    for my $borrowernumber (@borrowernumbers) {
3022
        my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber );
3022
        my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber );
3023
        my $library = Koha::Libraries->find( $borrower->{branchcode} )->unblessed;
3023
        my $library = Koha::Libraries->find( $borrower->{branchcode} )->unblessed;
3024
        my $biblio = C4::Biblio::GetBiblio( $order->{biblionumber} );
3024
        my $biblio = Koha::Biblios->find( $order->{biblionumber} )->unblessed;
3025
        my $letter = C4::Letters::GetPreparedLetter(
3025
        my $letter = C4::Letters::GetPreparedLetter(
3026
            module      => 'acquisition',
3026
            module      => 'acquisition',
3027
            letter_code => 'ACQ_NOTIF_ON_RECEIV',
3027
            letter_code => 'ACQ_NOTIF_ON_RECEIV',
(-)a/C4/Biblio.pm (-20 lines)
Lines 63-69 BEGIN { Link Here
63
63
64
    # to get something
64
    # to get something
65
    push @EXPORT, qw(
65
    push @EXPORT, qw(
66
      GetBiblio
67
      GetBiblioData
66
      GetBiblioData
68
      GetMarcBiblio
67
      GetMarcBiblio
69
      GetBiblioItemData
68
      GetBiblioItemData
Lines 962-986 sub GetISBDView { Link Here
962
    return $res;
961
    return $res;
963
}
962
}
964
963
965
=head2 GetBiblio
966
967
  my $biblio = &GetBiblio($biblionumber);
968
969
=cut
970
971
sub GetBiblio {
972
    my ($biblionumber) = @_;
973
    my $dbh            = C4::Context->dbh;
974
    my $sth            = $dbh->prepare("SELECT * FROM biblio WHERE biblionumber = ?");
975
    my $count          = 0;
976
    my @results;
977
    $sth->execute($biblionumber);
978
    if ( my $data = $sth->fetchrow_hashref ) {
979
        return $data;
980
    }
981
    return;
982
}    # sub GetBiblio
983
984
=head2 GetBiblioItemInfosOf
964
=head2 GetBiblioItemInfosOf
985
965
986
  GetBiblioItemInfosOf(@biblioitemnumbers);
966
  GetBiblioItemInfosOf(@biblioitemnumbers);
(-)a/C4/ILSDI/Services.pm (-9 / +10 lines)
Lines 421-426 sub GetPatronInfo { Link Here
421
            my $item = GetBiblioFromItemNumber( $reserve->{'itemnumber'}, undef );
421
            my $item = GetBiblioFromItemNumber( $reserve->{'itemnumber'}, undef );
422
            my $library = Koha::Libraries->find( $reserve->{branchcode} );
422
            my $library = Koha::Libraries->find( $reserve->{branchcode} );
423
            my $branchname = $library ? $library->branchname : '';
423
            my $branchname = $library ? $library->branchname : '';
424
            my $biblio = Koha::Biblios->find( $reserve->{biblionumber} );
424
425
425
            # Remove unwanted fields
426
            # Remove unwanted fields
426
            delete $item->{'more_subfields_xml'};
427
            delete $item->{'more_subfields_xml'};
Lines 428-434 sub GetPatronInfo { Link Here
428
            # Add additional fields
429
            # Add additional fields
429
            $reserve->{'item'}       = $item;
430
            $reserve->{'item'}       = $item;
430
            $reserve->{'branchname'} = $branchname;
431
            $reserve->{'branchname'} = $branchname;
431
            $reserve->{'title'}      = GetBiblio( $reserve->{'biblionumber'} )->{'title'};
432
            $reserve->{'title'}      = $biblio ? $biblio->title : ''; # Just in case, but should not be needed
432
        }
433
        }
433
        $borrower->{'holds'}->{'hold'} = \@reserves;
434
        $borrower->{'holds'}->{'hold'} = \@reserves;
434
    }
435
    }
Lines 624-633 sub HoldTitle { Link Here
624
625
625
    # Get the biblio record, or return an error code
626
    # Get the biblio record, or return an error code
626
    my $biblionumber = $cgi->param('bib_id');
627
    my $biblionumber = $cgi->param('bib_id');
627
    my $biblio = GetBiblio( $biblionumber );
628
    my $biblio = Koha::Biblios->find( $biblionumber );
628
    return { code => 'RecordNotFound' } unless $$biblio{biblionumber};
629
    return { code => 'RecordNotFound' } unless $biblio;
629
    
630
630
    my $title = $$biblio{title};
631
    my $title = $biblio ? $biblio->title : '';
631
632
632
    # Check if the biblio can be reserved
633
    # Check if the biblio can be reserved
633
    return { code => 'NotHoldable' } unless CanBookBeReserved( $borrowernumber, $biblionumber ) eq 'OK';
634
    return { code => 'NotHoldable' } unless CanBookBeReserved( $borrowernumber, $biblionumber ) eq 'OK';
Lines 692-701 sub HoldItem { Link Here
692
693
693
    # Get the biblio or return an error code
694
    # Get the biblio or return an error code
694
    my $biblionumber = $cgi->param('bib_id');
695
    my $biblionumber = $cgi->param('bib_id');
695
    my $biblio = GetBiblio($biblionumber);
696
    my $biblio = Koha::Biblios->find( $biblionumber );
696
    return { code => 'RecordNotFound' } unless $$biblio{biblionumber};
697
    return { code => 'RecordNotFound' } unless $biblio;
697
698
698
    my $title = $$biblio{title};
699
    my $title = $biblio ? $biblio->title : '';
699
700
700
    # Get the item or return an error code
701
    # Get the item or return an error code
701
    my $itemnumber = $cgi->param('item_id');
702
    my $itemnumber = $cgi->param('item_id');
Lines 703-709 sub HoldItem { Link Here
703
    return { code => 'RecordNotFound' } unless $$item{itemnumber};
704
    return { code => 'RecordNotFound' } unless $$item{itemnumber};
704
705
705
    # If the biblio does not match the item, return an error code
706
    # If the biblio does not match the item, return an error code
706
    return { code => 'RecordNotFound' } if $$item{biblionumber} ne $$biblio{biblionumber};
707
    return { code => 'RecordNotFound' } if $$item{biblionumber} ne $biblio->biblionumber;
707
708
708
    # Check for item disponibility
709
    # Check for item disponibility
709
    my $canitembereserved = C4::Reserves::CanItemBeReserved( $borrowernumber, $itemnumber );
710
    my $canitembereserved = C4::Reserves::CanItemBeReserved( $borrowernumber, $itemnumber );
(-)a/C4/ImportBatch.pm (-4 / +4 lines)
Lines 662-668 sub BatchCommitRecords { Link Here
662
            $recordid = $record_match;
662
            $recordid = $record_match;
663
            my $oldxml;
663
            my $oldxml;
664
            if ($record_type eq 'biblio') {
664
            if ($record_type eq 'biblio') {
665
                my $oldbiblio = GetBiblio($recordid);
665
                my $oldbiblio = Koha::Biblios->find( $recordid );
666
                $oldxml = GetXmlBiblio($recordid);
666
                $oldxml = GetXmlBiblio($recordid);
667
667
668
                # remove item fields so that they don't get
668
                # remove item fields so that they don't get
Lines 674-680 sub BatchCommitRecords { Link Here
674
                }
674
                }
675
                $oldxml = $old_marc->as_xml($marc_type);
675
                $oldxml = $old_marc->as_xml($marc_type);
676
676
677
                ModBiblio($marc_record, $recordid, $oldbiblio->{'frameworkcode'});
677
                ModBiblio($marc_record, $recordid, $oldbiblio->frameworkcode);
678
                $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?";
678
                $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?";
679
679
680
                if ($item_result eq 'create_new' || $item_result eq 'replace') {
680
                if ($item_result eq 'create_new' || $item_result eq 'replace') {
Lines 865-877 sub BatchRevertRecords { Link Here
865
            my $old_record = MARC::Record->new_from_xml(StripNonXmlChars($rowref->{'marcxml_old'}), 'UTF-8', $rowref->{'encoding'}, $marc_type);
865
            my $old_record = MARC::Record->new_from_xml(StripNonXmlChars($rowref->{'marcxml_old'}), 'UTF-8', $rowref->{'encoding'}, $marc_type);
866
            if ($record_type eq 'biblio') {
866
            if ($record_type eq 'biblio') {
867
                my $biblionumber = $rowref->{'matched_biblionumber'};
867
                my $biblionumber = $rowref->{'matched_biblionumber'};
868
                my $oldbiblio = GetBiblio($biblionumber);
868
                my $oldbiblio = Koha::Biblios->find( $biblionumber );
869
869
870
                $logger->info("C4::ImportBatch::BatchRevertRecords: Biblio record $biblionumber does not exist, restoration of this record was skipped") unless $oldbiblio;
870
                $logger->info("C4::ImportBatch::BatchRevertRecords: Biblio record $biblionumber does not exist, restoration of this record was skipped") unless $oldbiblio;
871
                next unless $oldbiblio; # Record has since been deleted. Deleted records should stay deleted.
871
                next unless $oldbiblio; # Record has since been deleted. Deleted records should stay deleted.
872
872
873
                $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
873
                $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
874
                ModBiblio($old_record, $biblionumber, $oldbiblio->{'frameworkcode'});
874
                ModBiblio($old_record, $biblionumber, $oldbiblio->frameworkcode);
875
            } else {
875
            } else {
876
                my $authid = $rowref->{'matched_authid'};
876
                my $authid = $rowref->{'matched_authid'};
877
                ModAuthority($authid, $old_record, GuessAuthTypeCode($old_record));
877
                ModAuthority($authid, $old_record, GuessAuthTypeCode($old_record));
(-)a/C4/Serials.pm (-4 / +4 lines)
Lines 1483-1496 sub NewSubscription { Link Here
1483
    logaction( "SERIAL", "ADD", $subscriptionid, "" ) if C4::Context->preference("SubscriptionLog");
1483
    logaction( "SERIAL", "ADD", $subscriptionid, "" ) if C4::Context->preference("SubscriptionLog");
1484
1484
1485
    #set serial flag on biblio if not already set.
1485
    #set serial flag on biblio if not already set.
1486
    my $bib = GetBiblio($biblionumber);
1486
    my $biblio = Koha::Biblios->find( $biblionumber );
1487
    if ( $bib and !$bib->{'serial'} ) {
1487
    if ( $biblio and !$biblio->serial ) {
1488
        my $record = GetMarcBiblio($biblionumber);
1488
        my $record = GetMarcBiblio($biblionumber);
1489
        my ( $tag, $subf ) = GetMarcFromKohaField( 'biblio.serial', $bib->{'frameworkcode'} );
1489
        my ( $tag, $subf ) = GetMarcFromKohaField( 'biblio.serial', $biblio->frameworkcode );
1490
        if ($tag) {
1490
        if ($tag) {
1491
            eval { $record->field($tag)->update( $subf => 1 ); };
1491
            eval { $record->field($tag)->update( $subf => 1 ); };
1492
        }
1492
        }
1493
        ModBiblio( $record, $biblionumber, $bib->{'frameworkcode'} );
1493
        ModBiblio( $record, $biblionumber, $biblio->frameworkcode );
1494
    }
1494
    }
1495
    return $subscriptionid;
1495
    return $subscriptionid;
1496
}
1496
}
(-)a/Koha/REST/V1/Hold.pm (-2 / +2 lines)
Lines 75-81 sub add { Link Here
75
        $biblionumber ||= $item_biblionumber;
75
        $biblionumber ||= $item_biblionumber;
76
    }
76
    }
77
77
78
    my $biblio = C4::Biblio::GetBiblio($biblionumber);
78
    my $biblio = Koha::Biblios->find( $biblionumber );
79
79
80
    my $can_reserve =
80
    my $can_reserve =
81
      $itemnumber
81
      $itemnumber
Lines 98-104 sub add { Link Here
98
98
99
    my $reserve_id = C4::Reserves::AddReserve($branchcode, $borrowernumber,
99
    my $reserve_id = C4::Reserves::AddReserve($branchcode, $borrowernumber,
100
        $biblionumber, undef, $priority, undef, $expirationdate, undef,
100
        $biblionumber, undef, $priority, undef, $expirationdate, undef,
101
        $biblio->{title}, $itemnumber);
101
        $biblio->title, $itemnumber);
102
102
103
    unless ($reserve_id) {
103
    unless ($reserve_id) {
104
        return $c->$cb({
104
        return $c->$cb({
(-)a/catalogue/imageviewer.pl (-3 / +2 lines)
Lines 44-52 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
44
44
45
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
45
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
46
my $imagenumber = $query->param('imagenumber');
46
my $imagenumber = $query->param('imagenumber');
47
my $biblio = GetBiblio($biblionumber);
47
my $biblio = Koha::Biblios->find( $biblionumber );
48
my $biblio_object = Koha::Biblios->find( $biblionumber ); # This should replace $biblio
48
my $itemcount = $biblio->items->count;;
49
my $itemcount = $biblio_object->items->count;;
50
49
51
my @items = GetItemsInfo($biblionumber);
50
my @items = GetItemsInfo($biblionumber);
52
51
(-)a/catalogue/issuehistory.pl (-6 / +5 lines)
Lines 27-32 use C4::Circulation; # GetBiblioIssues Link Here
27
use C4::Biblio;    # GetBiblio GetBiblioFromItemNumber
27
use C4::Biblio;    # GetBiblio GetBiblioFromItemNumber
28
use C4::Search;		# enabled_staff_search_views
28
use C4::Search;		# enabled_staff_search_views
29
29
30
use Koha::Biblios;
31
30
my $query = new CGI;
32
my $query = new CGI;
31
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32
    {
34
    {
Lines 38-57 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
38
    }
40
    }
39
);
41
);
40
42
41
# getting cgi params.
43
my $biblionumber = $query->param('biblionumber');
42
my $params = $query->Vars;
43
44
my $biblionumber = $params->{'biblionumber'};
45
44
46
if (C4::Context->preference("HidePatronName")) {
45
if (C4::Context->preference("HidePatronName")) {
47
   $template->param(HidePatronName => 1);
46
   $template->param(HidePatronName => 1);
48
}
47
}
49
48
50
my $issues = GetBiblioIssues($biblionumber);
49
my $issues = GetBiblioIssues($biblionumber);
51
my $biblio = GetBiblio($biblionumber);
50
my $biblio = Koha::Biblios->find( $biblionumber );
52
$template->param(%$biblio);
53
51
54
$template->param(
52
$template->param(
53
    biblio       => $biblio,
55
    total        => scalar @$issues,
54
    total        => scalar @$issues,
56
    issues       => $issues,
55
    issues       => $issues,
57
	issuehistoryview => 1,
56
	issuehistoryview => 1,
(-)a/catalogue/itemsearch.pl (-1 / +2 lines)
Lines 28-33 use C4::Biblio; Link Here
28
use C4::Koha;
28
use C4::Koha;
29
29
30
use Koha::AuthorisedValues;
30
use Koha::AuthorisedValues;
31
use Koha::Biblios;
31
use Koha::Item::Search::Field qw(GetItemSearchFields);
32
use Koha::Item::Search::Field qw(GetItemSearchFields);
32
use Koha::ItemTypes;
33
use Koha::ItemTypes;
33
use Koha::Libraries;
34
use Koha::Libraries;
Lines 226-232 if (scalar keys %params > 0) { Link Here
226
        }
227
        }
227
228
228
        foreach my $item (@$results) {
229
        foreach my $item (@$results) {
229
            $item->{biblio} = GetBiblio($item->{biblionumber});
230
            $item->{biblio} = Koha::Biblios->find( $item->{biblionumber} );
230
            ($item->{biblioitem}) = GetBiblioItemByBiblioNumber($item->{biblionumber});
231
            ($item->{biblioitem}) = GetBiblioItemByBiblioNumber($item->{biblionumber});
231
            $item->{status} = $notforloan_map->{$item->{notforloan}};
232
            $item->{status} = $notforloan_map->{$item->{notforloan}};
232
            if (defined $item->{location}) {
233
            if (defined $item->{location}) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt (-5 / +5 lines)
Lines 2-8 Link Here
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Catalog &rsaquo; Checkout history for [% title |html %]</title>
5
<title>Koha &rsaquo; Catalog &rsaquo; Checkout history for [% biblio.title |html %]</title>
6
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
7
<link rel="stylesheet" href="[% interface %]/[% theme %]/css/datatables.css" />
7
<link rel="stylesheet" href="[% interface %]/[% theme %]/css/datatables.css" />
8
[% INCLUDE 'datatables.inc' %]
8
[% INCLUDE 'datatables.inc' %]
Lines 23-29 $(document).ready(function() { Link Here
23
[% INCLUDE 'header.inc' %]
23
[% INCLUDE 'header.inc' %]
24
[% INCLUDE 'cat-search.inc' %]
24
[% INCLUDE 'cat-search.inc' %]
25
25
26
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Checkout history for <i>[% title |html %]</i></div>
26
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Checkout history for <i>[% biblio.title |html %]</i></div>
27
27
28
<div id="doc3" class="yui-t2">
28
<div id="doc3" class="yui-t2">
29
29
Lines 31-38 $(document).ready(function() { Link Here
31
	<div id="yui-main">
31
	<div id="yui-main">
32
	<div class="yui-b">
32
	<div class="yui-b">
33
33
34
<h1>Checkout history for [% title |html %]</h1>
34
<h1>Checkout history for [% biblio.title |html %]</h1>
35
[% IF ( author ) %]<h3>by [% author %]</h3>[% END %]
35
[% IF biblio.author %]<h3>by [% biblio.author %]</h3>[% END %]
36
36
37
<div class="searchresults">
37
<div class="searchresults">
38
    [% IF ( issues ) %]
38
    [% IF ( issues ) %]
Lines 94-100 $(document).ready(function() { Link Here
94
		</table>
94
		</table>
95
    [% ELSE %]
95
    [% ELSE %]
96
        <div class="dialog message"><p>
96
        <div class="dialog message"><p>
97
        <b>[% title |html %][% IF ( author ) %], by [% author %][% END %]</b> has never been checked out.</p></div>
97
        <b>[% biblio.title |html %][% IF biblio.author %], by [% biblio.author %][% END %]</b> has never been checked out.</p></div>
98
98
99
    [% END %]
99
    [% END %]
100
</div>
100
</div>
(-)a/opac/opac-imageviewer.pl (-1 / +3 lines)
Lines 26-31 use C4::Biblio; Link Here
26
use C4::Output;
26
use C4::Output;
27
use C4::Images;
27
use C4::Images;
28
28
29
use Koha::Biblios;
30
29
my $query = new CGI;
31
my $query = new CGI;
30
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
31
    {
33
    {
Lines 38-44 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
38
40
39
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
41
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
40
my $imagenumber = $query->param('imagenumber');
42
my $imagenumber = $query->param('imagenumber');
41
my $biblio = GetBiblio($biblionumber);
43
my $biblio = Koha::Biblios->find( $biblionumber );
42
44
43
if ( C4::Context->preference("OPACLocalCoverImages") ) {
45
if ( C4::Context->preference("OPACLocalCoverImages") ) {
44
    my @images = ListImagesForBiblio($biblionumber);
46
    my @images = ListImagesForBiblio($biblionumber);
(-)a/reports/orders_by_fund.pl (-2 / +4 lines)
Lines 34-39 use C4::Budgets; Link Here
34
use C4::Biblio;
34
use C4::Biblio;
35
use C4::Reports;
35
use C4::Reports;
36
use C4::Acquisition; #GetBasket()
36
use C4::Acquisition; #GetBasket()
37
use Koha::Biblios;
37
use Koha::DateUtils;
38
use Koha::DateUtils;
38
39
39
my $query = new CGI;
40
my $query = new CGI;
Lines 97-109 if ( $get_orders ) { Link Here
97
    # Format the order's informations
98
    # Format the order's informations
98
    foreach my $order (@orders) {
99
    foreach my $order (@orders) {
99
        # Get the title of the ordered item
100
        # Get the title of the ordered item
100
        my $biblio = C4::Biblio::GetBiblio($order->{'biblionumber'});
101
        my $biblio = Koha::Biblios->find( $order->{biblionumber} );
101
        my $basket = C4::Acquisition::GetBasket($order->{'basketno'});
102
        my $basket = C4::Acquisition::GetBasket($order->{'basketno'});
102
103
103
        $order->{'basketname'} = $basket->{'basketname'};
104
        $order->{'basketname'} = $basket->{'basketname'};
104
        $order->{'authorisedbyname'} = $basket->{'authorisedbyname'};
105
        $order->{'authorisedbyname'} = $basket->{'authorisedbyname'};
105
106
106
        $order->{'title'} = $biblio->{'title'} || $order->{'biblionumber'};
107
        $order->{title} = $biblio ? $biblio->title : '';
108
        $order->{title} ||= $order->{biblionumber};
107
109
108
        $order->{'total_rrp'} = $order->{'quantity'} * $order->{'rrp'};
110
        $order->{'total_rrp'} = $order->{'quantity'} * $order->{'rrp'};
109
        $order->{'total_ecost'} = $order->{'quantity'} * $order->{'ecost'};
111
        $order->{'total_ecost'} = $order->{'quantity'} * $order->{'ecost'};
(-)a/serials/subscription-history.pl (-2 / +3 lines)
Lines 35-40 use C4::Output; Link Here
35
35
36
use C4::Biblio;
36
use C4::Biblio;
37
use C4::Serials;
37
use C4::Serials;
38
use Koha::Biblios;
38
use Koha::DateUtils;
39
use Koha::DateUtils;
39
40
40
my $input = new CGI;
41
my $input = new CGI;
Lines 72-82 if($op && $op eq 'mod') { Link Here
72
    exit;
73
    exit;
73
} else {
74
} else {
74
    my $history = GetSubscriptionHistoryFromSubscriptionId($subscriptionid);
75
    my $history = GetSubscriptionHistoryFromSubscriptionId($subscriptionid);
75
    my $biblio  = GetBiblio($history->{'biblionumber'});
76
    my $biblio  = Koha::Biblios->find( $history->{biblionumber} );
76
77
77
    $template->param(
78
    $template->param(
78
        subscriptionid  => $subscriptionid,
79
        subscriptionid  => $subscriptionid,
79
        title           => $biblio->{'title'},
80
        title           => $biblio->title,
80
        histstartdate   => $history->{'histstartdate'},
81
        histstartdate   => $history->{'histstartdate'},
81
        histenddate     => $history->{'histenddate'},
82
        histenddate     => $history->{'histenddate'},
82
        receivedlist    => $history->{'recievedlist'},
83
        receivedlist    => $history->{'recievedlist'},
(-)a/t/db_dependent/Acquisition.t (-4 / +4 lines)
Lines 502-508 ok((not defined $error), "DelOrder does not fail"); Link Here
502
$order1 = GetOrder($order1->{ordernumber});
502
$order1 = GetOrder($order1->{ordernumber});
503
ok((defined $order1->{datecancellationprinted}), "order is cancelled");
503
ok((defined $order1->{datecancellationprinted}), "order is cancelled");
504
ok((not defined $order1->{cancellationreason}), "order has no cancellation reason");
504
ok((not defined $order1->{cancellationreason}), "order has no cancellation reason");
505
ok((defined GetBiblio($order1->{biblionumber})), "biblio still exists");
505
ok((defined Koha::Biblios->find( $order1->{biblionumber} )), "biblio still exists");
506
506
507
$order2 = GetOrder($ordernumbers[1]);
507
$order2 = GetOrder($ordernumbers[1]);
508
$error = DelOrder($order2->{biblionumber}, $order2->{ordernumber}, 1);
508
$error = DelOrder($order2->{biblionumber}, $order2->{ordernumber}, 1);
Lines 510-516 ok((not defined $error), "DelOrder does not fail"); Link Here
510
$order2 = GetOrder($order2->{ordernumber});
510
$order2 = GetOrder($order2->{ordernumber});
511
ok((defined $order2->{datecancellationprinted}), "order is cancelled");
511
ok((defined $order2->{datecancellationprinted}), "order is cancelled");
512
ok((not defined $order2->{cancellationreason}), "order has no cancellation reason");
512
ok((not defined $order2->{cancellationreason}), "order has no cancellation reason");
513
ok((not defined GetBiblio($order2->{biblionumber})), "biblio does not exist anymore");
513
ok((not defined Koha::Biblios->find( $order2->{biblionumber} )), "biblio does not exist anymore");
514
514
515
my $order4 = GetOrder($ordernumbers[3]);
515
my $order4 = GetOrder($ordernumbers[3]);
516
$error = DelOrder($order4->{biblionumber}, $order4->{ordernumber}, 1, "foobar");
516
$error = DelOrder($order4->{biblionumber}, $order4->{ordernumber}, 1, "foobar");
Lines 518-531 ok((not defined $error), "DelOrder does not fail"); Link Here
518
$order4 = GetOrder($order4->{ordernumber});
518
$order4 = GetOrder($order4->{ordernumber});
519
ok((defined $order4->{datecancellationprinted}), "order is cancelled");
519
ok((defined $order4->{datecancellationprinted}), "order is cancelled");
520
ok(($order4->{cancellationreason} eq "foobar"), "order has cancellation reason \"foobar\"");
520
ok(($order4->{cancellationreason} eq "foobar"), "order has cancellation reason \"foobar\"");
521
ok((not defined GetBiblio($order4->{biblionumber})), "biblio does not exist anymore");
521
ok((not defined Koha::Biblios->find( $order4->{biblionumber} )), "biblio does not exist anymore");
522
522
523
my $order5 = GetOrder($ordernumbers[4]);
523
my $order5 = GetOrder($ordernumbers[4]);
524
C4::Items::AddItem( { barcode => '0102030405' }, $order5->{biblionumber} );
524
C4::Items::AddItem( { barcode => '0102030405' }, $order5->{biblionumber} );
525
$error = DelOrder($order5->{biblionumber}, $order5->{ordernumber}, 1);
525
$error = DelOrder($order5->{biblionumber}, $order5->{ordernumber}, 1);
526
$order5 = GetOrder($order5->{ordernumber});
526
$order5 = GetOrder($order5->{ordernumber});
527
ok((defined $order5->{datecancellationprinted}), "order is cancelled");
527
ok((defined $order5->{datecancellationprinted}), "order is cancelled");
528
ok(GetBiblio($order5->{biblionumber}), "biblio still exists");
528
ok((defined Koha::Biblios->find( $order5->{biblionumber} )), "biblio still exists");
529
529
530
# End of tests for DelOrder
530
# End of tests for DelOrder
531
531
(-)a/tools/batch_record_modification.pl (-2 / +3 lines)
Lines 29-34 use C4::AuthoritiesMarc qw( BuildSummary ModAuthority ); Link Here
29
use C4::BackgroundJob;
29
use C4::BackgroundJob;
30
use C4::Biblio qw( GetMarcBiblio ModBiblio );
30
use C4::Biblio qw( GetMarcBiblio ModBiblio );
31
use C4::MarcModificationTemplates qw( GetModificationTemplateActions GetModificationTemplates ModifyRecordWithTemplate );
31
use C4::MarcModificationTemplates qw( GetModificationTemplateActions GetModificationTemplates ModifyRecordWithTemplate );
32
33
use Koha::Biblios;
32
use Koha::MetadataRecord::Authority;
34
use Koha::MetadataRecord::Authority;
33
35
34
my $input = new CGI;
36
my $input = new CGI;
Lines 116-122 if ( $op eq 'form' ) { Link Here
116
    for my $record_id ( uniq @record_ids ) {
118
    for my $record_id ( uniq @record_ids ) {
117
        if ( $recordtype eq 'biblio' ) {
119
        if ( $recordtype eq 'biblio' ) {
118
            # Retrieve biblio information
120
            # Retrieve biblio information
119
            my $biblio = C4::Biblio::GetBiblio( $record_id );
121
            my $biblio = Koha::Biblios->find( $record_id );
120
            unless ( $biblio ) {
122
            unless ( $biblio ) {
121
                push @messages, {
123
                push @messages, {
122
                    type => 'warning',
124
                    type => 'warning',
123
- 

Return to bug 18260