Bugzilla – Attachment 126747 Details for
Bug 22605
Adding the option to modify/edit searches on the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22605: (follow-up) Fix operators
Bug-22605-follow-up-Fix-operators.patch (text/plain), 3.53 KB, created by
Nick Clemens (kidclamp)
on 2021-10-22 11:38:22 UTC
(
hide
)
Description:
Bug 22605: (follow-up) Fix operators
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-10-22 11:38:22 UTC
Size:
3.53 KB
patch
obsolete
>From 999bf78b971f1dc7b22637a0e6f7fa6bb9893742 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 21 Oct 2021 18:44:50 +0000 >Subject: [PATCH] Bug 22605: (follow-up) Fix operators > >- Don't add an operator on first loop >- Only add plus option on last loop >- Fix indentation of first search box >- Remove spaces from operators in query_cgi and add to query and query_desc >--- > C4/Search.pm | 6 +++--- > .../intranet-tmpl/prog/en/modules/catalogue/advsearch.tt | 7 ++++++- > 2 files changed, 9 insertions(+), 4 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 441cbc1c6b..8f7cf7040b 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1583,7 +1583,7 @@ sub _build_initial_query { > my $operator = ""; > if ($params->{previous_operand}){ > #If there is a previous operand, add a supplied operator or the default 'and' >- $operator = ($params->{operator}) ? " ".($params->{operator})." " : ' and '; >+ $operator = ($params->{operator}) ? ($params->{operator}) : 'and'; > } > > #NOTE: indexes_set is typically set when doing truncation or field weighting >@@ -1591,14 +1591,14 @@ sub _build_initial_query { > > #e.g. "kw,wrdl:test" > #e.g. " and kw,wrdl:test" >- $params->{query} .= $operator . $operand; >+ $params->{query} .= " " . $operator . " " . $operand; > > $params->{query_cgi} .= "&op=".uri_escape_utf8($operator) if $operator; > $params->{query_cgi} .= "&idx=".uri_escape_utf8($params->{index}) if $params->{index}; > $params->{query_cgi} .= "&q=".uri_escape_utf8($params->{original_operand}) if $params->{original_operand}; > > #e.g. " and kw,wrdl: test" >- $params->{query_desc} .= $operator . ( $params->{index_plus} // q{} ) . " " . ( $params->{original_operand} // q{} ); >+ $params->{query_desc} .= " " . $operator . " " . ( $params->{index_plus} // q{} ) . " " . ( $params->{original_operand} // q{} ); > > $params->{previous_operand} = 1 unless $params->{previous_operand}; #If there is no previous operand, mark this as one > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >index 2858e5a6ab..4a05878fc5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >@@ -107,6 +107,9 @@ > <legend>Search for </legend> > [% FOREACH query IN queries %] > [% IF ( expanded_options ) %] >+ [% IF loop.first %] >+ <div class="search-term-row" style="text-indent: 4.25em;"> >+ [% ELSE %] > <div class="search-term-row"> > [% SET opindex = loop.index - 1 %] > <select name="op"> >@@ -124,6 +127,7 @@ > <option value="not">not</option> > [% END %] > </select> >+ [% END %] > [% ELSE %] > <div> > [% END %] >@@ -131,7 +135,9 @@ > [% INCLUDE 'search_indexes.inc' %] > <input type="text" size="30" name="q" title="Enter search terms" value="[% query | html %]" /> > [% IF ( expanded_options ) %] >+ [% IF ( loop.last ) %] > <a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a> >+ [% END %] > [% IF ( loop.first ) %] > <label for="scan">Scan indexes:</label> <input type="checkbox" name="scan" id="scan" value="1" /> > [% END %] >@@ -238,7 +244,6 @@ > <!-- /BASIC LIMITS --> > [% END %] > >- > [% IF ( UNIMARC ) %] > [% INCLUDE 'subtypes_unimarc.inc' %] > [% ELSE %] >-- >2.20.1
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 22605
:
114728
|
114734
|
114736
|
117174
|
119177
|
123816
|
123839
|
123840
|
123965
|
126746
|
126747
|
126748
|
126838
|
126851
|
126852
|
126853
|
126854
|
126855
|
126856
|
126857
|
126858
|
126859
|
126860
|
126862
|
126863
|
126864
|
131775
|
131776
|
131777
|
131778
|
131779