Module: check_mk
Branch: master
Commit: 7e07d4b6c003ce426b6091a55d6e3412e0d01093
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7e07d4b6c003ce…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jan 9 12:07:52 2015 +0100
#1804 FIX Fixed prechecked checkboxes in view actions after first action submit
When e.g. acknowleding a problem for the first time, the checkboxes "fixed" and
"notify"
are prechecked. When acknowledging a problem and opening the form again afterwards, the
checkboxes were not prechecked anymore. This has been fixed now.
---
.werks/1804 | 12 ++++++++++++
ChangeLog | 1 +
web/htdocs/htmllib.py | 4 ++--
web/htdocs/views.py | 2 +-
4 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/.werks/1804 b/.werks/1804
new file mode 100644
index 0000000..27ac7c6
--- /dev/null
+++ b/.werks/1804
@@ -0,0 +1,12 @@
+Title: Fixed prechecked checkboxes in view actions after first action submit
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1420801587
+
+When e.g. acknowleding a problem for the first time, the checkboxes "fixed" and
"notify"
+are prechecked. When acknowledging a problem and opening the form again afterwards, the
+checkboxes were not prechecked anymore. This has been fixed now.
diff --git a/ChangeLog b/ChangeLog
index 05a4063..19c6102 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -68,6 +68,7 @@
* 1796 FIX: Fix filtering in Multisite View BI Boxes...
* 1802 FIX: Links in messages like "successfully sent X commands" are now
working again...
* 1803 FIX: Fixed exception in Check_MK prediction page...
+ * 1804 FIX: Fixed prechecked checkboxes in view actions after first action submit...
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index f147269..88e91a9 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -287,11 +287,11 @@ class html:
self.global_vars += varnames
# [('varname1', value1), ('varname2', value2) ]
- def makeuri(self, addvars, remove_prefix = None, filename=None):
+ def makeuri(self, addvars, remove_prefix=None, filename=None, delvars=None):
new_vars = [ nv[0] for nv in addvars ]
vars = [ (v, self.var(v))
for v in self.vars
- if v[0] != "_" and v not in new_vars ]
+ if v[0] != "_" and v not in new_vars and (not delvars or v not
in delvars) ]
if remove_prefix != None:
vars = [ i for i in vars if not i[0].startswith(remove_prefix) ]
vars = vars + addvars
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 6aa1c7f..628ba15 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1182,7 +1182,7 @@ def render_view(view, rows, datasource, group_painters, painters,
if html.do_actions() and html.transaction_valid(): # submit button pressed, no
reload
try:
# Create URI with all actions variables removed
- backurl = html.makeuri([])
+ backurl = html.makeuri([], delvars=['filled_in',
'actions'])
has_done_actions = do_actions(view, datasource["infos"][0],
rows, backurl)
except MKUserError, e:
html.show_error(e.message)