OSB enhancements to date

This commit is contained in:
Deon George
2010-11-30 09:41:08 +11:00
parent 8715a2059b
commit ec6a542bc3
478 changed files with 23423 additions and 9309 deletions

View File

@@ -0,0 +1,122 @@
<!--
@TODO
* Include offpeak time, from supplier
* Include Static IP options
* Include Contract Term
* Include Shaped/Excess Charges
* Date Validation on Churn Date (4 to 10 days)
* Phone number Validation
* Address min length
* Disable Churn date if ADSL not connected
* Disable Submit if terms not accepted
* Change rate to show inc TAX
-->
{$list->unserial($record.prod_plugin_data,'plugin_data')}
<!-- ADSL SERVICE ATTRIBUTES TABLE -->
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="3" cellpadding="1">
<tr>
<td colspan="5" style="font-size: 120%;"><b>ADSL Inclusions</b></td>
</tr>
<tr>
<td colspan="5"><b>ADSL Data</b></td>
</tr>
<tr>
<td style="width: 20%;">&nbsp;</td>
<td style="width: 20%;">Downloads</td>
<td style="width: 20%;">Excess/GB</td>
<td style="width: 20%;">Uploads</td>
<td style="width: 20%;">Excess/GB</td>
</tr>
<tr>
<td>Peak</td>
<td>{$plugin_data.base_down_peak}</td>
<td>{$list->format_currency_num($plugin_data.extra_down_peak,$smarty.const.SESS_CURRENCY)}</td>
<td>{$plugin_data.base_up_peak}</td>
<td>{$list->format_currency_num($plugin_data.extra_up_peak,$smarty.const.SESS_CURRENCY)}</td>
</tr>
{assign var='sid' value=$plugin_data.supplier_product}
{if $list->smarty_array('adsl','offpeak_start,offpeak_end'," AND id=$sid",'supplier') && $supplier.0.offpeak_start && $supplier.0.offpeak_end}
<tr>
<td>Off Peak</td>
<td>{$plugin_data.base_down_offpeak}</td>
<td>{$list->format_currency_num($plugin_data.extra_down_offpeak,$smarty.const.SESS_CURRENCY)}</td>
<td>{$plugin_data.base_up_offpeak}</td>
<td>{$list->format_currency_num($plugin_data.extra_up_offpeak,$smarty.const.SESS_CURRENCY)}</td>
</tr>
{/if}
<tr>
<td colspan="5">&nbsp;</td>
</tr>
<tr>
<td colspan="5"><b>ADSL Extra Information</b></td>
</tr>
<tr>
<td>{t}Static IP address{/t}</td>
<td><b>{if $plugin_data.staticip}{t}Included{/t}{else}{t}No{/t}{/if}</b></td>
</tr>
<tr>
<td>{t}Extra Traffic Charged{/t}</td>
{if $plugin_data.extra_charged}
<td colspan="4"><b>{t}Yes{/t}</b> ({t}See the table above{/t})</td>
{else}
<td colspan="4"><b>{t}No{/t}</b> {if $plugin_data.extra_shape}({t}Your service will be shapped to{/t} <b>{$plugin_data.extra_shape}</b>){/if}</td>
{/if}
</tr>
{if $supplier && $supplier.0.offpeak_start && $supplier.0.offpeak_end}
<tr>
<td>{t}Offpeak Period{/t}</td>
<td colspan="4"><b>{$list->time($supplier.0.offpeak_start)}</b> - <b>{$list->time($supplier.0.offpeak_end)}</b></td>
</tr>
{/if}
{if $plugin_data.contract_term}
<tr>
<td>{t}Contract Term{/t}</td>
<td colspan="4"><b>{$plugin_data.contract_term}</b> {t}Months{/t}</td>
</tr>
{/if}
</table>
</td>
</tr>
</table>
<br/>
<!-- ADSL SERVICE -->
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td><b>ADSL Service Number</b></td>
</tr>
<tr valign="top">
<td><input type="text" id="attr_phone" name="attr[phone]" size="20"/></td>
</tr>
<tr>
<td><b>ADSL Service Address</b></td>
</tr>
<tr valign="top">
<td><textarea id="attr_address" name="attr[address]" cols="50" rows="3"></textarea></td>
</tr>
<!-- CHURNS -->
<!-- @todo use javascript to show the churn date -->
<tr>
<td><b>Do you have an ADSL service connected, already?</b> <input type="checkbox" name="attr[churn]" value="Yes" /></td>
</tr>
<tr>
<td><b>Requested CHURN date</b></td>
</tr>
<tr valign="top">
<td><input type="text" id="attr_churndate" name="attr[churndate]" size="20" /></td>
</tr>
<!-- TERMS -->
<tr>
<td width="70%" valign="middle"><b>Have you viewed and accepted the terms and conditions?</b> <input type="checkbox" name="attr[tc]" value="Yes" /></td>
</tr>
</table>
</td>
</tr>
</table>

