Bugzilla – Attachment 10219 Details for
Bug 7620
OPACNoResult, add search string to available parameters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
OPACNoResult, Add keyword to query string
OPACNoResult-Add-keyword-to-query-string.patch (text/plain), 2.65 KB, created by
Katrin Fischer
on 2012-06-11 14:51:19 UTC
(
hide
)
Description:
OPACNoResult, Add keyword to query string
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2012-06-11 14:51:19 UTC
Size:
2.65 KB
patch
obsolete
>From 03a3d2fcbcab7084330b398b6723c62cde71c722 Mon Sep 17 00:00:00 2001 >From: Lyon3 Team <koha@univ-lyon3.fr> >Date: Fri, 30 Mar 2012 10:57:28 +0200 >Subject: [PATCH] OPACNoResult, Add keyword to query string >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch add the keywords to the string entered by the user to OPACNoResultFound > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Rebased 2012-06-11 >Note: Patch does not work for search terms containing umlauts like äüö. Those >characters are lost from the displayed search term. > >http://bugs.koha-community.org/show_bug.cgi?id=7620 >--- > .../prog/en/modules/admin/preferences/opac.pref | 1 + > opac/opac-search.pl | 8 ++++++++ > 2 files changed, 9 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index e4ea15b..91127d5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -204,6 +204,7 @@ OPAC: > - a library select pulldown menu on the OPAC masthead. > - > - 'Display this HTML when no results are found for a search in the OPAC:' >+ - '<br />Note: The placeholder {QUERY_KW} will be replaced with the keywords of the query.' > - pref: OPACNoResultsFound > type: textarea > class: code >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 5f3ad86..d6a3621 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -736,6 +736,7 @@ for (my $i=0;$i<@servers;$i++) { > $template->param(next_page_offset => $next_page_offset) unless $pages eq $current_page_number; > } > # no hits >+ # extracting keywords in case of relaunching search > else { > $template->param( > searchdesc => 1, >@@ -744,6 +745,13 @@ for (my $i=0;$i<@servers;$i++) { > query_cgi => $query_cgi, > limit_cgi => $limit_cgi > ); >+ (my $query_kw=$query_desc)=~s/ and|or / /g; >+ my @query_kw=($query_kw=~ /([-\w]+\b)(?:[^,:]|$)/g); >+ $query_kw=join('+',@query_kw); >+ my $nohits=C4::Context->preference('OPACNoResultsFound'); >+ $nohits=~s/{QUERY_KW}/$query_kw/g; >+ $template->param( 'OPACNoResultsFound' =>$nohits); >+ $template->param(searchdesc => 1,query_desc => $query_desc,limit_desc => $limit_desc); > } > } # end of the if local > # asynchronously search the authority server >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7620
:
7941
|
8713
|
10219
|
10253
|
12773
|
14236
|
14240