Bug 14029: Provide 'clear' link to empty reports search filters
authorJonathan Druart <jonathan.druart@koha-community.org>
Thu, 4 Jun 2015 14:28:08 +0000 (16:28 +0200)
committerTomas Cohen Arazi <tomascohen@unc.edu.ar>
Thu, 11 Jun 2015 16:08:53 +0000 (13:08 -0300)
Patch adds a 'clear' link next to the 'Apply filters' button to
empty out the form fields.

To test:
- go to the reports module
- make sure you have some saved reports
- search your saved reports using the author, keyword and date filters
- verify searching works as expected
- verify the new 'clear' link works as expected

Tested couner patch, followed test plan, works as expected. QA tools ok.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
reports/guided_reports.pl

index e769af2..283a1cf 100644 (file)
@@ -1045,7 +1045,10 @@ Sub report:<select name="subreport">
     <li><label for="filter_keyword">Keyword:</label> <input type="text" id="filter_keyword" name="filter_keyword" value="[% filters.keyword %]" /></li>
   </ol>
   </fieldset>
-  <fieldset class="action"><input type="submit" value="Apply filter" /></fieldset>
+  <fieldset class="action">
+    <input type="submit" value="Apply filter" />
+    <a id="resetReportsFilter" href="?phase=Use saved&clear_filters=1">Clear</a>
+  </fieldset>
 </form>
 </div>
 [% END %]
index 0fb773f..9cfa8ce 100755 (executable)
@@ -77,7 +77,7 @@ if ( $input->param("filter_set") ) {
     $session->param('report_filter', $filter) if $session;
     $template->param( 'filter_set' => 1 );
 }
-elsif ($session) {
+elsif ($session and not $input->param('clear_filters')) {
     $filter = $session->param('report_filter');
 }