[checkmk-commits] 3570 FIX Dashboard: Fixed different issues with filtering using WATO folders

Lars Michelsen lm at mathias-kettner.de
Mon May 9 10:00:07 CEST 2016


Module: check_mk
Branch: master
Commit: 2ed57990b7e86d1fc7945b85feae9b061acb1e50
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2ed57990b7e86d1fc7945b85feae9b061acb1e50

Author: Lars Michelsen <lm at mathias-kettner.de>
Date:   Mon May  9 10:00:00 2016 +0200

3570 FIX Dashboard: Fixed different issues with filtering using WATO folders

---

 .werks/3570                       |   10 ++++++++++
 ChangeLog                         |    1 +
 web/htdocs/dashboard.py           |    3 ++-
 web/plugins/dashboard/dashlets.py |   12 +++++++++---
 4 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/.werks/3570 b/.werks/3570
new file mode 100644
index 0000000..2fbc535
--- /dev/null
+++ b/.werks/3570
@@ -0,0 +1,10 @@
+Title: Dashboard: Fixed different issues with filtering using WATO folders
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1462780790
+
+
diff --git a/ChangeLog b/ChangeLog
index e1e2f48..87b8516 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -280,6 +280,7 @@
     * 3468 FIX: Fix changing a user's language back to English if the default is German...
     * 3567 FIX: Werk list: Fixed link to not existing check man pages in some cases
     * 3569 FIX: Dashboard: Fixed wrong links to views in statistics dashlets when using state filters in dashlet
+    * 3570 FIX: Dashboard: Fixed different issues with filtering using WATO folders
 
     WATO:
     * 3244 WATO BI Module: swap order of aggregation function and child node selection...
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 07be582..06f3fec 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -447,7 +447,8 @@ def draw_dashlet_content(nr, the_dashlet, wato_folder, stash_html_vars=True):
 
     try:
         visuals.add_context_to_uri_vars(the_dashlet)
-        html.set_var("wato_folder", wato_folder)
+        if wato_folder != None:
+            html.set_var("wato_folder", wato_folder)
 
         dashlet_type = dashlet_types[the_dashlet['type']]
         if 'iframe_render' in dashlet_type:
diff --git a/web/plugins/dashboard/dashlets.py b/web/plugins/dashboard/dashlets.py
index 1c7bc6f..23d590d 100644
--- a/web/plugins/dashboard/dashlets.py
+++ b/web/plugins/dashboard/dashlets.py
@@ -255,10 +255,16 @@ def render_statistics(pie_id, what, table, filter, dashlet):
     table_entries.append(((_("Total"), "", "all%s" % what, ""), total))
 
     for (name, color, viewurl, query), count in table_entries:
-        url = "view.py?view_name=" + viewurl + "&filled_in=filter&search=1&wato_folder="
+        url = "view.py?view_name=" + viewurl + "&filled_in=filter&search=1"
         for filter_name, url_params in dashlet['context'].items():
-            # The svcstate filter URL vars are controlled by dashlet
-            if filter_name != "svcstate":
+            if filter_name == "wato_folder" and html.has_var("wato_folder"):
+                url += "&wato_folder=" + html.var("wato_folder")
+
+            elif filter_name == "svcstate":
+                # The svcstate filter URL vars are controlled by dashlet
+                continue
+
+            else:
                 url += '&' + html.urlencode_vars(url_params.items())
 
         html.write('<tr><th><a href="%s">%s</a></th>' % (url, name))



More information about the checkmk-commits mailing list