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

(-)a/C4/XSLT.pm (-1 / +1 lines)
Lines 188-194 sub XSLTParse4Display { Link Here
188
                              UseAuthoritiesForTracings TraceSubjectSubdivisions
188
                              UseAuthoritiesForTracings TraceSubjectSubdivisions
189
                              Display856uAsImage OPACDisplay856uAsImage 
189
                              Display856uAsImage OPACDisplay856uAsImage 
190
                              UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
190
                              UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
191
                              singleBranchMode
191
                              singleBranchMode OPACResultsBranchXSLT
192
                              AlternateHoldingsField AlternateHoldingsSeparator / )
192
                              AlternateHoldingsField AlternateHoldingsSeparator / )
193
    {
193
    {
194
        my $sp = C4::Context->preference( $syspref );
194
        my $sp = C4::Context->preference( $syspref );
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 383-385 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
383
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowLibrariesPulldownMobile','1','Show the libraries pulldown on the mobile version of the OPAC.',NULL,'YesNo');
383
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowLibrariesPulldownMobile','1','Show the libraries pulldown on the mobile version of the OPAC.',NULL,'YesNo');
384
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowFiltersPulldownMobile','1','Show the search filters pulldown on the mobile version of the OPAC.',NULL,'YesNo');
384
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowFiltersPulldownMobile','1','Show the search filters pulldown on the mobile version of the OPAC.',NULL,'YesNo');
385
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('AuthDisplayHierarchy','0','Display authority hierarchies','','YesNo');
385
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('AuthDisplayHierarchy','0','Display authority hierarchies','','YesNo');
386
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 5982-5987 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5982
    SetVersion($DBversion);
5982
    SetVersion($DBversion);
5983
}
5983
}
5984
5984
5985
$DBversion = "3.09.00.XXX";
5986
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5987
    $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')");
5988
    print "Upgrade to $DBversion done (Adds permissions flag for access to the patron modifications tool)\n";
5989
    SetVersion($DBversion);
5990
}
5991
5985
=head1 FUNCTIONS
5992
=head1 FUNCTIONS
5986
5993
5987
=head2 TableExists($table)
5994
=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 (-22 / +51 lines)
Lines 9-15 Link Here
9
    <xsl:import href="MARC21slimUtils.xsl"/>
9
    <xsl:import href="MARC21slimUtils.xsl"/>
10
    <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" />
10
    <xsl:output method = "html" 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:key name="item-by-status-and-branch-holding" match="items:item" use="concat(items:status, ' ', items:holdingbranch)"/>
13
    <xsl:key name="item-by-status-and-branch-home"    match="items:item" use="concat(items:status, ' ', items:homebranch)"/>
13
14
14
    <xsl:template match="/">
15
    <xsl:template match="/">
15
            <xsl:apply-templates/>
16
            <xsl:apply-templates/>
Lines 19-24 Link Here
19
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
20
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
20
        <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
21
        <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
21
22
23
    <xsl:variable name="OPACResultsBranchXSLT" select="marc:sysprefs/marc:syspref[@name='OPACResultsBranchXSLT']"/>
22
    <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
24
    <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
23
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
25
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
24
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
26
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
Lines 1028-1050 Link Here
1028
                           select="key('item-by-status', 'available')"/>
1030
                           select="key('item-by-status', 'available')"/>
1029
               <xsl:choose>
1031
               <xsl:choose>
1030
                   <xsl:when test="$singleBranchMode=1">
1032
                   <xsl:when test="$singleBranchMode=1">
1031
                       <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1033
                       <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1032
                           <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1034
                           <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1033
                           <xsl:text> (</xsl:text>
1035
                           <xsl:text> (</xsl:text>
1034
                           <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1036
                           <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
1035
                           <xsl:text>)</xsl:text>
1037
                           <xsl:text>)</xsl:text>
1036
                           <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1038
                           <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1037
                       </xsl:for-each>
1039
                       </xsl:for-each>
1038
                   </xsl:when>
1040
                   </xsl:when>
1039
                   <xsl:otherwise>
1041
                   <xsl:otherwise>
1040
                       <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch))[1])]">
1042
                        <xsl:choose>
1041
                           <xsl:value-of select="items:holdingbranch"/>
1043
                            <xsl:when test="$OPACResultsBranchXSLT='homebranch'">
1042
                           <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1044
                               <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1043
                           <xsl:text> (</xsl:text>
1045
                                   <xsl:value-of select="items:homebranch"/>
1044
                           <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch)))"/>
1046
                                   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1045
                           <xsl:text>)</xsl:text>
1047
                                   <xsl:text> (</xsl:text>
1046
                           <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:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
1047
                       </xsl:for-each>
1049
                                   <xsl:text>)</xsl:text>
1050
                                   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1051
                               </xsl:for-each>
1052
                            </xsl:when>
1053
                            <xsl:when test="$OPACResultsBranchXSLT='holdingbranch'">
1054
                               <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
1055
                                   <xsl:value-of select="items:holdingbranch"/>
1056
                                   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1057
                                   <xsl:text> (</xsl:text>
1058
                                   <xsl:value-of select="count(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch)))"/>
1059
                                   <xsl:text>)</xsl:text>
1060
                                   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1061
                               </xsl:for-each>
1062
                            </xsl:when>
1063
                        </xsl:choose>
1048
                   </xsl:otherwise>
1064
                   </xsl:otherwise>
1049
               </xsl:choose>
1065
               </xsl:choose>
1050
           </span>
1066
           </span>
Lines 1062-1077 Link Here
1062
                   <xsl:when test="count(key('item-by-status', 'reference'))>0">
1078
                   <xsl:when test="count(key('item-by-status', 'reference'))>0">
1063
                   <span class="available">
1079
                   <span class="available">
1064
                       <b><xsl:text>Copies available for reference: </xsl:text></b>
1080
                       <b><xsl:text>Copies available for reference: </xsl:text></b>
1065
                       <xsl:variable name="reference_items"
1081
                       <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1066
                           select="key('item-by-status', 'reference')"/>
1082
1067
                       <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch))[1])]">
1083
                      <xsl:choose>
1068
                           <xsl:value-of select="items:holdingbranch"/>
1084
                          <xsl:when test="$OPACResultsBranchXSLT='homebranch'">
1069
						   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1085
                              <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1070
                           <xsl:text> (</xsl:text>
1086
                                  <xsl:value-of select="items:homebranch"/>
1071
                           <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:holdingbranch)))"/>
1087
                                  <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1072
                           <xsl:text>)</xsl:text>
1088
                                  <xsl:text> (</xsl:text>
1073
                   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1089
                                  <xsl:value-of select="count(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch)))"/>
1074
                       </xsl:for-each>
1090
                                  <xsl:text>)</xsl:text>
1091
                                  <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1092
                              </xsl:for-each>
1093
                          </xsl:when>
1094
                          <xsl:when test="$OPACResultsBranchXSLT='holdingbranch'">
1095
                              <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
1096
                                  <xsl:value-of select="items:holdingbranch"/>
1097
                                  <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1098
                                  <xsl:text> (</xsl:text>
1099
                                  <xsl:value-of select="count(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch)))"/>
1100
                                  <xsl:text>)</xsl:text>
1101
                                  <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1102
                              </xsl:for-each>
1103
                          </xsl:when>
1104
                      </xsl:choose>
1075
                   </span>
1105
                   </span>
1076
                   </xsl:when>
1106
                   </xsl:when>
1077
                   </xsl:choose>
1107
                   </xsl:choose>
1078
- 

Return to bug 7441