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 761-766 for (my $i=0;$i<@servers;$i++) { Link Here
761
        }
761
        }
762
        # no hits
762
        # no hits
763
        else {
763
        else {
764
            my $nohits = C4::Context->preference('OPACNoResultsFound');
765
            if ($nohits and $nohits=~/{QUERY_KW}/){
766
                # extracting keywords in case of relaunching search
767
                (my $query_kw=$query_desc)=~s/ and|or / /g;
768
                $query_kw = Encode::decode_utf8($query_kw);
769
                my @query_kw=($query_kw=~ /([-\w]+\b)(?:[^,:]|$)/g);
770
                $query_kw=join('+',@query_kw);
771
                $nohits=~s/{QUERY_KW}/$query_kw/g;
772
                $template->param('OPACNoResultsFound' =>$nohits);
773
            }
764
            $template->param(
774
            $template->param(
765
                searchdesc => 1,
775
                searchdesc => 1,
766
                query_desc => $query_desc,
776
                query_desc => $query_desc,
767
- 

Return to bug 7620