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

(-)a/Koha/Biblio.pm (+32 lines)
Lines 1308-1313 sub get_marc_host { Link Here
1308
    }
1308
    }
1309
}
1309
}
1310
1310
1311
=head3 get_marc_host_only
1312
1313
    my $host = $biblio->get_marc_host_only;
1314
1315
Return host only
1316
1317
=cut
1318
1319
sub get_marc_host_only {
1320
    my ($self) = @_;
1321
1322
    my ( $host, $relatedparts ) = $self->get_marc_host;
1323
1324
    return $host;
1325
}
1326
1327
=head3 get_marc_relatedparts_only
1328
1329
    my $relatedparts = $biblio->get_marc_relatedparts_only;
1330
1331
Return related parts only
1332
1333
=cut
1334
1335
sub get_marc_relatedparts_only {
1336
    my ($self) = @_;
1337
1338
    my ( $host, $relatedparts ) = $self->get_marc_host;
1339
1340
    return $relatedparts;
1341
}
1342
1311
=head3 recalls
1343
=head3 recalls
1312
1344
1313
    my $recalls = $biblio->recalls;
1345
    my $recalls = $biblio->recalls;
(-)a/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.pl (-2 / +2 lines)
Lines 28-34 Please note that the attached file is a MARC bibliographic records file which ca Link Here
28
[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]
28
[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]
29
[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]
29
[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]
30
[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]
30
[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]
31
[% IF ( biblio.get_marc_host ) %]In: [% FOREACH entry IN biblio.get_marc_host %][% entry.title | html %][% IF ( entry.subtitle ) %][% FOREACH subtitle IN entry.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% entry.part_number | html %] [% entry.part_name | html %]<br>[% END %][% END %]
31
[% IF ( biblio.get_marc_host_only ) %]In: [% FOREACH entry IN biblio.get_marc_host_only %][% entry.title | html %][% IF ( entry.subtitle ) %][% FOREACH subtitle IN entry.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% entry.part_number | html %] [% entry.part_name | html %]<br>[% END %] [% biblio.get_marc_relatedparts_only %][% END %]
32
[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]
32
[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]
33
<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>
33
<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>
34
[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]
34
[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]
Lines 56-62 Please note that the attached file is a MARC bibliographic records file which ca Link Here
56
[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]
56
[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]
57
[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]
57
[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]
58
[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]
58
[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]
59
[% IF ( biblio.get_marc_host ) %]In: [% FOREACH entry IN biblio.get_marc_host %][% entry.title | html %][% IF ( entry.subtitle ) %][% FOREACH subtitle IN entry.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% entry.part_number | html %] [% entry.part_name | html %]<br>[% END %][% END %]
59
[% IF ( biblio.get_marc_host_only ) %]In: [% FOREACH entry IN biblio.get_marc_host_only %][% entry.title | html %][% IF ( entry.subtitle ) %][% FOREACH subtitle IN entry.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% entry.part_number | html %] [% entry.part_name | html %]<br>[% END %] [% biblio.get_marc_relatedparts_only %][% END %]
60
[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]
60
[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]
61
<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>
61
<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>
62
[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]
62
[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (-2 / +2 lines)
Lines 2215-2221 tables: Link Here
2215
            - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]"
2215
            - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]"
2216
            - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]"
2216
            - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]"
2217
            - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]"
2217
            - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]"
2218
            - "[% IF ( biblio.get_marc_host ) %]In: [% FOREACH entry IN biblio.get_marc_host %][% entry.title | html %][% IF ( entry.subtitle ) %][% FOREACH subtitle IN entry.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% entry.part_number | html %] [% entry.part_name | html %]<br>[% END %][% END %]"
2218
            - "[% IF ( biblio.get_marc_host_only ) %]In: [% FOREACH entry IN biblio.get_marc_host_only %][% entry.title | html %][% IF ( entry.subtitle ) %][% FOREACH subtitle IN entry.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% entry.part_number | html %] [% entry.part_name | html %]<br>[% END %] [% biblio.get_marc_relatedparts_only %][% END %]"
2219
            - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]"
2219
            - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]"
2220
            - "[<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>"
2220
            - "[<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>"
2221
            - "[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]"
2221
            - "[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]"
Lines 2250-2256 tables: Link Here
2250
            - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]"
2250
            - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]"
2251
            - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]"
2251
            - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]"
2252
            - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]"
2252
            - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]"
2253
            - "[% IF ( biblio.get_marc_host ) %]In: [% FOREACH entry IN biblio.get_marc_host %][% entry.title | html %][% IF ( entry.subtitle ) %][% FOREACH subtitle IN entry.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% entry.part_number | html %] [% entry.part_name | html %]<br>[% END %][% END %]"
2253
            - "[% IF ( biblio.get_marc_host_only ) %]In: [% FOREACH entry IN biblio.get_marc_host_only %][% entry.title | html %][% IF ( entry.subtitle ) %][% FOREACH subtitle IN entry.subtitle.split(' | ') %][% subtitle | html %][% END %][% END %][% entry.part_number | html %] [% entry.part_name | html %]<br>[% END %] [% biblio.get_marc_relatedparts_only %][% END %]"
2254
            - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]"
2254
            - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]"
2255
            - "<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>"
2255
            - "<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>"
2256
            - "[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]"
2256
            - "[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]"
(-)a/t/db_dependent/Koha/Biblio/host_record.t (-2 / +7 lines)
Lines 36-42 $schema->storage->txn_begin; Link Here
36
our $builder = t::lib::TestBuilder->new;
36
our $builder = t::lib::TestBuilder->new;
37
37
38
subtest 'get_marc_host' => sub {
38
subtest 'get_marc_host' => sub {
39
    plan tests => 15;
39
    plan tests => 17;
40
40
41
    t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' );
41
    t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' );
42
    t::lib::Mocks::mock_preference( 'MARCOrgCode', 'xyz' );
42
    t::lib::Mocks::mock_preference( 'MARCOrgCode', 'xyz' );
Lines 92-97 subtest 'get_marc_host' => sub { Link Here
92
    ( $host, $relatedparts, $info ) = $bib1->get_marc_host;
92
    ( $host, $relatedparts, $info ) = $bib1->get_marc_host;
93
    is( $host, undef, 'No Koha Biblio object returned with no $w' );
93
    is( $host, undef, 'No Koha Biblio object returned with no $w' );
94
    is( $info, "title, relpart", '773$atg returned when no $w' );
94
    is( $info, "title, relpart", '773$atg returned when no $w' );
95
96
    my $host_only = $bib1->get_marc_host_only;
97
    is_deeply( $host_only, $host, "Host only retrieved successfully" );
98
    my $relatedparts_only = $bib1->get_marc_relatedparts_only;
99
    is_deeply( $relatedparts_only, $relatedparts, "Related parts only retrieved successfully" );
100
95
    $marc->field('773')->delete_subfield( code => 't' ); # restore
101
    $marc->field('773')->delete_subfield( code => 't' ); # restore
96
102
97
    # Add second 773
103
    # Add second 773
98
- 

Return to bug 3150