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

(-)a/C4/XSLT.pm (-8 / +11 lines)
Lines 170-176 sub get_xslt_sysprefs { Link Here
170
                              UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
170
                              UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
171
                              OPACItemLocation DisplayIconsXSLT
171
                              OPACItemLocation DisplayIconsXSLT
172
                              AlternateHoldingsField AlternateHoldingsSeparator
172
                              AlternateHoldingsField AlternateHoldingsSeparator
173
                              TrackClicks opacthemes IdRef OpacSuppression / )
173
                              TrackClicks opacthemes IdRef OpacSuppression 
174
                              OPACResultsLibrary / )
174
    {
175
    {
175
        my $sp = C4::Context->preference( $syspref );
176
        my $sp = C4::Context->preference( $syspref );
176
        next unless defined($sp);
177
        next unless defined($sp);
Lines 310-322 sub buildKohaItemsNamespace { Link Here
310
        $location = $item->{location}? xml_escape($shelflocations->{$item->{location}}||$item->{location}):'';
311
        $location = $item->{location}? xml_escape($shelflocations->{$item->{location}}||$item->{location}):'';
311
        $ccode = $item->{ccode}? xml_escape($ccodes->{$item->{ccode}}||$item->{ccode}):'';
312
        $ccode = $item->{ccode}? xml_escape($ccodes->{$item->{ccode}}||$item->{ccode}):'';
312
        my $itemcallnumber = xml_escape($item->{itemcallnumber});
313
        my $itemcallnumber = xml_escape($item->{itemcallnumber});
313
        $xml.= "<item><homebranch>$homebranch</homebranch>".
314
        $xml .=
314
                "<holdingbranch>$holdingbranch</holdingbranch>".
315
            "<item>"
315
                "<location>$location</location>".
316
          . "<homebranch>$homebranch</homebranch>"
316
                "<ccode>$ccode</ccode>".
317
          . "<holdingbranch>$holdingbranch</holdingbranch>"
317
                "<status>$status</status>".
318
          . "<location>$location</location>"
318
                "<itemcallnumber>".$itemcallnumber."</itemcallnumber>".
319
          . "<ccode>$ccode</ccode>"
319
                "</item>";
320
          . "<status>$status</status>"
321
          . "<itemcallnumber>$itemcallnumber</itemcallnumber>"
322
          . "</item>";
320
    }
323
    }
321
    $xml = "<items xmlns=\"http://www.koha-community.org/items\">".$xml."</items>";
324
    $xml = "<items xmlns=\"http://www.koha-community.org/items\">".$xml."</items>";
322
    return $xml;
325
    return $xml;
(-)a/installer/data/mysql/atomicupdate/bug_7441.sql (+2 lines)
Line 0 Link Here
1
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES
2
('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 333-338 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
333
('OpacRenewalAllowed','0',NULL,'If ON, users can renew their issues directly from their OPAC account','YesNo'),
333
('OpacRenewalAllowed','0',NULL,'If ON, users can renew their issues directly from their OPAC account','YesNo'),
334
('OpacRenewalBranch','checkoutbranch','itemhomebranch|patronhomebranch|checkoutbranch|null','Choose how the branch for an OPAC renewal is recorded in statistics','Choice'),
334
('OpacRenewalBranch','checkoutbranch','itemhomebranch|patronhomebranch|checkoutbranch|null','Choose how the branch for an OPAC renewal is recorded in statistics','Choice'),
335
('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'),
335
('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'),
336
('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'),
336
('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'),
337
('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'),
337
('OPACSearchForTitleIn','<li><a  href=\"http://worldcat.org/search?q={TITLE}\" target=\"_blank\">Other Libraries (WorldCat)</a></li>\n<li><a href=\"http://www.scholar.google.com/scholar?q={TITLE}\" target=\"_blank\">Other Databases (Google Scholar)</a></li>\n<li><a href=\"http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr\" target=\"_blank\">Online Stores (Bookfinder.com)</a></li>\n<li><a href=\"http://openlibrary.org/search/?author=({AUTHOR})&title=({TITLE})\" target=\"_blank\">Open Library (openlibrary.org)</a></li>','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'),
338
('OPACSearchForTitleIn','<li><a  href=\"http://worldcat.org/search?q={TITLE}\" target=\"_blank\">Other Libraries (WorldCat)</a></li>\n<li><a href=\"http://www.scholar.google.com/scholar?q={TITLE}\" target=\"_blank\">Other Databases (Google Scholar)</a></li>\n<li><a href=\"http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr\" target=\"_blank\">Online Stores (Bookfinder.com)</a></li>\n<li><a href=\"http://openlibrary.org/search/?author=({AUTHOR})&title=({TITLE})\" target=\"_blank\">Open Library (openlibrary.org)</a></li>','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'),
338
('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'),
339
('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 1-6 Link Here
1
OPAC:
1
OPAC:
2
    Appearance:
2
    Appearance:
3
        -
3
        -
4
            - For search results in the OPAC, show the item's
5
            - pref: OPACResultsLibrary
6
              choices:
7
                  holdingbranch: "current location"
8
                  homebranch: "home library"
9
        -
4
            - Use the
10
            - Use the
5
            - pref: opacthemes
11
            - pref: opacthemes
6
              choices: opac-templates
12
              choices: opac-templates
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl (-34 / +55 lines)
Lines 10-16 Link Here
10
    <xsl:import href="MARC21slimUtils.xsl"/>
10
    <xsl:import href="MARC21slimUtils.xsl"/>
11
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
11
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
12
    <xsl:key name="item-by-status" match="items:item" use="items:status"/>
12
    <xsl:key name="item-by-status" match="items:item" use="items:status"/>
13
    <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
13
    <xsl:key name="item-by-status-and-branch-home" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
14
    <xsl:key name="item-by-status-and-branch-holding" match="items:item" use="concat(items:status, ' ', items:holdingbranch)"/>
14
15
15
    <xsl:template match="/">
16
    <xsl:template match="/">
16
            <xsl:apply-templates/>
17
            <xsl:apply-templates/>
Lines 20-25 Link Here
20
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
21
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
21
        <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
22
        <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
22
23
24
    <xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/>
23
    <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
25
    <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
24
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
26
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
25
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
27
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
Lines 1166-1200 Link Here
1166
                       <xsl:variable name="available_items"
1168
                       <xsl:variable name="available_items"
1167
                           select="key('item-by-status', 'available')"/>
1169
                           select="key('item-by-status', 'available')"/>
1168
               <xsl:choose>
1170
               <xsl:choose>
1169
               <xsl:when test="$singleBranchMode=1">
1171
                   <xsl:when test="$singleBranchMode=1">
1170
                   <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1172
                       <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1171
                       <span class="ItemSummary">
1173
                           <span class="ItemSummary">
1172
                           <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1174
                               <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1173
                           <xsl:text> (</xsl:text>
1175
                               <xsl:text> (</xsl:text>
1174
                               <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1176
                                   <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
1175
                           <xsl:text>)</xsl:text>
1177
                               <xsl:text>)</xsl:text>
1176
                           <xsl:choose>
1178
                               <xsl:choose>
1177
                               <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when>
1179
                                   <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when>
1178
                               <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise>
1180
                                   <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise>
1179
                           </xsl:choose>
1181
                               </xsl:choose>
1180
                        </span>
1182
                            </span>
1181
                   </xsl:for-each>
1183
                       </xsl:for-each>
1182
               </xsl:when>
1184
                   </xsl:when>
1183
               <xsl:otherwise>
1185
                   <xsl:otherwise>
1184
                   <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1186
                       <xsl:choose>
1185
                       <span class="ItemSummary">
1187
                            <xsl:when test="$OPACResultsLibrary='homebranch'">
1186
                           <xsl:value-of select="items:homebranch"/>
1188
                               <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1187
                           <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1189
                                   <span class="ItemSummary">
1188
                           <xsl:text> (</xsl:text>
1190
                                       <xsl:value-of select="items:homebranch"/>
1189
                               <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1191
                                       <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1190
                           <xsl:text>)</xsl:text>
1192
                                       <xsl:text> (</xsl:text>
1191
                           <xsl:choose>
1193
                                           <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
1192
                               <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when>
1194
                                       <xsl:text>)</xsl:text>
1193
                               <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise>
1195
                                       <xsl:choose>
1194
                           </xsl:choose>
1196
                                           <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when>
1195
                       </span>
1197
                                           <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise>
1196
                   </xsl:for-each>
1198
                                       </xsl:choose>
1197
               </xsl:otherwise>
1199
                                   </span>
1200
                               </xsl:for-each>
1201
                            </xsl:when>
1202
                            <xsl:otherwise>
1203
                               <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
1204
                                   <span class="ItemSummary">
1205
                                       <xsl:value-of select="items:holdingbranch"/>
1206
                                       <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1207
                                       <xsl:text> (</xsl:text>
1208
                                           <xsl:value-of select="count(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch)))"/>
1209
                                       <xsl:text>)</xsl:text>
1210
                                       <xsl:choose>
1211
                                           <xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when>
1212
                                           <xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise>
1213
                                       </xsl:choose>
1214
                                   </span>
1215
                               </xsl:for-each>
1216
                            </xsl:otherwise>
1217
                        </xsl:choose>
1218
                   </xsl:otherwise>
1198
               </xsl:choose>
1219
               </xsl:choose>
1199
1220
1200
           </span>
1221
           </span>
Lines 1206-1219 Link Here
1206
                    <span class="available">
1227
                    <span class="available">
1207
                        <b><xsl:text>Items available for reference: </xsl:text></b>
1228
                        <b><xsl:text>Items available for reference: </xsl:text></b>
1208
                        <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1229
                        <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1209
                        <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1230
                        <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1210
                            <span class="ItemSummary">
1231
                            <span class="ItemSummary">
1211
                                <xsl:if test="$singleBranchMode=0">
1232
                                <xsl:if test="$singleBranchMode=0">
1212
                                    <xsl:value-of select="items:homebranch"/>
1233
                                    <xsl:value-of select="items:homebranch"/>
1213
                                </xsl:if>
1234
                                </xsl:if>
1214
                                <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1235
                                <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<span class="LabelCallNumber">Call number: </span><xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1215
                                <xsl:text> (</xsl:text>
1236
                                <xsl:text> (</xsl:text>
1216
                                <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1237
                                <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
1217
                                <xsl:text>)</xsl:text>
1238
                                <xsl:text>)</xsl:text>
1218
                                <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1239
                                <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1219
                            </span>
1240
                            </span>
Lines 1280-1286 Link Here
1280
                <xsl:when test="count(key('item-by-status', 'available'))>0">
1301
                <xsl:when test="count(key('item-by-status', 'available'))>0">
1281
                    <span class="available">
1302
                    <span class="available">
1282
                        <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
1303
                        <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
1283
                        <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1304
                        <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1284
                            <xsl:choose>
1305
                            <xsl:choose>
1285
                                <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
1306
                                <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
1286
                                <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when>
1307
                                <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when>
Lines 1293-1299 Link Here
1293
                <xsl:when test="count(key('item-by-status', 'reference'))>0">
1314
                <xsl:when test="count(key('item-by-status', 'reference'))>0">
1294
                    <span class="available">
1315
                    <span class="available">
1295
                        <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1316
                        <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1296
                        <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1317
                        <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1297
                            <xsl:choose>
1318
                            <xsl:choose>
1298
                                <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
1319
                                <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
1299
                                <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when>
1320
                                <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl (-18 / +41 lines)
Lines 11-17 Link Here
11
<xsl:import href="UNIMARCslimUtils.xsl"/>
11
<xsl:import href="UNIMARCslimUtils.xsl"/>
12
<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
12
<xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/>
13
<xsl:key name="item-by-status" match="items:item" use="items:status"/>
13
<xsl:key name="item-by-status" match="items:item" use="items:status"/>
14
<xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
14
<xsl:key name="item-by-status-and-branch-home" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
15
<xsl:key name="item-by-status-and-branch-holding" match="items:item" use="concat(items:status, ' ', items:holdingbranch)"/>
15
16
16
<xsl:template match="/">
17
<xsl:template match="/">
17
  <xsl:apply-templates/>
18
  <xsl:apply-templates/>
Lines 25-30 Link Here
25
   select="marc:datafield[@tag=090]/marc:subfield[@code='a']"/>
26
   select="marc:datafield[@tag=090]/marc:subfield[@code='a']"/>
26
  <xsl:variable name="isbn"
27
  <xsl:variable name="isbn"
27
   select="marc:datafield[@tag=010]/marc:subfield[@code='a']"/>
28
   select="marc:datafield[@tag=010]/marc:subfield[@code='a']"/>
29
  <xsl:variable name="OPACResultsLibrary" select="marc:sysprefs/marc:syspref[@name='OPACResultsLibrary']"/>
28
  <xsl:variable name="BiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='BiblioDefaultView']"/>
30
  <xsl:variable name="BiblioDefaultView" select="marc:sysprefs/marc:syspref[@name='BiblioDefaultView']"/>
29
  <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
31
  <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
30
  <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
32
  <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
Lines 146-176 Link Here
146
          <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
148
          <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
147
      <xsl:choose>
149
      <xsl:choose>
148
      <xsl:when test="$singleBranchMode=1">
150
      <xsl:when test="$singleBranchMode=1">
149
      <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
151
      <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
150
        <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
152
        <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
151
          <xsl:text> (</xsl:text>
153
          <xsl:text> (</xsl:text>
152
          <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
154
          <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
153
          <xsl:text>)</xsl:text>
155
          <xsl:text>)</xsl:text>
154
          <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
156
          <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
155
      </xsl:for-each>
157
      </xsl:for-each>
156
      </xsl:when>
158
      </xsl:when>
157
      <xsl:otherwise>
159
      <xsl:otherwise>
158
          <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
160
          <xsl:choose>
159
            <xsl:value-of select="items:homebranch"/>
161
              <xsl:when test="$OPACResultsLibrary='homebranch'">
160
			    <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]
162
                  <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
161
			    </xsl:if>
163
                    <xsl:value-of select="items:homebranch"/>
162
            <xsl:text> (</xsl:text>
164
                        <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]
163
            <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
165
                        </xsl:if>
164
            <xsl:text>)</xsl:text>
166
                    <xsl:text> (</xsl:text>
165
            <xsl:choose>
167
                    <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
166
              <xsl:when test="position()=last()">
168
                    <xsl:text>)</xsl:text>
167
                <xsl:text>. </xsl:text>
169
                    <xsl:choose>
170
                      <xsl:when test="position()=last()">
171
                        <xsl:text>. </xsl:text>
172
                      </xsl:when>
173
                      <xsl:otherwise>
174
                        <xsl:text>, </xsl:text>
175
                      </xsl:otherwise>
176
                    </xsl:choose>
177
                  </xsl:for-each>
168
              </xsl:when>
178
              </xsl:when>
169
              <xsl:otherwise>
179
              <xsl:otherwise>
170
                <xsl:text>, </xsl:text>
180
                  <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
181
                    <xsl:value-of select="items:holdingbranch"/>
182
                        <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]
183
                        </xsl:if>
184
                    <xsl:text> (</xsl:text>
185
                    <xsl:value-of select="count(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch)))"/>
186
                    <xsl:text>)</xsl:text>
187
                    <xsl:choose>
188
                      <xsl:when test="position()=last()">
189
                        <xsl:text>. </xsl:text>
190
                      </xsl:when>
191
                      <xsl:otherwise>
192
                        <xsl:text>, </xsl:text>
193
                      </xsl:otherwise>
194
                    </xsl:choose>
195
                  </xsl:for-each>
171
              </xsl:otherwise>
196
              </xsl:otherwise>
172
            </xsl:choose>
197
            </xsl:choose>
173
          </xsl:for-each>
174
      </xsl:otherwise>
198
      </xsl:otherwise>
175
      </xsl:choose>
199
      </xsl:choose>
176
        </span>
200
        </span>
Lines 182-194 Link Here
182
          <b><xsl:text>Items available for reference: </xsl:text></b>
206
          <b><xsl:text>Items available for reference: </xsl:text></b>
183
          <xsl:variable name="reference_items"
207
          <xsl:variable name="reference_items"
184
                        select="key('item-by-status', 'reference')"/>
208
                        select="key('item-by-status', 'reference')"/>
185
          <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
209
          <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
186
            <xsl:if test="$singleBranchMode=0">
210
            <xsl:if test="$singleBranchMode=0">
187
                <xsl:value-of select="items:homebranch"/>
211
                <xsl:value-of select="items:homebranch"/>
188
            </xsl:if>
212
            </xsl:if>
189
            <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
213
            <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber">[<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
190
            <xsl:text> (</xsl:text>
214
            <xsl:text> (</xsl:text>
191
            <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
215
            <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
192
            <xsl:text>)</xsl:text>
216
            <xsl:text>)</xsl:text>
193
            <xsl:choose>
217
            <xsl:choose>
194
              <xsl:when test="position()=last()">
218
              <xsl:when test="position()=last()">
195
- 

Return to bug 7441