Initial Commit of AgileBill Open Source

This commit is contained in:
unknown
2008-11-26 14:50:40 -08:00
parent ae5a0fc25e
commit 02306ccc47
2954 changed files with 410976 additions and 0 deletions

View File

@@ -0,0 +1,153 @@
<!-- Display the form validation -->
{if $form_validation}
{ $block->display("core:alert_fields") }
{/if}
<!-- Display the form to collect the input values -->
<form id="charge_add" name="charge_add" 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=charge}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="35%">
{translate module=charge}
field_status
{/translate}
</td>
<td width="65%">
{ $list->bool("charge_status", $VAR.charge_status, "form_menu") }
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_sweep_type
{/translate}
</td>
<td width="65%">
<select name="charge_sweep_type" >
<option value="0" {if $VAR.charge_sweep_type == "0"}selected{/if}>Daily</option>
<option value="1" {if $VAR.charge_sweep_type == "1"}selected{/if}>Weekly</option>
<option value="2" {if $VAR.charge_sweep_type == "2"}selected{/if}>Monthly</option>
<option value="3" {if $VAR.charge_sweep_type == "3"}selected{/if}>Quarterly</option>
<option value="4" {if $VAR.charge_sweep_type == "4"}selected{/if}>Semi-anually</option>
<option value="5" {if $VAR.charge_sweep_type == "5"}selected{/if}>Anually</option>
<option value="6" {if $VAR.charge_sweep_type == "6"}selected{/if}>On
Service Rebill</option>
</select>
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_account_id
{/translate}
</td>
<td width="65%">
{html_select_account name="charge_account_id" default=$VAR.charge_account_id}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_product_id
{/translate}
</td>
<td width="65%">
{if $VAR.charge_product_id == ''}
{ $list->menu("", "charge_product_id", "product", "sku", "all", "form_menu") }
{else}
{ $list->menu("", "charge_product_id", "product", "sku", $VAR.charge_product_id, "form_menu") }
{/if}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_service_id
{/translate}
</td>
<td width="65%">
<input type="text" name="charge_service_id" value="{$VAR.charge_service_id}" {if $charge_service_id == true}class="form_field_error"{/if}>
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_amount
{/translate}
</td>
<td width="65%">
<input type="text" name="charge_amount" value="{$VAR.charge_amount}" {if $charge_amount == true}class="form_field_error"{/if}>
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_quantity
{/translate}
</td>
<td width="65%">
<input type="text" name="charge_quantity" value="{$VAR.charge_quantity}" {if $charge_quantity == true}class="form_field_error"{/if} size="5">
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_taxable
{/translate}
</td>
<td width="65%">
{ $list->bool("charge_taxable", $VAR.charge_taxable, "form_menu") }
</td>
</tr>
<tr class="row1" valign="top">
<td width="35%">
{translate module=charge}
field_attributes
{/translate}
</td>
<td width="65%">
<input type="text" name="attributes[0][0]" class=form_field size="16"> =
<input type="text" name="attributes[0][1]" class=form_field size="16"> <br>
<input type="text" name="attributes[1][0]" class=form_field size="16"> =
<input type="text" name="attributes[1][1]" class=form_field size="16"> <br>
<input type="text" name="attributes[2][0]" class=form_field size="16"> =
<input type="text" name="attributes[2][1]" class=form_field size="16"> <br>
<input type="text" name="attributes[3][0]" class=form_field size="16"> =
<input type="text" name="attributes[3][1]" class=form_field size="16"> <br>
<input type="text" name="attributes[4][0]" class=form_field size="16"> =
<input type="text" name="attributes[4][1]" class=form_field size="16"> <br>
<input type="text" name="attributes[5][0]" class=form_field size="16"> =
<input type="text" name="attributes[5][1]" class=form_field size="16">
</td>
</tr>
<tr valign="top">
<td width="35%"></td>
<td width="65%">
<input type="submit" name="Submit" value="{translate}submit{/translate}" class="form_button">
<input type="hidden" name="_page" value="charge:view">
<input type="hidden" name="_page_current" value="charge:add">
<input type="hidden" name="do[]" value="charge:add">
<input type="hidden" name="charge_date_orig" value="{$smarty.now}">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>

View File

