Changes to AgileBill

This commit is contained in:
Deon George
2009-08-03 14:10:16 +10:00
parent 0a22cfe22c
commit 27aee719b0
1051 changed files with 219109 additions and 117219 deletions

View File

@@ -1,349 +1,177 @@
{assign var=meth value=':'|explode:$VAR._page}
<!-- {$meth.0}:{$meth.1} -->
<!-- Display the form validation -->
{if $form_validation}
{ $block->display("core:alert_fields") }
{$block->display('core:alert_fields')}
{/if}
<!-- Display the form to collect the input values -->
<form id="discount_add" name="discount_add" method="post" action="">
<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 width="65%" class="table_heading">
<center>
{translate module=discount}
title_add
{/translate}
</center>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td width="50%">
{translate module=discount}
field_date_start
{/translate}
</td>
<td width="50%">
{ $list->calender_add("discount_date_start", $VAR.discount_date_start, "form_field") }
<input type="hidden" name="discount_date_orig" value="{$smarty.now}">
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_date_expire
{/translate}
</td>
<td width="50%">
{ $list->calender_add("discount_date_expire", $VAR.discount_date_expire, "form_field") }
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_status
{/translate}
</td>
<td width="50%">
{if $VAR.discount_status == ''}
{ $list->bool("discount_status", 1, "form_menu") }
{else}
{ $list->bool("discount_status", $VAR.discount_status, "form_menu") }
{/if}
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_name
{/translate}
</td>
<td width="50%">
<input type="text" name="discount_name" value="{$VAR.discount_name}" {if $discount_name == true}class="form_field_error"{/if}>
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_notes
{/translate}
</td>
<td width="50%">
<textarea name="discount_notes" cols="40" rows="5" {if $discount_notes == true}class="form_field_error"{/if}>{$VAR.discount_notes}</textarea>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td>
<div align="center"><b>{translate module=discount}discount_restrictions{/translate}</b></div>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td width="50%">
{translate module=discount}
field_max_usage_account
{/translate}
</td>
<td width="50%">
<input type="text" name="discount_max_usage_account" value="{$VAR.discount_max_usage_account}" {if $discount_max_usage_account == true}class="form_field_error"{/if}>
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_max_usage_global
{/translate}
</td>
<td width="50%">
<input type="text" name="discount_max_usage_global" value="{$VAR.discount_max_usage_global}" {if $discount_max_usage_global == true}class="form_field_error"{/if}>
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_avail_account_id
{/translate}
</td>
<td width="50%">
{html_select_account name="discount_avail_account_id" default=$VAR.discount_avail_account_id}
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_avail_product_id
{/translate}
</td>
<td width="50%">
{ $list->menu_multi($VAR.discount_avail_product_id, "discount_avail_product_id", "product", "sku", "", "10", "form_menu") }
</td>
</tr>
{if $list->is_installed("host_tld")}
<tr valign="top">
<td width="50%">
{translate module=discount}
field_avail_tld_id
{/translate}
</td>
<td width="50%">
{ $list->menu_multi($VAR.discount_avail_tld_id, "discount_avail_tld_id", "host_tld", "name", "", "10", "form_menu") }
</td>
</tr>
{/if}
<tr valign="top">
<td width="50%">
{translate module=discount}
field_avail_group_id
{/translate}
</td>
<td width="50%">
{ $list->menu_multi($VAR.discount_avail_group_id, 'discount_avail_group_id', 'group', 'name', '', '10', 'form_menu') }
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td>
<div align="center"><b>
{translate module=discount}
discount_new
{/translate}
</b></div>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td width="70%">
{translate module=discount}
field_new_status
{/translate}
</td>
<td width="30%">
{ $list->bool("discount_new_status", $VAR.discount_new_status, "form_menu") }
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_new_type
{/translate}
</td>
<td width="30%">
<select name="discount_new_type" >
<option value="0"{if $VAR.discount_new_type == "0"} selected{/if}>
{translate module=discount}
percent
{/translate}
</option>
<option value="1"{if $VAR.discount_new_type == "1"} selected{/if}>
{translate module=discount}
flat
{/translate}
</option>
</select>
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_new_rate
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_new_rate" value="{$VAR.discount_new_rate}" {if $discount_new_rate == true}class="form_field_error"{/if} size="12">
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_new_max_discount
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_new_max_discount" value="{$VAR.discount_new_max_discount}" {if $discount_new_max_discount == true}class="form_field_error"{/if} size="12">
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_new_min_cost
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_new_min_cost" value="{$VAR.discount_new_min_cost}" {if $discount_new_min_cost == true}class="form_field_error"{/if} size="12">
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td>
<div align="center"><b>
{translate module=discount}
discount_recurr
{/translate}
</b></div>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td width="70%">
{translate module=discount}
field_recurr_status
{/translate}
</td>
<td width="30%">
{ $list->bool("discount_recurr_status", $VAR.discount_recurr_status, "form_menu") }
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_recurr_type
{/translate}
</td>
<td width="30%">
<select name="discount_recurr_type" >
<option value="0"{if $VAR.discount_recurr_type == "0"} selected{/if}>
{translate module=discount}
percent
{/translate}
</option>
<option value="1"{if $VAR.discount_recurr_type == "1"} selected{/if}>
{translate module=discount}
flat
{/translate}
</option>
</select>
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_recurr_rate
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_recurr_rate" value="{$VAR.discount_recurr_rate}" {if $discount_recurr_rate == true}class="form_field_error"{/if} size="12">
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_recurr_max_discount
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_recurr_max_discount" value="{$VAR.discount_recurr_max_discount}" {if $discount_recurr_max_discount == true}class="form_field_error"{/if} size="12">
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_recurr_min_cost
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_recurr_min_cost" value="{$VAR.discount_recurr_min_cost}" {if $discount_recurr_min_cost == true}class="form_field_error"{/if} size="12">
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row2">
<tr valign="top">
<td width="35%"></td>
<td width="65%">
<div align="right">
<input type="submit" name="Submit" value="{translate}submit{/translate}" class="form_button">
<input type="hidden" name="_page" value="discount:view">
<input type="hidden" name="_page_current" value="discount:add">
<input type="hidden" name="do[]" value="discount:add">
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>&nbsp;</p></form>
<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="3" cellpadding="1" class="row1">
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=date_start}</td>
<td style="width: 65%;">{$list->calender_add('discount_date_start',$VAR.discount_date_start,'form_field')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=date_expire}</td>
<td style="width: 65%;">{$list->calender_add('discount_date_expire',$VAR.discount_date_expire,'form_field')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=status}</td>
<td style="width: 65%;">
{if $VAR.discount_status == ''}
{$list->bool('discount_status',1,'form_menu')}
{else}
{$list->bool('discount_status',$VAR.discount_status,'form_menu')}
{/if}
</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=name}</td>
<td style="width: 65%;"><input type="text" name="discount_name" value="{$VAR.discount_name}" {if $discount_name == true}class="form_field_error"{/if}/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=notes}</td>
<td style="width: 65%;"><textarea name="discount_notes" cols="40" rows="5" {if $discount_notes == true}class="form_field_error"{/if}>{$VAR.discount_notes}</textarea></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td style="text-align: center;"><b>{t}Discount Restrictions & Limitations{/t}</b></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=max_usage_account}</td>
<td style="width: 65%;"><input type="text" name="discount_max_usage_account" value="{$VAR.discount_max_usage_account}" {if $discount_max_usage_account == true}class="form_field_error"{/if}/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=max_usage_global}</td>
<td style="width: 65%;"><input type="text" name="discount_max_usage_global" value="{$VAR.discount_max_usage_global}" {if $discount_max_usage_global == true}class="form_field_error"{/if}/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=avail_account_id}</td>
<td style="width: 65%;">{osb f=autoselect module=account return=id field=discount_avail_account_id default=$VAR.discount_avail_account_id}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=avail_product_id}</td>
<td style="width: 65%;">{$list->menu_multi($VAR.discount_avail_product_id,'discount_avail_product_id','product','sku','','10','form_menu')}</td>
</tr>
{if $list->is_installed('host_tld')}
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=avail_tld_id}</td>
<td style="width: 65%;">{$list->menu_multi($VAR.discount_avail_tld_id,'discount_avail_tld_id','host_tld','name','','10','form_menu')}</td>
</tr>
{/if}
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=avail_group_id}</td>
<td style="width: 65%;">{$list->menu_multi($VAR.discount_avail_group_id,'discount_avail_group_id','group','name','','10','form_menu')}</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td style="text-align: center;"><b>{t}Settings for new Charges & Orders{/t}</b></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_status}</td>
<td style="width: 65%;">{$list->bool('discount_new_status',$VAR.discount_new_status,'form_menu')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_type}</td>
<td style="width: 65%;">{$list->menu_staticlist('discounttype','discount_new_type','discount_new_type',$VAR.discount_new_type,'form_menu')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_rate}</td>
<td style="width: 65%;"><input type="text" name="discount_new_rate" value="{$VAR.discount_new_rate}" {if $discount_new_rate == true}class="form_field_error"{/if} size="12"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_max_discount}</td>
<td style="width: 65%;"><input type="text" name="discount_new_max_discount" value="{$VAR.discount_new_max_discount}" {if $discount_new_max_discount == true}class="form_field_error"{/if} size="12"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_min_cost}</td>
<td style="width: 65%;"><input type="text" name="discount_new_min_cost" value="{$VAR.discount_new_min_cost}" {if $discount_new_min_cost == true}class="form_field_error"{/if} size="12"/></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td style="text-align: center;"><b>{t}Settings for Recurring Charges{/t}</b></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_status}</td>
<td style="width: 65%;">{$list->bool('discount_recurr_status',$VAR.discount_recurr_status,'form_menu')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_type}</td>
<td style="width: 65%;">{$list->menu_staticlist('discounttype','discount_recurr_type','discount_recurr_type',$VAR.discount_recurr_type,'form_menu')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_rate}</td>
<td style="width: 65%;"><input type="text" name="discount_recurr_rate" value="{$VAR.discount_recurr_rate}" {if $discount_recurr_rate == true}class="form_field_error"{/if} size="12"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_max_discount}</td>
<td style="width: 65%;"><input type="text" name="discount_recurr_max_discount" value="{$VAR.discount_recurr_max_discount}" {if $discount_recurr_max_discount == true}class="form_field_error"{/if} size="12"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_min_cost}</td>
<td style="width: 65%;"><input type="text" name="discount_recurr_min_cost" value="{$VAR.discount_recurr_min_cost}" {if $discount_recurr_min_cost == true}class="form_field_error"{/if} size="12"/></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row2">
{include file='file:../core/add_tr_submit.tpl'}
<tr>
<td style="width: 35%;">&nbsp;</td>
<td style="width: 65%;">&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>

