From 8902625bd3a73fe923337232f8644da8548919fe Mon Sep 17 00:00:00 2001 From: Marion Durand Date: Thu, 15 May 2025 08:31:17 +0000 Subject: [PATCH] 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 --- .../en/modules/admin/preferences/searching.pref | 3 ++- .../prog/en/xslt/UNIMARCslim2intranetDetail.xsl | 15 ++++++++++++++- .../prog/en/xslt/UNIMARCslimUtils.xsl | 14 ++++++++++++++ .../bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl | 14 ++++++++++++++ .../bootstrap/en/xslt/UNIMARCslimUtils.xsl | 14 ++++++++++++++ 5 files changed, 58 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index 447d145ab2..621c5bf6b3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -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 - . + - "
NOTE: 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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl index 982bea8b8b..d92d9cff86 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl @@ -21,7 +21,8 @@ - + + @@ -59,36 +60,48 @@ 700 Main Author main_author + + 710 Corporate Author (Main) corporate_main_author + + 701 Coauthor coauthor + + 702 Secondary Author secondary_author + + 711 Corporate Author (Coauthor) corporate_coauthor + + 712 Corporate Author (Secondary) corporate_secondary_author + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl index e344fdf7de..648f927141 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl @@ -419,6 +419,8 @@ + + @@ -434,6 +436,12 @@ /cgi-bin/koha/catalogue/search.pl?q=an: + + &sort_by= + + _ + + @@ -442,6 +450,12 @@ %20 + + &sort_by= + + _ + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl index 0992550b1a..27f1cbe13e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl @@ -23,6 +23,8 @@ + + @@ -89,36 +91,48 @@ 700 Main Author main_author + + 710 Corporate Author (Main) corporate_main_author + + 701 Coauthor coauthor + + 702 Secondary Author secondary_author + + 711 Corporate Author (Coauthor) corporate_coauthor + + 712 Corporate Author (Secondary) corporate_secondary_author + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl index 25874e25f8..054312bc4e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl @@ -418,6 +418,8 @@ + + @@ -433,6 +435,12 @@ /cgi-bin/koha/opac-search.pl?q=an: + + &sort_by= + + _ + + @@ -441,6 +449,12 @@ %20 + + &sort_by= + + _ + + -- 2.39.5