@@ -0,0 +1,187 @@
{ $method->exe("charge","search_form") }
{ if ($method->result == FALSE) }
{ $block->display("core:method_error") }
{else}
<form name="charge_search" method="post" action="">
{$COOKIE_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 width="65%" class="table_heading">
<center>
{translate module=charge}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=charge}
field_date_orig
{/translate}
</td>
<td width="65%">
{ $list->calender_search("charge_date_orig", $VAR.charge_date_orig, "form_field", "") }
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_status
{/translate}
</td>
<td width="65%">
{ $list->bool("charge_status", "all", "form_menu") }
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_sweep_type
{/translate}
</td>
<td width="65%">
<select name="charge_sweep_type" >
<option value=""></option>
<option value="0" {if $VAR.charge_sweep_type == "0"}selected{/if}>Daily</option>
<option value="1" {if $VAR.charge_sweep_type == "1"}selected{/if}>Weekly</option>
<option value="2" {if $VAR.charge_sweep_type == "2"}selected{/if}>Monthly</option>
<option value="3" {if $VAR.charge_sweep_type == "3"}selected{/if}>Quarterly</option>
<option value="4" {if $VAR.charge_sweep_type == "4"}selected{/if}>Semi-anually</option>
<option value="5" {if $VAR.charge_sweep_type == "5"}selected{/if}>Anually</option>
<option value="6" {if $VAR.charge_sweep_type == "6"}selected{/if}>On
Service Rebill</option>
</select>
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_account_id
{/translate}
</td>
<td width="65%">
{html_select_account name="charge_account_id" default=$VAR.charge_account_id}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_product_id
{/translate}
</td>
<td width="65%">
{ $list->menu("", "charge_product_id", "product", "sku", "all", "form_menu") }
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_amount
{/translate}
</td>
<td width="65%">
<input type="text" name="charge_amount" value="{$VAR.charge_amount}" {if $charge_amount == true}class="form_field_error"{/if}>
&nbsp;&nbsp;
{translate}
search_partial
{/translate}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_quantity
{/translate}
</td>
<td width="65%">
<input type="text" name="charge_quantity" value="{$VAR.charge_quantity}" {if $charge_quantity == true}class="form_field_error"{/if} size="5">
&nbsp;&nbsp; </td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_taxable
{/translate}
</td>
<td width="65%">
{ $list->bool("charge_taxable", "all", "form_menu") }
</td>
</tr>
<tr class="row1" valign="top">
<td width="35%">
{translate module=charge}
field_attributes
{/translate}
</td>
<td width="65%">
<input type="text" name="item_attributes[0][0]" class=form_field size="16"> =
<input type="text" name="item_attributes[0][1]" class=form_field size="16"> <br>
<input type="text" name="item_attributes[1][0]" class=form_field size="16"> =
<input type="text" name="item_attributes[1][1]" class=form_field size="16"> <br>
<input type="text" name="item_attributes[2][0]" class=form_field size="16"> =
<input type="text" name="item_attributes[2][1]" class=form_field size="16"> <br>
<input type="text" name="item_attributes[3][0]" class=form_field size="16"> =
<input type="text" name="item_attributes[3][1]" class=form_field size="16"> <br>
<input type="text" name="item_attributes[4][0]" class=form_field size="16"> =
<input type="text" name="item_attributes[4][1]" class=form_field size="16"> <br>
<input type="text" name="item_attributes[5][0]" class=form_field size="16"> =
<input type="text" name="item_attributes[5][1]" class=form_field size="16">
</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="{$charge_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=$charge 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="charge">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
{ $block->display("core:saved_searches") }
{ $block->display("core:recent_searches") }
{/if}

View File

