Code

Added support for optionally taking along members when copying object
authorwolffc <wolffc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Sep 2010 14:47:13 +0000 (14:47 +0000)
committerwolffc <wolffc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Sep 2010 14:47:13 +0000 (14:47 +0000)
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

trunk/gosa-core/locale/core/de/LC_MESSAGES/messages.po
trunk/gosa-core/locale/core/messages.po
trunk/gosa-core/plugins/admin/ogroups/class_ogroup.inc
trunk/gosa-core/plugins/admin/ogroups/paste_generic.tpl

index eae310d51ae165b7aafb2d6f6bab60cbff23e691..da8fccce5fef12209c82601297345ff88b994fb9 100644 (file)
@@ -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"
index 7a0fd53880fc43e107203462f959a21d4b54a710..76063fe21cb68adc651e8504efdf7dfc5358a3cb 100644 (file)
@@ -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 ""
index 3c26c693af05d1bd11eb338bf17c3405c52091e6..e9456ef7aa137aeaa3e6e8c25d53cba67e111f4b 100644 (file)
@@ -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();
+    }
   }
 
 
index 91f84d8aef85d336c214157cda000b343b2b40fc..c7e981e0f029143c9156d792d2cf815cce734ce3 100644 (file)
@@ -8,6 +8,14 @@
                </td>
        </tr>
 </table>
+<br>
+{if $copyMembers}
+<input class="center" type="checkbox" value="1" checked name="copyMembers" id="copyMembers">{t}Inherit Members{/t}<br>
+<br>
+{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}
 
 <script language="JavaScript" type="text/javascript">
        focus_field('cn');