Module: check_mk
Branch: master
Commit: 1839c3c145ec5c3b3ed21b258e9e23cee33036de
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1839c3c145ec5c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Oct 17 13:28:10 2013 +0200
It is now possible to enforce checkboxes in views upon view loading
---
ChangeLog | 2 ++
web/htdocs/views.py | 10 ++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3b0168d..fcaa1e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,8 @@
are omitted, since they do not really matter and make the
results less useful when using CMC.
* Added host aliases filter to some views (host/service search)
+ * It is now possible to enforce checkboxes in views upon view loading
+ (needs to be confgured per view via the view editor)
* FIX: Fixed encoding problem in webservice column output
* FIX: Fix output format python for several numeric columns
* FIX: Fixed searching hosts by aliases/adresses
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 836f4b3..bd0c839 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -637,8 +637,11 @@ def page_edit_view():
html.write("<br />\n")
html.checkbox("mobile", label=_('show this view in the Mobile
GUI'))
html.write("<br />\n")
- html.checkbox("mustsearch", label=_('show data only on search') +
"<br>")
+ html.checkbox("mustsearch", label=_('show data only on search'))
+ html.write("<br />\n")
html.checkbox("hidebutton", label=_('do not show a context button to
this view'))
+ html.write("<br />\n")
+ html.checkbox("force_checkboxes", label = _('always show the
checkboxes'))
forms.section(_("Automatic page reload"))
html.write(_("Reload page every "))
@@ -880,6 +883,7 @@ def load_view_into_html_vars(view):
html.set_var("hidden", view["hidden"] and
"on" or "")
html.set_var("mobile", view.get("mobile") and
"on" or "")
html.set_var("mustsearch", view["mustsearch"] and
"on" or "")
+ html.set_var("force_checkboxes", view.get("force_checkboxes",
False) and "on" or "")
html.set_var("hidebutton", view.get("hidebutton", False)
and "on" or "")
html.set_var("user_sortable", view.get("user_sortable", True)
and "on" or "")
@@ -1010,6 +1014,7 @@ def create_view(vs):
hidden = html.var("hidden", "") != ""
mobile = html.var("mobile", "") != ""
mustsearch = html.var("mustsearch", "") != ""
+ force_checkboxes = html.var("force_checkboxes", "") !=
""
hidebutton = html.var("hidebutton", "") != ""
column_headers = html.var("column_headers")
user_sortable = html.var("user_sortable")
@@ -1093,6 +1098,7 @@ def create_view(vs):
"hidden" : hidden,
"mobile" : mobile,
"mustsearch" : mustsearch,
+ "force_checkboxes" : force_checkboxes,
"hidebutton" : hidebutton,
"layout" : layoutname,
"num_columns" : num_columns,
@@ -1254,7 +1260,7 @@ def show_view(view, show_heading = False, show_buttons = True,
num_columns = vo.get("num_columns",
view.get("num_columns", 1))
browser_reload = vo.get("refresh",
view.get("browser_reload", None))
- show_checkboxes = html.var('show_checkboxes', '0') == '1'
+ show_checkboxes = view.get("force_checkboxes",
html.var('show_checkboxes', '0') == '1')
# Get the datasource (i.e. the logical table)
datasource = multisite_datasources[view["datasource"]]