Bugzilla – Attachment 135416 Details for
Bug 16522
Add 773 (Host item entry) to the cart and list displays and e-mails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16522: Adding 773 to cart and list displays and emails
Bug-16522-Adding-773-to-cart-and-list-displays-and.patch (text/plain), 21.60 KB, created by
Aleisha Amohia
on 2022-05-27 03:49:25 UTC
(
hide
)
Description:
Bug 16522: Adding 773 to cart and list displays and emails
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2022-05-27 03:49:25 UTC
Size:
21.60 KB
patch
obsolete
>From 766db7000e570ab2e052d87726fe13d3436ed6f1 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >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 patch adds a new subroutine get_host_item_entries in the >Koha::Biblio module which retrieves any 773 fields from the biblio >record. The subroutine is used to show a host item entry and a link to >the record in the following places: >- staff client list >- staff client cart >- staff client send list email >- staff client send cart email >- opac list >- opac cart >- opac send list email email >- opac send cart email > >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. > >Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ) >--- > basket/basket.pl | 1 + > basket/sendbasket.pl | 1 + > .../intranet-tmpl/prog/en/modules/basket/basket.tt | 20 ++++++++ > .../prog/en/modules/basket/sendbasket.tt | 10 ++++ > .../prog/en/modules/virtualshelves/sendshelf.tt | 10 ++++ > .../prog/en/xslt/MARC21slim2intranetResults.xsl | 54 ++++++++++++++++++++-- > .../opac-tmpl/bootstrap/en/modules/opac-basket.tt | 21 +++++++++ > .../bootstrap/en/modules/opac-sendbasket.tt | 10 ++++ > .../bootstrap/en/modules/opac-sendshelf.tt | 10 ++++ > .../bootstrap/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 92f6561c9c..db22ef4fc8 100755 >--- a/basket/basket.pl >+++ b/basket/basket.pl >@@ -107,6 +107,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 3c53605069..c423ecbecc 100755 >--- a/basket/sendbasket.pl >+++ b/basket/sendbasket.pl >@@ -91,6 +91,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/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >index 5c62dad4f1..30b724d733 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >@@ -217,6 +217,19 @@ > </tr> > [% END %] > >+ [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <tr> >+ <th scope="row">Host item entries</th> >+ <td> >+ [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <p> >+ [% INCLUDE 'biblio-title.inc' link = 1 biblio=entry %] >+ </p> >+ [% END %] >+ </td> >+ </tr> >+ [% END %] >+ > <tr> > <th scope="row">Location(s)</th> > <td> >@@ -281,6 +294,13 @@ > [% IF ( BIBLIO_RESULT.notes ) %] > <p>[% BIBLIO_RESULT.notes | html %]</p> > [% END %] >+ [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] >+ [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <p>Host item entry: >+ [% INCLUDE 'biblio-title.inc' link = 1 biblio=entry %] >+ </p> >+ [% END %] >+ [% END %] > <!-- COinS / Openurl --> > <span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.au=[% BIBLIO_RESULT.author | html %]&rft.btitle=[% BIBLIO_RESULT.title |url %]&rft.date=[% BIBLIO_RESULT.publicationyear | html %]&rft.tpages=[% BIBLIO_RESULT.item('size') | html %]&rft.isbn=[% BIBLIO_RESULT.isbn |url %]&rft.aucorp=&rft.place=[% BIBLIO_RESULT.place | html %]&rft.pub=[% BIBLIO_RESULT.publisher |url %]&rft.edition=[% BIBLIO_RESULT.edition | html %]&rft.series=[% BIBLIO_RESULT.series | html %]&rft.genre="></span> > </td> >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 6af47706d0..5bbe37b740 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasket.tt >@@ -126,6 +126,16 @@ Your cart > LCCN: [% BIBLIO_RESULT.lccn | $raw %] > </span><br/> > [% END %] >+ >+ [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] >+ [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <span>Host item entry: >+ [% INCLUDE 'biblio-title.inc' link = 1 biblio=entry %] >+ </span> >+ <br/> >+ [% END %] >+ [% END %] >+ > [% IF ( BIBLIO_RESULT.url ) %] > <span> > 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 0310e41c5b..983542b7b3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt >@@ -132,6 +132,16 @@ Your list: [% shelfname | $raw %] > LCCN: [% BIBLIO_RESULT.lccn | $raw %] > </span><br/> > [% END %] >+ >+ [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] >+ [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <span>Host item entry: >+ [% INCLUDE 'biblio-title.inc' link = 1 biblio=entry %] >+ </span> >+ <br/> >+ [% END %] >+ [% END %] >+ > [% IF ( BIBLIO_RESULT.url ) %] > <span> > 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 ab6bbb9530..337acd7188 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >@@ -926,13 +926,57 @@ > </span> > </xsl:if> > >+ <!-- 773 --> > <xsl:if test="marc:datafield[@tag=773]"> > <xsl:for-each select="marc:datafield[@tag=773]"> >- <xsl:if test="marc:subfield[@code='t']"> >- <span class="results_summary source"> >- <span class="label">Source: </span> >- <xsl:value-of select="marc:subfield[@code='t']"/> >- </span> >+ <xsl:if test="@ind1 !=1"> >+ <span class="results_summary in"><span class="label"> >+ <xsl:choose> >+ <xsl:when test="@ind2=' '"> >+ Source: >+ </xsl:when> >+ <xsl:when test="@ind2=8"> >+ <xsl:if test="marc:subfield[@code='i']"> >+ <xsl:value-of select="marc:subfield[@code='i']"/> >+ </xsl:if> >+ </xsl:when> >+ </xsl:choose> >+ </span> >+ <xsl:variable name="f773"> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a_t</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </xsl:variable> >+ <xsl:choose> >+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >+ <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute> >+ <xsl:value-of select="translate($f773, '()', '')"/> >+ </a> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code='0']"> >+ <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute> >+ <xsl:value-of select="$f773"/> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f773, '()', ''), true())"/></xsl:attribute> >+ <xsl:value-of select="$f773"/> >+ </a> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:if test="marc:subfield[@code='g']"> >+ <xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/> >+ </xsl:if> >+ </span> >+ >+ <xsl:if test="marc:subfield[@code='n']"> >+ <span class="results_summary in_note"><xsl:value-of select="marc:subfield[@code='n']"/></span> >+ </xsl:if> >+ > </xsl:if> > </xsl:for-each> > </xsl:if> >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 4e6219c0bd..f0e81a5d3d 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 @@ > </tr> > [% END %] > >+ [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <tr> >+ <th scope="row">Host item entries</th> >+ <td> >+ [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <p> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% entry.biblionumber | uri %]">[% INCLUDE 'biblio-title.inc' biblio=entry %]</a> >+ </p> >+ [% END %] >+ </td> >+ </tr> >+ [% END %] >+ > <tr> > <th scope="row">Location(s) (Status)</th> > <td> >@@ -292,6 +305,14 @@ > [% IF ( TagsInputEnabled && loggedinusername ) %] > <span id="newtag[% BIBLIO_RESULT.biblionumber | html %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</span> > [% END %] >+ >+ [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] >+ [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <p>Host item entry: >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% entry.biblionumber | uri %]">[% INCLUDE 'biblio-title.inc' biblio=entry %]</a> >+ </p> >+ [% END %] >+ [% END %] > </td> > <td>[% BIBLIO_RESULT.author | html %]</td> > <td> >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 823e0bf0a5..9165e49665 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt >@@ -130,6 +130,16 @@ Your cart > LCCN: [% BIBLIO_RESULT.lccn | $raw %] > </span><br/> > [% END %] >+ >+ [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] >+ [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <span>Host item entry: >+ <a href="[% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% entry.biblionumber | uri %]">[% INCLUDE 'biblio-title.inc' biblio=entry %]</a> >+ </span> >+ <br/> >+ [% END %] >+ [% END %] >+ > [% IF ( BIBLIO_RESULT.url ) %] > <span> > 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 be952e2399..25af69487f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt >@@ -133,6 +133,16 @@ Your list : [% shelfname | $raw %] > LCCN: [% BIBLIO_RESULT.lccn | $raw %] > </span><br/> > [% END %] >+ >+ [% IF BIBLIO_RESULT.HOSTITEMENTRIES %] >+ [% FOREACH entry IN BIBLIO_RESULT.HOSTITEMENTRIES %] >+ <span>Host item entry: >+ <a href="[% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% entry.biblionumber | uri %]">[% INCLUDE 'biblio-title.inc' biblio=entry %]</a> >+ </span> >+ <br/> >+ [% END %] >+ [% END %] >+ > [% IF ( BIBLIO_RESULT.url ) %] > <span> > 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 f20f7d6748..1b8fb35f62 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -657,13 +657,57 @@ > </div> > </xsl:if> > >+ <!-- 773 --> > <xsl:if test="marc:datafield[@tag=773]"> > <xsl:for-each select="marc:datafield[@tag=773]"> >- <xsl:if test="marc:subfield[@code='t']"> >- <div class="results_summary source"> >- <span class="label">Source: </span> >- <xsl:value-of select="marc:subfield[@code='t']"/> >- </div> >+ <xsl:if test="@ind1 !=1"> >+ <div class="results_summary in"><span class="label"> >+ <xsl:choose> >+ <xsl:when test="@ind2=' '"> >+ Source: >+ </xsl:when> >+ <xsl:when test="@ind2=8"> >+ <xsl:if test="marc:subfield[@code='i']"> >+ <xsl:value-of select="marc:subfield[@code='i']"/> >+ </xsl:if> >+ </xsl:when> >+ </xsl:choose> >+ <xsl:variable name="f773"> >+ <xsl:call-template name="chopPunctuation"> >+ <xsl:with-param name="chopString"> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a_t</xsl:with-param> >+ </xsl:call-template> >+ </xsl:with-param> >+ </xsl:call-template> >+ </xsl:variable> >+ <xsl:choose> >+ <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']"> >+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute> >+ <xsl:value-of select="translate($f773, '()', '')"/> >+ </a> >+ </xsl:when> >+ <xsl:when test="marc:subfield[@code='0']"> >+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute> >+ <xsl:value-of select="$f773"/> >+ </a> >+ </xsl:when> >+ <xsl:otherwise> >+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f773, '()', ''), true())"/></xsl:attribute> >+ <xsl:value-of select="$f773"/> >+ </a> >+ </xsl:otherwise> >+ </xsl:choose> >+ <xsl:if test="marc:subfield[@code='g']"> >+ <xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/> >+ </xsl:if> >+ </span> >+ </div> >+ >+ <xsl:if test="marc:subfield[@code='n']"> >+ <div class="results_summary in_note"><xsl:value-of select="marc:subfield[@code='n']"/></div> >+ </xsl:if> >+ > </xsl:if> > </xsl:for-each> > </xsl:if> >diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl >index 18737d7044..04bdf96fa7 100755 >--- a/opac/opac-basket.pl >+++ b/opac/opac-basket.pl >@@ -158,6 +158,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 75ddd3dc2c..40e35e74cc 100755 >--- a/opac/opac-sendbasket.pl >+++ b/opac/opac-sendbasket.pl >@@ -100,6 +100,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 4b33d8ef97..b3bb7ec9b1 100755 >--- a/opac/opac-sendshelf.pl >+++ b/opac/opac-sendshelf.pl >@@ -104,6 +104,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 504481b6ca..e5c214b360 100755 >--- a/virtualshelves/sendshelf.pl >+++ b/virtualshelves/sendshelf.pl >@@ -92,6 +92,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.11.0
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 16522
:
114178
|
114429
|
120425
|
130250
|
133509
|
135416
|
137196
|
137197
|
139168
|
139169
|
139846
|
139847
|
139848
|
141058
|
141059
|
141060
|
141061
|
141062
|
141063
|
142036
|
142037
|
142038
|
142039
|
142040
|
142041
|
142042
|
142843
|
144455
|
144456
|
145047
|
145521
|
145522
|
145523
|
145524
|
145525
|
145526
|
145527
|
145528