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

(-)a/C4/Search.pm (+29 lines)
Lines 1746-1751 sub searchResults { Link Here
1746
        $oldbiblio->{orderedcount}         = $ordered_count;
1746
        $oldbiblio->{orderedcount}         = $ordered_count;
1747
        $oldbiblio->{isbn} =~
1747
        $oldbiblio->{isbn} =~
1748
          s/-//g;    # deleting - in isbn to enable amazon content
1748
          s/-//g;    # deleting - in isbn to enable amazon content
1749
1750
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
1751
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
1752
            my $subfields = substr $fieldspec, 3;
1753
            my $holdingsep = C4::Context->preference("AlternateHoldingsSeparator") || ' ';
1754
            my @alternateholdingsinfo = ();
1755
            my @holdingsfields = $marcrecord->field(substr $fieldspec, 0, 3);
1756
            my $alternateholdingscount = 0;
1757
1758
            for my $field (@holdingsfields) {
1759
                my %holding = ( holding => '' );
1760
                my $havesubfield = 0;
1761
                for my $subfield ($field->subfields()) {
1762
                    if ((index $subfields, $$subfield[0]) >= 0) {
1763
                        $holding{'holding'} .= $holdingsep if (length $holding{'holding'} > 0);
1764
                        $holding{'holding'} .= $$subfield[1];
1765
                        $havesubfield++;
1766
                    }
1767
                }
1768
                if ($havesubfield) {
1769
                    push(@alternateholdingsinfo, \%holding);
1770
                    $alternateholdingscount++;
1771
                }
1772
            }
1773
1774
            $oldbiblio->{'ALTERNATEHOLDINGS'} = \@alternateholdingsinfo;
1775
            $oldbiblio->{'alternateholdings_count'} = $alternateholdingscount;
1776
        }
1777
1749
        push( @newresults, $oldbiblio )
1778
        push( @newresults, $oldbiblio )
