Fixed deletion of user groups
authorAlexander Ebert <ebert@woltlab.com>
Thu, 26 Jan 2012 15:17:36 +0000 (16:17 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 26 Jan 2012 15:17:36 +0000 (16:17 +0100)
wcfsetup/install/files/acp/templates/userGroupList.tpl
wcfsetup/install/files/lib/data/user/group/UserGroupEditor.class.php

index ee9bcb913db743e835cd0a80ff98a7e7bc8b4f9c..1b7585b76cd7b420d6752d3813f9c5b7bb852744 100644 (file)
@@ -1,5 +1,13 @@
 {include file='header'}
 
+<script type="text/javascript">
+       //<![CDATA[
+       $(function() {
+               new WCF.Action.Delete('wcf\\data\\user\\group\\UserGroupAction', $('.userGroupRow'));
+       });
+       //]]>
+</script>
+
 <header class="mainHeading">
        <img src="{@RELATIVE_WCF_DIR}icon/users1.svg" alt="" />
        <hgroup>
@@ -11,7 +19,7 @@
        {pages print=true assign=pagesLinks controller="UserGroupList" link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"}
        <nav>
                <ul class="largeButtons">
-                       <li><a href="{link controller='UserGroupAdd'}{/link}" title="{lang}wcf.acp.group.add{/lang}" class="button"><img src="{@RELATIVE_WCF_DIR}icon/add1.svg" alt="" /> <span>{lang}wcf.acp.group.add{/lang}</span></a></li>
+                       <li><a href="{link controller='UserGroupAdd'}{/link}" title="{lang}wcf.acp.group.add{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/add1.svg" alt="" /> <span>{lang}wcf.acp.group.add{/lang}</span></a></li>
                        
                        {event name='largeButtons'}
                </ul>
@@ -38,7 +46,7 @@
                        <tbody>
                                {content}
                                        {foreach from=$objects item=group}
-                                               <tr id="groupContainer{@$group->groupID}">
+                                               <tr id="groupContainer{@$group->groupID}" class="userGroupRow">
                                                        <td class="columnIcon">
                                                                {if $group->isEditable()}
                                                                        <a href="{link controller='UserGroupEdit' id=$group->groupID}{/link}"><img src="{@RELATIVE_WCF_DIR}icon/edit1.svg" alt="" title="{lang}wcf.global.button.edit{/lang}" class="balloonTooltip" /></a>
@@ -70,7 +78,7 @@
                {@$pagesLinks}
                <nav>
                        <ul class="largeButtons">
-                               <li><a href="{link controller='UserGroupAdd'}{/link}" title="{lang}wcf.acp.group.add{/lang}" class="button"><img src="{@RELATIVE_WCF_DIR}icon/add1.svg" alt="" /> <span>{lang}wcf.acp.group.add{/lang}</span></a></li>
+                               <li><a href="{link controller='UserGroupAdd'}{/link}" title="{lang}wcf.acp.group.add{/lang}"><img src="{@RELATIVE_WCF_DIR}icon/add1.svg" alt="" /> <span>{lang}wcf.acp.group.add{/lang}</span></a></li>
                                
                                {event name='largeButtons'}
                        </ul>
index 90c8fb05052cbde3ee391de5a625c1d286c395ea..a56b6b06f69e53717c22cfecaeb6d9b0bc12e5d5 100644 (file)
@@ -117,15 +117,15 @@ class UserGroupEditor extends DatabaseObjectEditor implements IEditableCachedObj
         */
        protected static function updateAccessibleGroups($groupID, $delete = false) {
                if ($delete) {
-                       $sql = "UPDATE  wcf".WCF_N."_group_option_value
+                       $sql = "UPDATE  wcf".WCF_N."_user_group_option_value
                                        SET     optionValue = ?
                                        WHERE   groupID = ?
                                        AND     optionID = ?";
                        $updateStatement = WCF::getDB()->prepareStatement($sql);
                        
                        $sql = "SELECT          groupID, optionValue, groupOption.optionID
-                               FROM            wcf".WCF_N."_group_option groupOption
-                               LEFT JOIN       wcf".WCF_N."_group_option_value optionValue
+                               FROM            wcf".WCF_N."_user_group_option groupOption
+                               LEFT JOIN       wcf".WCF_N."_user_group_option_value optionValue
                                ON              (groupOption.optionID = optionValue.optionID)
                                WHERE           groupOption.optionname = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);