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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+1 lines)
Lines 239-244 OPAC: Link Here
239
            - a library select pulldown menu on the OPAC masthead.
239
            - a library select pulldown menu on the OPAC masthead.
240
        -
240
        -
241
            - 'Display this HTML when no results are found for a search in the OPAC:'
241
            - 'Display this HTML when no results are found for a search in the OPAC:'
242
            - '<br />Note: You can insert placeholders {QUERY_KW} that will be replaced with the keywords of the query.'
242
            - pref: OPACNoResultsFound
243
            - pref: OPACNoResultsFound
243
              type: textarea
244
              type: textarea
244
              class: code
245
              class: code
(-)a/opac/opac-search.pl (-1 / +10 lines)
Lines 762-767 for (my $i=0;$i<@servers;$i++) { Link Here
762
        }
762
        }
763
        # no hits
763
        # no hits
764
        else {
764
        else {
765
            my $nohits = C4::Context->preference('OPACNoResultsFound');
766
            if ($nohits and $nohits=~/{QUERY_KW}/){
767
                # extracting keywords in case of relaunching search
768
                (my $query_kw=$query_desc)=~s/ and|or / /g;
769
                $query_kw = Encode::decode_utf8($query_kw);
770
                my @query_kw=($query_kw=~ /([-\w]+\b)(?:[^,:]|$)/g);
771
                $query_kw=join('+',@query_kw);
772
                $nohits=~s/{QUERY_KW}/$query_kw/g;
773
                $template->param('OPACNoResultsFound' =>$nohits);
774
            }
765
            $template->param(
775
            $template->param(
766
                searchdesc => 1,
776
                searchdesc => 1,
767
                query_desc => $query_desc,
777
                query_desc => $query_desc,
768
- 

Return to bug 7620