View | Details | Raw Unified | Return to bug 17624
Collapse All | Expand All

(-)a/C4/XSLT.pm (-1 / +1 lines)
Lines 170-176 sub get_xslt_sysprefs { Link Here
170
                              OPACItemLocation DisplayIconsXSLT
170
                              OPACItemLocation DisplayIconsXSLT
171
                              AlternateHoldingsField AlternateHoldingsSeparator
171
                              AlternateHoldingsField AlternateHoldingsSeparator
172
                              TrackClicks opacthemes IdRef OpacSuppression
172
                              TrackClicks opacthemes IdRef OpacSuppression
173
                              OPACResultsLibrary / )
173
                              OPACResultsLibrary OPACXSLTResultsHideNFL / )
174
    {
174
    {
175
        my $sp = C4::Context->preference( $syspref );
175
        my $sp = C4::Context->preference( $syspref );
176
        next unless defined($sp);
176
        next unless defined($sp);
(-)a/installer/data/mysql/atomicupdate/bug17624.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q|
4
INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('OPACXSLTResultsHideNFL', '0', NULL, 'Hide not-for-loans in OPAC XSLT results view', 'YesNo')|
5
    );
6
7
    SetVersion( $DBversion );
8
    print "Upgrade to $DBversion done (Bug 17624 - Hide not-for-loans in OPAC XSLT results)\n";
9
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 379-384 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
379
('OPACXSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on OPAC','Free'),
379
('OPACXSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on OPAC','Free'),
380
('OPACXSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on OPAC','Free'),
380
('OPACXSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on OPAC','Free'),
381
('OPACXSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on OPAC','Free'),
381
('OPACXSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on OPAC','Free'),
382
('OPACXSLTResultsHideNFL','0',NULL,'Hide not-for-loans in OPAC XSLT results view','YesNo'),
382
('OpenLibraryCovers','0',NULL,'If ON Openlibrary book covers will be show','YesNo'),
383
('OpenLibraryCovers','0',NULL,'If ON Openlibrary book covers will be show','YesNo'),
383
('OpenLibrarySearch','0',NULL,'If Yes Open Library search results will show in OPAC','YesNo'),
384
('OpenLibrarySearch','0',NULL,'If Yes Open Library search results will show in OPAC','YesNo'),
384
('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'),
385
('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +7 lines)
Lines 61-67 OPAC: Link Here
61
                  no: "Don't show"
61
                  no: "Don't show"
62
            - "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."
62
            - "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."
63
        -
63
        -
64
        -
65
            - "Show the following HTML when OpacMaintenance is enabled:"
64
            - "Show the following HTML when OpacMaintenance is enabled:"
66
            - pref: OpacMaintenanceNotice
65
            - pref: OpacMaintenanceNotice
67
              type: htmlarea
66
              type: htmlarea
Lines 343-348 OPAC: Link Here
343
                  both: "both top and footer"
342
                  both: "both top and footer"
344
                  top: "top"
343
                  top: "top"
345
                  footer: "only footer"
344
                  footer: "only footer"
345
        -
346
            - pref: OPACXSLTResultsHideNFL
347
              default: 0
348
              choices:
349
                  1: Hide
350
                  0: Show
351
            - not-for-loan items on the OPAC XSLT Results view.
346
    Features:
352
    Features:
347
        -
353
        -
348
            - pref: opacuserlogin
354
            - pref: opacuserlogin
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl (-6 / +6 lines)
Lines 21-26 Link Here
21
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
21
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
22
        <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
22
        <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
23
23
24
    <xsl:variable name="OPACXSLTResultsHideNFL" select="marc:sysprefs/marc:syspref[@name='OPACXSLTResultsHideNFL']"/>
24
    <xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/>
25
    <xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/>
25
    <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
26
    <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
26
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
27
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
Lines 1147-1153 Link Here
1147
                        <span class="results_summary availability">
1148
                        <span class="results_summary availability">
1148
                        <span class="label">Availability: </span>
1149
                        <span class="label">Availability: </span>
1149
                        <xsl:choose>
1150
                        <xsl:choose>
1150
				   <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">
1151
                   <xsl:when test="count(key('item-by-status', 'available'))=0 and ($OPACXSLTResultsHideNFL=1 or count(key('item-by-status', 'reference'))=0)">
1151
                        <xsl:choose>
1152
                        <xsl:choose>
1152
                            <xsl:when test="string-length($AlternateHoldingsField)=3 and marc:datafield[@tag=$AlternateHoldingsField]">
1153
                            <xsl:when test="string-length($AlternateHoldingsField)=3 and marc:datafield[@tag=$AlternateHoldingsField]">
1153
                            <xsl:variable name="AlternateHoldingsCount" select="count(marc:datafield[@tag=$AlternateHoldingsField])"/>
1154
                            <xsl:variable name="AlternateHoldingsCount" select="count(marc:datafield[@tag=$AlternateHoldingsField])"/>
Lines 1223-1229 Link Here
1223
				   </xsl:choose>
1224
				   </xsl:choose>
1224
1225
1225
            <xsl:choose>
1226
            <xsl:choose>
1226
                <xsl:when test="count(key('item-by-status', 'reference'))>0">
1227
                <xsl:when test="$OPACXSLTResultsHideNFL=0 and count(key('item-by-status', 'reference'))>0">
1227
                    <span class="available">
1228
                    <span class="available">
1228
                        <b><xsl:text>Items available for reference: </xsl:text></b>
1229
                        <b><xsl:text>Items available for reference: </xsl:text></b>
1229
                        <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1230
                        <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
Lines 1244-1250 Link Here
1244
            </xsl:choose>
1245
            </xsl:choose>
1245
1246
1246
                   <xsl:choose> <xsl:when test="count(key('item-by-status', 'available'))>0">
1247
                   <xsl:choose> <xsl:when test="count(key('item-by-status', 'available'))>0">
1247
                       <xsl:choose><xsl:when test="count(key('item-by-status', 'reference'))>0">
1248
                       <xsl:choose><xsl:when test="$OPACXSLTResultsHideNFL=0 and count(key('item-by-status', 'reference'))>0">
1248
                            <br/>
1249
                            <br/>
1249
                       </xsl:when></xsl:choose>
1250
                       </xsl:when></xsl:choose>
1250
                   </xsl:when> </xsl:choose>
1251
                   </xsl:when> </xsl:choose>
Lines 1294-1300 Link Here
1294
                   </xsl:if>
1295
                   </xsl:if>
1295
               </span>
1296
               </span>
1296
    <xsl:choose>
1297
    <xsl:choose>
1297
        <xsl:when test="($OPACItemLocation='location' or $OPACItemLocation='ccode') and (count(key('item-by-status', 'available'))!=0 or count(key('item-by-status', 'reference'))!=0)">
1298
        <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))">
1298
            <span class="results_summary location">
1299
            <span class="results_summary location">
1299
                <span class="label">Location(s): </span>
1300
                <span class="label">Location(s): </span>
1300
                <xsl:choose>
1301
                <xsl:choose>
Lines 1311-1317 Link Here
1311
                        </xsl:for-each>
1312
                        </xsl:for-each>
1312
                    </span>
1313
                    </span>
1313
                </xsl:when>
1314
                </xsl:when>
1314
                <xsl:when test="count(key('item-by-status', 'reference'))>0">
1315
                <xsl:when test="$OPACXSLTResultsHideNFL=0 and count(key('item-by-status', 'reference'))>0">
1315
                    <span class="available">
1316
                    <span class="available">
1316
                        <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1317
                        <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1317
                        <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1318
                        <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1318
- 

Return to bug 17624