From 53b3772a3ff974317f94f2b72d80d1d61e3a6aad Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 7 Mar 2023 17:51:09 +0000 Subject: [PATCH] Bug 3150: (follow-up) Make sure host information displays for unlinked records When the 773 entry is not linked to a record using $w or Easyanalytics we still want to display the information about the source/host item in the emails. To test: 1. Activate the UseControlNumber system preference 2. Search for a record and make sure it has 001 set to some value. 3. Use Edit > Add child record to create an analytical record from this record. 4. Make sure 773$w was filled in and finish by adding any mandatory fields, save. 5. Add this record to your cart. Also add a 773$g with the pages or similar. 6. Create another record with 773$t and $g, but without $w. 7. Also add this record to your cart. 8. Add a few other records to the cart. 9. Host item information (In: ) should display for all entries with 773 in the record. This also makes use of the biblio-title include to display the different parts of the title (245$abnp), if the record is linked. Signed-off-by: Katrin Fischer --- Koha/Biblio.pm | 16 ++++++++++++++++ .../bug_3150_-_add_LIST_and_CART_notices.pl | 6 ++++-- .../data/mysql/en/mandatory/sample_notices.yml | 6 ++++-- t/db_dependent/Koha/Biblio/host_record.t | 4 +++- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index ad1ba8812d..d08e42cf47 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -1340,6 +1340,22 @@ sub get_marc_relatedparts_only { 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; diff --git a/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.pl b/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.pl index c6525f7f10..f13178f095 100755 --- a/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.pl +++ b/installer/data/mysql/atomicupdate/bug_3150_-_add_LIST_and_CART_notices.pl @@ -11,6 +11,7 @@ return { ('catalogue','LIST','','Send list',1,'Your list: [% listname | html %]',"[%- USE Branches -%] [%- USE AuthorisedValues -%] [%- USE Koha -%] +[%- PROCESS 'html_helpers.inc' -%] Hi,

[% borrower.firstname | html %] [% borrower.surname | html %] sent you a list from our online catalog called: [% listname | html %].
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.
@@ -28,7 +29,7 @@ Please note that the attached file is a MARC bibliographic records file which ca [% IF ( biblio.unititle ) %]Unified title: [% biblio.unititle | html %]
[% END %] [% IF ( biblio.serial ) %]Serial: [% biblio.serial | html %]
[% END %] [% IF ( biblioitem.lccn ) %]LCCN: [% biblioitem.lccn | html %]
[% 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 %]
[% 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 %]
[% END %] [% IF ( biblioitem.url ) %]URL: [% biblioitem.url | html %]
[% END %] View in online catalog [% IF ( biblio.items.count > 0 ) %]
Items: