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

(-)a/C4/Search.pm (-8 / +8 lines)
Lines 1865-1872 sub searchResults { Link Here
1865
                $item->{'branchname'} = $branches{$item->{$otherbranch}};
1865
                $item->{'branchname'} = $branches{$item->{$otherbranch}};
1866
            }
1866
            }
1867
1867
1868
			my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber};
1868
            my $prefix = $item->{$hbranch} . '--' . $item->{location} . $item->{itype} . $item->{itemcallnumber};
1869
# For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item
1869
            # For each grouping of items (onloan, available, unavailable), we build a key to store relevant info about that item
1870
            my $userenv = C4::Context->userenv;
1870
            my $userenv = C4::Context->userenv;
1871
            if ( $item->{onloan} && !(C4::Members::GetHideLostItemsPreference($userenv->{'number'}) && $item->{itemlost}) ) {
1871
            if ( $item->{onloan} && !(C4::Members::GetHideLostItemsPreference($userenv->{'number'}) && $item->{itemlost}) ) {
1872
                $onloan_count++;
1872
                $onloan_count++;
Lines 1975-1986 sub searchResults { Link Here
1975
                else {
1975
                else {
1976
                    $can_place_holds = 1;
1976
                    $can_place_holds = 1;
1977
                    $available_count++;
1977
                    $available_count++;
1978
					$available_items->{$prefix}->{count}++ if $item->{$hbranch};
1978
                    $available_items->{$prefix}->{count}++ if $item->{$hbranch};
1979
					foreach (qw(branchname itemcallnumber description)) {
1979
                    foreach (qw(branchname itemcallnumber description homebranch holdingbranch)) {
1980
                    	$available_items->{$prefix}->{$_} = $item->{$_};
1980
                        $available_items->{$prefix}->{$_} = $item->{$_};
1981
					}
1981
                    }
1982
					$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} };
1982
                    $available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} };
1983
					$available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} );
1983
                    $available_items->{$prefix}->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $item->{itype} }->{imageurl} );
1984
                }
1984
                }
1985
            }
1985
            }
1986
        }    # notforloan, item level and biblioitem level
1986
        }    # notforloan, item level and biblioitem level
(-)a/C4/XSLT.pm (-1 / +1 lines)
Lines 207-213 sub XSLTParse4Display { Link Here
207
                              UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
207
                              UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
208
                              singleBranchMode OPACItemLocation DisplayIconsXSLT
208
                              singleBranchMode OPACItemLocation DisplayIconsXSLT
209
                              AlternateHoldingsField AlternateHoldingsSeparator
209
                              AlternateHoldingsField AlternateHoldingsSeparator
210
                              TrackClicks OPACResultsBranchXSLT / )
210
                              TrackClicks OPACResultsBranch / )
