Bug 7380: Rename filter to avoid confusion
authorJonathan Druart <jonathan.druart@biblibre.com>
Tue, 14 Apr 2015 10:05:45 +0000 (12:05 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 19 May 2015 13:10:31 +0000 (10:10 -0300)
The branchcode and categorycode parameter names are too common and are
confusing.
To remove the ambiguity, this patch renames them with branchcode_filter
and categorycode_filter.

Test plan:
1/ Go on the patron home page (members-home.pl)
2/ Fill the library and category dropdown list in the header search
3/ The patron result list appears and the filters (on the right) are
correctly set with what you have selected.
Make sure the ones in the header are also correctly selected.
4/ Click on a patron
5/ On the patron detail page (moremember.pl), the dropdown lists in the
header are not preselected.

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc
koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
members/member.pl

index 7723e3a..05a0e98 100644 (file)
@@ -75,8 +75,8 @@
 
         <p>
             <label for="branchcode">Library: </label>
-            [% SET branches = Branches.all( selected => branchcode ) %]
-            <select name="branchcode" id="branchcode">
+            [% SET branches = Branches.all( selected => branchcode_filter ) %]
+            <select name="branchcode_filter" id="branchcode">
                 [% IF branches.size != 1 %]
                   <option value="">Any</option>
                 [% END %]
@@ -92,8 +92,8 @@
 
         <p>
             <label for="categorycode">Category: </label>
-            [% SET categories = Categories.all( selected => categorycode ) %]
-            <select name="categorycode" id="categorycode">
+            [% SET categories = Categories.all( selected => categorycode_filter ) %]
+            <select name="categorycode_filter" id="categorycode">
                 <option value="">Any</option>
                 [% FOREACH categorie IN categories %]
                     [% IF ( categorie.selected ) %]
index cd2608b..aac6657 100644 (file)
@@ -98,10 +98,10 @@ $(document).ready(function() {
         $("#searchtype_filter").val("[% searchtype %]");
     [% END %]
     [% IF categorycode %]
-        $("#categorycode_filter").val("[% categorycode %]");
+        $("#categorycode_filter").val("[% categorycode_filter %]");
     [% END %]
     [% IF branchcode %]
-        $("#branchcode_filter").val("[% branchcode %]");
+        $("#branchcode_filter").val("[% branchcode_filter %]");
     [% END %]
 
     [% IF view != "show_results" %]
@@ -454,7 +454,7 @@ function filterByFirstLetterSurname(letter) {
             </li>
             <li>
               <label for="categorycode_filter">Category:</label>
-              [% SET categories = Categories.all( selected => categorycode ) %]
+              [% SET categories = Categories.all( selected => categorycode_filter ) %]
               <select id="categorycode_filter">
                 <option value="">Any</option>
                 [% FOREACH cat IN categories %]
@@ -468,7 +468,7 @@ function filterByFirstLetterSurname(letter) {
             </li>
             <li>
               <label for="branchcode_filter">Library:</label>
-              [% SET branches = Branches.all( selected => branchcode ) %]
+              [% SET branches = Branches.all( selected => branchcode_filter ) %]
               <select id="branchcode_filter">
                 [% IF branches.size != 1 %]
                   <option value="">Any</option>
index 71b1f40..1cc5ac5 100755 (executable)
@@ -45,11 +45,6 @@ my ($template, $loggedinuser, $cookie)
 
 my $theme = $input->param('theme') || "default";
 
-my $patron = $input->Vars;
-foreach (keys %$patron){
-    delete $patron->{$_} unless($patron->{$_});
-}
-
 my $searchmember = $input->param('searchmember');
 my $quicksearch = $input->param('quicksearch') // 0;
 
@@ -82,8 +77,8 @@ my $view = $input->request_method() eq "GET" ? "show_form" : "show_results";
 $template->param(
     patron_lists => [ GetPatronLists() ],
     searchmember        => $searchmember,
-    branchcode          => $patron->{branchcode},
-    categorycode        => $patron->{categorycode},
+    branchcode_filter   => $input->param('branchcode_filter'),
+    categorycode_filter => $input->param('categorycode_filter'),
     searchtype          => $input->param('searchtype') || 'start_with',
     searchfieldstype    => $searchfieldstype,
     PatronsPerPage      => C4::Context->preference("PatronsPerPage") || 20,