Merge branch 'master' into next
authorMatthias Schmidt <gravatronics@live.com>
Sun, 18 Sep 2016 08:09:07 +0000 (10:09 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 18 Sep 2016 08:09:07 +0000 (10:09 +0200)
1  2 
com.woltlab.wcf/templates/textSearchableOptionType.tpl
wcfsetup/install/files/acp/templates/textSearchableOptionType.tpl
wcfsetup/install/files/lib/acp/form/PaidSubscriptionAddForm.class.php
wcfsetup/install/files/lib/acp/form/PaidSubscriptionEditForm.class.php

index e366d1312866dfdad523684e0538848ade8fe247,f238827cbf2488c50c0ba88a676fa2dc3ab966a0..0d5abac65239b7179aab2038faeb06c7342303e5
@@@ -1,17 -1,29 +1,29 @@@
 -<label><input type="checkbox" id="search_{$option->optionName}" name="searchOptions[{$option->optionName}]"{if $searchOption} checked="checked"{/if} /> {lang}wcf.user.option.searchTextOption{/lang}</label>
 -<input type="{@$inputType}" id="{$option->optionName}" name="values[{$option->optionName}]" value="{$value}"{if $inputClass} class="{@$inputClass}"{/if}{if !$searchOption} disabled="disabled"{/if} />
 +<label><input type="checkbox" id="search_{$option->optionName}" name="searchOptions[{$option->optionName}]"{if $searchOption} checked{/if}> {lang}wcf.user.option.searchTextOption{/lang}</label>
 +<input type="{@$inputType}" id="{$option->optionName}" name="values[{$option->optionName}]" value="{$value}"{if $inputClass} class="{@$inputClass}"{/if}{if !$searchOption} disabled{/if}{if $option->required} required{/if}>
  
  <script data-relocate="true">
- //<![CDATA[
- $(function() {
-       $('#search_{$option->optionName}').change(function(event) {
-               if ($(event.currentTarget).prop('checked')) {
-                       $('#{$option->optionName}').enable();
-               }
-               else {
-                       $('#{$option->optionName}').disable();
-               }
+       //<![CDATA[
+       $(function() {
+               $('#search_{$option->optionName}').change(function(event) {
+                       if ($(event.currentTarget).prop('checked')) {
+                               $('#{$option->optionName}').enable();
+                               
+                               {if $inputType === 'date'}
+                                       $('#{$option->optionName}DatePicker').enable();
+                               {/if}
+                       }
+                       else {
+                               $('#{$option->optionName}').disable();
+                               
+                               {if $inputType === 'date'}
+                                       $('#{$option->optionName}DatePicker').disable();
+                               {/if}
+                       }
+               });
+               
+               {if !$searchOption}
+                       $('#{$option->optionName}DatePicker').disable();
+               {/if}
        });
- });
- //]]>
+       //]]>
  </script>
index 81c0de79b486ddc45798c345861ca64618d2c55a,f238827cbf2488c50c0ba88a676fa2dc3ab966a0..abad01dad87bb998b38526ff85329f5dcac18507
@@@ -1,17 -1,29 +1,29 @@@
 -<label><input type="checkbox" id="search_{$option->optionName}" name="searchOptions[{$option->optionName}]"{if $searchOption} checked="checked"{/if} /> {lang}wcf.user.option.searchTextOption{/lang}</label>
 -<input type="{@$inputType}" id="{$option->optionName}" name="values[{$option->optionName}]" value="{$value}"{if $inputClass} class="{@$inputClass}"{/if}{if !$searchOption} disabled="disabled"{/if} />
 +<label><input type="checkbox" id="search_{$option->optionName}" name="searchOptions[{$option->optionName}]"{if $searchOption} checked{/if}> {lang}wcf.user.option.searchTextOption{/lang}</label>
 +<input type="{@$inputType}" id="{$option->optionName}" name="values[{$option->optionName}]" value="{$value}"{if $inputClass} class="{@$inputClass}"{/if}{if !$searchOption} disabled{/if}>
  
  <script data-relocate="true">
- //<![CDATA[
- $(function() {
-       $('#search_{$option->optionName}').change(function(event) {
-               if ($(event.currentTarget).prop('checked')) {
-                       $('#{$option->optionName}').enable();
-               }
-               else {
-                       $('#{$option->optionName}').disable();
-               }
+       //<![CDATA[
+       $(function() {
+               $('#search_{$option->optionName}').change(function(event) {
+                       if ($(event.currentTarget).prop('checked')) {
+                               $('#{$option->optionName}').enable();
+                               
+                               {if $inputType === 'date'}
+                                       $('#{$option->optionName}DatePicker').enable();
+                               {/if}
+                       }
+                       else {
+                               $('#{$option->optionName}').disable();
+                               
+                               {if $inputType === 'date'}
+                                       $('#{$option->optionName}DatePicker').disable();
+                               {/if}
+                       }
+               });
+               
+               {if !$searchOption}
+                       $('#{$option->optionName}DatePicker').disable();
+               {/if}
        });
- });
- //]]>
+       //]]>
  </script>
index 5a8780470295867332722b89e088a698081dbded,b2f96497434bff00560079be99c2af8aab5dce68..d31a64ced36bfa834c952f47dd23b48180199b6f
@@@ -74,33 -75,7 +73,7 @@@ class PaidSubscriptionEditForm extends 
        }
        
        /**
 -       * @see \wcf\form\IForm::save()
 +       * @inheritDoc
-        */
-       public function readFormParameters() {
-               parent::readFormParameters();
-               
-               // read i18n values
-               I18nHandler::getInstance()->readValues();
-               
-               // handle i18n plain input
-               if (I18nHandler::getInstance()->isPlainValue('description')) $this->description = I18nHandler::getInstance()->getValue('description');
-               if (I18nHandler::getInstance()->isPlainValue('title')) $this->title = I18nHandler::getInstance()->getValue('title');
-               
-               if (!empty($_POST['isDisabled'])) $this->isDisabled = 1;
-               if (isset($_POST['showOrder'])) $this->showOrder = intval($_POST['showOrder']);
-               if (isset($_POST['cost'])) $this->cost = floatval($_POST['cost']);
-               if (isset($_POST['currency'])) $this->currency = $_POST['currency'];
-               if (!empty($_POST['subscriptionLengthPermanent'])) $this->subscriptionLengthPermanent = 1;
-               if (!$this->subscriptionLengthPermanent) {
-                       if (isset($_POST['subscriptionLength'])) $this->subscriptionLength = intval($_POST['subscriptionLength']);
-                       if (isset($_POST['subscriptionLengthUnit'])) $this->subscriptionLengthUnit = $_POST['subscriptionLengthUnit'];
-               }
-               if (!empty($_POST['isRecurring'])) $this->isRecurring = 1;
-               if (isset($_POST['groupIDs']) && is_array($_POST['groupIDs'])) $this->groupIDs = ArrayUtil::toIntegerArray($_POST['groupIDs']);
-       }
-       
-       /**
-        * @inheritDoc
         */
        public function save() {
                AbstractForm::save();