From 7daf26ec2eeb100d8b50b07a01f0f4e702acaea1 Mon Sep 17 00:00:00 2001 From: wolffc Date: Mon, 13 Sep 2010 14:47:13 +0000 Subject: [PATCH] Added support for optionally taking along members when copying object groups. This is disabled for workstations, terminals and servers, which must not belong to more than one object group. A note has been added to warn users that adding members of a different type will delete the copied settings. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@19650 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../locale/core/de/LC_MESSAGES/messages.po | 28 +++++++++++++++++++ trunk/gosa-core/locale/core/messages.po | 18 ++++++++++++ .../plugins/admin/ogroups/class_ogroup.inc | 12 ++++++++ .../plugins/admin/ogroups/paste_generic.tpl | 8 ++++++ 4 files changed, 66 insertions(+) diff --git a/trunk/gosa-core/locale/core/de/LC_MESSAGES/messages.po b/trunk/gosa-core/locale/core/de/LC_MESSAGES/messages.po index eae310d51..da8fccce5 100644 --- a/trunk/gosa-core/locale/core/de/LC_MESSAGES/messages.po +++ b/trunk/gosa-core/locale/core/de/LC_MESSAGES/messages.po @@ -3860,6 +3860,34 @@ msgstr "Mitglied" msgid "Please enter the new object group name" msgstr "Bitte geben Sie einen Namen für die neue Objektgruppe ein" +#: plugins/admin/ogroups/paste_generic.tpl:13 +msgid "Inherit Members" +msgstr "Mitglieder übernehmen" + +#: plugins/admin/ogroups/paste_generic.tpl:15 +msgid "" +"Note that settings are copied even if you choose to not inherit members. " +"Those settings will be lost in case different type members get added to the " +"group and will only appear once a new member of the current type is added." +msgstr "" +"Beachten Sie, dass die Einstellungen auch dann kopiert werden, " +"wenn keine Mitglieder übernommen werden. Diese Einstellungen gehen verloren, " +"wenn ein Mitglied von einem anderen Typ zu der Gruppe hinzugefügt wird und " +"werden erst angezeigt, wenn ein entsprechendes Mitglied hinzugefügt wurde." + +#: plugins/admin/ogroups/paste_generic.tpl:17 +msgid "" +"Note that only settings are copied and the new object group will have no " +"members initially. Those settings will be lost in case different type " +"members get added to the group and will only appear once a new member of " +"the current type is added." +msgstr "" +"Beachten Sie, dass lediglich die Einstellungen kopiert werden und " +"die neue Objektgruppe Anfangs keine Mitglieder hat. Diese Einstellungen " +"gehen verloren, wenn ein Mitglied von einem anderen Typ zu der Gruppe " +"hinzugefügt wird und werden erst angezeigt, wenn ein entsprechendes " +"Mitglied hinzugefügt wurde." + #: plugins/admin/ogroups/class_ogroupManagement.inc:27 msgid "Manage object groups" msgstr "Objektgruppen verwalten" diff --git a/trunk/gosa-core/locale/core/messages.po b/trunk/gosa-core/locale/core/messages.po index 7a0fd5388..76063fe21 100644 --- a/trunk/gosa-core/locale/core/messages.po +++ b/trunk/gosa-core/locale/core/messages.po @@ -3588,6 +3588,24 @@ msgstr "" msgid "Please enter the new object group name" msgstr "" +#: plugins/admin/ogroups/paste_generic.tpl:13 +msgid "Inherit Members" +msgstr "" + +#: plugins/admin/ogroups/paste_generic.tpl:15 +msgid "" +"Note that settings are copied even if you choose to not inherit members. " +"Those settings will be lost in case different type members get added to the " +"group." +msgstr "" + +#: plugins/admin/ogroups/paste_generic.tpl:17 +msgid "" +"Note that only settings are copied and the new object group will have no " +"members initially. Those settings will be lost in case different type " +"members get added to the group." +msgstr "" + #: plugins/admin/ogroups/class_ogroupManagement.inc:27 msgid "Manage object groups" msgstr "" diff --git a/trunk/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/trunk/gosa-core/plugins/admin/ogroups/class_ogroup.inc index 3c26c693a..e9456ef7a 100644 --- a/trunk/gosa-core/plugins/admin/ogroups/class_ogroup.inc +++ b/trunk/gosa-core/plugins/admin/ogroups/class_ogroup.inc @@ -67,6 +67,8 @@ class ogroup extends plugin var $attributes= array("cn", "description", "gosaGroupObjects","member","accessTo","trustModel"); var $objectclasses= array("top", "gosaGroupOfNames"); + var $copyMembers = TRUE; + function ogroup (&$config, $dn= NULL) { plugin::plugin ($config, $dn); @@ -1061,6 +1063,12 @@ class ogroup extends plugin $this->gosaGroupObjects = $source['gosaGroupObjects'][0]; } + if (preg_match("/[STW]/", $this->gosaGroupObjects) || !isset($source['member'])) { + $this->copyMembers = false; + } else { + $this->copyMembers = true; + } + /* Reload tabs */ $this->parent->reload($this->gosaGroupObjects ); @@ -1088,6 +1096,7 @@ class ogroup extends plugin { $smarty = get_smarty(); $smarty->assign("cn", $this->cn); + $smarty->assign("copyMembers", $this->copyMembers); $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__))); $ret = array(); $ret['string'] = $str; @@ -1100,6 +1109,9 @@ class ogroup extends plugin if(isset($_POST['cn'])){ $this->cn = $_POST['cn']; } + if(!isset($_POST['copyMembers'])){ + $this->member = array(); + } } diff --git a/trunk/gosa-core/plugins/admin/ogroups/paste_generic.tpl b/trunk/gosa-core/plugins/admin/ogroups/paste_generic.tpl index 91f84d8ae..c7e981e0f 100644 --- a/trunk/gosa-core/plugins/admin/ogroups/paste_generic.tpl +++ b/trunk/gosa-core/plugins/admin/ogroups/paste_generic.tpl @@ -8,6 +8,14 @@ +
+{if $copyMembers} +{t}Inherit Members{/t}
+
+{t}Note that settings are copied even if you choose to not inherit members. Those settings will be lost in case different type members get added to the group and will only appear once a new member of the current type is added.{/t} +{else} +{t}Note that only settings are copied and the new object group will have no members initially. Those settings will be lost in case different type members get added to the group and will only appear once a new member of the current type is added.{/t} +{/if}