return $relatedparts;
}
+=head3 get_marc_hostinfo_only
+
+ my $hostinfo = $biblio->get_marc_hostinfo_only;
+
+Return host info only
+
+=cut
+
+sub get_marc_hostinfo_only {
+ my ($self) = @_;
+
+ my ( $host, $relatedparts, $hostinfo ) = $self->get_marc_host;
+
+ return $hostinfo;
+}
+
=head3 recalls
my $recalls = $biblio->recalls;
('catalogue','LIST','','Send list',1,'Your list: [% listname | html %]',"[%- USE Branches -%]
[%- USE AuthorisedValues -%]
[%- USE Koha -%]
+[%- PROCESS 'html_helpers.inc' -%]
Hi,<br><br>
[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %].<br>
Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.<br>
[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]
[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]
[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]
-[% 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 %]
+[% IF ( biblio.get_marc_host_only || biblio.get_marc_hostinfo_only ) %]In: [% IF biblio.get_marc_host_only.biblionumber %][% INCLUDE 'biblio-title.inc' biblio=biblio.get_marc_host_only %] [% biblio.get_marc_relatedparts_only %][% ELSE %][% biblio.get_marc_hostinfo_only %][% END %]<br>[% END %]
[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]
<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>
[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]
('catalogue','CART','','Send cart',1,'Your cart',"[%- USE Branches -%]
[%- USE AuthorisedValues -%]
[%- USE Koha -%]
+[%- PROCESS 'html_helpers.inc' -%]
Hi,<br><br>
[% borrower.firstname | html %] [% borrower.surname | html %] sent you a cart from our online catalog.<br>
Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.<br>
[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]
[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]
[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]
-[% 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 %]
+[% IF ( biblio.get_marc_host_only || biblio.get_marc_hostinfo_only ) %]In: [% IF biblio.get_marc_host_only.biblionumber %][% INCLUDE 'biblio-title.inc' biblio=biblio.get_marc_host_only %] [% biblio.get_marc_relatedparts_only %][% ELSE %][% biblio.get_marc_hostinfo_only %][% END %]<br>[% END %]
[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]
<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>
[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]
- "[%- USE Branches -%]"
- "[%- USE AuthorisedValues -%]"
- "[%- USE Koha -%]"
+ - "[%- PROCESS 'html_helpers.inc' -%]"
- "Hi,<br><br>"
- "[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %].<br>"
- "Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.<br>"
- "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]"
- "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]"
- "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]"
- - "[% 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 %]"
+ - "[% IF ( biblio.get_marc_host_only || biblio.get_marc_hostinfo_only ) %]In: [% IF biblio.get_marc_host_only.biblionumber %][% INCLUDE 'biblio-title.inc' biblio=biblio.get_marc_host_only %] [% biblio.get_marc_relatedparts_only %][% ELSE %][% biblio.get_marc_hostinfo_only %][% END %]<br>[% END %]"
- "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]"
- "[<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>"
- "[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]"
- "[%- USE Branches -%]"
- "[%- USE AuthorisedValues -%]"
- "[%- USE Koha -%]"
+ - "[%- PROCESS 'html_helpers.inc' -%]"
- "Hi,<br><br>"
- "[% borrower.firstname | html %] [% borrower.surname | html %] sent you a cart from our online catalog.<br>"
- "Please note that the attached file is a MARC bibliographic records file which can be imported into personal bibliographic software like EndNote, Reference Manager or ProCite.<br>"
- "[% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]<br>[% END %]"
- "[% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]<br>[% END %]"
- "[% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]<br>[% END %]"
- - "[% 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 %]"
+ - "[% IF ( biblio.get_marc_host_only || biblio.get_marc_hostinfo_only ) %]In: [% IF biblio.get_marc_host_only.biblionumber %][% INCLUDE 'biblio-title.inc' biblio=biblio.get_marc_host_only %] [% biblio.get_marc_relatedparts_only %][% ELSE %][% biblio.get_marc_hostinfo_only %][% END %]<br>[% END %]"
- "[% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]<br>[% END %]"
- "<a href='[% Koha.Preference('OpacBaseUrl') %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblio.biblionumber | html %]'>View in online catalog</a>"
- "[% IF ( biblio.items.count > 0 ) %]<br>Items: <ul>[% FOREACH item IN biblio.items %]<li>[% Branches.GetName( item.holdingbranch ) | html %]"
our $builder = t::lib::TestBuilder->new;
subtest 'get_marc_host' => sub {
- plan tests => 17;
+ plan tests => 18;
t::lib::Mocks::mock_preference( 'marcflavour', 'MARC21' );
t::lib::Mocks::mock_preference( 'MARCOrgCode', 'xyz' );
is_deeply( $host_only, $host, "Host only retrieved successfully" );
my $relatedparts_only = $bib1->get_marc_relatedparts_only;
is_deeply( $relatedparts_only, $relatedparts, "Related parts only retrieved successfully" );
+ my $hostinfo_only = $bib1->get_marc_hostinfo_only;
+ is_deeply( $hostinfo_only, $info, "Host info only retrieved successfully");
$marc->field('773')->delete_subfield( code => 't' ); # restore