--- /dev/null
+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' });
+ },
+};
('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'),
- 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:
</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>