Module: check_mk
Branch: master
Commit: 732d9c6302167f4cb08aa23db36e21992a7d18b8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=732d9c6302167f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 1 23:24:51 2014 +0100
#1577 FIX Fixed editing of views using the "Downtime for host/service" sorter or
column
---
.werks/1577 | 10 ++++++++++
web/plugins/views/painters.py | 8 ++++----
web/plugins/views/sorters.py | 2 +-
3 files changed, 15 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/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)