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

(-)a/Koha/Biblio.pm (+32 lines)
Lines 1293-1298 sub get_marc_host { Link Here
1293
    }
1293
    }
1294
}
1294
}
1295
1295
1296
=head3 get_marc_host_only
1297
1298
    my $host = $biblio->get_marc_host_only;
1299
1300
Return host only
1301
1302
=cut
1303
1304
sub get_marc_host_only {
1305
    my ($self) = @_;
1306
1307
    my ( $host, $relatedparts ) = $self->get_marc_host;
1308
1309
    return $host;
1310
}
1311
1312
=head3 get_marc_relatedparts_only
1313
1314
    my $relatedparts = $biblio->get_marc_relatedparts_only;
1315
1316
Return related parts only
1317
1318
=cut
1319
1320
sub get_marc_relatedparts_only {
1321
    my ($self) = @_;
1322
1323
    my ( $host, $relatedparts ) = $self->get_marc_host;
1324
1325
    return $relatedparts;
1326
}
1327
1296
=head3 recalls
1328
=head3 recalls
1297
1329
1298
    my $recalls = $biblio->recalls;
1330
    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 2140-2146 tables: Link Here
2140
            - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]"
2140
            - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]"
2141
            - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]"
2141
            - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]"
2142
            - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]"
2142
            - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]"
2143
            - "[% 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 %]"
2143
            - "[% 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 %]"
2144
            - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]"
2144
            - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]"
2145
            - "[<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>"
2145
            - "[<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>"
2146
            - "[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]"
2146
            - "[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]"
Lines 2175-2181 tables: Link Here
2175
            - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]"
2175
            - "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]"
2176
            - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]"
2176
            - "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]"
2177
            - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]"
2177
            - "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]"
2178
            - "[% 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 %]"
2178
            - "[% 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 %]"
2179
            - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]"
2179
            - "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]"
2180
            - "<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>"
2180
            - "<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>"
2181
            - "[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]"
2181
            - "[% 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