View File

@@ -0,0 +1,131 @@
{assign var=meth value=':'|explode:$VAR._page}
<!-- {$meth.0}:{$meth.1} -->
{$list->unserial($record.prod_plugin_data,'plugin_data')}
{$list->unserial($record.prod_attr,'prod_attr')}
{if $meth.0 == 'service'}
<table width="100%" border="0" cellspacing="1" cellpadding="4" class="table_background">
<tr valign="top" class="row2">
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td style="width: 20%;">{t}Service Number{/t}</td>
<td style="width: 30%;">{assign var=key value='Service Phone Number'}<input type="text" name="{$meth.0}_prod_attr[service_number]" value="{$prod_attr.service_number}{$plugin_data.$key}"/></td>
<td style="width: 20%;">{t}Service Account Name{/t}</td>
<td style="width: 30%;">{assign var=key value='Service Phone Name'}<input type="text" name="{$meth.0}_prod_attr[service_account_name]" value="{$prod_attr.service_account_name}{$plugin_data.$key}" size="50"/></td>
</tr>
<tr>
<td style="width: 20%; vertical-align:text-top;">{t}Contact End Date{/t}</td>
<td style="width: 30%; vertical-align:text-top;">{assign var=key value='Contract End Date'}<input type="text" name="{$meth.0}_prod_attr[contract_end_date]" value="{$prod_attr.contract_end_date}{$plugin_data.$key}"/></td>
<td style="width: 20%;">{t}Service Address{/t}</td>
<td style="width: 30%;">{assign var=key value='Service Address'}<textarea id="attr_address" name="{$meth.0}_prod_attr[service_address]" cols="50" rows="3">{$prod_attr.service_address}{$plugin_data.$key}</textarea></td>
</tr>
</table>
</td>
</tr>
</table>
{/if}
<table width="100%" border="0" cellspacing="0" cellpadding="4">
{if $meth.0 == 'service'}
<tr valign="top" class="row2">
<td style="width: 20%;">{t}Override Product Details{/t}</td>
<td style="width: 30%;"><input type="checkbox" id="override" name="product_prod_plugin_data[override]" value="1" {if $plugin_data.override}checked="checked"{/if} onchange="pdisable(this.checked)"/>{$plugin_data.override}</td>
</tr>
{/if}
<!-- PRODUCT -->
<tr valign="top" class="row2">
<td style="width: 20%;">{osb f=tf field=supplier_product}</td>
<td style="width: 30%;">{$list->menu('no','product_prod_plugin_data[supplier_product]','adsl','product_desc',$plugin_data.supplier_product,'')}</td>
<td style="width: 20%;">{osb f=tf field=contract_term}</td>
<td style="width: 30%;"><input type="text" id="contract_term" name="product_prod_plugin_data[contract_term]" value="{$plugin_data.contract_term}"/></td>
</tr>
<!-- CHURN AVAILABLE -->
<tr valign="top" class="row2">
<td>{osb f=tf field=churnable}</td>
<td><input type="checkbox" id="churnable" name="product_prod_plugin_data[churnable]" value="1" {if $plugin_data.churnable}checked="checked"{/if} /></td>
<td>{osb f=tf field=churnsetup_discount}</td>
<td><input type="text" id="churnsetup_discount" name="product_prod_plugin_data[churnsetup_discount]" value="{$plugin_data.churnsetup_discount}"/></td>
</tr>
<!-- STATIC IP AVAILABLE -->
<tr valign="top" class="row2">
<td>{osb f=tf field=staticip}</td>
<td colspan="3"><input id="staticip" type="checkbox" name="product_prod_plugin_data[staticip]" value="1" {if $plugin_data.staticip}checked="checked"{/if} /></td>
</tr>
<!-- INCLUDED TRAFFIC -->
<tr valign="top" class="row2">
<td>{osb f=tf field=product_base_down_peak}</td>
<td><input type="text" id="base_down_peak" name="product_prod_plugin_data[base_down_peak]" value="{$plugin_data.base_down_peak}"/></td>
<td>{osb f=tf field=product_base_up_peak}</td>
<td><input type="text" id="base_up_peak" name="product_prod_plugin_data[base_up_peak]" value="{$plugin_data.base_up_peak}"/></td>
</tr>
<tr valign="top" class="row2">
<td>{osb f=tf field=product_base_down_offpeak}</td>
<td><input type="text" id="base_down_offpeak" name="product_prod_plugin_data[base_down_offpeak]" value="{$plugin_data.base_down_offpeak}"/></td>
<td>{osb f=tf field=product_base_up_offpeak}</td>
<td><input type="text" id="base_up_offpeak" name="product_prod_plugin_data[base_up_offpeak]" value="{$plugin_data.base_up_offpeak}"/></td>
</tr>
<!-- EXCESS TRAFFIC -->
<tr valign="top" class="row2">
<td>{osb f=tf field=product_extra_charged}</td>
<td>{$list->bool('product_prod_plugin_data[extra_charged]',$plugin_data.extra_charged,'form_menu')}</td>
<td>{osb f=tf field=product_extra_shape}</td>
<td><input type="text" id="extra_shape" name="product_prod_plugin_data[extra_shape]" value="{$plugin_data.extra_shape}"/></td>
</tr>
<tr valign="top" class="row2">
<td>{osb f=tf field=product_extra_down_peak}</td>
<td><input type="text" id="extra_down_peak" name="product_prod_plugin_data[extra_down_peak]" value="{$plugin_data.extra_down_peak}"/></td>
<td>{osb f=tf field=product_extra_up_peak}</td>
<td><input type="text" id="extra_up_peak" name="product_prod_plugin_data[extra_up_peak]" value="{$plugin_data.extra_up_peak}"/></td>
</tr>
<tr valign="top" class="row2">
<td>{osb f=tf field=product_extra_down_offpeak}</td>
<td><input type="text" id="extra_down_offpeak" name="product_prod_plugin_data[extra_down_offpeak]" value="{$plugin_data.extra_down_offpeak}"/></td>
<td>{osb f=tf field=product_extra_up_offpeak}</td>
<td><input type="text" id="extra_up_offpeak" name="product_prod_plugin_data[extra_up_offpeak]" value="{$plugin_data.extra_up_offpeak}"/></td>
</tr>
</table>
<script type="text/javascript">
<!--
{literal}
// @todo need to improve these ids, when the form is rendered with $list
function pdisable(val) {
var x;
var ids = new Array();
ids[0] = 'contract_term';
ids[1] = 'churnable';
ids[2] = 'churnsetup_discount';
ids[3] = 'staticip';
ids[4] = 'base_down_peak';
ids[5] = 'base_up_peak';
ids[6] = 'base_down_offpeak';
ids[7] = 'base_up_offpeak';
ids[8] = 'product_prod_plugin_data_extra_charged_';
ids[9] = 'extra_shape';
ids[10] = 'extra_down_peak';
ids[11] = 'extra_up_peak';
ids[12] = 'extra_down_offpeak';
ids[13] = 'extra_up_offpeak';
ids[14] = 'adsl_product_desc_100';
for (x in ids)
if (typeof ids[x] != 'function') {
if (val) {
document.getElementById(ids[x]).disabled = false;
document.getElementById('override').value = 1;
} else {
document.getElementById(ids[x]).disabled = true;
}
}
}
{/literal}
{if is_null($plugin_data.override)}
document.getElementById('override').checked = false;
document.getElementById('override').value = 0;
pdisable(0);
{/if}
//-->
</script>

