From e131dd8f4d19794c26c4e067e9ffe0a7b6a51758 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 2 Apr 2021 09:09:25 +0000 Subject: [PATCH] Bug 26302: Use resultsMaxItemsUnavailable in stylesheet Content-Type: text/plain; charset=utf-8 We start here with Checked out until On hold. Not sure if we should do exactly the same for the remaining not for loan categories. --- ...PAC-XSLT-Results-List-variable-number-of-.patch | 124 +++++++++++++++++++++ ...02-Add-syspref-resultsMaxItemsUnavailable.patch | 28 +++++ ...se-resultsMaxItemsUnavailable-in-styleshe.patch | 65 +++++++++++ .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 115 +++++++++++-------- 4 files changed, 284 insertions(+), 48 deletions(-) create mode 100644 0001-Bug-26302-OPAC-XSLT-Results-List-variable-number-of-.patch create mode 100644 0002-Bug-26302-Add-syspref-resultsMaxItemsUnavailable.patch create mode 100644 0003-Bug-26302-Use-resultsMaxItemsUnavailable-in-styleshe.patch diff --git a/0001-Bug-26302-OPAC-XSLT-Results-List-variable-number-of-.patch b/0001-Bug-26302-OPAC-XSLT-Results-List-variable-number-of-.patch new file mode 100644 index 0000000000..2722d8445d --- /dev/null +++ b/0001-Bug-26302-OPAC-XSLT-Results-List-variable-number-of-.patch @@ -0,0 +1,124 @@ +From 569a125952166d289abf7c7c6b82205d30dd7dd2 Mon Sep 17 00:00:00 2001 +From: Marcel de Rooy +Date: Wed, 26 Aug 2020 13:49:53 +0000 +Subject: [PATCH 1/3] Bug 26302: OPAC XSLT Results: List variable number of + itemcallnumbers +Content-Type: text/plain; charset=utf-8 + +We define a local preference resultsMaxItems and add it to the xml +passed to the results XSLT (in C4::XSLT). +Instead of showing one item, we add this number of items for the +available for loan and reference segments. + +Test plan: +Play with the value of local pref resultsMaxItems. +Check if it matches with displayed callnumbers. +Try home and holdingbranch for results location. + +Signed-off-by: Marcel de Rooy +--- + C4/XSLT.pm | 2 ++ + .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 41 +++++++++++++++++----- + 2 files changed, 35 insertions(+), 8 deletions(-) + +diff --git a/C4/XSLT.pm b/C4/XSLT.pm +index cd183fbe51..c32368d622 100644 +--- a/C4/XSLT.pm ++++ b/C4/XSLT.pm +@@ -173,9 +173,11 @@ sub get_xslt_sysprefs { + TrackClicks opacthemes IdRef OpacSuppression + OPACResultsLibrary OPACShowOpenURL + OpenURLResolverURL OpenURLImageLocation ++ resultsMaxItems + OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts / ) + { + my $sp = C4::Context->preference( $syspref ); ++ $sp ||= 1 if $syspref eq 'resultsMaxItems'; # needs default + next unless defined($sp); + $sysxml .= "$sp\n"; + } +diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +index d7f299e226..7a0065fef1 100644 +--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl ++++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +@@ -39,6 +39,7 @@ + + + ++ + + + +@@ -1282,7 +1283,13 @@ + + + Call number: +- , .. ++ ++ ++ ++ , ++ ++ , .. ++ + + + +@@ -1302,10 +1309,16 @@ + + ) + +- ++ + Call number: +- , .. +- ++ ++ ++ ++ , ++ ++ , .. ++ ++ + + + . +@@ -1322,10 +1335,16 @@ + + ) + +- ++ + Call number: +- , .. +- ++ ++ ++ ++ , ++ ++ , .. ++ ++ + + + . +@@ -1362,7 +1381,13 @@ + + + Call number: +- , .. ++ ++ ++ ++ , ++ ++ , .. ++ + + + . , +-- +2.11.0 + diff --git a/0002-Bug-26302-Add-syspref-resultsMaxItemsUnavailable.patch b/0002-Bug-26302-Add-syspref-resultsMaxItemsUnavailable.patch new file mode 100644 index 0000000000..583bc71851 --- /dev/null +++ b/0002-Bug-26302-Add-syspref-resultsMaxItemsUnavailable.patch @@ -0,0 +1,28 @@ +From 5f59d9cc62b4ee4e35bb779c7c1512b4d4d0f5b5 Mon Sep 17 00:00:00 2001 +From: Marcel de Rooy +Date: Fri, 2 Apr 2021 09:07:37 +0000 +Subject: [PATCH 2/3] Bug 26302: Add syspref resultsMaxItemsUnavailable +Content-Type: text/plain; charset=utf-8 + +This is the number of call numbers displayed for unavailable +categories in the results XSLT. +--- + C4/XSLT.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/C4/XSLT.pm b/C4/XSLT.pm +index c32368d622..15cab1425e 100644 +--- a/C4/XSLT.pm ++++ b/C4/XSLT.pm +@@ -173,7 +173,7 @@ sub get_xslt_sysprefs { + TrackClicks opacthemes IdRef OpacSuppression + OPACResultsLibrary OPACShowOpenURL + OpenURLResolverURL OpenURLImageLocation +- resultsMaxItems ++ resultsMaxItems resultsMaxItemsUnavailable + OpenURLText OPACShowMusicalInscripts OPACPlayMusicalInscripts / ) + { + my $sp = C4::Context->preference( $syspref ); +-- +2.11.0 + diff --git a/0003-Bug-26302-Use-resultsMaxItemsUnavailable-in-styleshe.patch b/0003-Bug-26302-Use-resultsMaxItemsUnavailable-in-styleshe.patch new file mode 100644 index 0000000000..38e8797db9 --- /dev/null +++ b/0003-Bug-26302-Use-resultsMaxItemsUnavailable-in-styleshe.patch @@ -0,0 +1,65 @@ +From d6c94eeeb1a3b4c8d94d85ee6057963207ba314b Mon Sep 17 00:00:00 2001 +From: Marcel de Rooy +Date: Fri, 2 Apr 2021 09:09:25 +0000 +Subject: [PATCH 3/3] Bug 26302: Use resultsMaxItemsUnavailable in stylesheet +Content-Type: text/plain; charset=utf-8 + +We start here with Checked out until +--- + .../bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 22 ++++++++++++++++++++-- + 1 file changed, 20 insertions(+), 2 deletions(-) + +diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +index 7a0065fef1..7bbd685d36 100644 +--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl ++++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +@@ -40,6 +40,7 @@ + + + ++ + + + +@@ -1419,14 +1420,18 @@ + + Checked out ( + +- ). ++ ) ++ ++ . + + + + + Withdrawn ( + +- ). ++ ) ++ ++ . + + + +@@ -1623,4 +1628,17 @@ + + + ++ ++ ++ ++ ++ [ ++ ++ , ++ ++ , .. ++ ] ++ ++ ++ + +-- +2.11.0 + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl index 7a0065fef1..9ebce5b81c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -40,6 +40,7 @@ + @@ -1415,55 +1416,50 @@ - - - Checked out ( - - ). - - - - - Withdrawn ( - - ). - - - - - Lost ( - - ). - - - - - Damaged ( - - ). - - - - - Pending hold ( - - ). - - - - - In transit ( - - ). - - - - - On hold ( - - ). - + + Checked out + + + + + + Withdrawn + + + + + + + Lost + + + + + + Damaged + + + + + + Pending hold + + + + + + In transit + + + + + + On hold + + + + @@ -1623,4 +1619,27 @@ + + + + + + + + ( + + ) + + [ + + , + + , .. + ] + + . + + + + -- 2.11.0