Bugzilla – Attachment 57540 Details for
Bug 17624
Add Staff Collection status for items in C4::XSLT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17624: Hide not-for-loan items on search results' availability
Bug-17624-Hide-not-for-loan-items-on-search-result.patch (text/plain), 9.03 KB, created by
Marcel de Rooy
on 2016-11-16 12:46:29 UTC
(
hide
)
Description:
Bug 17624: Hide not-for-loan items on search results' availability
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-11-16 12:46:29 UTC
Size:
9.03 KB
patch
obsolete
>From 32709c885fdcc7f16968662d4256f04979516d99 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 14 Nov 2016 15:15:49 +0100 >Subject: [PATCH] Bug 17624: Hide not-for-loan items on search results' > availability >Content-Type: text/plain; charset=utf-8 > >Currently, not for loan items are listed as copies for reference on the >OPAC XSLT search results. >This reports add a preference to hide or show these not-for-loan items on >the OPAC XSLT results view. It is: OPACXSLTResultsHideNFL. >By default, it will still show them. So, no behavior change here. > >Note: This patch also removed a double line in the pref file that resulted in >a small empty table row at the end of the Appearance section for OPAC >preferences. > >Test plan: >[1] Run the dbrev via the web installer. Verify that the pref is still off. > This means that not-for-loans should be listed on the Availability > line as "Copies available for reference". >[2] Set the pref to Hide. >[3] Verify that the not-for-loans are not shown in the search results. > Note that you still see them in the details view (no problem: they > are listed just as what they are: not for loan). >[4] Set OpacItemLocation to Location. Look at the search results again. >--- > C4/XSLT.pm | 2 +- > installer/data/mysql/atomicupdate/bug17624.perl | 9 +++++++++ > installer/data/mysql/sysprefs.sql | 1 + > .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 8 +++++++- > .../opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl | 11 ++++++----- > 5 files changed, 24 insertions(+), 7 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug17624.perl > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 50ab8e6..24d5399 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -170,7 +170,7 @@ sub get_xslt_sysprefs { > OPACItemLocation DisplayIconsXSLT > AlternateHoldingsField AlternateHoldingsSeparator > TrackClicks opacthemes IdRef OpacSuppression >- OPACResultsLibrary / ) >+ OPACResultsLibrary OPACXSLTResultsHideNFL / ) > { > my $sp = C4::Context->preference( $syspref ); > next unless defined($sp); >diff --git a/installer/data/mysql/atomicupdate/bug17624.perl b/installer/data/mysql/atomicupdate/bug17624.perl >new file mode 100644 >index 0000000..bd8cd70 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug17624.perl >@@ -0,0 +1,9 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q| >+INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('OPACXSLTResultsHideNFL', '0', NULL, 'Hide not-for-loans in OPAC XSLT results view', 'YesNo')| >+ ); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 17624 - Hide not-for-loans in OPAC XSLT results)\n"; >+} >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 7c69940..c0f46ee 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -379,6 +379,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OPACXSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on OPAC','Free'), > ('OPACXSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on OPAC','Free'), > ('OPACXSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on OPAC','Free'), >+('OPACXSLTResultsHideNFL','0',NULL,'Hide not-for-loans in OPAC XSLT results view','YesNo'), > ('OpenLibraryCovers','0',NULL,'If ON Openlibrary book covers will be show','YesNo'), > ('OpenLibrarySearch','0',NULL,'If Yes Open Library search results will show in OPAC','YesNo'), > ('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 62aaeff..46aaed7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -61,7 +61,6 @@ OPAC: > no: "Don't show" > - "a warning that the OPAC is under maintenance, instead of the OPAC itself. Note: this shows the same warning as when the database needs to be upgraded, but unconditionally." > - >- - > - "Show the following HTML when OpacMaintenance is enabled:" > - pref: OpacMaintenanceNotice > type: htmlarea >@@ -343,6 +342,13 @@ OPAC: > both: "both top and footer" > top: "top" > footer: "only footer" >+ - >+ - pref: OPACXSLTResultsHideNFL >+ default: 0 >+ choices: >+ 1: Hide >+ 0: Show >+ - not-for-loan items on the OPAC XSLT Results view. > Features: > - > - pref: opacuserlogin >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index 353b08e..b1ea15f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -21,6 +21,7 @@ > <!-- Option: Display Alternate Graphic Representation (MARC 880) --> > <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/> > >+ <xsl:variable name="OPACXSLTResultsHideNFL" select="marc:sysprefs/marc:syspref[@name='OPACXSLTResultsHideNFL']"/> > <xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/> > <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/> > <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/> >@@ -1147,7 +1148,7 @@ > <span class="results_summary availability"> > <span class="label">Availability: </span> > <xsl:choose> >- <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0"> >+ <xsl:when test="count(key('item-by-status', 'available'))=0 and ($OPACXSLTResultsHideNFL=1 or count(key('item-by-status', 'reference'))=0)"> > <xsl:choose> > <xsl:when test="string-length($AlternateHoldingsField)=3 and marc:datafield[@tag=$AlternateHoldingsField]"> > <xsl:variable name="AlternateHoldingsCount" select="count(marc:datafield[@tag=$AlternateHoldingsField])"/> >@@ -1223,7 +1224,7 @@ > </xsl:choose> > > <xsl:choose> >- <xsl:when test="count(key('item-by-status', 'reference'))>0"> >+ <xsl:when test="$OPACXSLTResultsHideNFL=0 and count(key('item-by-status', 'reference'))>0"> > <span class="available"> > <b><xsl:text>Items available for reference: </xsl:text></b> > <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/> >@@ -1244,7 +1245,7 @@ > </xsl:choose> > > <xsl:choose> <xsl:when test="count(key('item-by-status', 'available'))>0"> >- <xsl:choose><xsl:when test="count(key('item-by-status', 'reference'))>0"> >+ <xsl:choose><xsl:when test="$OPACXSLTResultsHideNFL=0 and count(key('item-by-status', 'reference'))>0"> > <br/> > </xsl:when></xsl:choose> > </xsl:when> </xsl:choose> >@@ -1294,7 +1295,7 @@ > </xsl:if> > </span> > <xsl:choose> >- <xsl:when test="($OPACItemLocation='location' or $OPACItemLocation='ccode') and (count(key('item-by-status', 'available'))!=0 or count(key('item-by-status', 'reference'))!=0)"> >+ <xsl:when test="($OPACItemLocation='location' or $OPACItemLocation='ccode') and (count(key('item-by-status', 'available'))>0 or ($OPACXSLTResultsHideNFL=0 and count(key('item-by-status', 'reference'))>0))"> > <span class="results_summary location"> > <span class="label">Location(s): </span> > <xsl:choose> >@@ -1311,7 +1312,7 @@ > </xsl:for-each> > </span> > </xsl:when> >- <xsl:when test="count(key('item-by-status', 'reference'))>0"> >+ <xsl:when test="$OPACXSLTResultsHideNFL=0 and count(key('item-by-status', 'reference'))>0"> > <span class="available"> > <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/> > <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]"> >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17624
:
57540
|
57541
|
57833
|
57834