View File

@@ -1,4 +1,4 @@
{$list->unserial($product.prod_plugin_data, "plugin_data")}
{$list->unserial($record.prod_plugin_data,'plugin_data')}
<table width="100%" border="0" cellspacing="0" cellpadding="4">
{if $service.id}
<tr valign="top" class="row2">

View File

@@ -0,0 +1,78 @@
{assign var=meth value=':'|explode:$VAR._page}
<!-- {$meth.0}:{$meth.1} -->
{$list->unserial($record.prod_plugin_data,'plugin_data')}
{$list->unserial($record.prod_attr,'prod_attr')}
<table width="100%" border="0" cellspacing="1" cellpadding="4" class="table_background">
<tr valign="top" class="row2">
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td style="width: 20%;">{t}Service Number{/t}</td>
<td style="width: 30%;"><b>{$prod_attr.service_number}</b></td>
<td style="width: 20%;">{t}Service Account Name{/t}</td>
<td style="width: 30%;"><b>{$prod_attr.service_account_name}</b></td>
</tr>
<tr>
<td style="width: 20%; vertical-align:text-top;">{t}Contact End Date{/t}</td>
<td style="width: 30%; vertical-align:text-top;"><b>{$prod_attr.contract_end_date}</b></td>
<td style="width: 20%;">{t}Service Address{/t}</td>
<td style="width: 30%;"><b>{$prod_attr.service_address}</b></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<!-- PRODUCT -->
{assign var="pid" value=$record.product_id}
{if ($list->smarty_array('product_translate','description_short'," AND product_id=$pid ",'product'))}
<tr valign="top" class="row2">
<td style="width: 20%;">{osb f=tf field=product}</td>
<td colspan="3"><b>{$product.0.description_short}</b></td>
</tr>
{/if}
{if $meth.1 != 'user_view'}
<!-- STATIC IP AVAILABLE -->
<tr valign="top" class="row2">
<td style="width: 20%;">{osb f=tf field=contract_term}</td>
<td style="width: 30%;"><b>{$plugin_data.contract_term}</b></td>
<td style="width: 20%;">{osb f=tf field=staticip}</td>
<td style="width: 30%;"><b>{$list->bool('',$plugin_data.staticip,'')}</b></td>
</tr>
<!-- INCLUDED TRAFFIC -->
<tr valign="top" class="row2">
<td>{osb f=tf field=product_base_down_peak}</td>
<td><b>{$plugin_data.base_down_peak}</b></td>
<td>{osb f=tf field=product_base_up_peak}</td>
<td><b>{$plugin_data.base_up_peak}</b></td>
</tr>
<tr valign="top" class="row2">
<td>{osb f=tf field=product_base_down_offpeak}</td>
<td><b>{$plugin_data.base_down_offpeak}</b></td>
<td>{osb f=tf field=product_base_up_offpeak}</td>
<td><b>{$plugin_data.base_up_offpeak}</b></td>
</tr>
<!-- EXCESS TRAFFIC -->
<tr valign="top" class="row2">
<td>{osb f=tf field=product_extra_charged}</td>
<td><b>{$list->bool('',$plugin_data.extra_charged,'')}</b></td>
<td>{osb f=tf field=product_extra_shape}</td>
<td><b>{$plugin_data.extra_shape}</b></td>
</tr>
<tr valign="top" class="row2">
<td>{osb f=tf field=product_extra_down_peak}</td>
<td><b>{$plugin_data.extra_down_peak}</b></td>
<td>{osb f=tf field=product_extra_up_peak}</td>
<td><b>{$plugin_data.extra_up_peak}</b></td>
</tr>
<tr valign="top" class="row2">
<td>{osb f=tf field=product_extra_down_offpeak}</td>
<td><b>{$plugin_data.extra_down_offpeak}</b></td>
<td>{osb f=tf field=product_extra_up_offpeak}</td>
<td><b>{$plugin_data.extra_up_offpeak}</b></td>
</tr>
{/if}
</table>