1750
            if(not $hidelostitems
1779
            if(not $hidelostitems
1751
               or (($items_count > $itemlost_count )
1780
               or (($items_count > $itemlost_count )
(-)a/C4/XSLT.pm (-1 / +2 lines)
Lines 131-137 sub XSLTParse4Display { Link Here
131
    foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow
131
    foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow
132
                              DisplayOPACiconsXSLT URLLinkText viewISBD
132
                              DisplayOPACiconsXSLT URLLinkText viewISBD
133
                              OPACBaseURL TraceCompleteSubfields
133
                              OPACBaseURL TraceCompleteSubfields
134
                              UseAuthoritiesForTracings TraceSubjectSubdivisions / )
134
                              UseAuthoritiesForTracings TraceSubjectSubdivisions
135
                              AlternateHoldingsField AlternateHoldingsSeparator / )
135
    {
136
    {
136
        my $sp = C4::Context->preference( $syspref );
137
        my $sp = C4::Context->preference( $syspref );
137
        next unless defined($sp);
138
        next unless defined($sp);
(-)a/catalogue/detail.pl (+27 lines)
Lines 236-241 $template->param( Link Here
236
	C4::Search::enabled_staff_search_views,
236
	C4::Search::enabled_staff_search_views,
237
);
237
);
238
238
239
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
240
    my $fieldspec = C4::Context->preference("AlternateHoldingsField");
241
    my $subfields = substr $fieldspec, 3;
242
    my $holdingsep = C4::Context->preference("AlternateHoldingsSeparator") || ' ';
243
    my @alternateholdingsinfo = ();
244
    my @holdingsfields = $record->field(substr $fieldspec, 0, 3);
245
246
    for my $field (@holdingsfields) {
247
        my %holding = ( holding => '' );
248
        my $havesubfield = 0;
249
        for my $subfield ($field->subfields()) {
250
            if ((index $subfields, $$subfield[0]) >= 0) {
251
                $holding{'holding'} .= $holdingsep if (length $holding{'holding'} > 0);
252
                $holding{'holding'} .= $$subfield[1];
253
                $havesubfield++;
254
            }
255
        }
256
        if ($havesubfield) {
257
            push(@alternateholdingsinfo, \%holding);
258
        }
259
    }
260
261
    $template->param(
262
        ALTERNATEHOLDINGS   => \@alternateholdingsinfo,
263
        );
264
}
265
239
my @results = ( $dat, );
266
my @results = ( $dat, );
240
foreach ( keys %{$dat} ) {
267
foreach ( keys %{$dat} ) {
241
    $template->param( "$_" => defined $dat->{$_} ? $dat->{$_} : '' );
268
    $template->param( "$_" => defined $dat->{$_} ? $dat->{$_} : '' );
(-)a/installer/data/mysql/de-DE/mandatory/sysprefs.sql (+2 lines)
Lines 299-301 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( Link Here
299
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
299
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
300
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
300
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
301
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
301
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
302
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
303
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (+2 lines)
Lines 299-301 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( Link Here
299
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
299
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
300
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
300
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
301
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
301
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
302
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
303
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql (-1 / +2 lines)
Lines 301-304 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( Link Here
301
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
301
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
302
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
302
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
303
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
303
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
304
304
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
305
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
(-)a/installer/data/mysql/it-IT/necessari/sysprefs.sql (-1 / +3 lines)
Lines 285-288 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
285
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
285
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
286
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
286
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
287
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
287
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
288
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
288
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
289
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
290
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
(-)a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql (+2 lines)
Lines 298-300 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( Link Here
298
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
298
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
299
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
299
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
300
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
300
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
301
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
302
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
(-)a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql (-1 / +3 lines)
Lines 352-355 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
352
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
352
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
353
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
353
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
354
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
354
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
355
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
355
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
356
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
357
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
(-)a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql (+2 lines)
Lines 378-380 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( Link Here
378
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
378
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
379
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
379
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
380
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
380
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
381
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free');
382
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free');
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 4134-4139 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4134
    SetVersion ($DBversion);
4134
    SetVersion ($DBversion);
4135
}
4135
}
4136
4136
4137
$DBversion = "3.03.00.XXX";
4138
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4139
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsField','','The MARC field/subfield that contains alternate holdings information for bibs taht do not have items attached (e.g. 852abchi for libraries converting from MARC Magician).',NULL,'free')");
4140
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AlternateHoldingsSeparator','','The string to use to separate subfields in alternate holdings displays.',NULL,'free')");
4141
    print "Upgrade to $DBversion done (Add sysprefs to control alternate holdings information display)\n";
4142
    SetVersion ($DBversion);
4143
}
4144
4137
=head1 FUNCTIONS
4145
=head1 FUNCTIONS
4138
4146
4139
=head2 DropAllForeignKeys($table)
4147
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+6 lines)
Lines 52-57 Cataloging: Link Here
52
            - pref: itemcallnumber
52
            - pref: itemcallnumber
53
            - "to an item's callnumber. (This can contain multiple subfields to look in; for instance <code>082ab</code> would look in 082 subfields a and b.)<br />Examples: <strong>Dewey</strong>: <code>082ab</code> or <code>092ab</code>; <strong>LOC</strong>: <code>050ab</code> or <code>090ab</code>; <strong>from the item record</strong>: <code>852hi</code>"
53
            - "to an item's callnumber. (This can contain multiple subfields to look in; for instance <code>082ab</code> would look in 082 subfields a and b.)<br />Examples: <strong>Dewey</strong>: <code>082ab</code> or <code>092ab</code>; <strong>LOC</strong>: <code>050ab</code> or <code>090ab</code>; <strong>from the item record</strong>: <code>852hi</code>"
54
        -
54
        -
55
            - Display MARC subfield
56
            - pref: AlternateHoldingsField
57
            - "as holdings information for records that do not have items (This can contain multiple subfields to look in; for instance <code>852abhi</code> would look in 852 subfields a, b, h, and i.), with the subfields separated by"
58
            - pref: AlternateHoldingsSeparator
59
            - "."
60
        -
55
            - Fill in the <a href="http://www.loc.gov/marc/organizations/orgshome.html">MARC organization code</a>
61
            - Fill in the <a href="http://www.loc.gov/marc/organizations/orgshome.html">MARC organization code</a>
56
            - pref: MARCOrgCode
62
            - pref: MARCOrgCode
57
            - by default in new MARC records (leave blank to disable).
63
            - by default in new MARC records (leave blank to disable).
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl (-1 / +7 lines)
Lines 373-379 function verify_images() { Link Here
373
		</table>
373
		</table>
374
		<!-- /TMPL_IF -->
374
		<!-- /TMPL_IF -->
375
<!-- TMPL_ELSE -->
375
<!-- TMPL_ELSE -->
376
    <p>No physical items for this record</p>
376
    <!-- TMPL_IF NAME="ALTERNATEHOLDINGS" -->
377
    <!-- TMPL_LOOP NAME="ALTERNATEHOLDINGS" -->
378
        <div id="alternateholdings"><span class="holdings_label">Holdings:</span> <!-- TMPL_VAR NAME="holding" --></div>
379
    <!-- /TMPL_LOOP -->
380
    <!-- TMPL_ELSE -->
381
    <div id="noitems">No physical items for this record</div>
382
    <!-- /TMPL_IF -->
377
<!-- /TMPL_IF -->
383
<!-- /TMPL_IF -->
378
    </div>
384
    </div>
379
    
385
    
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl (+9 lines)
Lines 554-560 YAHOO.util.Event.onContentReady("searchheader", function () { Link Here
554
                                    <!-- /TMPL_LOOP --></ul>
554
                                    <!-- /TMPL_LOOP --></ul>
555
                                    <!-- /TMPL_IF -->
555
                                    <!-- /TMPL_IF -->
556
                                    <!-- TMPL_ELSE -->
556
                                    <!-- TMPL_ELSE -->
557
                                    <!-- TMPL_IF NAME="ALTERNATEHOLDINGS" -->
558
                                    <strong id="altholdings_heading">Other holdings:</strong>
559
                                    <ul>
560
                                    <!-- TMPL_LOOP NAME="ALTERNATEHOLDINGS" -->
561
                                    <li id="alternateholdings"><!-- TMPL_VAR NAME="holding" --></li>
562
                                    <!-- /TMPL_LOOP -->
563
                                    </li>
564
                                    <!-- TMPL_ELSE -->
557
                                    <span class="unavailable">No items</span>
565
                                    <span class="unavailable">No items</span>
566
                                    <!-- /TMPL_IF -->
558
                                    <!-- /TMPL_IF --> <!-- /items count -->
567
                                    <!-- /TMPL_IF --> <!-- /items count -->
559
                                    </div></td>
568
                                    </div></td>
560
569
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl (-1 / +7 lines)
Lines 418-424 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
418
	</table>
418
	</table>
419
    <!-- /TMPL_IF -->
419
    <!-- /TMPL_IF -->
420
<!-- TMPL_ELSE -->
420
<!-- TMPL_ELSE -->
421
<p>No physical items for this record</p>
421
    <!-- TMPL_IF NAME="ALTERNATEHOLDINGS" -->
422
    <!-- TMPL_LOOP NAME="ALTERNATEHOLDINGS" -->
423
        <div id="alternateholdings"><span class="holdings_label">Holdings:</span> <!-- TMPL_VAR NAME="holding" --></div>
424
    <!-- /TMPL_LOOP -->
425
    <!-- TMPL_ELSE -->
426
    <div id="noitems">No physical items for this record</div>
427
    <!-- /TMPL_IF -->
422
<!-- /TMPL_IF -->
428
<!-- /TMPL_IF -->
423
429
424
<!-- TMPL_IF NAME="OpenOPACShelfBrowser" -->
430
<!-- TMPL_IF NAME="OpenOPACShelfBrowser" -->
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl (-1 / +7 lines)
Lines 446-452 $(document).ready(function(){ Link Here
446
                    <!-- /TMPL_LOOP -->
446
                    <!-- /TMPL_LOOP -->
447
                    </span>
447
                    </span>
448
                    <!-- TMPL_ELSE -->
448
                    <!-- TMPL_ELSE -->
449
                    <span class="unavailable">No items available:</span>
449
                    <!-- TMPL_IF NAME="ALTERNATEHOLDINGS" -->
450
                    <!-- TMPL_LOOP NAME="ALTERNATEHOLDINGS" -->
451
                        &nbsp;<span id="alternateholdings"><!-- TMPL_VAR NAME="holding" --></span>,
452
                    <!-- /TMPL_LOOP -->
453
                    <!-- TMPL_ELSE -->
454
                        <span class="unavailable">No items available:</span>
455
                    <!-- /TMPL_IF -->
450
                    <!-- /TMPL_IF -->
456
                    <!-- /TMPL_IF -->
451
                    <span class="unavailable">
457
                    <span class="unavailable">
452
                    <!-- TMPL_IF NAME="onloancount" --> Checked out (<!-- TMPL_VAR NAME="onloancount" -->), <!-- /TMPL_IF -->
458
                    <!-- TMPL_IF NAME="onloancount" --> Checked out (<!-- TMPL_VAR NAME="onloancount" -->), <!-- /TMPL_IF -->
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl (-2 / +18 lines)
Lines 23-28 Link Here
23
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
23
    <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
24
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
24
    <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
25
    <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
25
    <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
26
    <xsl:variable name="AlternateHoldingsField" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 1, 3)"/>
27
    <xsl:variable name="AlternateHoldingsSubfields" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 4)"/>
28
    <xsl:variable name="AlternateHoldingsSeparator" select="marc:sysprefs/marc:syspref[@name='AlternateHoldingsSeparator']"/>
26
        <xsl:variable name="leader" select="marc:leader"/>
29
        <xsl:variable name="leader" select="marc:leader"/>
27
        <xsl:variable name="leader6" select="substring($leader,7,1)"/>
30
        <xsl:variable name="leader6" select="substring($leader,7,1)"/>
28
        <xsl:variable name="leader7" select="substring($leader,8,1)"/>
31
        <xsl:variable name="leader7" select="substring($leader,8,1)"/>
Lines 953-962 Link Here
953
                            </xsl:for-each>
956
                            </xsl:for-each>
954
                            </span>
957
                            </span>
955
                        </xsl:if>
958
                        </xsl:if>
956
                        <span class="results_summary">
959
                        <span class="results_summary" id="availability">
957
                        <span class="label">Availability: </span>
960
                        <span class="label">Availability: </span>
958
                        <xsl:choose>
961
                        <xsl:choose>
959
				   <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">No copies available
962
				   <xsl:when test="count(key('item-by-status', 'available'))=0 and count(key('item-by-status', 'reference'))=0">
963
                        <xsl:choose>
964
                            <xsl:when test="string-length($AlternateHoldingsField)=3 and marc:datafield[@tag=$AlternateHoldingsField]">
965
                            <xsl:variable name="AlternateHoldingsCount" select="count(marc:datafield[@tag=$AlternateHoldingsField])"/>
966
                            <xsl:for-each select="marc:datafield[@tag=$AlternateHoldingsField][1]">
967
                                <xsl:call-template select="marc:datafield[@tag=$AlternateHoldingsField]" name="subfieldSelect">
968
                                    <xsl:with-param name="codes"><xsl:value-of select="$AlternateHoldingsSubfields"/></xsl:with-param>
969
                                    <xsl:with-param name="delimeter"><xsl:value-of select="$AlternateHoldingsSeparator"/></xsl:with-param>
970
                                </xsl:call-template>
971
                            </xsl:for-each>
972
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
973
                            </xsl:when>
974
                            <xsl:otherwise>No copies available</xsl:otherwise>
975
                        </xsl:choose>
960
				   </xsl:when>
976
				   </xsl:when>
961
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
977
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
962
                   <span class="available">
978
                   <span class="available">
(-)a/opac/opac-detail.pl (-1 / +29 lines)
Lines 41-46 use C4::Members; Link Here
41
use C4::VirtualShelves;
41
use C4::VirtualShelves;
42
use C4::XSLT;
42
use C4::XSLT;
43
use C4::ShelfBrowser;
43
use C4::ShelfBrowser;
44
use MARC::Record;
45
use MARC::Field;
44
46
45
BEGIN {
47
BEGIN {
46
	if (C4::Context->preference('BakerTaylorEnabled')) {
48
	if (C4::Context->preference('BakerTaylorEnabled')) {
Lines 223-228 my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib Link Here
223
                     subtitle                => $subtitle,
225
                     subtitle                => $subtitle,
224
    );
226
    );
225
227
228
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
229
    my $fieldspec = C4::Context->preference("AlternateHoldingsField");
230
    my $subfields = substr $fieldspec, 3;
231
    my $holdingsep = C4::Context->preference("AlternateHoldingsSeparator") || ' ';
232
    my @alternateholdingsinfo = ();
233
    my @holdingsfields = $record->field(substr $fieldspec, 0, 3);
234
235
    for my $field (@holdingsfields) {
236
        my %holding = ( holding => '' );
237
        my $havesubfield = 0;
238
        for my $subfield ($field->subfields()) {
239
            if ((index $subfields, $$subfield[0]) >= 0) {
240
                $holding{'holding'} .= $holdingsep if (length $holding{'holding'} > 0);
241
                $holding{'holding'} .= $$subfield[1];
242
                $havesubfield++;
243
            }
244
        }
245
        if ($havesubfield) {
246
            push(@alternateholdingsinfo, \%holding);
247
        }
248
    }
249
250
    $template->param(
251
        ALTERNATEHOLDINGS   => \@alternateholdingsinfo,
252
        );
253
}
254
226
foreach ( keys %{$dat} ) {
255
foreach ( keys %{$dat} ) {
227
    $template->param( "$_" => defined $dat->{$_} ? $dat->{$_} : '' );
256
    $template->param( "$_" => defined $dat->{$_} ? $dat->{$_} : '' );
228
}
257
}
229
- 

Return to bug 4421