View File

@@ -1,168 +1,70 @@
{assign var=meth value=':'|explode:$VAR._page}
<!-- {$meth.0}:{$meth.1} -->
{ $method->exe("discount","search_form") }
{ if ($method->result == FALSE) }
{ $block->display("core:method_error") }
{$method->exe($meth.0,$meth.1)}
{if ($method->result == false)}
{$block->display('core:method_error')}
{else}
<form name="discount_search" method="post" action="">
<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 width="65%" class="table_heading">
<center>
{translate module=discount}title_search{/translate}
</center>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td width="35%">
{translate module=discount}
field_date_orig
{/translate}
</td>
<td width="65%">
{ $list->calender_search("discount_date_orig", $VAR.discount_date_orig, "form_field", "") }
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=discount}
field_date_start
{/translate}
</td>
<td width="65%">
{ $list->calender_search("discount_date_start", $VAR.discount_date_start, "form_field", "") }
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=discount}
field_date_expire
{/translate}
</td>
<td width="65%">
{ $list->calender_search("discount_date_expire", $VAR.discount_date_expire, "form_field", "") }
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=discount}
field_status
{/translate}
</td>
<td width="65%">
{ $list->bool("discount_status", "all", "form_menu") }
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=discount}
field_name
{/translate}
</td>
<td width="65%">
<input type="text" name="discount_name" value="{$VAR.discount_name}" {if $discount_name == true}class="form_field_error"{/if}>
&nbsp;&nbsp;
{translate}
search_partial
{/translate}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=discount}
field_notes
{/translate}
</td>
<td width="65%">
<input type="text" name="discount_notes" value="{$VAR.discount_notes}" {if $discount_notes == true}class="form_field_error"{/if}>
&nbsp;&nbsp;
{translate}
search_partial
{/translate}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=discount}
field_avail_account_id
{/translate}
</td>
<td width="65%">
{html_select_account name="discount_avail_account_id" default=$VAR.discount_avail_account_id}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=discount}
field_new_status
{/translate}
</td>
<td width="65%">
{ $list->bool("discount_new_status", "all", "form_menu") }
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=discount}
field_recurr_status
{/translate}
</td>
<td width="65%">
{ $list->bool("discount_recurr_status", "all", "form_menu") }
</td>
</tr>
<!-- Define the results per page -->
<tr class="row1" valign="top">
<td width="35%">
{translate}
search_results_per
{/translate}
</td>
<td width="65%">
<input type="text" name="limit" size="5" value="{$discount_limit}">
</td>
</tr>
<!-- Define the order by field per page -->
<tr class="row1" valign="top">
<td width="35%">
{translate}
search_order_by
{/translate}
</td>
<td width="65%">
<select name="order_by">
{foreach from=$discount item=record}
<option value="{$record.field}">
{$record.translate}
</option>
{/foreach}
</select>
</td>
</tr>
<tr class="row1" valign="top">
<td width="35%"></td>
<td width="65%">
<input type="submit" name="Submit" value="{translate}search{/translate}" class="form_button">
<input type="hidden" name="_page" value="core:search">
<input type="hidden" name="_escape" value="Y">
<input type="hidden" name="module" value="discount">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
{ $block->display("core:saved_searches") }
{ $block->display("core:recent_searches") }
<form id="search_form" 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="3" cellpadding="1" class="row1">
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=date_orig}</td>
<td style="width: 65%;">{$list->calender_search('discount_date_orig',$VAR.discount_date_orig,'form_field','')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=date_start}</td>
<td style="width: 65%;">{$list->calender_search('discount_date_start',$VAR.discount_date_start,'form_field','')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=date_expire}</td>
<td style="width: 65%;">{$list->calender_search('discount_date_expire',$VAR.discount_date_expire,'form_field','')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=status}</td>
<td style="width: 65%;">{$list->bool('discount_status','all')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=name}</td>
<td style="width: 65%;"><input type="text" name="discount_name" value="{$VAR.discount_name}" {if $discount_name == true}class="form_field_error"{/if}/>&nbsp;&nbsp;{t}"%" for partial match{/t}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=notes}</td>
<td style="width: 65%;"><input type="text" name="discount_notes" value="{$VAR.discount_notes}" {if $discount_notes == true}class="form_field_error"{/if}/>&nbsp;&nbsp;{t}"%" for partial match{/t}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=avail_account_id}</td>
<td style="width: 65%;">{osb f=autoselect module=account return=id field=discount_avail_account_id default=$VAR.discount_avail_account_id}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_status}</td>
<td style="width: 65%;">{$list->bool('discount_new_status','all')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_status}</td>
<td style="width: 65%;">{$list->bool('discount_recurr_status','all')}</td>
</tr>
{include file='file:../core/search_post.tpl'}
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
{$block->display('core:saved_searches')}
{$block->display('core:recent_searches')}
{/if}

