Bug 4907: make 'Organize by' filter in suggestions reflect selected option
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Mon, 1 Jul 2013 21:44:39 +0000 (23:44 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 8 Jul 2013 15:15:16 +0000 (15:15 +0000)
When using the 'Organize by' option to change the display of the
suggestions, the option is applied, but the pull down always jumps
back to the first entry 'Status'.

This patch fixes that.

To test:
- Try out all settings and verify that after the page reloads the selected
  option is applied to your suggestions and the pull down shows
  the option you selected.

Note: Until bug 10519 is properly fixed the tabs will not show
the correct descriptions, but the URL will show you the selected
option as parameter: displayby=acceptedby

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt

index c1f54e3..0b4a4ab 100644 (file)
@@ -586,11 +586,31 @@ $(document).ready(function() { calcNewsuggTotal(); });
 <form name="suggestionfilter" action="suggestion.pl" method="get">
 <fieldset class="brief"><ol style="display:block;"><li><label for="displayby">Organize by: </label>
                 <select name="displayby" id="displayby" style="width:auto;">
-                    <option value="STATUS">Status</option>
-                    <option value="branchcode">Library</option>
-                    <option value="itemtype">Item type</option>
-                    <option value="managedby">Managed by</option>
-                    <option value="acceptedby">Accepted by</option>
+                    [% IF ( displayby == "STATUS" ) %]
+                        <option value="STATUS" selected="selected">Status</option>
+                    [% ELSE %]
+                        <option value="STATUS">Status</option>
+                    [% END %]
+                    [% IF ( displayby == "branchcode" ) %]
+                        <option value="branchcode" selected="selected">Library</option>
+                    [% ELSE %]
+                        <option value="branchcode">Library</option>
+                    [% END %]
+                    [% IF ( displayby == "itemtype" ) %]
+                        <option value="itemtype" selected="selected">Item type</option>
+                    [% ELSE %]
+                        <option value="itemtype">Item type</option>
+                    [% END %]
+                    [% IF ( displayby == "managedby" ) %]
+                        <option value="managedby" selected="selected">Managed by</option>
+                    [% ELSE %]
+                        <option value="managedby">Managed by</option>
+                    [% END %]
+                    [% IF ( displayby == "acceptedby" ) %]
+                        <option value="acceptedby" selected="selected">Accepted by</option>
+                    [% ELSE %]
+                        <option value="acceptedby">Accepted by</option>
+                    [% END %]
                 </select> <input type="submit" value="Go" /></li></ol></fieldset>
 <h4>Filter by: <a style="font-size:80%;font-weight:normal;" href="/cgi-bin/koha/suggestion/suggestion.pl">[clear]</a></h4>
                 <div style="display:block;" id="limits">