Andre Genrich vor 5 Jahren
Ursprung
Commit
eb5911d4ed

+ 123 - 0
templates/orderforms/croster_mailbox/checkconfigureproduct.tpl

@@ -0,0 +1,123 @@
+<script>
+    function checkMailAddress ( mailname, maildomain) {
+        var xhttp = new XMLHttpRequest();
+        xhttp.onreadystatechange = function() {
+            if (this.readyState == 4 && this.status == 200) {
+                if( this.responseText.trim() == 'yes') {
+                    console.log(this.responseText);
+                    $(customFields[4]).prop("disabled",false);
+                    $(customFields[5]).prop("disabled",true);
+                    $(customFields[2]).addClass('has-success');
+                    $(customFields[2]).css('background-color', '#0f03');;
+                    $("#hintHead").text('');
+                    $("#hintLength").text('');
+                    $("#hintNumeric").text('');
+                    $("#hintSymbols").text('');
+                    $("#hintUpperLower").text('');
+                } else {
+                    console.log(this.responseText);
+                    $(customFields[4]).prop("disabled",true);
+                    $(customFields[5]).prop("disabled",true);
+                    $(customFields[2]).addClass('has-error');
+                    $(customFields[2]).css('background-color', '#f003');;
+                    $("#hintHead").text('Mailadresse ' + $(customFields[2]).val() + '@' + $(customFields[3]).val() + ' nicht verfügbar!');
+                    $("#hintLength").text('');
+                    $("#hintNumeric").text('');
+                    $("#hintSymbols").text('');
+                    $("#hintUpperLower").text('');
+                }
+            }
+        };
+        xhttp.open("GET", "modules/servers/zimbraSingle/zimbraAddressCheck.php?name=" + mailname + '&domain=' +maildomain, true);
+        xhttp.send();
+    };
+    jQuery(document).ready(function(){
+        $("#btnCompleteProductConfig").prop("disabled",true);
+        customFields = $("*[id^='customfield']");
+        $(customFields[4]).prop("disabled",true);
+        $(customFields[5]).prop("disabled",true);
+        $(customFields[2]).blur(function () {
+            checkMailAddress( $(customFields[2]).val(), $(customFields[3]).val());
+        });
+        $(customFields[3]).change(function () {
+            checkMailAddress( $(customFields[2]).val(), $(customFields[3]).val());
+        });
+        $(customFields[4]).focus (function () {
+            $("#hintHead").text('Tipps für ein gutes Passwort');
+            $("#hintLength").text('Benutzen Sie mindestens 8 Zeichen');
+            $("#hintNumeric").text('Benutzen Sie mindestens eine Zahl');
+            $("#hintSymbols").text('Benutzen Sie auch mindestens eines der folgenden Symbole (# $ ! % &amp; etc...)');
+            $("#hintUpperLower").text('Benutzen Sie Groß- und Kleinschreibung');
+        });
+        $(customFields[4]).keyup(function () {
+            var pwlengthOK = false;
+            var numericOK = false;
+            var symbolsOK = false;
+            var upperOK = false;
+            var pw = $(customFields[4]).val();
+            var pwlength = (pw.length);
+            if (pwlength > 7) {
+                pwlengthOK = true;
+                $("#hintLength").text('');
+            } else {
+                pwlengthOK = false;
+                $("#hintLength").text('Benutzen Sie mindestens 8 Zeichen');
+            }
+            var numeric = pw.replace(/[0-9]/g, "");
+            var numnumeric = (pw.length - numeric.length);
+            if (numnumeric > 0) {
+                numericOK = true;
+                $("#hintNumeric").text('');
+            } else {
+                numericOK = true;
+                $("#hintNumeric").text('Benutzen Sie mindestens eine Zahl');
+            }
+            var symbols = pw.replace(/\W/g, "");
+            var numsymbols = (pw.length - symbols.length);
+            if (numsymbols > 0) {
+                symbolsOK = true;
+                $("#hintSymbols").text('');
+            } else {
+                symbolsOK = true;
+                $("#hintSymbols").text('Benutzen Sie auch mindestens eines der folgenden Symbole (# $ ! % &amp; etc...)');
+            }
+            var upper = pw.replace(/[A-Z]/g, "");
+            var numupper = (pw.length - upper.length);
+            var lower = pw.replace(/[a-z]/g, "");
+            var numlower = (pw.length - lower.length);
+            if ((numupper > 0) && (numlower > 0)) {
+                upperlowerOK = true;
+                $("#hintUpperLower").text('');
+            } else {
+                upperlowerOK = false;
+                $("#hintUpperLower").text('Benutzen Sie Groß- und Kleinschreibung');
+            }
+            $(customFields[4]).removeClass('has-error has-warning has-success');
+            if (pwlengthOK && numericOK && symbolsOK && upperlowerOK) {
+                $(customFields[5]).prop("disabled",false);
+                $(customFields[4]).addClass('has-success');
+                $(customFields[4]).css('background-color', '#0f03');;
+                $("#hintHead").text('');
+            } else {
+                $(customFields[5]).prop("disabled",true);
+                $(customFields[4]).addClass('has-error');
+                $(customFields[4]).css('background-color', '#f003');;
+                $("#hintHead").text('Tipps für ein gutes Passwort');
+            }
+        });
+        $(customFields[5]).keyup(function () {
+            if ($(customFields[5]).val() == $(customFields[4]).val()) {
+                $("#btnCompleteProductConfig").prop("disabled",false);
+                $(customFields[5]).addClass('has-success');
+                $(customFields[5]).css('background-color', '#0f03');;
+                $("#hintHead").text('');
+            } else {
+                $("#btnCompleteProductConfig").prop("disabled",true);
+                $(customFields[5]).addClass('has-error');
+                $(customFields[5]).css('background-color', '#f003');;
+                $("#hintHead").text('Passworte stimmen nicht überein!');
+            }
+        });
+    });
+</script>
+

