From 8b393d9bd981f8f1f412a2379c07021cc106f419 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Fri, 4 Dec 2020 16:00:31 +1300 Subject: [PATCH] Bug 16522: Adding 773 to cart and list displays and emails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This enhancement adds information from a host item entry and a link if applicable to the host record in the following places: - staff client list - staff client cart - staff client send list email - staff client send cart email - staff client search results - staff client detail page - opac list - opac cart - opac send list email email - opac send cart email - opac search results - opac detail page To test: 1. apply patch, restart services 2. log into the staff client and enable the syspref EasyAnalyticalRecords 3. find a record with an item. take note of the barcode. 4. go to another record (biblio 2). click Edit -> Link to host record 5. enter the barcode in the input and submit. 6. click the MARC tab and confirm the host record has been linked under MARC field 773. 7. add biblio 2 to your cart, and to a list. 8. go to your cart. confirm you see the 'host item entry' link. 9. click on 'more details' and confirm you see the 'host item entries' link. 10. click 'send' to email the cart. confirm the email contains the host item entry and the link sends you to the catalogue page for the record in the OPAC. 11. go to the list you added the record to. confirm you see the 'source' link for the host item entry. 12. click 'send list' to email the list. confirm the email contains the host item entry and the link sends you to the catalogue page for the record in the OPAC. 13. log into the OPAC. repeat steps 7 to 12 on the OPAC and confirm they all pass as expected. 14. Confirm host item info also shows correctly on the OPAC and staff client search results, and the OPAC and staff client detail pages (where XSLT is used) 15. Delete the 773$w and confirm host item info still shows correctly but no longer links to biblio 16. confirm tests pass t/db_dependent/Koha/Biblio/host_record.t Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ) Signed-off-by: Katrin Fischer --- basket/basket.pl | 1 + basket/sendbasket.pl | 1 + .../prog/en/modules/basket/basket.tt | 20 +++++++ .../prog/en/modules/basket/sendbasket.tt | 10 ++++ .../en/modules/virtualshelves/sendshelf.tt | 10 ++++ .../en/xslt/MARC21slim2intranetResults.xsl | 54 +++++++++++++++++-- .../bootstrap/en/modules/opac-basket.tt | 21 ++++++++ .../bootstrap/en/modules/opac-sendbasket.tt | 10 ++++ .../bootstrap/en/modules/opac-sendshelf.tt | 10 ++++ .../en/xslt/MARC21slim2OPACResults.xsl | 54 +++++++++++++++++-- opac/opac-basket.pl | 1 + opac/opac-sendbasket.pl | 1 + opac/opac-sendshelf.pl | 1 + virtualshelves/sendshelf.pl | 1 + 14 files changed, 185 insertions(+), 10 deletions(-) diff --git a/basket/basket.pl b/basket/basket.pl index 7aeed4df646..c1e76ebb2a9 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -96,6 +96,7 @@ foreach my $biblionumber ( @bibs ) { $dat->{MARCSERIES} = $marcseriesarray; $dat->{MARCURLS} = $marcurlsarray; $dat->{HASAUTHORS} = $hasauthors; + $dat->{HOSTITEMENTRIES} = $biblio->get_marc_host; push( @results, $dat ); } diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index 21e42050a02..f6740eb1b33 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -86,6 +86,7 @@ if ( $email_add ) { $dat->{HASAUTHORS} = $hasauthors; $dat->{'biblionumber'} = $biblionumber; $dat->{ITEM_RESULTS} = $biblio->items->search_ordered; + $dat->{HOSTITEMENTRIES} = $biblio->get_marc_host; $iso2709 .= $record->as_usmarc(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt index 50c83759f28..9f8453b98d9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt @@ -219,6 +219,19 @@ [% END %] + [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] + + Host item entries + + [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] +

+ [% INCLUDE 'biblio-title.inc' link = 1 biblio=entry %] +

+ [% END %] + + + [% END %] + Location(s) @@ -285,6 +298,13 @@ [% IF ( BIBLIO_RESULT.notes ) %]

[% BIBLIO_RESULT.notes | html %]

[% END %] + [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] + [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] +

Host item entry: + [% INCLUDE 'biblio-title.inc' link = 1 biblio=entry %] +

+ [% END %] + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt index c6082787ccb..88ec0af7521 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt @@ -127,6 +127,16 @@ Your cart LCCN: [% BIBLIO_RESULT.lccn | $raw %]
[% END %] + + [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] + [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] + Host item entry: + [% INCLUDE 'biblio-title.inc' link = 1 biblio=entry %] + +
+ [% END %] + [% END %] + [% IF ( BIBLIO_RESULT.url ) %] URL: [% BIBLIO_RESULT.url | html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt index 5ee9a72f064..9eb6f845ca9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt @@ -134,6 +134,16 @@ Your list: [% shelfname | $raw %] LCCN: [% BIBLIO_RESULT.lccn | $raw %]
[% END %] + + [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] + [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] + Host item entry: + [% INCLUDE 'biblio-title.inc' link = 1 biblio=entry %] + +
+ [% END %] + [% END %] + [% IF ( BIBLIO_RESULT.url ) %] URL: [% BIBLIO_RESULT.url | html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl index 94fd5e40390..d8091ce483f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -929,13 +929,57 @@ + - - - Source: - - + + + + + Source: + + + + + + + + + + + + + a_t + + + + + + + /cgi-bin/koha/catalogue/search.pl?q=Control-number: + + + + + /cgi-bin/koha/catalogue/detail.pl?biblionumber= + + + + + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + + + + + + + + + + + + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt index 4e6219c0bd6..f0e81a5d3db 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -234,6 +234,19 @@ [% END %] + [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] + + Host item entries + + [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] +

+ [% INCLUDE 'biblio-title.inc' biblio=entry %] +

+ [% END %] + + + [% END %] + Location(s) (Status) @@ -292,6 +305,14 @@ [% IF ( TagsInputEnabled && loggedinusername ) %] [% END %] + + [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] + [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] +

Host item entry: + [% INCLUDE 'biblio-title.inc' biblio=entry %] +

+ [% END %] + [% END %] [% BIBLIO_RESULT.author | html %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt index b75320530c4..6c9e0e35fac 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt @@ -132,6 +132,16 @@ Your cart LCCN: [% BIBLIO_RESULT.lccn | $raw %]
[% END %] + + [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] + [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] + Host item entry: + [% INCLUDE 'biblio-title.inc' biblio=entry %] + +
+ [% END %] + [% END %] + [% IF ( BIBLIO_RESULT.url ) %] URL: [% BIBLIO_RESULT.url | html %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt index 168dce74be8..c7a893a6718 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt @@ -135,6 +135,16 @@ Your list : [% shelfname | $raw %] LCCN: [% BIBLIO_RESULT.lccn | $raw %]
[% END %] + + [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] + [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] + Host item entry: + [% INCLUDE 'biblio-title.inc' biblio=entry %] + +
+ [% END %] + [% END %] + [% IF ( BIBLIO_RESULT.url ) %] URL: [% BIBLIO_RESULT.url | html %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl index f28277038a6..631076b7b71 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -660,13 +660,57 @@ + - -
- Source: - -
+ + + + +
+
+
diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index eb4ac974d22..18a00f45e3c 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -140,6 +140,7 @@ foreach my $biblionumber ( @bibs ) { $dat->{MARCSERIES} = $marcseriesarray; $dat->{MARCURLS} = $marcurlsarray; $dat->{HASAUTHORS} = $hasauthors; + $dat->{HOSTITEMENTRIES} = $biblio->get_marc_host; push( @results, $dat ); } diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index 15004465390..35860f5f882 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -97,6 +97,7 @@ if ( $email_add ) { $dat->{HASAUTHORS} = $hasauthors; $dat->{'biblionumber'} = $biblionumber; $dat->{ITEM_RESULTS} = $items; + $dat->{HOSTITEMENTRIES} = $biblio->get_marc_host; $iso2709 .= $record->as_usmarc(); diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index b9cec96b244..96c36c1cf0f 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -102,6 +102,7 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { $dat->{'biblionumber'} = $biblionumber; $dat->{ITEM_RESULTS} = $items; $dat->{HASAUTHORS} = $dat->{'author'} || @$marcauthorsarray; + $dat->{HOSTITEMENTRIES} = $biblio->get_marc_host; $iso2709 .= $record->as_usmarc(); diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index 0dd51b78ea8..d9daa40b19d 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -90,6 +90,7 @@ if ($to_address) { $dat->{'biblionumber'} = $biblionumber; $dat->{ITEM_RESULTS} = $items; $dat->{HASAUTHORS} = $dat->{'author'} || @$marcauthorsarray; + $dat->{HOSTITEMENTRIES} = $biblio->get_host_item_entries; $iso2709 .= $record->as_usmarc(); -- 2.20.1