Label group for labels is now permanent
authorAlexander Ebert <ebert@woltlab.com>
Sat, 2 Jul 2016 12:04:07 +0000 (14:04 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 2 Jul 2016 12:04:13 +0000 (14:04 +0200)
wcfsetup/install/files/acp/templates/labelAdd.tpl
wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 9f92474bdc8c5d65cde0de8449dc9ff330c487b9..a0767317dbda82480f844173a06921c27823f734 100644 (file)
                        <dl{if $errorField == 'groupID'} class="formError"{/if}>
                                <dt><label for="groupID">{lang}wcf.acp.label.group{/lang}</label></dt>
                                <dd>
-                                       <select id="groupID" name="groupID">
+                                       <select id="groupID" name="groupID"{if $action == 'edit'} disabled{/if}>
                                                <option value="0">{lang}wcf.global.noSelection{/lang}</option>
                                                {foreach from=$labelGroupList item=group}
                                                        <option value="{@$group->groupID}"{if $group->groupID == $groupID} selected{/if}>{$group}{if $group->groupDescription} / {$group->groupDescription}{/if}</option>
                                                {/foreach}
                                        </select>
+                                       <small>{lang}wcf.acp.label.group.permanentSelection{/lang}</small>
                                        {if $errorField == 'groupID'}
                                                <small class="innerError">
                                                        {if $errorType == 'empty'}
index 1d722d38b7689109a85f7a153bcc552e9d0ec011..8bc5a70ae7830199ec749a3a38334170c8a0f574 100644 (file)
@@ -35,9 +35,9 @@ class LabelEditForm extends LabelAddForm {
        
        /**
         * label object
-        * @var \wcf\data\label\Label
+        * @var Label
         */
-       public $labelObj = null;
+       public $labelObj;
        
        /**
         * @inheritDoc
@@ -68,10 +68,12 @@ class LabelEditForm extends LabelAddForm {
                }
                
                // update label
+               
+               // groupID is immutable because altering it would cause issues with objects that are
+               // assigned to them, but the new group is not allowed at their current position  
                $this->objectAction = new LabelAction([$this->labelID], 'update', ['data' => array_merge($this->additionalFields, [
                        'label' => $this->label,
                        'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName),
-                       'groupID' => $this->groupID,
                        'showOrder' => $this->showOrder
                ])]);
                $this->objectAction->executeAction();
index 7159a3ed1d3309ca3ab68fecf336074bac61a6f7..70390b1106f40c5782c445206539ef6dfc5c5d94 100644 (file)
                <item name="wcf.acp.label.group.error.notValid"><![CDATA[Die gewählte Labelgruppe ist ungültig.]]></item>
                <item name="wcf.acp.label.group.forceSelection"><![CDATA[Label aus dieser Gruppe muss zwingend ausgewählt werden]]></item>
                <item name="wcf.acp.label.group.list"><![CDATA[Labelgruppen]]></item>
+               <item name="wcf.acp.label.group.permanentSelection"><![CDATA[Die ausgewählte Labelgruppe kann nachträglich nicht mehr verändert werden.]]></item>
                <item name="wcf.acp.label.label"><![CDATA[Label]]></item>
                <item name="wcf.acp.label.list"><![CDATA[Labels]]></item>
                <item name="wcf.acp.label.group.groupName.description"><![CDATA[Der Titel ist für alle Benutzer sichtbar, die Zugriff auf diese Labelgruppe haben.]]></item>
index eb6e2461ccfd6e779c0c1c4b73543efe01710758..eff916b5523c5767beca72ee3306453ba80d4820 100644 (file)
@@ -535,6 +535,7 @@ Examples for medium ID detection:
                <item name="wcf.acp.label.group.error.notValid"><![CDATA[Chosen label group is invalid.]]></item>
                <item name="wcf.acp.label.group.forceSelection"><![CDATA[Force selection of a label]]></item>
                <item name="wcf.acp.label.group.list"><![CDATA[Label Groups]]></item>
+               <item name="wcf.acp.label.group.permanentSelection"><![CDATA[The selected label group cannot be modified and is permanent for this label.]]></item>
                <item name="wcf.acp.label.label"><![CDATA[Label]]></item>
                <item name="wcf.acp.label.list"><![CDATA[Labels]]></item>
                <item name="wcf.acp.label.group.groupName.description"><![CDATA[The title is visible for every user who can interact with the label group.]]></item>