This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/themes/default/blocks/service/add.tpl

501 lines
22 KiB
Smarty
Raw Normal View History

2009-08-03 04:10:16 +00:00
{assign var=meth value=':'|explode:$VAR._page}
<!-- {$meth.0}:{$meth.1} -->
<!-- Display the form validation -->
{if $form_validation}
2009-08-03 04:10:16 +00:00
{$block->display('core:alert_fields')}
{/if}
2009-08-03 04:10:16 +00:00
{$method->exe($meth.0,'tpl_add')}
{if ($method->result == false)}
{$block->display('core:method_error')}
{else}
2009-08-03 04:10:16 +00:00
<script type="text/javascript">
<!--
{literal}
function hideServiceType(type) {
document.getElementById('service_'+type+'Tag').style.color='999999';
document.getElementById('service_'+type).checked=false;
document.getElementById('service_'+type).disabled=true;
}
function unhideServiceType(type) {
document.getElementById('service_'+type+'Tag').style.color='000000';
document.getElementById('service_'+type).disabled=false;
}
function updateTR() {
var a = new Array(5);
a[0] = 'none';
a[1] = 'group';
a[2] = 'product';
a[3] = 'hosting';
a[4] = 'domain';
for(i=0;i<5;i++) {
if(document.getElementById('service_'+a[i]).checked == true) {
document.getElementById(a[i]).style.display = 'block';
} else {
document.getElementById(a[i]).style.display = 'none';
}
}
// display recurring?
if( document.getElementById('billing_type1').checked == true) {
document.getElementById("recurring").style.display = 'block';
document.getElementById('vrecurring').value = '1';
} else {
2009-08-03 04:10:16 +00:00
document.getElementById("recurring").style.display = 'none';
document.getElementById('vrecurring').value = '0';
}
}
2009-08-03 04:10:16 +00:00
function ServiceType(type) {
var service_type = 'service_'+type;
if(type == 'none') {
if(document.getElementById(service_type).checked == true) {
unhideServiceType(type);
hideServiceType('group');
hideServiceType('product');
hideServiceType('hosting');
hideServiceType('domain');
document.getElementById('billing_type1').checked = true;
document.getElementById('vnone').value='1';
} else {
unhideServiceType('group');
unhideServiceType('product');
unhideServiceType('hosting');
unhideServiceType('domain');
document.getElementById('vnone').value='0';
}
2009-08-03 04:10:16 +00:00
} else if (type == 'group') {
if(document.getElementById(service_type).checked == true) {
unhideServiceType(type);
hideServiceType('none');
hideServiceType('domain');
document.getElementById('vgroup').value='1';
} else {
2009-08-03 04:10:16 +00:00
if(document.getElementById('service_product').checked == false
&& document.getElementById('service_hosting').checked == false) {
unhideServiceType('none');
unhideServiceType('product');
unhideServiceType('hosting');
unhideServiceType('domain');
document.getElementById('vgroup').value='0';
}
}
2009-08-03 04:10:16 +00:00
} else if (type == 'product') {
if(document.getElementById(service_type).checked == true) {
unhideServiceType(type);
hideServiceType('none');
hideServiceType('hosting');
hideServiceType('domain');
document.getElementById('vproduct').value='1';
} else {
2009-08-03 04:10:16 +00:00
if(document.getElementById('service_group').checked == true) {
unhideServiceType('hosting');
} else {
unhideServiceType('none');
unhideServiceType('group');
unhideServiceType('hosting');
unhideServiceType('domain');
}
document.getElementById('vproduct').value='0';
}
2009-08-03 04:10:16 +00:00
} else if (type == 'hosting') {
if(document.getElementById(service_type).checked == true) {
unhideServiceType(type);
hideServiceType('none');
hideServiceType('product');
hideServiceType('domain');
document.getElementById('vhosting').value='1';
} else {
if(document.getElementById('service_group').checked == true) {
unhideServiceType('product');
} else {
unhideServiceType('none');
unhideServiceType('group');
unhideServiceType('product');
unhideServiceType('domain');
}
document.getElementById('vhosting').value='0';
}
} else if (type == 'domain') {
if(document.getElementById(service_type).checked == true) {
unhideServiceType(type);
hideServiceType('group');
hideServiceType('product');
hideServiceType('hosting');
hideServiceType('none');
document.getElementById('billing_type').style.color='999999';
document.getElementById('billing_type0').checked=true;
document.getElementById('billing_type0').disabled=true;
document.getElementById('billing_type1').checked=false;
document.getElementById('billing_type1').disabled=true;
document.getElementById('vdomain').value='0';
} else {
unhideServiceType('group');
unhideServiceType('product');
unhideServiceType('hosting');
unhideServiceType('none');
document.getElementById('billing_type').style.color='000000';
document.getElementById('billing_type0').disabled=false;
document.getElementById('billing_type1').disabled=false;
document.getElementById('vdomain').value='0';
}
}
updateTR();
}
function clearall() {
document.getElementById('do').value='service:tpl_add';
document.getElementById('clearall').value='1';
document.getElementById('vgroup').value='0';
document.getElementById('vproduct').value='0';
document.getElementById('vhosting').value='0';
document.getElementById('vdomain').value='0';
document.forms.service_add.submit();
}
function domainUpdate(domain,tld,type) {
document.forms.service_add.domain_name.value = domain;
document.forms.service_add.domain_tld.value = tld;
document.forms.service_add.domain_option.value = type;
}
{/literal}
//-->
</script>
<!-- Display the form to collect the input values -->
<form id="add" method="post" action="" enctype="multipart/form-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr valign="top">
<td class="table_heading">{osb f=tt}</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="5" cellpadding="1" class="body">
<tr>
<td><b>{osb f=tf field=account_id}</b></td>
</tr>
<tr>
<td>{osb f=autoselect module=account return=id field=service_account_id default=$VAR.service_account_id}</td>
</tr>
<tr>
<td><b>{osb f=tf field=product_id}</b></td>
</tr>
<tr>
<td>
<select name="product_id">
{foreach from=$prod_menu item=p}
<option value="{$p.id}"{if $VAR.product_id == $p.id} selected="selected"{/if}>{$p.sku}</option>
{/foreach}
</select>
<a href="javascript:document.getElementById('changeproduct').value='1'; javascript:document.getElementById('do').value='service:tpl_add'; javascript:document.getElementById('clearall').value=0; document.forms.add.submit()">Select Product</a>
</td>
</tr>
<tr>
<td><b>{osb f=tf field=sku}</b></td>
</tr>
<tr>
<td>
{if $product.sku != ''}
<input type="text" name="service_sku" value="{$product.sku}" maxlength="32"/>
{else}
<input type="text" name="service_sku" value="{$VAR.service_sku}" maxlength="32"/>
{/if}
<a href="javascript:clearall()">Clear & Configure Manually</a>
</td>
</tr>
<tr>
<td><b>{osb f=tf field=type}</b></td>
</tr>
<tr>
<td>
<span id="service_noneTag"><input type="checkbox" id="service_none" name="service_none" value="none" onchange="ServiceType(this.value);"/> None </span>
<span id="service_groupTag"><input type="checkbox" id="service_group" name="service_group" value="group" onchange="ServiceType(this.value);"/> Group Access </span>
<span id="service_productTag"><input type="checkbox" id="service_product" name="service_product" value="product" onchange="ServiceType(this.value);"/> Product Plugin </span>
<span id="service_hostingTag"><input type="checkbox" id="service_hosting" name="service_hosting" value="hosting" onchange="ServiceType(this.value);"/> Hosting </span>
<span id="service_domainTag"><input type="checkbox" id="service_domain" name="service_domain" value="domain" onchange="ServiceType(this.value);"/> Domain </span>
</td>
</tr>
<tr>
<td><b>{osb f=tf field=price_type}</b></td>
</tr>
<tr>
<td>
<div id="billing_type">
<input type="radio" id="billing_type0" name="billing_type" value="0" onchange="updateTR()" checked="checked"/>{t}One-time Charge{/t}
<input type="radio" id="billing_type1" name="billing_type" value="1" onchange="updateTR()" {if $product.price_type == 1}checked="checked"{/if}/>{t}Recurring Membership/Subscription{/t}
</div>
</td>
</tr>
<tr valign="top">
<td>
<b><a href="javascript:document.getElementById('do').value='service:add'; javascript:document.getElementById('page').value='service:add'; document.forms.service_add.submit();">{t}Submit{/t}</a></b>
<input type="hidden" name="_page" value="{$meth.0}:view"/>
<input type="hidden" name="_page_current" value="{$VAR._page}"/>
<input type="hidden" id="do" name="do[]" value="{$meth.0}:tpl_add"/>
<input type="hidden" id="changeproduct" name="changeproduct" value="0"/>
<input type="hidden" id="clearall" name="clearall" value="0"/>
<input type="hidden" id="vnone" name="vnone" value="0"/>
<input type="hidden" id="vhosting" name="vhosting" value="0"/>
<input type="hidden" id="vproduct" name="vproduct" value="0"/>
<input type="hidden" id="vgroup" name="vgroup" value="0"/>
<input type="hidden" id="vdomain" name="vdomain" value="0"/>
<input type="hidden" id="vrecurring" name="vrecurring" value="0"/>
<input type="hidden" id="domain_name" name="domain_name" value="0"/>
<input type="hidden" id="domain_tld" name="domain_tld" value="0"/>
<input type="hidden" id="domain_option" name="domain_option" value="0"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div id="recurring" {osb f=style_hide}>
<br/>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr valign="top">
<td class="table_heading">{t}Recurring Details{/t}</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top" class="row1">
<td style="width: 50%;"><b>{osb f=tf field=price_base}</b></td>
<td style="width: 50%;"><input type="text" name="product_price_base" value="{$product.price_base}" size="5"/>{$list->currency_iso('')}</td>
</tr>
<tr valign="top" class="row1">
<td style="width: 50%;"><b>{osb f=tf field=date_last_invoice}</b></td>
<td style="width: 50%;">{$list->calender_view('date_last_invoice',0,'form_field')}</td>
</tr>
<tr valign="top" class="row1">
<td style="width: 50%;"><b>{osb f=tf field=price_recurr_default}</b></td>
<td style="width: 50%;">{$list->menu_staticlist('recur_schedule','product_price_recurr_default','product_price_recurr_default',$product.price_recurr_default,'form_menu',true)}</td>
</tr>
<tr valign="top" class="row1">
<td style="width: 50%;"><b>{osb f=tf field=taxable}</b></td>
<td style="width: 50%;">{$list->bool('product_taxable',$product.taxable,'form_menu')}</td>
</tr>
<tr valign="top" class="row1">
<td style="width: 50%;"><b>{osb f=tf field=price_recurr_type}</b></td>
<td style="width: 50%;"><b>{translate module=product}user_options{/translate}</b></td>
</tr>
<tr valign="top" class="row1">
<td style="width: 50%;">
<input type="radio" id="recurr_type0" name="product_price_recurr_type" value="0" {if $product.price_recurr_type == "0" || $product.price_recurr_type == ""}checked="checked"{/if} onclick="document.getElementById('billing_weekday').style.display='none'"/> {t}Bill on Aniversary Date of Subscription{/t}<br/>
<input type="radio" id="recurr_type1" name="product_price_recurr_type" value="1" {if $product.price_recurr_type == "1"}checked="checked"{/if} onclick="document.getElementById('billing_weekday').style.display='block'"/> {t}Bill on Fixed Schedule{/t}<br/>
<div id="billing_weekday" style="display:none">
{osb f=tf field=price_recurr_weekday} <input type="text" name="product_price_recurr_weekday" value="{if $product.price_recurr_weekday != ""}{$product.price_recurr_weekday}{else}{$smarty.const.BILLING_WEEKDAY}{/if}" size="2" maxlength="2"/> (1-28)
</div>
</td>
<td style="width: 50%;">
{$list->bool('product_price_recurr_schedule',$product.price_recurr_schedule,'form_menu')} {osb f=tf field=price_recurr_schedule} <br/>
{$list->bool('product_price_recurr_cancel',$product.price_recurr_cancel,'form_menu')} {osb f=tf field=price_recurr_cancel} <br/>
{$list->bool('product_price_recurr_modify',$product.price_recurr_modify,'form_menu')} {osb f=tf field=price_recurr_modify}
</td>
</tr>
<tr valign="top" class="row1">
<td style="width: 50%;"><b>{osb f=tf field=account_billing_id}</b></td>
<td style="width: 50%;">{$list->menu_cc_admin('account_billing_id',$VAR.service_account_id,$VAR.ccnum,'form_menu')}</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
2009-08-03 04:10:16 +00:00
</tr>
</table>
</div>
<div id="group" {osb f=style_hide}>
<br/>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr valign="top">
<td class="table_heading">{t}Group Details{/t}</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="2" cellpadding="3" class="row1">
<tr>
<td>
<input type="radio" name="product_assoc_grant_group_type" value="0" {if $product.assoc_grant_group_type == "0" || $product.assoc_grant_group_type == ""}checked="checked"{/if}/>{t}Grant access for specified amount of days:{/t} <input type="text" name="product_assoc_grant_group_days" value="{$product.assoc_grant_group_days}" size="3"/><br/>
<input type="radio" name="product_assoc_grant_group_type" value="1" {if $product.assoc_grant_group_type == "1"}checked="checked"{/if}/>{t}Grant access while associated subscription is active{/t}<br/>
<input type="radio" name="product_assoc_grant_group_type" value="2" {if $product.assoc_grant_group_type == "2"}checked="checked"{/if}/>{t}Grant access forerver{/t}
</td>
<td align="left" valign="top">{$list->menu_multi($product.assoc_grant_group,'product_assoc_grant_group','group','name','10','','form_menu')}</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
2009-08-03 04:10:16 +00:00
</tr>
</table>
</div>
<div id="hosting" {osb f=style_hide}>
{if $list->is_installed('host_server')}
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr valign="top">
<td class="table_heading">{t}Hosting Details{/t}</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="2" cellpadding="1" class="row1">
<tr>
<td width="50%">{osb f=tf field=host_server_id}</td>
<td width="50%">{$list->menu('no','product_host_server_id','host_server','name',$product.host_server_id,'" onchange="submit();')}<a href="javascript:document.forms.service_add.submit()">Configure</a></td>
</tr>
<tr>
<td width="50%">{osb f=tf field=domain_name}</td>
<td width="50%"><input type="text" name="host_domain_name" value="{$VAR.host_domain_name}"/>.{$list->menu('no','host_domain_tld','host_tld','name',$VAR.host_domain_tld,'form_menu',true)}</td>
</tr>
<tr>
<td width="50%">{osb f=tf field=host_ip}</td>
<td width="50%"><input type="text" name="host_ip" value="{$VAR.host_ip}"/></td>
</tr>
<tr>
<td width="50%">{osb f=tf field=host_username}</td>
<td width="50%"><input type="text" name="host_username" value="{$VAR.host_username}"/></td>
</tr>
<tr>
<td width="50%">{osb f=tf field=host_password}</td>
<td width="50%"><input type="text" name="host_password" value="{$VAR.host_password}"/></td>
</tr>
</table>
</td>
</tr>
{if ($list->smarty_array('host_server','provision_plugin','','plugin'))}
{foreach from=$plugin item=arr}
{if $product.host_server_id == $arr.id}
<tr valign="top">
<td width="65%" class="row1">
{assign var="afile" value=$arr.provision_plugin}
{assign var="ablock" value='host_provision_plugin:plugin_prod_'}
{assign var="blockfile" value="$ablock$afile"}
{$block->display($blockfile)}
<iframe name="iframe" id="iframe" style="border:0px; width:100%; height:0px;" scrolling="no" width="100%" allowtransparency="false" frameborder="0" class="body" src="themes/{$THEME_NAME}/IEFrameWarningBypass.htm"></iframe>
</td>
</tr>
{/if}
{/foreach}
{/if}
</table>
</td>
</tr>
</table>
{/if}
</div>
2009-08-03 04:10:16 +00:00
<div id="product" {osb f=style_hide}>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr valign="top">
<td class="table_heading">{t}Product Plugin{/t}</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="2" cellpadding="1" class="row1">
<tr>
<td width="50%">{t}Plugin to Enable{/t}</td>
<td width="50%">{$list->menu_files('','product_prod_plugin_file',$product.prod_plugin_file,'product','','.php','" onchange="document.product_view.submit();')} <a href="javascript:document.forms.service_add.submit()">Configure</a>
</td>
</tr>
</table>
</td>
</tr>
{if $product.prod_plugin_file != ''}
<tr valign="top">
<td class="row1">
{assign var="afile" value=$product.prod_plugin_file}
{assign var="ablock" value='product_plugin:plugin_prod_'}
{assign var="blockfile" value="$ablock$afile"}
{$block->display($blockfile)}
</td>
</tr>
{/if}
</table>
</td>
</tr>
</table>
</div>
<div id="domain" {osb f=style_hide}>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr valign="top">
<td class="table_heading">{t}Domain Details{/t}</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="2" cellpadding="1" class="row1">
<tr>
<td bgcolor="#FFFFFF">
{if $list->is_installed('host_tld')}
<input type="radio" id="register" name="domain_type" value="register" onclick="domainUpdate('0','0','register'); showIFrame('iframe',480,95,'?_page=host_tld:iframe_register&_escape=1');"/>{t}Register new domain name{/t}<br/>
<input type="radio" id="transfer" name="domain_type" value="transfer" onclick="domainUpdate('0','0','transfer'); showIFrame('iframe',480,110,'?_page=host_tld:iframe_transfer&_escape=1');"/>{t}Transfer existing domain name{/t}<br/>
{/if}
<input type="radio" id="ns_transfer" name="domain_type" value="ns_transfer" onclick="domainUpdate('0','0','ns_transfer'); showIFrame('iframe',480,70,'?_page=host_tld:iframe_ns_transfer&_escape=1');"/>{t}I will use an existing domain name and update my nameservers only.{/t}
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<iframe name="iframe" id="iframe" style="border:0px; width:100%; height:0px;" scrolling="no" width="100%" allowtransparency="false" frameborder="0" class="body" src="themes/{$THEME_NAME}/IEFrameWarningBypass.htm"><br/></iframe>
<div id="none" style="display:none"></div>
2009-08-03 04:10:16 +00:00
</form>
{/if}
<script type="text/javascript">
<!--
{if $VAR.vnone == 1}
document.getElementById('service_none').checked = true;
ServiceType('none');
{elseif $product.group || $VAR.vgroup == 1}
document.getElementById('service_group').checked = true;
ServiceType('group');
{/if}
{if $product.host == 1 || $VAR.vhosting == 1}
document.getElementById('service_hosting').checked = true;
ServiceType('hosting');
{elseif $product.prod_plugin == 1 || $VAR.vproduct == 1}
document.getElementById('service_product').checked = true;
ServiceType('product');
{/if}
{if $VAR.vrecurring == 1}
document.getElementById('billing_type1').checked = true;
{/if}
updateTR();
//-->
</script>