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

(-)a/catalogue/search.pl (-23 / +24 lines)
Lines 546-551 for (my $i=0;$i<@servers;$i++) { Link Here
546
        my @newresults = searchResults('intranet', $query_desc, $hits, $results_per_page, $offset, $scan,
546
        my @newresults = searchResults('intranet', $query_desc, $hits, $results_per_page, $offset, $scan,
547
                                       $results_hashref->{$server}->{"RECORDS"});
547
                                       $results_hashref->{$server}->{"RECORDS"});
548
        $total = $total + $results_hashref->{$server}->{"hits"};
548
        $total = $total + $results_hashref->{$server}->{"hits"};
549
550
        # Search history
551
        if (C4::Context->preference('EnableSearchHistory')) {
552
            unless ( $offset ) {
553
                my $path_info = $cgi->url(-path_info=>1);
554
                my $query_cgi_history = $cgi->url(-query=>1);
555
                $query_cgi_history =~ s/^$path_info\?//;
556
                $query_cgi_history =~ s/;/&/g;
557
                my $query_desc_history = $query_desc;
558
                $query_desc_history .= ", $limit_desc"
559
                    if $limit_desc;
560
561
                C4::Search::History::add({
562
                    userid => $borrowernumber,
563
                    sessionid => $cgi->cookie("CGISESSID"),
564
                    query_desc => $query_desc_history,
565
                    query_cgi => $query_cgi_history,
566
                    total => $total,
567
                    type => "biblio",
568
                });
569
            }
570
            $template->param( EnableSearchHistory => 1 );
571
        }
572
549
        ## If there's just one result, redirect to the detail page
573
        ## If there's just one result, redirect to the detail page
550
        if ($total == 1) {         
574
        if ($total == 1) {         
551
            my $biblionumber = $newresults[0]->{biblionumber};
575
            my $biblionumber = $newresults[0]->{biblionumber};
Lines 653-681 for (my $i=0;$i<@servers;$i++) { Link Here
653
            $template->param (z3950_search_params => C4::Search::z3950_search_args($z3950par || $query_desc));
677
            $template->param (z3950_search_params => C4::Search::z3950_search_args($z3950par || $query_desc));
654
        }
678
        }
655
679
656
        # Search history
657
        if (C4::Context->preference('EnableSearchHistory')) {
658
            unless ( $offset ) {
659
                my $path_info = $cgi->url(-path_info=>1);
660
                my $query_cgi_history = $cgi->url(-query=>1);
661
                $query_cgi_history =~ s/^$path_info\?//;
662
                $query_cgi_history =~ s/;/&/g;
663
                my $query_desc_history = $query_desc;
664
                $query_desc_history .= ", $limit_desc"
665
                    if $limit_desc;
666
667
                C4::Search::History::add({
668
                    userid => $borrowernumber,
669
                    sessionid => $cgi->cookie("CGISESSID"),
670
                    query_desc => $query_desc_history,
671
                    query_cgi => $query_cgi_history,
672
                    total => $total,
673
                    type => "biblio",
674
                });
675
            }
676
            $template->param( EnableSearchHistory => 1 );
677
        }
678
679
    } # end of the if local
680
    } # end of the if local
680
681
681
    # asynchronously search the authority server
682
    # asynchronously search the authority server
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt (-1 / +1 lines)
Lines 1-3 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% USE Koha %]
2
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE KohaDates %]
3
<title>Koha &rsaquo; Catalog &rsaquo; Search history</title>
4
<title>Koha &rsaquo; Catalog &rsaquo; Search history</title>
4
- 

Return to bug 10862