Preserves ACL options for unsaved label group (changes)
authorMatthias Schmidt <gravatronics@live.com>
Thu, 8 Aug 2013 11:01:10 +0000 (13:01 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 8 Aug 2013 11:01:10 +0000 (13:01 +0200)
wcfsetup/install/files/acp/templates/labelGroupAdd.tpl
wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php
wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php

index 2e2b97816ec5ed14c8c0b89c8446bce5ad0db7af..bdb8ac3168d487f53267a4042fadbe3b888d5f21 100644 (file)
@@ -5,7 +5,6 @@
 <script data-relocate="true">
        //<![CDATA[
        $(function() {
-               new WCF.ACL.List($('#groupPermissions'), {@$objectTypeID}{if $groupID|isset}, '', {@$groupID}{/if});
                new WCF.Label.ACPList.Connect();
                
                WCF.TabMenu.init();
        //]]>
 </script>
 
+{if !$groupID|isset}
+       {include file='aclPermissionJavaScript' containerID='groupPermissions'}
+{else}
+       {include file='aclPermissionJavaScript' containerID='groupPermissions' objectID=$groupID}
+{/if}
+
 <header class="boxHeadline">
        <h1>{lang}wcf.acp.label.group.{$action}{/lang}</h1>
 </header>
index ff34f8fca131e09bf9ca682efbed0259e6500bca..6a21e3dff11a98ca29d26eaaadcfce7dc68d62f7 100644 (file)
@@ -137,13 +137,14 @@ class LabelGroupAddForm extends AbstractForm {
                        'groupName' => $this->groupName
                )));
                $returnValues = $this->objectAction->executeAction();
-                               
+               
                // save acl
                ACLHandler::getInstance()->save($returnValues['returnValues']->groupID, $this->objectTypeID);
+               ACLHandler::getInstance()->disableAssignVariables();
                
                // save object type relations
                $this->saveObjectTypeRelations($returnValues['returnValues']->groupID);
-
+               
                foreach ($this->labelObjectTypes as $objectTypeID => $labelObjectType) {
                        $labelObjectType->save();
                }
@@ -168,6 +169,8 @@ class LabelGroupAddForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
+               ACLHandler::getInstance()->assignVariables($this->objectTypeID);
+               
                WCF::getTPL()->assign(array(
                        'action' => 'add',
                        'forceSelection' => $this->forceSelection,
index 8d20fa30e78c44b7a0c6d31ae612405766b05758..eaca7a1d83aa30073da7c65b06bda399cbef0afc 100644 (file)
@@ -68,6 +68,7 @@ class LabelGroupEditForm extends LabelGroupAddForm {
                
                // update acl
                ACLHandler::getInstance()->save($this->groupID, $this->objectTypeID);
+               ACLHandler::getInstance()->disableAssignVariables();
                
                // update object type relations
                $this->saveObjectTypeRelations($this->groupID);