Bugzilla – Attachment 21005 Details for
Bug 10862
Add an search history for the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10862: FIX if the query returns 1 result, it does not appears in the history
Bug-10862-FIX-if-the-query-returns-1-result-it-doe.patch (text/plain), 3.64 KB, created by
Jonathan Druart
on 2013-09-12 09:53:22 UTC
(
hide
)
Description:
Bug 10862: FIX if the query returns 1 result, it does not appears in the history
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-09-12 09:53:22 UTC
Size:
3.64 KB
patch
obsolete
>From 032af063e6d953b6b81a9be5b841314f4dcfd016 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 12 Sep 2013 11:52:43 +0200 >Subject: [PATCH] Bug 10862: FIX if the query returns 1 result, it does not > appears in the history > >--- > catalogue/search.pl | 47 ++++++++++---------- > .../prog/en/modules/catalogue/search-history.tt | 1 + > 2 files changed, 25 insertions(+), 23 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 4bb8d21..e4cfd3b 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -546,6 +546,30 @@ for (my $i=0;$i<@servers;$i++) { > my @newresults = searchResults('intranet', $query_desc, $hits, $results_per_page, $offset, $scan, > $results_hashref->{$server}->{"RECORDS"}); > $total = $total + $results_hashref->{$server}->{"hits"}; >+ >+ # Search history >+ if (C4::Context->preference('EnableSearchHistory')) { >+ unless ( $offset ) { >+ my $path_info = $cgi->url(-path_info=>1); >+ my $query_cgi_history = $cgi->url(-query=>1); >+ $query_cgi_history =~ s/^$path_info\?//; >+ $query_cgi_history =~ s/;/&/g; >+ my $query_desc_history = $query_desc; >+ $query_desc_history .= ", $limit_desc" >+ if $limit_desc; >+ >+ C4::Search::History::add({ >+ userid => $borrowernumber, >+ sessionid => $cgi->cookie("CGISESSID"), >+ query_desc => $query_desc_history, >+ query_cgi => $query_cgi_history, >+ total => $total, >+ type => "biblio", >+ }); >+ } >+ $template->param( EnableSearchHistory => 1 ); >+ } >+ > ## If there's just one result, redirect to the detail page > if ($total == 1) { > my $biblionumber = $newresults[0]->{biblionumber}; >@@ -653,29 +677,6 @@ for (my $i=0;$i<@servers;$i++) { > $template->param (z3950_search_params => C4::Search::z3950_search_args($z3950par || $query_desc)); > } > >- # Search history >- if (C4::Context->preference('EnableSearchHistory')) { >- unless ( $offset ) { >- my $path_info = $cgi->url(-path_info=>1); >- my $query_cgi_history = $cgi->url(-query=>1); >- $query_cgi_history =~ s/^$path_info\?//; >- $query_cgi_history =~ s/;/&/g; >- my $query_desc_history = $query_desc; >- $query_desc_history .= ", $limit_desc" >- if $limit_desc; >- >- C4::Search::History::add({ >- userid => $borrowernumber, >- sessionid => $cgi->cookie("CGISESSID"), >- query_desc => $query_desc_history, >- query_cgi => $query_cgi_history, >- total => $total, >- type => "biblio", >- }); >- } >- $template->param( EnableSearchHistory => 1 ); >- } >- > } # end of the if local > > # asynchronously search the authority server >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt >index ae48c1b..1c3c800 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/search-history.tt >@@ -1,3 +1,4 @@ >+[% INCLUDE 'doc-head-open.inc' %] > [% USE Koha %] > [% USE KohaDates %] > <title>Koha › Catalog › Search history</title> >-- >1.7.10.4
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 10862
:
20953
|
20982
|
21005
|
21047
|
21048
|
21049
|
22100
|
22101
|
22102