Fixes name of edited group in group dropdown menu
authorMatthias Schmidt <gravatronics@live.com>
Wed, 9 Oct 2013 15:05:37 +0000 (17:05 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 9 Oct 2013 15:05:37 +0000 (17:05 +0200)
wcfsetup/install/files/acp/templates/userGroupAdd.tpl
wcfsetup/install/files/lib/acp/form/UserGroupEditForm.class.php
wcfsetup/install/files/lib/data/user/group/UserGroup.class.php

index 9a27edbfdd097d5635d9cbb08cf438f7fb65cecd..a771e38ea3bbf6facef2a8904c46decca5817e9c 100644 (file)
@@ -32,7 +32,7 @@
                                        <div class="dropdownMenu">
                                                <ul class="scrollableDropdownMenu">
                                                        {foreach from=$availableUserGroups item='availableUserGroup'}
-                                                               <li{if $availableUserGroup->groupID == $groupID} class="active"{/if}><a href="{link controller='UserGroupEdit' id=$availableUserGroup->groupID}{/link}">{lang}{$availableUserGroup->groupName}{/lang}</a></li>
+                                                               <li{if $availableUserGroup->groupID == $groupID} class="active"{/if}><a href="{link controller='UserGroupEdit' id=$availableUserGroup->groupID}{/link}">{$availableUserGroup->getName()}</a></li>
                                                        {/foreach}
                                                </ul>
                                        </div>
index c58e84af540fb12d8f45c8bd15ea09075bbbe9f2..b2b9cf8fbb92454cae0ecb3613e96765c2dbcd6e 100755 (executable)
@@ -131,9 +131,14 @@ class UserGroupEditForm extends UserGroupAddForm {
                if (I18nHandler::getInstance()->isPlainValue('groupName')) {
                        I18nHandler::getInstance()->remove($this->groupName);
                        $this->groupName = I18nHandler::getInstance()->getValue('groupName');
+                       
+                       UserGroup::getGroupByID($this->groupID)->setName($this->groupName);
                }
                else {
                        I18nHandler::getInstance()->save('groupName', $this->groupName, 'wcf.acp.group', 1);
+                       
+                       $groupNames = I18nHandler::getInstance()->getValues('groupName');
+                       UserGroup::getGroupByID($this->groupID)->setName($groupNames[WCF::getLanguage()->languageID]);
                }
                $this->groupDescription = 'wcf.acp.group.groupDescription'.$this->group->groupID;
                if (I18nHandler::getInstance()->isPlainValue('groupDescription')) {
index ed507573444a7f59b25d7b4b37c88496261093ea..bf99256946e959eb87f4f8c22d8d598c22ac6d9f 100644 (file)
@@ -248,6 +248,18 @@ class UserGroup extends DatabaseObject {
                return WCF::getLanguage()->get($this->groupName);
        }
        
+       /**
+        * Sets the name of this user group.
+        * 
+        * This method is only needed to set the current name of it has been changed
+        * in the same request.
+        * 
+        * @param       string          $name
+        */
+       public function setName($name) {
+               $this->data['groupName'] = $name;
+       }
+       
        /**
         * Returns true if current user may delete this group.
         *