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

(-)a/C4/Search.pm (-2 / +2 lines)
Lines 1677-1683 Format results in a form suitable for passing to the template Link Here
1677
# IMO this subroutine is pretty messy still -- it's responsible for
1677
# IMO this subroutine is pretty messy still -- it's responsible for
1678
# building the HTML output for the template
1678
# building the HTML output for the template
1679
sub searchResults {
1679
sub searchResults {
1680
    my ( $search_context, $searchdesc, $hits, $results_per_page, $offset, $scan, $marcresults ) = @_;
1680
    my ( $search_context, $searchdesc, $hits, $results_per_page, $offset, $scan, $marcresults, $xslt_variables ) = @_;
1681
    my $dbh = C4::Context->dbh;
1681
    my $dbh = C4::Context->dbh;
1682
    my @newresults;
1682
    my @newresults;
1683
1683
Lines 2087-2093 sub searchResults { Link Here
2087
        # XSLT processing of some stuff
2087
        # XSLT processing of some stuff
2088
        # we fetched the sysprefs already before the loop through all retrieved record!
2088
        # we fetched the sysprefs already before the loop through all retrieved record!
2089
        if (!$scan && $xslfile) {
2089
        if (!$scan && $xslfile) {
2090
            $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang);
2090
            $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $xslsyspref, 1, \@hiddenitems, $sysxml, $xslfile, $lang, $xslt_variables);
2091
        }
2091
        }
2092
2092
2093
        # if biblio level itypes are used and itemtype is notforloan, it can't be reserved either
2093
        # if biblio level itypes are used and itemtype is notforloan, it can't be reserved either
(-)a/opac/opac-detail.pl (-3 / +8 lines)
Lines 170-180 my $lang = $xslfile ? C4::Languages::getlanguage() : undef; Link Here
170
my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
170
my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
171
171
172
if ( $xslfile ) {
172
if ( $xslfile ) {
173
174
    my $variables = {
175
        anonymous_session => ($borrowernumber) ? 0 : 1
176
    };
177
173
    $template->param(
178
    $template->param(
174
        XSLTBloc => XSLTParse4Display(
179
        XSLTBloc => XSLTParse4Display(
175
                        $biblionumber, $record, "OPACXSLTDetailsDisplay",
180
            $biblionumber, $record, "OPACXSLTDetailsDisplay", 1, undef,
176
                        1, undef, $sysxml, $xslfile, $lang
181
            $sysxml, $xslfile, $lang, $variables
177
                    )
182
        )
178
    );
183
    );
179
}
184
}
180
185
(-)a/opac/opac-search.pl (-2 / +4 lines)
Lines 650-655 if (C4::Context->preference('OpacHiddenItemsExceptions')){ Link Here
650
    $search_context->{'category'} = $patron ? $patron->categorycode : q{};
650
    $search_context->{'category'} = $patron ? $patron->categorycode : q{};
651
}
651
}
652
652
653
my $variables = { anonymous_session => ($borrowernumber) ? 0 : 1 };
654
653
for (my $i=0;$i<@servers;$i++) {
655
for (my $i=0;$i<@servers;$i++) {
654
    my $server = $servers[$i];
656
    my $server = $servers[$i];
655
    if ($server && $server =~/biblioserver/) { # this is the local bibliographic server
657
    if ($server && $server =~/biblioserver/) { # this is the local bibliographic server
Lines 662-673 for (my $i=0;$i<@servers;$i++) { Link Here
662
                # we want as specified by $offset and $results_per_page,
664
                # we want as specified by $offset and $results_per_page,
663
                # we need to set the offset parameter of searchResults to 0
665
                # we need to set the offset parameter of searchResults to 0
664
                my @group_results = searchResults( $search_context, $query_desc, $group->{'group_count'},$results_per_page, 0, $scan,
666
                my @group_results = searchResults( $search_context, $query_desc, $group->{'group_count'},$results_per_page, 0, $scan,
665
                                                   $group->{"RECORDS"});
667
                                                   $group->{"RECORDS"}, $variables);
666
                push @newresults, { group_label => $group->{'group_label'}, GROUP_RESULTS => \@group_results };
668
                push @newresults, { group_label => $group->{'group_label'}, GROUP_RESULTS => \@group_results };
667
            }
669
            }
668
        } else {
670
        } else {
669
            @newresults = searchResults( $search_context, $query_desc, $hits, $results_per_page, $offset, $scan,
671
            @newresults = searchResults( $search_context, $query_desc, $hits, $results_per_page, $offset, $scan,
670
                                        $results_hashref->{$server}->{"RECORDS"});
672
                                        $results_hashref->{$server}->{"RECORDS"}, $variables);
671
        }
673
        }
672
        $hits = 0 unless @newresults;
674
        $hits = 0 unless @newresults;
673
675
(-)a/opac/opac-shelves.pl (-3 / +11 lines)
Lines 316-324 if ( $op eq 'view' ) { Link Here
316
                });
316
                });
317
                $record_processor->process($record);
317
                $record_processor->process($record);
318
318
319
                if ( $xslfile ) {
319
                if ($xslfile) {
320
                    $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "OPACXSLTListsDisplay",
320
                    my $variables = {
321
                                                                1, undef, $sysxml, $xslfile, $lang);
321
                        anonymous_session => ($loggedinuser) ? 0 : 1
322
                    };
323
                    $this_item->{XSLTBloc} = XSLTParse4Display(
324
                        $biblionumber,          $record,
325
                        "OPACXSLTListsDisplay", 1,
326
                        undef,                  $sysxml,
327
                        $xslfile,               $lang,
328
                        $variables
329
                    );
322
                }
330
                }
323
331
324
                my $marcflavour = C4::Context->preference("marcflavour");
332
                my $marcflavour = C4::Context->preference("marcflavour");
(-)a/opac/opac-tags.pl (-4 / +9 lines)
Lines 284-293 if ($loggedinuser) { Link Here
284
        my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
284
        my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
285
        my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
285
        my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
286
286
287
        if ( $xslfile ) {
287
        if ($xslfile) {
288
            my $variables = {
289
                anonymous_session => ($loggedinuser) ? 0 : 1
290
            };
288
            $tag->{XSLTBloc} = XSLTParse4Display(
291
            $tag->{XSLTBloc} = XSLTParse4Display(
289
                    $tag->{ biblionumber }, $record, "OPACXSLTResultsDisplay",
292
                $tag->{biblionumber},     $record,
290
                    1, $hidden_items, $sysxml, $xslfile, $lang
293
                "OPACXSLTResultsDisplay", 1,
294
                $hidden_items,            $sysxml,
295
                $xslfile,                 $lang,
296
                $variables
291
            );
297
            );
292
        }
298
        }
293
299
294
- 

Return to bug 25416