Bugzilla – Attachment 86024 Details for
Bug 19046
IntranetCatalogSearchPulldown doesn't retain last selection
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19046: Make seach pulldown to retain index selection
Bug-19046-Make-seach-pulldown-to-retain-index-sele.patch (text/plain), 13.29 KB, created by
Jonathan Druart
on 2019-03-04 18:42:18 UTC
(
hide
)
Description:
Bug 19046: Make seach pulldown to retain index selection
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-03-04 18:42:18 UTC
Size:
13.29 KB
patch
obsolete
>From 50799cd6e570c9cc1f99f0e20169465cfe9c0f59 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 4 Mar 2019 15:39:29 -0300 >Subject: [PATCH] Bug 19046: Make seach pulldown to retain index selection > >This patch also fixes add the term in the search input > >Test plan: >Enable IntranetCatalogSearchPulldown >Search for a term using the search input in the header (simple search) >Re-do selecting different indices > >The selection must retain on the search result page. >--- > catalogue/search.pl | 8 + > .../intranet-tmpl/prog/en/includes/cat-search.inc | 2 +- > .../prog/en/includes/search_indexes.inc | 203 +++++++++++++++++---- > 3 files changed, 179 insertions(+), 34 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index af70dac698..f3d653f737 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -385,12 +385,20 @@ my @indexes = map uri_unescape($_), $cgi->multi_param('idx'); > if ($indexes[0] && (!$indexes[1] || $params->{'scan'})) { > my $idx = "ms_".$indexes[0]; > $idx =~ s/\,/comma/g; # template toolkit doesn't like variables with a , in it >+ $idx =~ s/-/dash/g; # template toolkit doesn't like variables with a dash in it > $template->param($idx => 1); > } > > # an operand can be a single term, a phrase, or a complete ccl query > my @operands = map uri_unescape($_), $cgi->multi_param('q'); > >+# if a simple search, display the value in the search box >+if ($operands[0] && !$operands[1]) { >+ my $ms_query = $operands[0]; >+ $ms_query =~ s/ #\S+//; >+ $template->param(ms_value => $ms_query); >+} >+ > # limits are use to limit to results to a pre-defined category such as branch or language > my @limits = map uri_unescape($_), $cgi->multi_param('limit'); > my @nolimits = map uri_unescape($_), $cgi->multi_param('nolimit'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc >index 215ebaf3de..b14619bdb1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-search.inc >@@ -28,7 +28,7 @@ > <p class="tip">Enter search keywords:</p> > <form action="/cgi-bin/koha/catalogue/search.pl" method="get" id="cat-search-block"> > [% IF ( Koha.Preference('IntranetCatalogSearchPulldown') ) %][% INCLUDE 'search_indexes.inc' %][% END %] >- <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="head-searchbox form-text" /> >+ <input type="text" name="q" id="search-form" size="40" value="[% ms_value | html %]" title="Enter the terms you wish to search for." class="head-searchbox form-text" /> > <input type="submit" class="submit" value="Submit" /> > </form> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc >index 1aff1a4091..733e7d3f36 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc >@@ -1,46 +1,175 @@ > [% USE Koha %] > <select class="advsearch" name="idx"> >- <option value="kw">Keyword</option> >- <option value="kw,phr"> Keyword as phrase</option> >- <option value="au">Author</option> >- <option value="au,phr"> Author as phrase</option> >- <option value="cpn"> Corporate name</option> >- <option value="cfn"> Conference name</option> >- <option value="cpn,phr"> Corporate name as phrase</option> >- <option value="cfn,phr"> Conference name as phrase</option> >- <option value="pn"> Personal name</option> >- <option value="pn,phr"> Personal name as phrase</option> >- <option value="ti">Title</option> >- <option value="ti,phr"> Title as phrase</option> >- <option value="se"> Series title</option> >- <option value="su">Subject</option> >- <option value="su,phr"> Subject as phrase</option> >+ [% IF ms_kw %] >+ <option selected="selected" value="kw">Keyword</option> >+ [% ELSE %] >+ <option value="kw">Keyword</option> >+ [% END %] >+ [% IF ms_kwcommaphr %] >+ <option selected="selected" value="kw,phr"> Keyword as phrase</option> >+ [% ELSE %] >+ <option value="kw,phr"> Keyword as phrase</option> >+ [% END %] >+ [% IF ms_au %] >+ <option selected="selected" value="au">Author</option> >+ [% ELSE %] >+ <option value="au">Author</option> >+ [% END %] >+ [% IF ms_aucommaphr %] >+ <option selected="selected" value="au,phr"> Author as phrase</option> >+ [% ELSE %] >+ <option value="au,phr"> Author as phrase</option> >+ [% END %] >+ [% IF ms_cpn %] >+ <option selected="selected" value="cpn"> Corporate name</option> >+ [% ELSE %] >+ <option value="cpn"> Corporate name</option> >+ [% END %] >+ [% IF ms_cfn %] >+ <option selected="selected" value="cfn"> Conference name</option> >+ [% ELSE %] >+ <option value="cfn"> Conference name</option> >+ [% END %] >+ [% IF ms_cpncommaphr %] >+ <option selected="selected" value="cpn,phr"> Corporate name as phrase</option> >+ [% ELSE %] >+ <option value="cpn,phr"> Corporate name as phrase</option> >+ [% END %] >+ [% IF ms_cfncommaphr %] >+ <option selected="selected" value="cfn,phr"> Conference name as phrase</option> >+ [% ELSE %] >+ <option value="cfn,phr"> Conference name as phrase</option> >+ [% END %] >+ [% IF ms_pn %] >+ <option selected="selected" value="pn"> Personal name</option> >+ [% ELSE %] >+ <option value="pn"> Personal name</option> >+ [% END %] >+ [% IF ms_pncommaphr %] >+ <option selected="selected" value="pn,phr"> Personal name as phrase</option> >+ [% ELSE %] >+ <option value="pn,phr"> Personal name as phrase</option> >+ [% END %] >+ [% IF ms_ti %] >+ <option selected="selected" value="ti">Title</option> >+ [% ELSE %] >+ <option value="ti">Title</option> >+ [% END %] >+ [% IF ms_ticommaphr %] >+ <option selected="selected" value="ti,phr"> Title as phrase</option> >+ [% ELSE %] >+ <option value="ti,phr"> Title as phrase</option> >+ [% END %] >+ [% IF ms_ticommaphr %] >+ <option selected="selected" value="ti,phr"> Title as phrase</option> >+ [% ELSE %] >+ <option value="ti,phr"> Title as phrase</option> >+ [% END %] >+ [% IF ms_se %] >+ <option selected="seleced" value="se"> Series title</option> >+ [% ELSE %] >+ <option value="se"> Series title</option> >+ [% END %] >+ [% IF ms_su %] >+ <option selected="selected" value="su">Subject</option> >+ [% ELSE %] >+ <option value="su">Subject</option> >+ [% END %] >+ [% IF ms_sucommaphr %] >+ <option selected="selected" value="su,phr"> Subject as phrase</option> >+ [% ELSE %] >+ <option value="su,phr"> Subject as phrase</option> >+ [% END %] > [% IF ( expanded_options ) %] >- <option value="su-br"> Subject and broader terms</option> >- <option value="su-na"> Subject and narrower terms</option> >- <option value="su-rl"> Subject and related terms</option> >+ [% IF ms_sudashbr %] >+ <option selected="selected" value="su-br"> Subject and broader terms</option> >+ [% ELSE %] >+ <option value="su-br"> Subject and broader terms</option> >+ [% END %] >+ [% IF ms_sudashna %] >+ <option selected="selected" value="su-na"> Subject and narrower terms</option> >+ [% ELSE %] >+ <option value="su-na"> Subject and narrower terms</option> >+ [% END %] >+ [% IF ms_sudashrl %] >+ <option selected="selected" value="su-rl"> Subject and related terms</option> >+ [% ELSE %] >+ <option value="su-rl"> Subject and related terms</option> >+ [% END %] >+ [% END %] >+ [% IF ms_bc %] >+ <option selected="selected" value="bc">Barcode</option> >+ [% ELSE %] >+ <option value="bc">Barcode</option> >+ [% END %] >+ [% IF ms_location %] >+ <option selected="selected" value="location">Shelving location</option> >+ [% ELSE %] >+ <option value="location">Shelving location</option> > [% END %] >- <option value="bc">Barcode</option> >- <option value="location">Shelving location</option> > [% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %] >- <option value="ident,phr">Standard number</option> >+ [% IF ms_identcommaphr %] >+ <option selected="selected" value="ident,phr">Standard number</option> >+ [% ELSE %] >+ <option value="ident,phr">Standard number</option> >+ [% END %] >+ [% ELSE %] >+ [% IF ms_ident %] >+ <option selected="selected" value="ident">Standard number</option> >+ [% ELSE %] >+ <option value="ident">Standard number</option> >+ [% END %] >+ [% END %] >+ [% IF ms_nb %] >+ <option selected="selected" value="nb"> ISBN</option> >+ [% ELSE %] >+ <option value="nb"> ISBN</option> >+ [% END %] >+ [% IF ms_ns %] >+ <option selected="selected" value="ns"> ISSN</option> > [% ELSE %] >- <option value="ident">Standard number</option> >+ <option value="ns"> ISSN</option> > [% END %] >- <option value="nb"> ISBN</option> >- <option value="ns"> ISSN</option> > [% IF ( Koha.Preference('IntranetNumbersPreferPhrase') ) %] >- <option value="callnum,phr"> Call number</option> >+ [% IF ms_callnumcommaphr %] >+ <option selected="selected" value="callnum,phr"> Call number</option> >+ [% ELSE %] >+ <option value="callnum,phr"> Call number</option> >+ [% END %] >+ [% ELSE %] >+ [% IF ms_callnum %] >+ <option selected="selected" value="callnum"> Call number</option> >+ [% ELSE %] >+ <option value="callnum"> Call number</option> >+ [% END %] >+ [% END %] >+ [% IF ms_lncommartrn %] >+ <option selected="selected" value="ln,rtrn">Language</option> > [% ELSE %] >- <option value="callnum"> Call number</option> >+ <option value="ln,rtrn">Language</option> >+ [% END %] >+ [% IF ms_nt %] >+ <option selected="selected" value="nt">Notes/Comments</option> >+ [% ELSE %] >+ <option value="nt">Notes/Comments</option> > [% END %] >- <option value="ln,rtrn">Language</option> >- <option value="nt">Notes/Comments</option> > [% IF (marcflavour != 'UNIMARC' ) %] >- <option value="curriculum">Curriculum</option> >+ [% IF ms_curriculum %] >+ <option selected="selected" value="curriculum">Curriculum</option> >+ [% ELSE %] >+ <option value="curriculum">Curriculum</option> >+ [% END %] >+ [% END %] >+ [% IF ms_pb %] >+ <option selected="selected" value="pb">Publisher</option> >+ [% ELSE %] >+ <option value="pb">Publisher</option> >+ [% END %] >+ [% IF ms_pl %] >+ <option selected="selected" value="pl">Publisher location</option> >+ [% ELSE %] >+ <option value="pl">Publisher location</option> > [% END %] >- <option value="pb">Publisher</option> >- <option value="pl">Publisher location</option> > > [%# Use non-normalized st-year instead of st-numeric, %] > [%# since pubdate can include 'u' to signify unknown %] >@@ -48,6 +177,14 @@ > [%# http://www.loc.gov/marc/bibliographic/bd008a.html %] > [%# This search is also for date ranges due to the %] > [%# special Zebra r=r CCL mapping for 'yr' %] >- <option value="yr,st-year">Publication date (yyyy-yyyy)</option> >- <option value="acqdate,st-date-normalized">Acquisition date (yyyy-mm-dd)</option> >+ [% IF ms_yrcommastdashyear %] >+ <option selected="selected" value="yr,st-year">Publication date (yyyy-yyyy)</option> >+ [% ELSE %] >+ <option value="yr,st-year">Publication date (yyyy-yyyy)</option> >+ [% END %] >+ [% IF ms_acqdatecommastdashdatedashnormalized %] >+ <option selected="selected" value="acqdate,st-date-normalized">Acquisition date (yyyy-mm-dd)</option> >+ [% ELSE %] >+ <option value="acqdate,st-date-normalized">Acquisition date (yyyy-mm-dd)</option> >+ [% END %] > </select> >-- >2.11.0
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 19046
:
86024
|
86401
|
86416
|
86417