Module: check_mk
Branch: master
Commit: 0a2412591606afe41fccc88c00c20ff6c7f07876
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0a2412591606af…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 1 16:56:59 2014 +0100
#1577 FIX Fixed editing of views using the "Downtime for host/service" sorter or
column
Views which were using the "Downtime for host/service" (downtime_what) sorter or
column
were loosing this information when opening the view for editing and saving it again.
---
.werks/1577 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/visuals.py | 1 +
web/plugins/views/painters.py | 8 ++++----
web/plugins/views/sorters.py | 2 +-
5 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/.werks/1577 b/.werks/1577
new file mode 100644
index 0000000..c33902d
--- /dev/null
+++ b/.werks/1577
@@ -0,0 +1,10 @@
+Title: Fixed editing of views using the "Downtime for host/service" sorter or
column
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417449307
+Class: fix
+
+Views which were using the "Downtime for host/service" (downtime_what) sorter
or column
+were loosing this information when opening the view for editing and saving it again.
diff --git a/ChangeLog b/ChangeLog
index c553423..c15ce1e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -89,6 +89,7 @@
* 1544 FIX: Fixed exception in complain phase in view editor...
* 1573 FIX: WATO Quickaccess snapin: Pending button is not overlapped by icons
anymore
* 1557 FIX: Fix sorting of hostnames that only differ in lower/uppercaseness
+ * 1577 FIX: Fixed editing of views using the "Downtime for host/service"
sorter or column...
WATO:
* 1170 Added buttons to move rules to top/bottom of the list to ruleset edit dialog
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index 0a81be9..f7115a7 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -548,6 +548,7 @@ def page_edit_visual(what, all_visuals, custom_field_handler = None,
if load_handler:
load_handler(visual)
+
else:
mode = 'create'
single_infos = []
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index f264933..0f1c01d 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -1625,8 +1625,8 @@ multisite_painters["downtime_comment"] = {
}
multisite_painters["downtime_fixed"] = {
- "title" : _("Type of Downtime"),
- "short" : _("Type"),
+ "title" : _("Downtime start mode"),
+ "short" : _("Start"),
"columns" : ["downtime_fixed"],
"paint" : lambda row: (None, row["downtime_fixed"] == 0 and
_("flexible") or _("fixed")),
}
@@ -1634,8 +1634,8 @@ multisite_painters["downtime_fixed"] = {
multisite_painters["downtime_what"] = {
"title" : _("Downtime for host/service"),
"short" : _("for"),
- "columns" : ["is_service"],
- "paint" : lambda row: (None, row["is_service"] and
_("Service") or _("Host")),
+ "columns" : ["downtime_is_service"],
+ "paint" : lambda row: (None, row["downtime_is_service"] and
_("Service") or _("Host")),
}
multisite_painters["downtime_type"] = {
diff --git a/web/plugins/views/sorters.py b/web/plugins/views/sorters.py
index bbe2815..1c02cdc 100644
--- a/web/plugins/views/sorters.py
+++ b/web/plugins/views/sorters.py
@@ -300,7 +300,7 @@ declare_1to1_sorter("downtime_author",
cmp_simple_string)
declare_1to1_sorter("downtime_comment", cmp_simple_string)
declare_1to1_sorter("downtime_fixed", cmp_simple_number)
declare_1to1_sorter("downtime_type", cmp_simple_number)
-declare_simple_sorter("downtime_what", _("Downtime type
(host/service)"), "is_service", cmp_simple_number)
+declare_simple_sorter("downtime_what", _("Downtime for
host/service"), "downtime_is_service", cmp_simple_number)
declare_simple_sorter("downtime_start_time", _("Downtime start"),
"downtime_start_time", cmp_simple_number)
declare_simple_sorter("downtime_end_time", _("Downtime end"),
"downtime_end_time", cmp_simple_number)
declare_simple_sorter("downtime_entry_time", _("Downtime entry
time"), "downtime_entry_time", cmp_simple_number)