Bugzilla – Attachment 93558 Details for
Bug 23475
Search context is lost when simple search leads to a single record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23475: Use cookies to preserve simple search values
Bug-23475-Use-cookies-to-preserve-simple-search-va.patch (text/plain), 3.76 KB, created by
Biblibre Sandboxes
on 2019-10-03 11:31:31 UTC
(
hide
)
Description:
Bug 23475: Use cookies to preserve simple search values
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2019-10-03 11:31:31 UTC
Size:
3.76 KB
patch
obsolete
>From 73b207ba66ab45dc0e69eb95b16cae2ba7bbb955 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 19 Aug 2019 19:38:52 +0000 >Subject: [PATCH] Bug 23475: Use cookies to preserve simple search values >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > catalogue/detail.pl | 9 +++++++++ > catalogue/search.pl | 8 ++++---- > koha-tmpl/intranet-tmpl/prog/js/commons.js | 7 +++++++ > 3 files changed, 20 insertions(+), 4 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index b4d9bae..4acd511 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -88,6 +88,15 @@ if ( not defined $record ) { > exit; > } > >+if( $query->param('found1') ){ >+ if($query->cookie("pulldown_selection")){ >+ my $ms = "ms_".$query->cookie("pulldown_selection"); >+ $template->param( $ms => 1); >+ } >+ if($query->cookie("searchbox_value")){ >+ $template->param( ms_value => $query->cookie("searchbox_value") ); >+ } >+} > if($query->cookie("holdfor")){ > my $holdfor_patron = Koha::Patrons->find( $query->cookie("holdfor") ); > $template->param( >diff --git a/catalogue/search.pl b/catalogue/search.pl >index e1e9e85..81cb827 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -590,13 +590,13 @@ for (my $i=0;$i<@servers;$i++) { > my $defaultview = C4::Context->preference('IntranetBiblioDefaultView'); > my $views = { C4::Search::enabled_staff_search_views }; > if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) { >- print $cgi->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber"); >+ print $cgi->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber&found1=1"); > } elsif ($defaultview eq 'marc' && $views->{can_view_MARC}) { >- print $cgi->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber"); >+ print $cgi->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber&found1=1"); > } elsif ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) { >- print $cgi->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber"); >+ print $cgi->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&found1=1"); > } else { >- print $cgi->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber"); >+ print $cgi->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&found1=1"); > } > exit; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/js/commons.js b/koha-tmpl/intranet-tmpl/prog/js/commons.js >index 4981c07..8483b63 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/commons.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/commons.js >@@ -57,10 +57,17 @@ function resetSearchContext() { > setContextBiblioNumbers( new Array() ); > } > >+function saveOrClearSimpleSearchParams() { >+ // Simple masthead search - pass value for display on details page >+ $.cookie('pulldown_selection', $("#cat-search-block select.advsearch").val() ); >+ $.cookie('searchbox_value', $("#cat-search-block #search-form").val() ); >+} >+ > $(document).ready(function(){ > // forms with action leading to search > $("form[action*='search.pl']").submit(function(){ > resetSearchContext(); >+ saveOrClearSimpleSearchParams(); > }); > // any link to launch a search except navigation links > $("[href*='search.pl?']").not(".nav").not('.searchwithcontext').click(function(){ >-- >2.7.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 23475
:
92357
|
93558
|
93562
|
108124
|
109624
|
111325
|
111338
|
111339
|
111340
|
111798
|
111799
|
111800
|
112697
|
112714
|
112971
|
113744
|
113784
|
113904
|
114055
|
114056