Bug 15930: Make patron searches defaulting on 'contain'
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 6 Apr 2016 10:33:11 +0000 (11:33 +0100)
committerFrédéric Demians <f.demians@tamil.fr>
Wed, 27 Apr 2016 15:21:18 +0000 (17:21 +0200)
The default patron search types has changed from 'contain' to
start_with. Users consider it as a bug.
This patch revert the previous changes to default on 'contain'.

Test plan:
Search for patrons in different places (guarantor, checkout, patron
module, acquisition module, etc.) and confirm that the default is always
'contain'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
(cherry picked from commit a8491dc156db9d746b0f5ddd6175b66bf1bfa4ab)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
(cherry picked from commit f2c5b7b036a47289a069f89bf3e63ede548058d8)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

C4/Utils/DataTables/Members.pm
koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc
koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
members/member.pl

index 1f7facb..e7ba5f3 100644 (file)
@@ -12,7 +12,7 @@ sub search {
     my $firstletter = $params->{firstletter};
     my $categorycode = $params->{categorycode};
     my $branchcode = $params->{branchcode};
-    my $searchtype = $params->{searchtype} || 'start_with';
+    my $searchtype = $params->{searchtype} || 'contain';
     my $searchfieldstype = $params->{searchfieldstype} || 'standard';
     my $dt_params = $params->{dt_params};
 
index 8b0ffca..cb76120 100644 (file)
         <p>
             <label for="searchtype">Search type:</label>
             <select name="searchtype" id="searchtype">
-              [% IF searchtype != 'start_with' %]
-                  <option value='start_with'>Starts with</option>
-                  <option selected="selected" value='contain'>Contains</option>
-              [% ELSE %]
+              [% IF searchtype == 'start_with' %]
                   <option selected="selected" value='start_with'>Starts with</option>
                   <option value='contain'>Contains</option>
+              [% ELSE %]
+                  <option value='start_with'>Starts with</option>
+                  <option selected="selected" value='contain'>Contains</option>
               [% END %]
             </select>
         </p>
index a0a47cc..88a00a4 100644 (file)
@@ -463,10 +463,11 @@ function filterByFirstLetterSurname(letter) {
             <li>
               <label for="searchtype_filter">Search type:</label>
               <select name="searchtype" id="searchtype_filter">
-                <option value='start_with'>Starts with</option>
-                [% IF searchtype == "contain" %]
-                  <option value="contain" selected="selected">Contains</option>
+                [% IF searchtype == "start_with" %]
+                  <option value='start_with' selected="selected">Starts with</option>
+                  <option value="contain">Contains</option>
                 [% ELSE %]
+                  <option value='start_with'>Starts with</option>
                   <option value="contain" selected="selected">Contains</option>
                 [% END %]
               </select>
index 1cc5ac5..0d18687 100755 (executable)
@@ -79,7 +79,7 @@ $template->param(
     searchmember        => $searchmember,
     branchcode_filter   => $input->param('branchcode_filter'),
     categorycode_filter => $input->param('categorycode_filter'),
-    searchtype          => $input->param('searchtype') || 'start_with',
+    searchtype          => $input->param('searchtype') || 'contain',
     searchfieldstype    => $searchfieldstype,
     PatronsPerPage      => C4::Context->preference("PatronsPerPage") || 20,
     view                => $view,