Added support for terms of service confirmation
authorMarcel Werk <burntime@woltlab.com>
Thu, 2 Oct 2014 23:08:42 +0000 (01:08 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 2 Oct 2014 23:08:42 +0000 (01:08 +0200)
com.woltlab.wcf/option.xml
com.woltlab.wcf/templates/dashboardBoxPaidSubscriptions.tpl
com.woltlab.wcf/templates/dashboardBoxPaidSubscriptionsSidebar.tpl
com.woltlab.wcf/templates/paidSubscriptionList.tpl
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 3d763a0a2e9de3323272e19c61131185bc431e14..173a949f57fc5937e0319cb08cf4f96a42357011 100644 (file)
@@ -844,6 +844,17 @@ memcached:cache_source_memcached_host]]></enableoptions>
                                <categoryname>general.payment</categoryname>
                                <optiontype>boolean</optiontype>
                        </option>
+                       
+                       <option name="paid_subscription_enable_tos_confirmation">
+                               <categoryname>general.payment</categoryname>
+                               <optiontype>boolean</optiontype>
+                               <enableoptions><![CDATA[paid_subscription_tos_url]]></enableoptions>
+                       </option>
+                       
+                       <option name="paid_subscription_tos_url">
+                               <categoryname>general.payment</categoryname>
+                               <optiontype>text</optiontype>
+                       </option>
                        <!-- /general.payment -->
                        
                        <option name="attachment_storage">
index d8153d1bd56382f25a8f81d1a83e3e23adf6554f..759629aa7c672291237cf4a387ab2fa5b9a3c560 100644 (file)
                                        <small>{lang}wcf.paidSubscription.formattedCost{/lang}</small> 
                                </div>
                                
-                               <ul class="buttonList marginTopTiny">
-                                       {foreach from=$subscription->getPurchaseButtons() item=button}
-                                               <li>{@$button}</li>
-                                       {/foreach}
-                               </ul>
+                               {if !PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION}
+                                       <ul class="buttonList marginTopTiny">
+                                               {foreach from=$subscription->getPurchaseButtons() item=button}
+                                                       <li>{@$button}</li>
+                                               {/foreach}
+                                       </ul>
+                               {/if}
                        </li>
                {/foreach}
        </ul>
+       
+       {if PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION}
+               <ul class="buttonList">
+                       <li><a class="button small" href="{link controller='PaidSubscriptionList'}{/link}">{lang}wcf.paidSubscription.button.moreInformation{/lang}</a></li>
+               </ul>
+       {/if}
 </div>
index 35a716e987331816741c31d067e6dd00c268e51d..b338552ab0861e4c5f7b16dcbfb5257d70fcab61 100644 (file)
@@ -6,11 +6,17 @@
                                <small>{lang}wcf.paidSubscription.formattedCost{/lang}</small> 
                        </div>
                        
-                       <ul class="buttonList marginTopTiny">
-                               {foreach from=$subscription->getPurchaseButtons() item=button}
-                                       <li>{@$button}</li>
-                               {/foreach}
-                       </ul>
+                       {if !PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION}
+                               <ul class="buttonList marginTopTiny">
+                                       {foreach from=$subscription->getPurchaseButtons() item=button}
+                                               <li>{@$button}</li>
+                                       {/foreach}
+                               </ul>
+                       {/if}
                </li>
        {/foreach}
 </ul>
+
+{if PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION}
+       <a class="button small more" href="{link controller='PaidSubscriptionList'}{/link}">{lang}wcf.paidSubscription.button.moreInformation{/lang}</a>
+{/if}
\ No newline at end of file
index 7b29a158a791666fb4ac1a06b9fe85446b87f434..e7e914768774ed8d8c4f1f3947bf42210ad57fc5 100644 (file)
@@ -4,6 +4,30 @@
        <title>{lang}wcf.user.menu.settings.paidSubscription{/lang} - {lang}wcf.user.menu.settings{/lang} - {PAGE_TITLE|language}</title>
        
        {include file='headInclude'}
+       
+       {if PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION}
+               <script data-relocate="true">
+                       $(function() {
+                               $('#tosConfirmed').change(function () {
+                                       if ($('#tosConfirmed').is(':checked')) {
+                                               $('.paidSubscriptionList button').enable();
+                                       }
+                                       else {
+                                               $('.paidSubscriptionList button').disable();
+                                       }
+                               });
+                               $('#tosConfirmed').change();
+                       });
+               </script>
+               
+               <noscript>
+                       <style type="text/css">
+                               .paidSubscriptionList button {
+                                       display: none;
+                               }
+                       </style>
+               </noscript>
+       {/if}
 </head>
 
 <body id="tpl{$templateName|ucfirst}" data-template="{$templateName}" data-application="{$templateNameApplication}">
                <h2>{lang}wcf.paidSubscription.availableSubscriptions{/lang}</h2>
        </header>
        
-       <div class="container marginTop">
+       {if PAID_SUBSCRIPTION_ENABLE_TOS_CONFIRMATION}
+               <div class="container containerPadding marginTop">
+                       <label><input type="checkbox" id="tosConfirmed" name="tosConfirmed" value="1" /> {lang}wcf.paidSubscription.confirmTOS{/lang}</label>
+               </div>
+       {/if}
+       
+       <div class="container marginTop paidSubscriptionList">
                <ul class="containerList">
                        {foreach from=$subscriptions item=subscription}
                                <li>
