Module: check_mk
Branch: master
Commit: 0abeb5bc186d7b8ad59ca4a4ef6bdd63f81b5580
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0abeb5bc186d7b…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Nov 7 19:16:47 2018 +0100
6677 It is now possible to hide annotations in PDF reports
A new option <tt>Hide annotation in report</tt> is now available when editing
an annotation.
CMK-997
Change-Id: If62ca691ea8496b6820c88b72c7d12ac3bb44e52
---
.werks/6677 | 10 ++++++++++
cmk/gui/plugins/views/availability.py | 10 +++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/6677 b/.werks/6677
new file mode 100644
index 0000000..bb96540
--- /dev/null
+++ b/.werks/6677
@@ -0,0 +1,10 @@
+Title: It is now possible to hide specific annotations in PDF reports
+Level: 1
+Component: reporting
+Compatible: compat
+Edition: cee
+Version: 1.6.0i1
+Date: 1541614522
+Class: feature
+
+A new option <tt>Hide annotation in report</tt> is now available when editing
an annotation.
diff --git a/cmk/gui/plugins/views/availability.py
b/cmk/gui/plugins/views/availability.py
index 8d72240..0cef148 100644
--- a/cmk/gui/plugins/views/availability.py
+++ b/cmk/gui/plugins/views/availability.py
@@ -26,6 +26,7 @@
import time
+import cmk
import cmk.gui.config as config
import cmk.gui.availability as availability
import cmk.gui.table as table
@@ -34,6 +35,7 @@ from cmk.gui.i18n import _
from cmk.gui.globals import html
from cmk.gui.exceptions import MKUserError
from cmk.gui.valuespec import (
+ Checkbox,
TextAreaUnicode,
TextAscii,
Dictionary,
@@ -767,6 +769,8 @@ def show_annotations(annotations, av_rawdata, what, avoptions,
omit_service):
table.cell(_("Annotation"),
html.render_text(annotation["text"]))
table.cell(_("Author"), annotation["author"])
table.cell(_("Entry"), render_date(annotation["date"]),
css="nobr narrow")
+ if not cmk.is_raw_edition():
+ table.cell(_("Hide in report"), _("Yes") if
annotation.get("hide_from_report") else _("No"))
table.end()
@@ -837,6 +841,10 @@ def edit_annotation():
def _vs_annotation():
+ extra_elements = []
+ if not cmk.is_raw_edition():
+ extra_elements.append(("hide_from_report", Checkbox(title =
_("Hide annotation in report"))))
+
return Dictionary(
elements = [
("site", TextAscii(title = _("Site")) ),
@@ -855,7 +863,7 @@ def _vs_annotation():
label = _("Reclassify downtime of this period"),
)),
("text", TextAreaUnicode(title = _("Annotation"),
allow_empty = False) ),
- ],
+ ] + extra_elements,
title = _("Edit annotation"),
optional_keys = [],
)