[checkmk-commits] Check_MK Git: check_mk: WATO: Cloning of contact/host/service groups ( without members)

git version control git at mathias-kettner.de
Sun Nov 18 14:34:54 CET 2012


Module: check_mk
Branch: master
Commit: a756bb3faecfa93696749e30a903c4a7e983b66b
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a756bb3faecfa93696749e30a903c4a7e983b66b

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Sun Nov 18 14:28:32 2012 +0100

WATO: Cloning of contact/host/service groups (without members)

---

 ChangeLog          |    3 +++
 web/htdocs/wato.py |   12 ++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3de6b68..7b432e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
     * New performance counter for client request processing time
     * FIX: fixed bug in rule optimizer with ranges of syslog priorities
 
+    WATO:
+    * Cloning of contact/host/service groups (without members)
+
 
 1.2.1i2:
     Core:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index d23391b..a0135f7 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5755,8 +5755,10 @@ def mode_groups(phase, what):
         html.write('<tr class="data %s0">' % odd)
         edit_url = make_link([("mode", "edit_%s_group" % what), ("edit", name)])
         delete_url = html.makeactionuri([("_delete", name)])
+        clone_url    =  make_link([("mode", "edit_%s_group" % what), ("clone", name)])
         html.write("<td class=buttons>")
         html.icon_button(edit_url, _("Properties"), "edit")
+        html.icon_button(clone_url, _("Create a copy of this group"), "clone")
         html.icon_button(delete_url, _("Delete"), "delete")
         html.write("</td><td>%s</td><td>%s</td>" % (name, alias))
         if what == "contact":
@@ -5821,7 +5823,8 @@ def mode_edit_group(phase, what):
     html.help(_("The name of the group is used as an internal key. It cannot be "
                  "changed later. It is also visible in the status GUI."))
     if new:
-        html.text_input("name")
+        clone_group = html.var("clone")
+        html.text_input("name", clone_group or "")
         html.set_focus("name")
     else:
         html.write(name)
@@ -5829,7 +5832,12 @@ def mode_edit_group(phase, what):
 
     forms.section(_("Alias"))
     html.help(_("An Alias or description of this group."))
-    html.text_input("alias", name and groups.get(name, "") or "")
+    alias = groups.get(name, "")
+    if not alias and clone_group:
+        alias = groups.get(clone_group, "")
+    if not alias:
+        alias = name
+    html.text_input("alias", alias)
     forms.end()
     html.button("save", _("Save"))
     html.hidden_fields()



More information about the checkmk-commits mailing list