Bugzilla – Attachment 137324 Details for
Bug 30880
Expand OPACResultsUnavailableGroupingBy to have a 'branch only' option
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30880: Add 'branchonly' to OPACResultsUnavailableGroupingBy
Bug-30880-Add-branchonly-to-OPACResultsUnavailable.patch (text/plain), 8.12 KB, created by
David Nind
on 2022-07-07 14:57:55 UTC
(
hide
)
Description:
Bug 30880: Add 'branchonly' to OPACResultsUnavailableGroupingBy
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-07-07 14:57:55 UTC
Size:
8.12 KB
patch
obsolete
>From ecfb8563e3af149a286c823aa6bab8711fc5a3e5 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 1 Jun 2022 22:35:06 +0000 >Subject: [PATCH] Bug 30880: Add 'branchonly' to > OPACResultsUnavailableGroupingBy > >This patch adds a third option 'branch only' to the >OPACResultsUnavailableGroupBy system preference. This option will group >unavailable items by branch in the OPAC search results and NOT show >individual callnumbers or substatuses. > >Note: This assumes OPACXSLTResultsDisplay is set to default. > >To test: >1. Create a biblio record with 3 items with the following home branches: >Item A: Branch A >Item B: Branch A >Item C: Branch B >2. Check out Item A to yourself >3. Edit Item B to have a lost status >4. Go to Administration -> global system preferences. Search for >OPACResultsUnavailableGroupingBy. >5. By default, this preference will be set to 'branch'. >6. Open the OPAC in another tab, and search for your record. >7. Confirm the search results shows an Availability line with "Not >available: Branch A: Checked out (1). Branch A: Lost (1)." i.e. showing >both branch and substatus. >8. In your staff client tab, set OPACResultsUnavailableGroupingBy to >'substatus'. >9. Go back to your OPAC tab and search for your record. Confirm the >search results shows an Availability line with "Not available: Checked >out (1). Lost (1)." i.e. showing substatus only. >10. Apply patch, update database, restart services. >11. In your staff client tab, refresh the page. Confirm the options for >OPACResultsUnavailableGroupingBy have now changed to: >- branch and substatus >- substatus only >- branch only >12. Set OPACResultsUnavailableGroupingBy to 'branch only'. >13. Go back to your OPAC tab and search for your record. Confirm the >search results shows an Availability line with "Not available: Branch A >(2)." i.e. showing branch only. >14. Confirm the other two options still work as expected. > >Sponsored-by: Chartered Accountants Australia and New Zealand > >Signed-off-by: David Nind <david@davidnind.com> >--- > ...OPACResultsUnavailableGroupingBy_syspref.pl | 12 ++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 2 +- > .../en/modules/admin/preferences/opac.pref | 5 +++-- > .../en/xslt/MARC21slim2OPACResults.xsl | 18 ++++++++++++++++++ > 4 files changed, 34 insertions(+), 3 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_30880_-_add_option_OPACResultsUnavailableGroupingBy_syspref.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_30880_-_add_option_OPACResultsUnavailableGroupingBy_syspref.pl b/installer/data/mysql/atomicupdate/bug_30880_-_add_option_OPACResultsUnavailableGroupingBy_syspref.pl >new file mode 100644 >index 0000000000..2d79b90d6c >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_30880_-_add_option_OPACResultsUnavailableGroupingBy_syspref.pl >@@ -0,0 +1,12 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "30880", >+ description => "Add branchonly option to OPACResultsUnavailableGroupingBy syspref", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ $dbh->do(q{ UPDATE systempreferences SET options = 'branch|substatus|branchonly', explanation = 'Group OPAC XSLT results by branch and substatus, or substatus only, or branch only' WHERE variable = 'OPACResultsUnavailableGroupingBy' }); >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index c1162d9f6c..fdf3fc2c70 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -467,7 +467,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'), > ('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'), > ('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'), >-('OPACResultsUnavailableGroupingBy','branch','branch|substatus','Group OPAC XSLT results by branch or substatus','Choice'), >+('OPACResultsUnavailableGroupingBy','branch','branch|substatus|branchonly','Group OPAC XSLT results by branch and substatus, or substatus only, or branch only','Choice'), > ('OPACSearchForTitleIn','<a href=\"https://worldcat.org/search?q={TITLE}\" target=\"_blank\">Other Libraries (WorldCat)</a>\n<a href=\"https://scholar.google.com/scholar?q={TITLE}\" target=\"_blank\">Other Databases (Google Scholar)</a>\n<a href=\"https://www.bookfinder.com/search/?author={AUTHOR}&title={TITLE}&st=xl&ac=qr\" target=\"_blank\">Online Stores (Bookfinder.com)</a>\n<a href=\"https://openlibrary.org/search?author=({AUTHOR})&title=({TITLE})\" target=\"_blank\">Open Library (openlibrary.org)</a>','70|10','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','Textarea'), > ('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'), > ('OpacSeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings (OPAC)','Choice'), >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 ea9e864911..1044f76fd7 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 >@@ -330,8 +330,9 @@ OPAC: > - Group unavailable items by > - pref: OPACResultsUnavailableGroupingBy > choices: >- branch: "branch" >- substatus: "substatus" >+ branch: "branch and substatus" >+ substatus: "substatus only" >+ branchonly: "branch only" > - ". (NOTE: For large consortia we recommend to group unavailable items by substatus, listing item counts only.)" > > Features: >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index f20f7d6748..599e2e996c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -1387,6 +1387,24 @@ > </xsl:call-template> > </xsl:for-each> > </xsl:when> >+ <xsl:when test="$OPACResultsUnavailableGroupingBy='branchonly'"> >+ <!-- Only group by branch, do not list substatuses and individual call numbers --> >+ <xsl:for-each select="items:items/items:item[not(items:resultbranch=preceding-sibling::*/items:resultbranch)]"> >+ <xsl:sort select="items:resultbranch"/> >+ <xsl:variable name="currentbranch" select="items:resultbranch"/> >+ <xsl:if test="count($unavailable_items[items:resultbranch=$currentbranch])>0"> >+ <span class="ItemSummary unavailable"> >+ <xsl:value-of select="$currentbranch"/> >+ <span class="unavailable"> >+ <xsl:text> (</xsl:text> >+ <xsl:value-of select="count($unavailable_items[items:resultbranch=$currentbranch])"/> >+ <xsl:text>)</xsl:text> >+ </span> >+ <xsl:text>. </xsl:text> >+ </span> >+ </xsl:if> >+ </xsl:for-each> >+ </xsl:when> > </xsl:choose> > </span></xsl:if> > >-- >2.30.2
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 30880
:
135563
|
137324
|
139480
|
139481