index b1f9934eb396f019a942706ddf11b9dc85a597cd..05415b3b21fe941c07b36abadcf28c63bf43245e 100644 (file)
@@ -1045,6 +1045,8 @@ GmbH=Gesellschaft mit beschränkter Haftung]]></item>
                <item name="wcf.acp.option.paypal_email_address.description"><![CDATA[TODO]]></item>
                <item name="wcf.acp.option.module_paid_subscription"><![CDATA[Bezahlte Mitgliedschaften aktivieren]]></item>
                <item name="wcf.acp.option.module_paid_subscription.description"><![CDATA[TODO]]></item>
+               <item name="wcf.acp.option.paid_subscription_enable_tos_confirmation"><![CDATA[Benutzer müssen vor dem Kauf Nutzungsbedingungen akzeptieren]]></item>
+               <item name="wcf.acp.option.paid_subscription_tos_url"><![CDATA[URL zu Nutzungsbedingungen]]></item>
        </category>
        
        <category name="wcf.acp.package">
@@ -2506,6 +2508,8 @@ Fehler sind beispielsweise:
                <item name="wcf.paidSubscription.formattedCost"><![CDATA[{$subscription->currency} {$subscription->cost|currency}{if $subscription->subscriptionLength} {if $subscription->subscriptionLength != 1}für{else}pro{/if} {if $subscription->subscriptionLength != 1}{@$subscription->subscriptionLength} {/if}{if $subscription->subscriptionLengthUnit == 'D'}Tag{if $subscription->subscriptionLength != 1}e{/if}{/if}{if $subscription->subscriptionLengthUnit == 'M'}Monat{if $subscription->subscriptionLength != 1}e{/if}{/if}{if $subscription->subscriptionLengthUnit == 'Y'}Jahr{if $subscription->subscriptionLength != 1}e{/if}{/if}{/if}]]></item>
                <item name="wcf.paidSubscription.expires"><![CDATA[Gültig bis]]></item>
                <item name="wcf.paidSubscription.returnMessage"><![CDATA[Danke für Ihre Zahlung. Ihre Transaktion wurde abgeschlossen. Sobald Ihre Zahlung von uns verarbeitet wurde, wird die erworbene Mitgliedschaft aktiviert.]]></item>
+               <item name="wcf.paidSubscription.confirmTOS"><![CDATA[Hiermit bestätige ich mein Einverständnis mit den <a href="{PAID_SUBSCRIPTION_TOS_URL}">Nutzungsbedingungen</a>]]></item>
+               <item name="wcf.paidSubscription.button.moreInformation"><![CDATA[Mehr Informationen]]></item>
        </category>
        
        <category name="wcf.payment">
index 32fea855d6c8dbb6f3e00b276a8d87b092fd44d5..15c5450be03472f15f715f5b705ba4b4ed3a7719 100644 (file)
@@ -1044,6 +1044,8 @@ GmbH=Gesellschaft mit beschränkter Haftung]]></item>
                <item name="wcf.acp.option.paypal_email_address.description"><![CDATA[TODO]]></item>
                <item name="wcf.acp.option.module_paid_subscription"><![CDATA[TODO: Bezahlte Mitgliedschaften aktivieren]]></item>
                <item name="wcf.acp.option.module_paid_subscription.description"><![CDATA[TODO]]></item>
+               <item name="wcf.acp.option.paid_subscription_enable_tos_confirmation"><![CDATA[TODO: Benutzer müssen vor dem Kauf Nutzungsbedingungen akzeptieren]]></item>
+               <item name="wcf.acp.option.paid_subscription_tos_url"><![CDATA[TODO: URL zu Nutzungsbedingungen]]></item>
        </category>
        
        <category name="wcf.acp.package">
@@ -2482,6 +2484,8 @@ Errors are:
                <item name="wcf.paidSubscription.formattedCost"><![CDATA[TODO: {$subscription->currency} {$subscription->cost|currency}{if $subscription->subscriptionLength} {if $subscription->subscriptionLength != 1}für{else}pro{/if} {if $subscription->subscriptionLength != 1}{@$subscription->subscriptionLength} {/if}{if $subscription->subscriptionLengthUnit == 'D'}Tag{if $subscription->subscriptionLength != 1}e{/if}{/if}{if $subscription->subscriptionLengthUnit == 'M'}Monat{if $subscription->subscriptionLength != 1}e{/if}{/if}{if $subscription->subscriptionLengthUnit == 'Y'}Jahr{if $subscription->subscriptionLength != 1}e{/if}{/if}{/if}]]></item>
                <item name="wcf.paidSubscription.expires"><![CDATA[TODO: Gültig bis]]></item>
                <item name="wcf.paidSubscription.returnMessage"><![CDATA[TODO: Danke für Ihre Zahlung. Ihre Transaktion wurde abgeschlossen. Sobald Ihre Zahlung von uns verarbeitet wurde, wird die erworbene Mitgliedschaft aktiviert.]]></item>
+               <item name="wcf.paidSubscription.confirmTOS"><![CDATA[TODO: Hiermit bestätige ich mein Einverständnis mit den <a href="{PAID_SUBSCRIPTION_TOS_URL}">Nutzungsbedingungen</a>]]></item>
+               <item name="wcf.paidSubscription.button.moreInformation"><![CDATA[TODO: Mehr Informationen]]></item>
        </category>
        
        <category name="wcf.payment">