View File

@@ -1,140 +1,32 @@
{assign var=meth value=':'|explode:$VAR._page}
<!-- {$meth.0}:{$meth.1} -->
{$method->exe("discount","search_show")}
{if ($method->result == FALSE)}
{$block->display("core:method_error")}
{$method->exe($meth.0,$meth.1)}
{if ($method->result == false)}
{$block->display('core:method_error')}
{else}
{if $results == 1}
{translate results=$results}search_result_count{/translate}
{else}
{translate results=$results}search_results_count{/translate}
{/if}
<BR>
{include file='file:../core/search_show_pre.tpl'}
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<tr>
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
{$method->exe_noauth($meth.0,'tpl_search_show')}
{foreach from=$search_show item=record}
{include file='file:../core/search_show_tr_record.tpl'}
<td>{$record.name}</td>
<td>{$list->bool('',$record.status,'')}</td>
<td>{$record.orders}</td>
<td>{$list->format_currency($record.revenue,'')}</td>
<td>{$list->format_currency($record.savings,'')}</td>
<td>{$list->menu_staticlist('discounttype','','',$record.new_type,'')}</td>
</tr>
{/foreach}
</table>
</td>
</tr>
</table>
{literal}
<script language="JavaScript">
<!-- START
var module = 'discount';
{/literal}
{if $VAR._print == TRUE}
var p = '&_escape=y&_print=y';
{else}
var p = '';
{/if}{literal}
var IMAGE = '{/literal}{$NONSSL_IMAGE}{literal}';
var order = '{/literal}{$order}{literal}';
var sort1 = '{/literal}{$sort}{literal}';
var search_id = '{/literal}{$search_id}{literal}';
var page = {/literal}{$page}{literal};
var pages = '{/literal}{$pages}{literal}';
var results = '{/literal}{$results}{literal}';
var limit = '{/literal}{$limit}{literal}';
record_arr = new Array ({/literal}{$limit}{literal});
var i = 0;
// END -->
</script>
<SCRIPT SRC="themes/{/literal}{$THEME_NAME}{literal}/search.js"></SCRIPT>
{/literal}
<!-- SHOW THE SEARCH NAVIGATION MENU -->
<center><script language="JavaScript">document.write(search_nav_top());</script></center>
<!-- BEGIN THE RESULTS CONTENT AREA -->
<div id="search_results" onKeyPress="key_handler(event);">
<table id="main1" width="100%" border="0" cellspacing="0" cellpadding="0" class="table_background">
<form id="form1" name="form1" method="post" action="">
<tr>
<td>
<table id="main2" width="100%" border="0" cellspacing="1" cellpadding="2">
<!-- DISPLAY THE SEARCH HEADING -->
<tr valign="middle" align="center" class="table_heading">
<td width="44" class="table_heading">&nbsp;</td>
<td width="130" class="table_heading">
{literal}
<script language="JavaScript">
document.write(search_heading('{/literal}{translate module=discount}field_name{/translate}{literal}','name'));
</script>
{/literal}
</td>
<td width="85" class="table_heading">
{literal}
<script language="JavaScript">
document.write(search_heading('{/literal}{translate module=discount}field_status{/translate}{literal}','status'));
</script>
{/literal}
</td>
<td width="144" class="table_heading">{translate module=discount}invoice_count{/translate}</td>
<td width="119" class="table_heading">{translate module=discount}revenue{/translate}</td>
<td width="112" class="table_heading">{translate module=discount}savings{/translate}</td>
<td width="248" class="table_heading">
{literal}
<script language="JavaScript">
document.write(search_heading('{/literal}{translate module=discount}field_new_type{/translate}{literal}','new_type'));
</script>
{/literal}
</td>
<!-- LOOP THROUGH EACH RECORD -->
{foreach from=$discount item=record}
<tr id="row{$record.id}" onClick="row_sel('{$record.id}',1);" onDblClick="window.location='?_page=discount:view&id={$record.id},';" onMouseOver="row_mouseover('{$record.id}', 'row_mouse_over_select', 'row_mouse_over');" onMouseOut="row_mouseout('{$record.id}', '{$record._C}', 'row_select');" class="{$record._C}">
<td align="center" width="44">
<input type="checkbox" name="record{$record.id}" value="{$record.id}" onClick="row_sel('{$record.id}',1,'{$record._C}');">
</td>
<td width="130"> &nbsp;
{$record.name}
</td>
<td width="85">&nbsp;
{if $record.status == "1"}
{translate}
true
{/translate}
{else}
{translate}
false
{/translate}
{/if}
&nbsp; </td>
<td width="144">&nbsp;
{$record.orders}
</td>
<td width="119">&nbsp;
{$list->format_currency($record.revenue,'')}
</td>
<td width="112"> &nbsp;
{$list->format_currency($record.savings,'')}
</td>
<td width="248">&nbsp;
{if $record.new_type == "0"}
{translate module=discount}
percent
{/translate}
{else}
{translate module=discount}
flat
{/translate}
{/if}
</td>
</tr>
{literal}
<script language="JavaScript">row_sel('{/literal}{$record.id}{literal}', 0, '{/literal}{$record._C}{literal}'); record_arr[i] = '{/literal}{$record.id}{literal}'; i++; </script>
{/literal}
{/foreach}
<!-- END OF RESULT LOOP -->
</table>
</td>
</tr>
</form>
</table>
{if $VAR._print != TRUE}<br>
<center>
<input type="submit" name="Submit" value="{translate}view_edit{/translate}" onClick="mass_do('', module+':view', limit, module);" class="form_button">
<input type="submit" name="Submit" value="{translate}delete{/translate}" onClick="mass_do('delete', module+':search_show&search_id={$search_id}&page={$page}&order_by={$order}&{$sort}', limit, module);" class="form_button">
<input type="submit" name="Submit" value="{translate}select_all{/translate}" onClick="all_select(record_arr);" class="form_button">
<input type="submit" name="Submit" value="{translate}deselect_all{/translate}" onClick="all_deselect(record_arr);" class="form_button">
<input type="submit" name="Submit" value="{translate}range_select{/translate}" onClick="all_range_select(record_arr,limit);" class="form_button">
<br>
</center>
{/if}
{/if}
</div>
{include file='file:../core/search_show_post-1.tpl'}
{include file='file:../core/search_show_post-2.tpl'}
{/if}

