From ac4e28bcf194fa5f46ded84a8277626ff0dc54d4 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 25 May 2015 11:03:14 +0200 Subject: [PATCH] Bug 14029: Provide 'clear' link to empty reports search filters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Katrin Fischer Changed patch to include suggestion from Marc VĂ‚eron for reloading the form on clearing. Thx Marc! --- .../prog/en/modules/reports/guided_reports_start.tt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index e769af2..4ef7e91 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -150,6 +150,12 @@ $(document).ready(function(){ return false; } }); + + $("#resetReportsFilter").click(function(e) { + e.preventDefault(); + $("form[name='ReportsFilter']").find("input[type=text]").val(""); + $("form[name='ReportsFilter']").submit(); + }); [% END %] [% IF ( showsql ) %] @@ -1031,7 +1037,7 @@ Sub report:
@@ -1045,7 +1051,9 @@ Sub report:
-
+
+ Clear +
[% END %] -- 1.9.1