Bugzilla – Attachment 147880 Details for
Bug 3150
Move emails for sending cart and list contents into notices tool
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 3150: (follow-up) Make sure host information displays for unlinked records
Bug-3150-follow-up-Make-sure-host-information-disp.patch (text/plain), 11.19 KB, created by
Katrin Fischer
on 2023-03-07 18:05:07 UTC
(
hide
)
Description:
Bug 3150: (follow-up) Make sure host information displays for unlinked records
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-03-07 18:05:07 UTC
Size:
11.19 KB
patch
obsolete
>From 53b3772a3ff974317f94f2b72d80d1d61e3a6aad Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >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 <katrin.fischer@bsz-bw.de> >--- > 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,<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> >@@ -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 %]<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 %] >@@ -39,6 +40,7 @@ Please note that the attached file is a MARC bibliographic records file which ca > ('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> >@@ -56,7 +58,7 @@ Please note that the attached file is a MARC bibliographic records file which ca > [% 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 %] >diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml >index c99fb0d0c6..a518ea8e54 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices.yml >+++ b/installer/data/mysql/en/mandatory/sample_notices.yml >@@ -2199,6 +2199,7 @@ tables: > - "[%- 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>" >@@ -2215,7 +2216,7 @@ tables: > - "[% 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 %]" >@@ -2234,6 +2235,7 @@ tables: > - "[%- 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>" >@@ -2250,7 +2252,7 @@ tables: > - "[% 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 %]" >diff --git a/t/db_dependent/Koha/Biblio/host_record.t b/t/db_dependent/Koha/Biblio/host_record.t >index aab1c36d02..c5c5827ad1 100755 >--- a/t/db_dependent/Koha/Biblio/host_record.t >+++ b/t/db_dependent/Koha/Biblio/host_record.t >@@ -36,7 +36,7 @@ $schema->storage->txn_begin; > 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' ); >@@ -97,6 +97,8 @@ subtest 'get_marc_host' => sub { > 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 > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 3150
:
114127
|
114545
|
114579
|
114582
|
117237
|
118313
|
120477
|
120478
|
121026
|
121027
|
121037
|
121038
|
123020
|
123021
|
123022
|
125225
|
125226
|
125227
|
125379
|
126544
|
126545
|
126546
|
126547
|
130150
|
130151
|
130152
|
130153
|
134304
|
134305
|
134306
|
134307
|
134308
|
134477
|
137690
|
137691
|
137692
|
137693
|
137694
|
137716
|
137717
|
137718
|
137719
|
137720
|
137878
|
140246
|
140247
|
140248
|
140249
|
140250
|
140251
|
140252
|
140253
|
140254
|
140255
|
140256
|
140257
|
140258
|
140259
|
145229
|
145230
|
145231
|
145232
|
145233
|
145234
|
145676
|
145677
|
145678
|
145679
|
145680
|
145681
|
146560
|
146561
|
146562
|
146563
|
146564
|
146565
|
146566
|
146858
|
146859
|
146860
|
146861
|
146862
|
146863
|
146864
|
146865
|
146866
|
146867
|
146987
|
147423
|
147868
|
147869
|
147870
|
147871
|
147872
|
147873
|
147874
|
147875
|
147876
|
147877
|
147878
|
147879
|
147880
|
148045
|
148170
|
148171
|
148172
|
148173
|
148174
|
148175
|
148176
|
148177
|
148178
|
148179
|
148180
|
148181
|
148182
|
148183
|
148184
|
148185