Bug 16522: Adding 773 to cart and list displays and emails
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: Heather Hernandez <heather_hernandez@nps.gov> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
b2c1c0efe1
commit
62eba64cfe
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -219,6 +219,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>
|
||||
|
|
@ -285,6 +298,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>
|
||||
|
|
|
|||
|
|
@ -127,6 +127,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 %]
|
||||
|
|
|
|||
|
|
@ -134,6 +134,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 %]
|
||||
|
|
|
|||
|
|
@ -929,13 +929,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>
|
||||
|
|
|
|||
|
|
@ -236,6 +236,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>
|
||||
|
|
@ -294,6 +307,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>
|
||||
|
|
|
|||
|
|
@ -132,6 +132,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 %]
|
||||
|
|
|
|||
|
|
@ -135,6 +135,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 %]
|
||||
|
|
|
|||
|
|
@ -660,13 +660,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>
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ foreach my $biblionumber ( @bibs ) {
|
|||
$dat->{MARCSERIES} = $marcseriesarray;
|
||||
$dat->{MARCURLS} = $marcurlsarray;
|
||||
$dat->{HASAUTHORS} = $hasauthors;
|
||||
$dat->{HOSTITEMENTRIES} = $biblio->get_marc_host;
|
||||
|
||||
push( @results, $dat );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue