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

(-)a/C4/XSLT.pm (-1 / +1 lines)
Lines 187-193 sub XSLTParse4Display { Link Here
187
                              OPACBaseURL TraceCompleteSubfields UseICU
187
                              OPACBaseURL TraceCompleteSubfields UseICU
188
                              UseAuthoritiesForTracings TraceSubjectSubdivisions
188
                              UseAuthoritiesForTracings TraceSubjectSubdivisions
189
                              Display856uAsImage OPACDisplay856uAsImage 
189
                              Display856uAsImage OPACDisplay856uAsImage 
190
                              UseControlNumber
190
                              UseControlNumber ResultsBranchXSLT
191
                              AlternateHoldingsField AlternateHoldingsSeparator / )
191
                              AlternateHoldingsField AlternateHoldingsSeparator / )
192
    {
192
    {
193
        my $sp = C4::Context->preference( $syspref );
193
        my $sp = C4::Context->preference( $syspref );
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 363-365 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( Link Here
363
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','all',NULL,'disable|all|details','Choice');
363
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','all',NULL,'disable|all|details','Choice');
364
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo');
364
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo');
365
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SvcMaxReportRows','10','Maximum number of rows to return via the report web service.',NULL,'Integer');
365
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SvcMaxReportRows','10','Maximum number of rows to return via the report web service.',NULL,'Integer');
366
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('OPACResultsBranchXSLT', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice');
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 5246-5251 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5246
    SetVersion($DBversion);
5246
    SetVersion($DBversion);
5247
}
5247
}
5248
5248
5249
$DBversion = "3.09.00.XXX";
5250
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5251
    $dbh->do("INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('OPACResultsBranchXSLT', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice')");
5252
    print "Upgrade to $DBversion done (Adds permissions flag for access to the patron modifications tool)\n";
5253
    SetVersion($DBversion);
5254
}
5255
5249
=head1 FUNCTIONS
5256
=head1 FUNCTIONS
5250
5257
5251
=head2 TableExists($table)
5258
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+7 lines)
Lines 73-78 OPAC: Link Here
73
                  no: "don't show"
73
                  no: "don't show"
74
            - icons for itemtype and authorized values.
74
            - icons for itemtype and authorized values.
75
        -
75
        -
76
            - On search result pages displayed with XSLT stylesheets on the OPAC, show the item's
77
            - pref: OPACResultsBranchXSLT
78
              choices:
79
                  holdingbranch: "holding branch"
80
                  homebranch: "home branch"
81
            - icons for itemtype and authorized values.
82
        -
76
            - pref: COinSinOPACResults
83
            - pref: COinSinOPACResults
77
              choices:
84
              choices:
78
                  yes: Include
85
                  yes: Include
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl (-20 / +47 lines)
Lines 9-15 Link Here
9
    <xsl:import href="MARC21slimUtils.xsl"/>
9
    <xsl:import href="MARC21slimUtils.xsl"/>
10
    <xsl:output method = "xml" indent="yes" omit-xml-declaration = "yes" />
10
    <xsl:output method = "xml" indent="yes" omit-xml-declaration = "yes" />
11
    <xsl:key name="item-by-status" match="items:item" use="items:status"/>
11
    <xsl:key name="item-by-status" match="items:item" use="items:status"/>
12
    <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:holdingbranch)"/>
12
    <xsl:if test="$OPACResultsBranchXSLT='holdingbranch'">
13
        <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:holdingbranch)"/>
14
    </xsl:if>
15
    <xsl:if test="$OPACResultsBranchXSLT='homebranch'">
16
        <xsl:key name="item-by-status-and-branch" match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
17
    </xsl:if>
13
18
14
    <xsl:template match="/">
19
    <xsl:template match="/">
15
            <xsl:apply-templates/>
20
            <xsl:apply-templates/>
Lines 1014-1027 Link Here
1014
                       <b><xsl:text>Copies available for loan: </xsl:text></b>
1019
                       <b><xsl:text>Copies available for loan: </xsl:text></b>
1015
                       <xsl:variable name="available_items"
1020
                       <xsl:variable name="available_items"
1016
                           select="key('item-by-status', 'available')"/>
1021
                           select="key('item-by-status', 'available')"/>
1017
                       <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch))[1])]">
1022
                       <xsl:if test="$OPACResultsBranchXSLT='holdingbranch'">
1018
                           <xsl:value-of select="items:holdingbranch"/>
1023
                           <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch))[1])]">
1019
						   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1024
                               <xsl:value-of select="items:holdingbranch"/>
1020
                           <xsl:text> (</xsl:text>
1025
                               <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1021
                           <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch)))"/>
1026
                               <xsl:text> (</xsl:text>
1022
                           <xsl:text>)</xsl:text>
1027
                               <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch)))"/>
1023
<xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1028
                               <xsl:text>)</xsl:text>
1024
                       </xsl:for-each>
1029
                               <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1030
                           </xsl:for-each>
1031
                       </xsl:if>
1032
                       <xsl:if test="$OPACResultsBranchXSLT='homebranch'">
1033
                           <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1034
                               <xsl:value-of select="items:homebranch"/>
1035
                               <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1036
                               <xsl:text> (</xsl:text>
1037
                               <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1038
                               <xsl:text>)</xsl:text>
1039
                               <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1040
                           </xsl:for-each>
1041
                       </xsl:if>
1025
                   </span>
1042
                   </span>
1026
                   </xsl:when>
1043
                   </xsl:when>
1027
				   </xsl:choose>
1044
				   </xsl:choose>
Lines 1036-1051 Link Here
1036
                   <xsl:when test="count(key('item-by-status', 'reference'))>0">
1053
                   <xsl:when test="count(key('item-by-status', 'reference'))>0">
1037
                   <span class="available">
1054
                   <span class="available">
1038
                       <b><xsl:text>Copies available for reference: </xsl:text></b>
1055
                       <b><xsl:text>Copies available for reference: </xsl:text></b>
1039
                       <xsl:variable name="reference_items"
1056
                       <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1040
                           select="key('item-by-status', 'reference')"/>
1057
                       <xsl:if test="$OPACResultsBranchXSLT='holdingbranch'">
1041
                       <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch))[1])]">
1058
                           <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch))[1])]">
1042
                           <xsl:value-of select="items:holdingbranch"/>
1059
                               <xsl:value-of select="items:holdingbranch"/>
1043
						   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1060
                               <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1044
                           <xsl:text> (</xsl:text>
1061
                               <xsl:text> (</xsl:text>
1045
                           <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch)))"/>
1062
                               <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch)))"/>
1046
                           <xsl:text>)</xsl:text>
1063
                               <xsl:text>)</xsl:text>
1047
                   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1064
                               <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1048
                       </xsl:for-each>
1065
                           </xsl:for-each>
1066
                       </xsl:if>
1067
                       <xsl:if test="$OPACResultsBranchXSLT='homebranch'">
1068
                           <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1069
                               <xsl:value-of select="items:homebranch"/>
1070
                               <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1071
                               <xsl:text> (</xsl:text>
1072
                               <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1073
                               <xsl:text>)</xsl:text>
1074
                               <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1075
                           </xsl:for-each>
1076
                       </xsl:if>
1049
                   </span>
1077
                   </span>
1050
                   </xsl:when>
1078
                   </xsl:when>
1051
                   </xsl:choose>
1079
                   </xsl:choose>
1052
- 

Return to bug 7441