+ 372 - 0
templates/orderforms/croster_mailbox/configureproduct.tpl

@@ -0,0 +1,372 @@
+{include file="orderforms/{$carttpl}/common.tpl"}
+
+<script>
+var _localLang = {
+    'addToCart': '{$LANG.orderForm.addToCart|escape}',
+    'addedToCartRemove': '{$LANG.orderForm.addedToCartRemove|escape}'
+}
+</script>
+
+{if file_exists("templates/orderforms/{$carttpl}/layouts/head.tpl")}
+	{include file="templates/orderforms/{$carttpl}/layouts/head.tpl"}
+{/if}
+
+<div id="order-standard_cart">
+
+    <div class="row" style="position:relative;">
+
+        <div class="col-md-12">
+			{if file_exists("templates/orderforms/{$carttpl}/layouts/head.tpl")}
+			{else}
+            <div class="header-lined">
+                <h1>{$LANG.orderconfigure}</h1>
+            </div>
+			{/if}
+			
+			{include file="orderforms/{$carttpl}/sidebar-categories-collapsed.tpl"}
+
+        </div>
+
+        <div class="col-md-12">
+
+            <form id="frmConfigureProduct">
+                <input type="hidden" name="configure" value="true" />
+                <input type="hidden" name="i" value="{$i}" />
+
+                <div class="row">
+                    <div class="col-md-9">
+
+                        <h3>{$LANG.orderForm.configureDesiredOptions}</h3>
+
+                        <div class="panel panel-default">
+							<div class="panel-body">
+								<p class="product-title"><strong><i>{$productinfo.group_name}</i> - {$productinfo.name}</strong></p>
+								<p>{$productinfo.description}</p>
+							</div>
+                        </div>
+
+                        <div class="alert alert-danger hidden" role="alert" id="containerProductValidationErrors">
+                            <p>{$LANG.orderForm.correctErrors}:</p>
+                            <ul id="containerProductValidationErrorsList"></ul>
+                        </div>
+
+                        {if $pricing.type eq "recurring"}
+                            <div class="field-container">
+                                <div class="form-group">
+                                    <label for="inputBillingcycle">{$LANG.cartchoosecycle}</label>
+                                    <select name="billingcycle" id="inputBillingcycle" class="form-control select-inline" onchange="{if $configurableoptions}updateConfigurableOptions({$i}, this.value);{else}recalctotals();{/if}">
+                                        {if $pricing.monthly}
+                                            <option value="monthly"{if $billingcycle eq "monthly"} selected{/if}>
+                                                {$pricing.monthly}
+                                            </option>
+                                        {/if}
+                                        {if $pricing.quarterly}
+                                            <option value="quarterly"{if $billingcycle eq "quarterly"} selected{/if}>
+                                                {$pricing.quarterly}
+                                            </option>
+                                        {/if}
+                                        {if $pricing.semiannually}
+                                            <option value="semiannually"{if $billingcycle eq "semiannually"} selected{/if}>
+                                                {$pricing.semiannually}
+                                            </option>
+                                        {/if}
+                                        {if $pricing.annually}
+                                            <option value="annually"{if $billingcycle eq "annually"} selected{/if}>
+                                                {$pricing.annually}
+                                            </option>
+                                        {/if}
+                                        {if $pricing.biennially}
+                                            <option value="biennially"{if $billingcycle eq "biennially"} selected{/if}>
+                                                {$pricing.biennially}
+                                            </option>
+                                        {/if}
+                                        {if $pricing.triennially}
+                                            <option value="triennially"{if $billingcycle eq "triennially"} selected{/if}>
+                                                {$pricing.triennially}
+                                            </option>
+                                        {/if}
+                                    </select>
+                                </div>
+                            </div>
+                        {/if}
+
+                        {if count($metrics) > 0}
+                            <div class="sub-heading">
+                                <span>{$LANG.metrics.title}</span>
+                            </div>
+
+                            <p>{$LANG.metrics.explanation}</p>
+
+                            <ul>
+                                {foreach $metrics as $metric}
+                                    <li>
+                                        {$metric.displayName}
+                                        -
+                                        {if count($metric.pricing) > 1}
+                                            {$LANG.metrics.startingFrom} {$metric.lowestPrice} / {if $metric.unitName}{$metric.unitName}{else}{$LANG.metrics.unit}{/if}
+                                            <button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#modalMetricPricing-{$metric.systemName}">
+                                                {$LANG.metrics.viewPricing}
+                                            </button>
+                                        {elseif count($metric.pricing) == 1}
+                                            {$metric.lowestPrice} / {if $metric.unitName}{$metric.unitName}{else}{$LANG.metrics.unit}{/if}
+                                            {if $metric.includedQuantity > 0} ({$metric.includedQuantity} {$LANG.metrics.includedNotCounted}){/if}
+                                        {/if}
+                                        {include file="$template/usagebillingpricing.tpl"}
+                                    </li>
+                                {/foreach}
+                            </ul>
+
+                            <br>
+                        {/if}
+
+                        {if $productinfo.type eq "server"}
+                            <div class="sub-heading">
+                                <span>{$LANG.cartconfigserver}</span>
+                            </div>
+
+                            <div class="field-container">
+
+                                <div class="row">
+                                    <div class="col-sm-6">
+                                        <div class="form-group">
+                                            <label for="inputHostname">{$LANG.serverhostname}</label>
+                                            <input type="text" name="hostname" class="form-control" id="inputHostname" value="{$server.hostname}" placeholder="servername.yourdomain.com">
+                                        </div>
+                                    </div>
+                                    <div class="col-sm-6">
+                                        <div class="form-group">
+                                            <label for="inputRootpw">{$LANG.serverrootpw}</label>
+                                            <input type="password" name="rootpw" class="form-control" id="inputRootpw" value="{$server.rootpw}">
+                                        </div>
+                                    </div>
+                                </div>
+
+                                <div class="row">
+                                    <div class="col-sm-6">
+                                        <div class="form-group">
+                                            <label for="inputNs1prefix">{$LANG.serverns1prefix}</label>
+                                            <input type="text" name="ns1prefix" class="form-control" id="inputNs1prefix" value="{$server.ns1prefix}" placeholder="ns1">
+                                        </div>
+                                    </div>
+                                    <div class="col-sm-6">
+                                        <div class="form-group">
+                                            <label for="inputNs2prefix">{$LANG.serverns2prefix}</label>
+                                            <input type="text" name="ns2prefix" class="form-control" id="inputNs2prefix" value="{$server.ns2prefix}" placeholder="ns2">
+                                        </div>
+                                    </div>
+                                </div>
+
+                            </div>
+                        {/if}
+
+                        {if $configurableoptions}
+                            <div class="sub-heading">
+                                <span>{$LANG.orderconfigpackage}</span>
+                            </div>
+                            <div class="product-configurable-options" id="productConfigurableOptions">
+                                <div class="row">
+                                    {foreach $configurableoptions as $num => $configoption}
+                                        {if $configoption.optiontype eq 1}
+                                            <div class="col-sm-12">
+                                                <div class="form-group">
+                                                    <label for="inputConfigOption{$configoption.id}">{$configoption.optionname}</label>
+                                                    <select name="configoption[{$configoption.id}]" id="inputConfigOption{$configoption.id}" class="form-control">
+                                                        {foreach key=num2 item=options from=$configoption.options}
+                                                            <option value="{$options.id}"{if $configoption.selectedvalue eq $options.id} selected="selected"{/if}>
+                                                                {$options.name}
+                                                            </option>
+                                                        {/foreach}
+                                                    </select>
+                                                </div>
+                                            </div>
+                                        {elseif $configoption.optiontype eq 2}
+                                            <div class="col-sm-12">
+                                                <div class="form-group">
+                                                    <label for="inputConfigOption{$configoption.id}">{$configoption.optionname}</label>
+                                                    {foreach key=num2 item=options from=$configoption.options}
+                                                        <br />
+                                                        <label>
+                                                            <input type="radio" name="configoption[{$configoption.id}]" value="{$options.id}"{if $configoption.selectedvalue eq $options.id} checked="checked"{/if} />
+                                                            {if $options.name}
+                                                                {$options.name}
+                                                            {else}
+                                                                {$LANG.enable}
+                                                            {/if}
+                                                        </label>
+                                                    {/foreach}
+                                                </div>
+                                            </div>
+                                        {elseif $configoption.optiontype eq 3}
+                                            <div class="col-sm-12">
+                                                <div class="form-group">
+                                                    <label for="inputConfigOption{$configoption.id}">{$configoption.optionname}</label>
+                                                    <br />
+                                                    <label>
+                                                        <input type="checkbox" name="configoption[{$configoption.id}]" id="inputConfigOption{$configoption.id}" value="1"{if $configoption.selectedqty} checked{/if} />
+                                                        {if $configoption.options.0.name}
+                                                            {$configoption.options.0.name}
+                                                        {else}
+                                                            {$LANG.enable}
+                                                        {/if}
+                                                    </label>
+                                                </div>
+                                            </div>
+                                        {elseif $configoption.optiontype eq 4}
+                                            <div class="col-sm-12">
+                                                <div class="form-group">
+                                                    <label for="inputConfigOption{$configoption.id}">{$configoption.optionname}</label>
+                                                    {if $configoption.qtymaximum}
+                                                        {if !$rangesliderincluded}
+                                                            <script type="text/javascript" src="{$BASE_PATH_JS}/ion.rangeSlider.min.js"></script>
+                                                            <link href="{$BASE_PATH_CSS}/ion.rangeSlider.css" rel="stylesheet">
+                                                            <link href="{$BASE_PATH_CSS}/ion.rangeSlider.skinModern.css" rel="stylesheet">
+                                                            {assign var='rangesliderincluded' value=true}
+                                                        {/if}
+                                                        <input type="text" name="configoption[{$configoption.id}]" value="{if $configoption.selectedqty}{$configoption.selectedqty}{else}{$configoption.qtyminimum}{/if}" id="inputConfigOption{$configoption.id}" class="form-control" />
+                                                        <script>
+                                                            var sliderTimeoutId = null;
+                                                            var sliderRangeDifference = {$configoption.qtymaximum} - {$configoption.qtyminimum};
+                                                            // The largest size that looks nice on most screens.
+                                                            var sliderStepThreshold = 25;
+                                                            // Check if there are too many to display individually.
+                                                            var setLargerMarkers = sliderRangeDifference > sliderStepThreshold;
+
+                                                            jQuery("#inputConfigOption{$configoption.id}").ionRangeSlider({
+                                                                min: {$configoption.qtyminimum},
+                                                                max: {$configoption.qtymaximum},
+                                                                grid: true,
+                                                                grid_snap: setLargerMarkers ? false : true,
+                                                                onChange: function() {
+                                                                    if (sliderTimeoutId) {
+                                                                        clearTimeout(sliderTimeoutId);
+                                                                    }
+
+                                                                    sliderTimeoutId = setTimeout(function() {
+                                                                        sliderTimeoutId = null;
+                                                                        recalctotals();
+                                                                    }, 250);
+                                                                }
+                                                            });
+                                                        </script>
+                                                    {else}
+                                                        <div>
+                                                            <input type="number" name="configoption[{$configoption.id}]" value="{if $configoption.selectedqty}{$configoption.selectedqty}{else}{$configoption.qtyminimum}{/if}" id="inputConfigOption{$configoption.id}" min="{$configoption.qtyminimum}" onchange="recalctotals()" onkeyup="recalctotals()" class="form-control form-control-qty" />
+                                                            <span class="form-control-static form-control-static-inline">
+                                                                x {$configoption.options.0.name}
+                                                            </span>
+                                                        </div>
+                                                    {/if}
+                                                </div>
+                                            </div>
+                                        {/if}
+                                        {if $num % 2 != 0}
+                                            </div>
+                                            <div class="row">
+                                        {/if}
+                                    {/foreach}
+                                </div>
+                            </div>
+
+                        {/if}
+
+                        {if $customfields}
+			    {include file="./checkconfigureproduct.tpl"}
+                            <div class="sub-heading">
+                                <span>{$LANG.orderadditionalrequiredinfo}</span>
+                            </div>
+
+                            <div class="field-container">
+                                {foreach $customfields as $customfield}
+                                    <div class="form-group">
+                                        <label for="customfield{$customfield.id}">{$customfield.name}</label>
+                                        {$customfield.input}
+                                        {if $customfield.description}
+                                            <span class="field-help-text">
+                                                {$customfield.description}
+                                            </span>
+                                        {/if}
+                                    </div>
+                                {/foreach}
+                            </div>
+			    <div class="alert alert-info">
+				<div id='hints'>
+				    <strong id='hintHead'></strong>
+                                    <div id='hintLength'></div>
+                                    <div id='hintNumeric'></div>
+                                    <div id='hintSymbols'></div>
+                                    <div id='hintUpperLower'></div>
+				</div>
+			    </div>
+                        {/if}
+
+                        {if $addons || count($addonsPromoOutput) > 0}
+
+                            <div class="sub-heading">
+                                <span>{$LANG.cartavailableaddons}</span>
+                            </div>
+
+                            {foreach $addonsPromoOutput as $output}
+                                <div>
+                                    {$output}
+                                </div>
+                            {/foreach}
+							
+							
+                            <div class="row addon-products">
+                                {foreach $addons as $addon}
+                                    <div class="col-sm-{if count($addons) > 1}6{else}12{/if}"">
+                                        <div class="panel panel-default panel-addon{if $addon.status} panel-addon-selected{/if}">
+                                            <div class="panel-body">
+                                               <input type="checkbox" name="addons[{$addon.id}]"{if $addon.status} checked{/if} />
+                                                <span class="panel-addon-name">{$addon.name}</span>
+												<span class="panel-addon-price">{$addon.pricing}</span>
+                                                <p class="text-muted">{$addon.description}</p>
+                                            </div>
+                                        </div>
+                                    </div>
+                                {/foreach}
+                            </div>
+
+                        {/if}
+
+                        <div class="alert alert-warning text-center">
+                            <i class="fas fa-question-circle"></i>
+                            {$LANG.orderForm.haveQuestionsContact} <a href="contact.php" target="_blank" class="alert-link">{$LANG.orderForm.haveQuestionsClickHere}</a>
+                        </div>
+
+                    </div>
+                    <div class="col-md-3" id="scrollingPanelContainer">
+
+						<div id="orderSummary">
+                            <div class="order-summary">
+                                <div class="loader" id="orderSummaryLoader">
+                                    <i class="fas fa-fw fa-sync fa-spin"></i>
+                                </div>
+                                <h2>{$LANG.ordersummary}</h2>
+                                <div class="summary-container" id="producttotal"></div>
+                            </div>
+                            <div class="text-center">
+                                 <button type="submit" id="btnCompleteProductConfig" class="btn btn-primary btn-lg">
+                                    {$LANG.continue}
+                                    <i class="fas fa-arrow-circle-right"></i>
+                                </button>
+                            </div>
+                        </div>
+
+                    </div>
+
+                </div>
+
+            </form>
+        </div>
+    </div>
+</div>
+
+{if file_exists("templates/orderforms/{$carttpl}/layouts/foot.tpl")}
+	{include file="templates/orderforms/{$carttpl}/layouts/foot.tpl"}
+{/if}
+
+
+<script language="javascript">
+	recalctotals();
+</script>