211
    {
211
    {
212
        my $sp = C4::Context->preference( $syspref );
212
        my $sp = C4::Context->preference( $syspref );
213
        next unless defined($sp);
213
        next unless defined($sp);
(-)a/Koha/Template/Plugin/Koha.pm (+1 lines)
Lines 21-26 use Modern::Perl; Link Here
21
21
22
use base qw( Template::Plugin );
22
use base qw( Template::Plugin );
23
23
24
use C4::Koha;
24
use C4::Context;
25
use C4::Context;
25
26
26
=pod
27
=pod
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 427-430 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
427
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo');
427
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo');
428
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo');
428
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo');
429
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
429
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
430
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');
430
INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('OPACResultsBranch', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results.', 'Choice');
(-)a/installer/data/mysql/updatedatabase.pl (-2 / +2 lines)
Lines 6993-7000 if ( CheckVersion($DBversion) ) { Link Here
6993
6993
6994
$DBversion = "3.13.00.XXX";
6994
$DBversion = "3.13.00.XXX";
6995
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6995
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
6996
    $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')");
6996
    $dbh->do("INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('OPACResultsBranch', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice')");
6997
    print "Upgrade to $DBversion done (Add syspref OPACResultsBranchXSLT)\n";
6997
    print "Upgrade to $DBversion done (Add syspref OPACResultsBranch)\n";
6998
    SetVersion($DBversion);
6998
    SetVersion($DBversion);
6999
}
6999
}
7000
7000
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-2 / +1 lines)
Lines 84-94 OPAC: Link Here
84
            - the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC.
84
            - the format, audience, and material type icons in XSLT MARC21 results and detail pages in the OPAC.
85
        -
85
        -
86
            - On search result pages displayed with XSLT stylesheets on the OPAC, show the item's
86
            - On search result pages displayed with XSLT stylesheets on the OPAC, show the item's
87
            - pref: OPACResultsBranchXSLT
87
            - pref: OPACResultsBranch
88
              choices:
88
              choices:
89
                  holdingbranch: "holding branch"
89
                  holdingbranch: "holding branch"
90
                  homebranch: "home branch"
90
                  homebranch: "home branch"
91
            - icons for itemtype and authorized values.
92
        -
91
        -
93
            - pref: COinSinOPACResults
92
            - pref: COinSinOPACResults
94
              choices:
93
              choices:
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (-2 / +7 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
2
[% USE KohaBranchName %]
1
[% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnList ) %]
3
[% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnList ) %]
2
[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %]
4
[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %]
3
5
Lines 538-546 $(document).ready(function(){ Link Here
538
                    [% IF ( singleBranchMode ) %]
540
                    [% IF ( singleBranchMode ) %]
539
                        [% available_items_loo.location %]
541
                        [% available_items_loo.location %]
540
                    [% ELSE %]
542
                    [% ELSE %]
541
                        [% available_items_loo.branchname %]
543
                        [% IF Koha.Preference('OPACResultsBranch') == 'homebranch' %]
544
                            [% available_items_loo.homebranch | $KohaBranchName %]
545
                        [% ELSE %]
546
                            [% available_items_loo.holdingbranch | $KohaBranchName %]
547
                        [% END %]
542
                    [% END %]
548
                    [% END %]
543
544
                    [% IF ( OPACItemsResultsDisplay ) %]
549
                    [% IF ( OPACItemsResultsDisplay ) %]
545
                        [% UNLESS ( singleBranchMode ) %][% available_items_loo.location %][% END %]
550
                        [% UNLESS ( singleBranchMode ) %][% available_items_loo.location %][% END %]
546
                        [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% available_items_loo.itemcallnumber |url %]">[% available_items_loo.itemcallnumber %]</a>][% END %]
551
                        [% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% available_items_loo.itemcallnumber |url %]">[% available_items_loo.itemcallnumber %]</a>][% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl (-5 / +5 lines)
Lines 20-26 Link Here
20
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
20
        <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
21
        <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
21
        <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
22
22
23
    <xsl:variable name="OPACResultsBranchXSLT" select="marc:sysprefs/marc:syspref[@name='OPACResultsBranchXSLT']"/>
23
    <xsl:variable name="OPACResultsBranch" select="marc:sysprefs/marc:syspref[@name='OPACResultsBranch']"/>
24
    <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
24
    <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
25
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
25
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
26
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
26
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
Lines 1064-1070 Link Here
1064
                   </xsl:when>
1064
                   </xsl:when>
1065
                   <xsl:otherwise>
1065
                   <xsl:otherwise>
1066
                        <xsl:choose>
1066
                        <xsl:choose>
1067
                            <xsl:when test="$OPACResultsBranchXSLT='homebranch'">
1067
                            <xsl:when test="$OPACResultsBranch='homebranch'">
1068
                                <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1068
                                <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1069
                                    <xsl:value-of select="items:homebranch"/>
1069
                                    <xsl:value-of select="items:homebranch"/>
1070
                                    <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1070
                                    <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
Lines 1074-1080 Link Here
1074
                                    <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
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>
1075
                               </xsl:for-each>
1076
                            </xsl:when>
1076
                            </xsl:when>
1077
                            <xsl:when test="$OPACResultsBranchXSLT='holdingbranch'">
1077
                            <xsl:when test="$OPACResultsBranch='holdingbranch'">
1078
                               <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
1078
                               <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
1079
                                   <xsl:value-of select="items:holdingbranch"/>
1079
                                   <xsl:value-of select="items:holdingbranch"/>
1080
                                   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1080
                                   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
Lines 1099-1105 Link Here
1099
                               <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1099
                               <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1100
1100
1101
                              <xsl:choose>
1101
                              <xsl:choose>
1102
                                  <xsl:when test="$OPACResultsBranchXSLT='homebranch'">
1102
                                  <xsl:when test="$OPACResultsBranch='homebranch'">
1103
                                      <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1103
                                      <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
1104
                                          <xsl:value-of select="items:homebranch"/>
1104
                                          <xsl:value-of select="items:homebranch"/>
1105
                                          <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1105
                                          <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
Lines 1109-1115 Link Here
1109
                                          <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1109
                                          <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1110
                                      </xsl:for-each>
1110
                                      </xsl:for-each>
1111
                                  </xsl:when>
1111
                                  </xsl:when>
1112
                                  <xsl:when test="$OPACResultsBranchXSLT='holdingbranch'">
1112
                                  <xsl:when test="$OPACResultsBranch='holdingbranch'">
1113
                                      <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
1113
                                      <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
1114
                                          <xsl:value-of select="items:holdingbranch"/>
1114
                                          <xsl:value-of select="items:holdingbranch"/>
1115
                                          <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1115
                                          <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl (-6 / +5 lines)
Lines 28-34 Link Here
28
  <xsl:variable name="isbn"
28
  <xsl:variable name="isbn"
29
   select="marc:datafield[@tag=010]/marc:subfield[@code='a']"/>
29
   select="marc:datafield[@tag=010]/marc:subfield[@code='a']"/>
30
30
31
  <xsl:variable name="OPACResultsBranchXSLT" select="marc:sysprefs/marc:syspref[@name='OPACResultsBranchXSLT']"/>
31
  <xsl:variable name="OPACResultsBranch" select="marc:sysprefs/marc:syspref[@name='OPACResultsBranch']"/>
32
  <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
32
  <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
33
  <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
33
  <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
34
34
Lines 147-153 Link Here
147
        </xsl:when>
147
        </xsl:when>
148
        <xsl:otherwise>
148
        <xsl:otherwise>
149
          <xsl:choose>
149
          <xsl:choose>
150
            <xsl:when test="$OPACResultsBranchXSLT='homebranch'">
150
            <xsl:when test="$OPACResultsBranch='homebranch'">
151
              <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-home', 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])]">
152
                <xsl:value-of select="items:homebranch"/>
152
                <xsl:value-of select="items:homebranch"/>
153
                <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
153
                <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
Lines 157-163 Link Here
157
                <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
157
                <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
158
              </xsl:for-each>
158
              </xsl:for-each>
159
            </xsl:when>
159
            </xsl:when>
160
            <xsl:when test="$OPACResultsBranchXSLT='holdingbranch'">
160
            <xsl:when test="$OPACResultsBranch='holdingbranch'">
161
              <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
161
              <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
162
                <xsl:value-of select="items:holdingbranch"/>
162
                <xsl:value-of select="items:holdingbranch"/>
163
                <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
163
                <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
Lines 180-186 Link Here
180
          <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
180
          <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
181
181
182
          <xsl:choose>
182
          <xsl:choose>
183
              <xsl:when test="$OPACResultsBranchXSLT='homebranch'">
183
              <xsl:when test="$OPACResultsBranch='homebranch'">
184
                  <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
184
                  <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-home', concat(items:status, ' ', items:homebranch))[1])]">
185
                      <xsl:value-of select="items:homebranch"/>
185
                      <xsl:value-of select="items:homebranch"/>
186
                      <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
186
                      <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
Lines 190-196 Link Here
190
                      <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
190
                      <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
191
                  </xsl:for-each>
191
                  </xsl:for-each>
192
              </xsl:when>
192
              </xsl:when>
193
              <xsl:when test="$OPACResultsBranchXSLT='holdingbranch'">
193
              <xsl:when test="$OPACResultsBranch='holdingbranch'">
194
                  <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
194
                  <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch-holding', concat(items:status, ' ', items:holdingbranch))[1])]">
195
                      <xsl:value-of select="items:holdingbranch"/>
195
                      <xsl:value-of select="items:holdingbranch"/>
196
                      <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
196
                      <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
197
- 

Return to bug 7441