@@ -0,0 +1,142 @@
{$method->exe("charge","search_show")}
{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>
{literal}
<script language="JavaScript">
<!-- START
var module = 'charge';
{/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="9%" class="table_heading">&nbsp;</td>
<td width="23%" class="table_heading">
{literal}
<script language="JavaScript">
document.write(search_heading('{/literal}{translate module=charge}field_date_orig{/translate}{literal}','date_orig'));
</script>
{/literal}
</td>
<td width="22%" class="table_heading">
{literal}
<script language="JavaScript">
document.write(search_heading('{/literal}{translate module=charge}field_account_id{/translate}{literal}','account_id'));
</script>
{/literal}
</td>
<td width="23%" class="table_heading">
{literal}
<script language="JavaScript">
document.write(search_heading('{/literal}{translate module=charge}field_status{/translate}{literal}','status'));
</script>
{/literal}
</td>
<td width="23%" class="table_heading">
{literal}
<script language="JavaScript">
document.write(search_heading('{/literal}{translate module=charge}field_amount{/translate}{literal}','amount'));
</script>
{/literal}
</td>
<!-- LOOP THROUGH EACH RECORD -->
{foreach from=$charge item=record}
<tr id="row{$record.id}" onClick="row_sel('{$record.id}',1);" onDblClick="window.location='?_page=charge:view&id={$record.id},{$COOKIE_URL}';" 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="9%">
<input type="checkbox" name="record{$record.id}" value="{$record.id}" onClick="row_sel('{$record.id}',1,'{$record._C}');">
</td>
<td width="23%">&nbsp;
{$list->date_time($record.date_orig)}
</td>
<td width="22%">&nbsp;
{$record.account_id}
</td>
<td width="23%">&nbsp;
{if $record.status == "1"}
{translate}
true
{/translate}
{else}
{translate}
false
{/translate}
{/if}
</td>
<td width="23%">
<div align="right">&nbsp;
{$record.amount}
&nbsp; </div>
</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}{$COOKIE_URL}', 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>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td valign="middle" align="center">
<a href="#" onClick="NewWindow('ExportWin','toolbar=no,status=no,width=300,height=300','?_page=core:export_search&module=charge&_escape=1&search_id={$search_id}&page={$page}&order={$order}&sort={$sort}{$COOKIE_URL}');"><img src="themes/{$THEME_NAME}/images//icons/exp_32.gif" alt="{translate}search_export_image{/translate}" border="0"></a>
<a href="?_page=charge:search_show&_print=true&order_by={$order}&search_id={$search_id}&limit={$limit}&page={$page}{$COOKIE_URL}"><img src="themes/{$THEME_NAME}/images//icons/print_32.gif" border="0" alt="{translate}search_print_image{/translate}"></a>
<a href="?_page=charge:search_form{$COOKIE_URL}"><img src="themes/{$THEME_NAME}/images/icons/srch_32.gif" border="0" alt="{translate}search_new_image{/translate}"></a>
<a href="?_page=charge:add{$COOKIE_URL}"><img src="themes/{$THEME_NAME}/images/icons/add_32.gif" border="0" alt="{translate module=charge}title_add{/translate}"></a>
</td>
</tr>
</table>
</center>
{/if}
{/if}
</div>

View File

@@ -0,0 +1,208 @@
{ $method->exe("charge","view") } { if ($method->result == FALSE) } { $block->display("core:method_error") } {else}
{literal}
<!-- Define the update delete function -->
<script src="themes/{/literal}{$THEME_NAME}{literal}/view.js"></script>
<script language="JavaScript">
<!-- START
var module = 'charge';
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));
}
// Mass update, view, and delete controller
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}
<!-- Loop through each record -->
{foreach from=$charge item=charge} <a name="{$charge.id}"></a>
<!-- Display the field validation -->
{if $form_validation}
{ $block->display("core:alert_fields") }
{/if}
<!-- Display each record -->
<form id="charge_view" name="charge_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=charge}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="35%">
{translate module=charge}
field_date_orig
{/translate}</td>
<td width="65%">
{$list->date_time($charge.date_orig)}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_status
{/translate}</td>
<td width="65%">
{ $list->bool("charge_status", $charge.status, "onChange=\"submit()\"") }
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_sweep_type
{/translate}</td>
<td width="65%">
{if $charge.sweep_type == "0"}
Daily
{/if}
{if $charge.sweep_type == "1"}
Weekly
{/if}
{if $charge.sweep_type == "2"}
Monthly
{/if}
{if $charge.sweep_type == "3"}
Quarterly
{/if}
{if $charge.sweep_type == "4"}
Semi-Anually
{/if}
{if $charge.sweep_type == "5"}
Anually
{/if}
{if $charge.sweep_type == "6"}
On Service Rebill
{/if}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_account_id
{/translate}</td>
<td width="65%">
{html_select_account name="charge_account_id" default=$charge.account_id}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_product_id
{/translate}</td>
<td width="65%">
{$charge.product_id}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_service_id
{/translate}</td>
<td width="65%">
{$charge.service_id}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_amount
{/translate}</td>
<td width="65%">
<input type="text" name="charge_amount" value="{$charge.amount}" size="16">
{$list->currency_iso("")}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_quantity
{/translate}</td>
<td width="65%">
<input type="text" name="charge_quantity" value="{$charge.quantity}" size="3">
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_taxable
{/translate}</td>
<td width="65%">
{if $charge.taxable == "1"}{translate}true{/translate}{else}{translate}false{/translate}{/if}
</td>
</tr>
<tr valign="top">
<td width="35%">
{translate module=charge}
field_attributes
{/translate}</td>
<td width="65%">
{$charge.attributes|nl2br|replace:"==":" -> "}
</td>
</tr>
<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('{$charge.id}','{$VAR.id}');">
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<input type="hidden" name="_page" value="charge:view">
<input type="hidden" name="charge_id" value="{$charge.id}">
<input type="hidden" name="do[]" value="charge:update">
<input type="hidden" name="id" value="{$VAR.id}">
</form>
{/foreach}
{/if}