View File

@@ -1,405 +1,174 @@
{ $method->exe("discount","view") } { if ($method->result == FALSE) } { $block->display("core:method_error") } {else}
{assign var=meth value=':'|explode:$VAR._page}
<!-- {$meth.0}:{$meth.1} -->
{literal}
<script src="themes/{/literal}{$THEME_NAME}{literal}/view.js"></script>
<script language="JavaScript">
var module = 'discount';
var locations = '{/literal}{$VAR.module_id}{literal}';
var id = '{/literal}{$VAR.id}{literal}';
var ids = '{/literal}{$VAR.ids}{literal}';
var array_id = id.split(",");
var array_ids = ids.split(",");
var num=0;
if(array_id.length > 2) {
document.location = '?_page='+module+':view&id='+array_id[0]+'&ids='+id;
}else if (array_ids.length > 2) {
document.write(view_nav_top(array_ids,id,ids));
}
function delete_record(id,ids)
{
temp = window.confirm("{/literal}{translate}alert_delete{/translate}{literal}");
if(temp == false) return;
var replace_id = id + ",";
ids = ids.replace(replace_id, '');
if(ids == '') {
var url = '?_page=core:search&module=' + module + '&do[]=' + module + ':delete&delete_id=' + id + COOKIE_URL;
window.location = url;
return;
} else {
var page = 'view&id=' +ids;
}
var doit = 'delete';
var url = '?_page='+ module +':'+ page +'&do[]=' + module + ':' + doit + '&delete_id=' + id + COOKIE_URL;
window.location = url;
}
// END -->
</script>
{/literal}
{$method->exe($meth.0,$meth.1)}
{if ($method->result == false)}
{$block->display('core:method_error')}
{else}
{include file='file:../core/view_pre.tpl'}
<!-- Loop through each record -->
{foreach from=$discount item=discount} <a name="{$discount.id}"></a>
<!-- Display the field validation -->
{if $form_validation}
{$block->display('core:alert_fields')}
{/if}
<!-- Display the field validation -->
{if $form_validation}
{ $block->display("core:alert_fields") }
{/if}
<!-- Display each record -->
<form id="discount_view" name="discount_view" method="post" action="">
<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 width="65%" class="table_heading">
<center>
{translate module=discount}
title_view
{/translate}
</center>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td width="50%">
{translate module=discount}
field_date_orig
{/translate}
</td>
<td width="50%">
{$list->date_time($discount.date_orig)}
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_date_start
{/translate}
</td>
<td width="50%">
{ $list->calender_view("discount_date_start", $discount.date_start, "form_field", $discount.id) }
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_date_expire
{/translate}
</td>
<td width="50%">
{ $list->calender_view("discount_date_expire", $discount.date_expire, "form_field", $discount.id) }
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_status
{/translate}
</td>
<td width="50%">
{ $list->bool("discount_status", $discount.status, "onChange=\"submit()\"") }
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_name
{/translate}
</td>
<td width="50%">
<input type="text" name="discount_name" value="{$discount.name}" size="32">
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_notes
{/translate}
</td>
<td width="50%">
<textarea name="discount_notes" cols="40" rows="5" >{$discount.notes}</textarea>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td>
<div align="center"><b>
{translate module=discount}
discount_restrictions
{/translate}
</b></div>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td width="50%">
{translate module=discount}
field_max_usage_account
{/translate}
</td>
<td width="50%">
<input type="text" name="discount_max_usage_account" value="{$discount.max_usage_account}" size="32">
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_max_usage_global
{/translate}
</td>
<td width="50%">
<input type="text" name="discount_max_usage_global" value="{$discount.max_usage_global}" size="32">
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_avail_account_id
{/translate}
</td>
<td width="50%">
{html_select_account name="discount_avail_account_id" default=$discount.avail_account_id}
</td>
</tr>
<tr valign="top">
<td width="50%">
{translate module=discount}
field_avail_product_id
{/translate}
</td>
<td width="50%">
{ $list->menu_multi($discount.avail_product_id, "discount_avail_product_id", "product", "sku", "", "10", "form_menu") }
</td>
</tr>
{if $list->is_installed("host_tld")}
<tr valign="top">
<td width="50%">
{translate module=discount}
field_avail_tld_id
{/translate}
</td>
<td width="50%">
{ $list->menu_multi($discount.avail_tld_id, "discount_avail_tld_id", "host_tld", "name", "", "10", "form_menu") }
</td>
</tr>
{/if}
<tr valign="top">
<td width="50%">
{translate module=discount}
field_avail_group_id
{/translate}
</td>
<td width="50%">
{ $list->menu_multi($discount.avail_group_id, 'discount_avail_group_id', 'group', 'name', '', '10', 'form_menu') }
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td>
<div align="center"><b>
{translate module=discount}
discount_new
{/translate}
</b></div>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td width="70%">
{translate module=discount}
field_new_status
{/translate}
</td>
<td width="30%">
{ $list->bool("discount_new_status", $discount.new_status, "form_menu") }
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_new_type
{/translate}
</td>
<td width="30%">
<select name="discount_new_type" >
<option value="0"{if $discount.new_type == "0"} selected{/if}>
{translate module=discount}
percent
{/translate}
</option>
<option value="1"{if $discount.new_type == "1"} selected{/if}>
{translate module=discount}
flat
{/translate}
</option>
</select>
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_new_rate
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_new_rate" value="{$discount.new_rate}" size="12">
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_new_max_discount
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_new_max_discount" value="{$discount.new_max_discount}" size="12">
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_new_min_cost
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_new_min_cost" value="{$discount.new_min_cost}" size="12">
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td>
<div align="center"><b>
{translate module=discount}
discount_recurr
{/translate}
</b></div>
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td width="70%">
{translate module=discount}
field_recurr_status
{/translate}
</td>
<td width="30%">
{ $list->bool("discount_recurr_status", $discount.recurr_status, "form_menu") }
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_recurr_type
{/translate}
</td>
<td width="30%">
<select name="discount_recurr_type" >
<option value="0"{if $discount.recurr_type == "0"} selected{/if}>
{translate module=discount}
percent
{/translate}
</option>
<option value="1"{if $discount.recurr_type == "1"} selected{/if}>
{translate module=discount}
flat
{/translate}
</option>
</select>
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_recurr_rate
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_recurr_rate" value="{$discount.recurr_rate}" size="12">
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_recurr_max_discount
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_recurr_max_discount" value="{$discount.recurr_max_discount}" size="12">
</td>
</tr>
<tr valign="top">
<td width="70%">
{translate module=discount}
field_recurr_min_cost
{/translate}
</td>
<td width="30%">
<input type="text" name="discount_recurr_min_cost" value="{$discount.recurr_min_cost}" size="12">
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td width="65%" class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr class="row1" valign="middle" align="left">
<td width="35%">
<input type="submit" name="Submit" value="{translate}submit{/translate}" class="form_button">
</td>
<td width="65%">
<div align="right">
<input type="button" name="delete" value="{translate}delete{/translate}" class="form_button" onClick="delete_record('{$discount.id}','{$VAR.id}');">
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<input type="hidden" name="_page" value="discount:view">
<input type="hidden" name="discount_id" value="{$discount.id}">
<input type="hidden" name="do[]" value="discount:update">
<input type="hidden" name="id" value="{$VAR.id}">
</form>
{/foreach}
<!-- Display each record -->
<form id="view" 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="3" cellpadding="1" class="row1">
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=date_orig}</td>
<td style="width: 65%;">{$list->date_time($record.date_orig)}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=date_start}</td>
<td style="width: 65%;">{$list->calender_view('discount_date_start',$record.date_start,'form_field')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=date_expire}</td>
<td style="width: 65%;">{$list->calender_view('discount_date_expire',$record.date_expire,'form_field')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=status}</td>
<td style="width: 65%;">{$list->bool('discount_status',$record.status,'" onchange="submit()')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=name}</td>
<td style="width: 65%;"><input type="text" name="discount_name" value="{$record.name}" size="32"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=notes}</td>
<td style="width: 65%;"><textarea name="discount_notes" cols="40" rows="5" >{$record.notes}</textarea></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td style="text-align: center;"><b>{t}Discount Restrictions & Limitations{/t}</b></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=max_usage_account}</td>
<td style="width: 65%;"><input type="text" name="discount_max_usage_account" value="{$record.max_usage_account}" size="32"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=max_usage_global}</td>
<td style="width: 65%;"><input type="text" name="discount_max_usage_global" value="{$record.max_usage_global}" size="32"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=avail_account_id}</td>
<td style="width: 65%;">{osb f=autoselect module=account return=id field=discount_avail_account_id default=$record.avail_account_id}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=avail_product_id}</td>
<td style="width: 65%;">{$list->menu_multi($record.avail_product_id,'discount_avail_product_id','product','sku','','10','form_menu')}</td>
</tr>
{if $list->is_installed('host_tld')}
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=avail_tld_id}</td>
<td style="width: 65%;">{$list->menu_multi($record.avail_tld_id,'discount_avail_tld_id','host_tld','name','','10','form_menu')}</td>
</tr>
{/if}
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=avail_group_id}</td>
<td style="width: 65%;">{$list->menu_multi($record.avail_group_id,'discount_avail_group_id','group','name','','10','form_menu')}</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td style="text-align: center;"><b>{t}Settings for new Charges & Orders{/t}</b></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_status}</td>
<td style="width: 65%;">{$list->bool('discount_new_status',$record.new_status)}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_type}</td>
<td style="width: 65%;">{$list->menu_staticlist('discounttype','discount_new_type','discount_new_type',$record.new_type,'form_menu')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_rate}</td>
<td style="width: 65%;"><input type="text" name="discount_new_rate" value="{$record.new_rate}" size="12"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_max_discount}</td>
<td style="width: 65%;"><input type="text" name="discount_new_max_discount" value="{$record.new_max_discount}" size="12"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=new_min_cost}</td>
<td style="width: 65%;"><input type="text" name="discount_new_min_cost" value="{$record.new_min_cost}" size="12"/></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="1" cellpadding="10" class="row2">
<tr>
<td style="text-align: center;"><b>{t}Settings for Recurring Charges{/t}</b></td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td class="row1">
<table width="100%" border="0" cellspacing="3" cellpadding="1" class="row1">
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_status}</td>
<td style="width: 65%;">{$list->bool('discount_recurr_status',$record.recurr_status)}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_type}</td>
<td style="width: 65%;">{$list->menu_staticlist('discounttype','discount_recurr_type','discount_recurr_type',$VAR.recurr_type,'form_menu')}</td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_rate}</td>
<td style="width: 65%;"><input type="text" name="discount_recurr_rate" value="{$record.recurr_rate}" size="12"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_max_discount}</td>
<td style="width: 65%;"><input type="text" name="discount_recurr_max_discount" value="{$record.recurr_max_discount}" size="12"/></td>
</tr>
<tr valign="top">
<td style="width: 35%;">{osb f=tf field=recurr_min_cost}</td>
<td style="width: 65%;"><input type="text" name="discount_recurr_min_cost" value="{$record.recurr_min_cost}" size="12"/></td>
</tr>
</table>
</td>
</tr>
{include file='file:../core/view_tr_submit_delete.tpl'}
</table>
</td>
</tr>
</table>
{include file='file:../core/view_post.tpl'}
</form>
{/if}