From 9519882800e094f58446c1fead524fc4f6698c15 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 5 Aug 2021 11:43:16 +0000 Subject: [PATCH] Bug 26302: Refactor Availability block in OPAC results xslt Decided finally to do a larger refactor here. Hopefully we improved consistency and removed some redundancy. And the two new prefs provide additional functionality. Most significant changes: [1] Clearer distinction of the Availability line in three parts: Available, Reference and Unavailable. For Unavailable we loop thru branches now too. [2] Calling template to list item data (including location or ccode). Made the separate Location line obsolete. [3] The tests around OPACItemLibrary are removed since we now look at resultbranch from XSLT.pm. [4] Removed code replication for various 'other' statuses like Checked out. [5] Obsoleted three xslt key indexes, singleBranchMode. [6] Apply the two prefs to control number of listed items. Test plan: You may play with: OPACResultsLibrary (home/holding), OPACItemLocation (library, callno, location, ccode), resultsMaxItems[Unavailable] (numbers), Reference_NFL_Statuses (list of notforloan codes in reference part). [1] Create a biblio with various items on a few branches. Fill call number, location and ccode too. Set home branch and holdingbranch differently. [2] Toggle the preferences, and verify display within OAPC search results. Example with prefs (home, callnumber, 2, 2): Availability: Items available for loan: Centerville (2)Call number: perl A 4, PERL D 1. Items available for reference: Fairfield: Not For Loan (1)Call number: PERL A 5. Not available: Centerville: Checked out (1)Call number: PERL A 3. Centerville: Ordered (1)Call number: PERL B 1. Centerville: Staff Collection (2)Call number: PERL A 2, PERL E 1. Centerville: Withdrawn (1)Call number: PERL B 2. Fairfield: Withdrawn (1)Call number: PERL C 1. Same data with prefs (holding, callnumber, 2, 2): Availability: Items available for loan: Centerville (1)Call number: PERL D 1. Liberty (1)Call number: perl A 4. Items available for reference: Centerville: Not For Loan (1)Call number: PERL A 5. Not available: Centerville: Checked out (1)Call number: PERL A 3. Centerville: Staff Collection (1)Call number: PERL A 2. Centerville: Withdrawn (1)Call number: PERL B 2. Fairfield: Ordered (1)Call number: PERL B 1. Fairfield: Withdrawn (1)Call number: PERL C 1. Liberty: Staff Collection (1)Call number: PERL E 1. Same data with prefs (holding, library, n/a, n/a): Availability: Items available for loan: Centerville (1). Liberty (1). Items available for reference: Centerville: Not For Loan (1). Not available: Centerville: Checked out (1). Centerville: Staff Collection (1). Centerville: Withdrawn (1). Fairfield: Ordered (1). Fairfield: Withdrawn (1). Liberty: Staff Collection (1). Signed-off-by: Marcel de Rooy Signed-off-by: Owen Leonard Signed-off-by: David Nind Signed-off-by: Nick Clemens --- .../en/xslt/MARC21slim2OPACResults.xsl | 383 +++++++----------- 1 file changed, 144 insertions(+), 239 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl index 92d1d2ff8f..d2867e54fe 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -5,14 +5,13 @@ xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:items="http://www.koha-community.org/items" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:exsl="http://exslt.org/common" xmlns:str="http://exslt.org/strings" - exclude-result-prefixes="marc items str"> + exclude-result-prefixes="marc items str" extension-element-prefixes="exsl"> + - - - @@ -24,6 +23,8 @@ + + @@ -36,7 +37,6 @@ - @@ -1250,258 +1250,123 @@ Availability: - - + - - - - - - - - - - () - - No items available. - - - - - Items available for loan: - - - - - - - - - Call number: - , .. - - - - . - , - - + + + + + + + + - - - - - - - - ( - - ) - - - Call number: - , .. - - - - . - , - - - - - - - - - ( - - ) - - - Call number: - , .. - - - - . - , - - - - - - - - + () + + No items available. + - - - - - Items available for reference: - - - - - ItemSummary - - - - - - - ( - - ) - - - Call number: - , .. - - - . , + + + + + + + Items available for loan: + + + + + + + + + + + + + - - - + - - - - Not available: + + + Items available for reference: + + + + + + + + + + + + + + + + + + + + + - - - + + + Not available: + + Checked out + Withdrawn + Lost + Damaged + Pending hold + In transit + On hold + + + + + + - - ( - - ) - . , + + + + + + + + + + : + + + + + + + + + + + + + - - - - Checked out ( - - ). - - - - - Withdrawn ( - - ). - - - - - Lost ( - - ). - - - - - Damaged ( - - ). - - - - - Pending hold ( - - ). - - - - - In transit ( - - ). - - - - - On hold ( - - ). - - - - + - - - - - - - - Location(s): - - - Collection(s): - - - - - - - - - - - - - - - Call number: - - - - . , - - - - - - - - - - - - - - Call number: - - - - . , - - - - - - - - - @@ -1598,4 +1463,44 @@ + + + + + + + + + + + ( + + ) + + + + Call number: + Collection code, call number: + Location, call number: + + + + + + + + + + , + + , .. + + + + . + + + + + -- 2.20.1