From c7e6ce11d42e1b74315271a37f2a5c6563bce580 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 8 Aug 2013 13:01:10 +0200 Subject: [PATCH] Preserves ACL options for unsaved label group (changes) --- wcfsetup/install/files/acp/templates/labelGroupAdd.tpl | 7 ++++++- .../install/files/lib/acp/form/LabelGroupAddForm.class.php | 7 +++++-- .../files/lib/acp/form/LabelGroupEditForm.class.php | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl b/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl index 2e2b97816e..bdb8ac3168 100644 --- a/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl +++ b/wcfsetup/install/files/acp/templates/labelGroupAdd.tpl @@ -5,7 +5,6 @@ +{if !$groupID|isset} + {include file='aclPermissionJavaScript' containerID='groupPermissions'} +{else} + {include file='aclPermissionJavaScript' containerID='groupPermissions' objectID=$groupID} +{/if} +

{lang}wcf.acp.label.group.{$action}{/lang}

diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php index ff34f8fca1..6a21e3dff1 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php @@ -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, diff --git a/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php b/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php index 8d20fa30e7..eaca7a1d83 100644 --- a/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php @@ -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); -- 2.20.1