Bug 39896: Add UNIMARC support for AuthorLinkSortBy
This patch add support for AuthorLinkSortBy and AuthorLinkSortOrder in
the default UNIMARC XSLT files.
The description of the syspref is also slighly updated to hint users of
custom XSLT file about the need to update their template.
To test:
0. On a UNIMARC database
1. Set AuthorLinkSortBy to 'title' and AuthorLinkSortORder to
'descending'
2. On the intranet and OPAC, search for an author you have multiple
titles from and click on a result
3. Click on a link one a name for an author
4. Note a new search is performed, sorted by field from defaultSortField
preference and not by title descending
5. Apply the patch
6. restart_all
7. Check that the syspref description now include a note about custom
XSLT files
8. Repeat step 2 and 3
9. Note a new search is performed, sorted by title descending
10. Test other values - confirm links are updated in both staff and opac
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4581e399bb)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
f6ad2409df
commit
fa9279644a
|
|
@ -213,7 +213,7 @@ Searching:
|
|||
za: from Z to A
|
||||
- .
|
||||
-
|
||||
- By default, sort search results from author links in MARC21 detail pages and result lists by
|
||||
- By default, sort search results from author links in detail pages and result lists by
|
||||
- pref: AuthorLinkSortBy
|
||||
default: default
|
||||
choices:
|
||||
|
|
@ -230,6 +230,7 @@ Searching:
|
|||
az: from A to Z
|
||||
za: from Z to A
|
||||
- .
|
||||
- "<br /><strong>NOTE:</strong> If you are using custom XSLT you need to make sure the system preference check is implemented."
|
||||
-
|
||||
- When limiting search results with a library or library group, limit by the item's
|
||||
- pref: SearchLimitLibrary
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@
|
|||
<xsl:variable name="leader6" select="substring($leader,7,1)"/>
|
||||
<xsl:variable name="leader7" select="substring($leader,8,1)"/>
|
||||
<xsl:variable name="biblionumber" select="marc:controlfield[@tag=001]"/>
|
||||
|
||||
<xsl:variable name="AuthorLinkSortBy" select="marc:sysprefs/marc:syspref[@name='AuthorLinkSortBy']"/>
|
||||
<xsl:variable name="AuthorLinkSortOrder" select="marc:sysprefs/marc:syspref[@name='AuthorLinkSortOrder']"/>
|
||||
|
||||
<xsl:if test="marc:datafield[@tag=200]">
|
||||
<xsl:for-each select="marc:datafield[@tag=200]">
|
||||
|
|
@ -59,36 +60,48 @@
|
|||
<xsl:with-param name="tag">700</xsl:with-param>
|
||||
<xsl:with-param name="label">Main Author</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">main_author</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="tag_7xx">
|
||||
<xsl:with-param name="tag">710</xsl:with-param>
|
||||
<xsl:with-param name="label">Corporate Author (Main)</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">corporate_main_author</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="tag_7xx">
|
||||
<xsl:with-param name="tag">701</xsl:with-param>
|
||||
<xsl:with-param name="label">Coauthor</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">coauthor</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="tag_7xx">
|
||||
<xsl:with-param name="tag">702</xsl:with-param>
|
||||
<xsl:with-param name="label">Secondary Author</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">secondary_author</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="tag_7xx">
|
||||
<xsl:with-param name="tag">711</xsl:with-param>
|
||||
<xsl:with-param name="label">Corporate Author (Coauthor)</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">corporate_coauthor</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="tag_7xx">
|
||||
<xsl:with-param name="tag">712</xsl:with-param>
|
||||
<xsl:with-param name="label">Corporate Author (Secondary)</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">corporate_secondary_author</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:if test="marc:datafield[@tag=101]">
|
||||
|
|
|
|||
|
|
@ -419,6 +419,8 @@
|
|||
<xsl:param name="tag" />
|
||||
<xsl:param name="label" />
|
||||
<xsl:param name="spanclass" />
|
||||
<xsl:param name="AuthorLinkSortBy"/>
|
||||
<xsl:param name="AuthorLinkSortOrder"/>
|
||||
<xsl:if test="marc:datafield[@tag=$tag]">
|
||||
<span class="results_summary author {$spanclass}">
|
||||
<span class="label">
|
||||
|
|
@ -434,6 +436,12 @@
|
|||
<xsl:attribute name="href">
|
||||
<xsl:text>/cgi-bin/koha/catalogue/search.pl?q=an:</xsl:text>
|
||||
<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/>
|
||||
<xsl:if test="$AuthorLinkSortBy!='default'">
|
||||
<xsl:text>&sort_by=</xsl:text>
|
||||
<xsl:value-of select="$AuthorLinkSortBy"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="$AuthorLinkSortOrder"/>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
|
|
@ -442,6 +450,12 @@
|
|||
<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>
|
||||
<xsl:text>%20</xsl:text>
|
||||
<xsl:value-of select="str:encode-uri(marc:subfield[@code='b'], true())"/>
|
||||
<xsl:if test="$AuthorLinkSortBy!='default'">
|
||||
<xsl:text>&sort_by=</xsl:text>
|
||||
<xsl:value-of select="$AuthorLinkSortBy"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="$AuthorLinkSortOrder"/>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
<xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
|
||||
<xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
|
||||
<xsl:variable name="ContentWarningField" select="marc:sysprefs/marc:syspref[@name='ContentWarningField']"/>
|
||||
<xsl:variable name="AuthorLinkSortBy" select="marc:sysprefs/marc:syspref[@name='AuthorLinkSortBy']"/>
|
||||
<xsl:variable name="AuthorLinkSortOrder" select="marc:sysprefs/marc:syspref[@name='AuthorLinkSortOrder']"/>
|
||||
|
||||
<xsl:if test="marc:datafield[@tag=200]">
|
||||
<xsl:for-each select="marc:datafield[@tag=200]">
|
||||
|
|
@ -89,36 +91,48 @@
|
|||
<xsl:with-param name="tag">700</xsl:with-param>
|
||||
<xsl:with-param name="label">Main Author</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">main_author</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="tag_7xx">
|
||||
<xsl:with-param name="tag">710</xsl:with-param>
|
||||
<xsl:with-param name="label">Corporate Author (Main)</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">corporate_main_author</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="tag_7xx">
|
||||
<xsl:with-param name="tag">701</xsl:with-param>
|
||||
<xsl:with-param name="label">Coauthor</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">coauthor</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="tag_7xx">
|
||||
<xsl:with-param name="tag">702</xsl:with-param>
|
||||
<xsl:with-param name="label">Secondary Author</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">secondary_author</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="tag_7xx">
|
||||
<xsl:with-param name="tag">711</xsl:with-param>
|
||||
<xsl:with-param name="label">Corporate Author (Coauthor)</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">corporate_coauthor</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="tag_7xx">
|
||||
<xsl:with-param name="tag">712</xsl:with-param>
|
||||
<xsl:with-param name="label">Corporate Author (Secondary)</xsl:with-param>
|
||||
<xsl:with-param name="spanclass">corporate_secondary_author</xsl:with-param>
|
||||
<xsl:with-param name="AuthorLinkSortOrder" select="$AuthorLinkSortOrder"/>
|
||||
<xsl:with-param name="AuthorLinkSortBy" select="$AuthorLinkSortBy"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:call-template name="tag_title">
|
||||
|
|
|
|||
|
|
@ -418,6 +418,8 @@
|
|||
<xsl:param name="tag" />
|
||||
<xsl:param name="label" />
|
||||
<xsl:param name="spanclass" />
|
||||
<xsl:param name="AuthorLinkSortBy"/>
|
||||
<xsl:param name="AuthorLinkSortOrder"/>
|
||||
<xsl:variable name="IdRef" select="marc:sysprefs/marc:syspref[@name='IdRef']"/>
|
||||
<xsl:if test="marc:datafield[@tag=$tag]">
|
||||
<span class="results_summary author {$spanclass}">
|
||||
|
|
@ -433,6 +435,12 @@
|
|||
<xsl:attribute name="href">
|
||||
<xsl:text>/cgi-bin/koha/opac-search.pl?q=an:</xsl:text>
|
||||
<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/>
|
||||
<xsl:if test="$AuthorLinkSortBy!='default'">
|
||||
<xsl:text>&sort_by=</xsl:text>
|
||||
<xsl:value-of select="$AuthorLinkSortBy"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="$AuthorLinkSortOrder"/>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
|
|
@ -441,6 +449,12 @@
|
|||
<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>
|
||||
<xsl:text>%20</xsl:text>
|
||||
<xsl:value-of select="str:encode-uri(marc:subfield[@code='b'], true())"/>
|
||||
<xsl:if test="$AuthorLinkSortBy!='default'">
|
||||
<xsl:text>&sort_by=</xsl:text>
|
||||
<xsl:value-of select="$AuthorLinkSortBy"/>
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="$AuthorLinkSortOrder"/>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
|
|
|||
Loading…
Reference in New Issue