Initial Commit of AgileBill Open Source
This commit is contained in:
128
modules/currency/currency.inc.php
Normal file
128
modules/currency/currency.inc.php
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AgileBill - Open Billing Software
|
||||
*
|
||||
* This body of work is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the Open AgileBill License
|
||||
* License as published at http://www.agileco.com/agilebill/license1-4.txt
|
||||
*
|
||||
* For questions, help, comments, discussion, etc., please join the
|
||||
* Agileco community forums at http://forum.agileco.com/
|
||||
*
|
||||
* @link http://www.agileco.com/
|
||||
* @copyright 2004-2008 Agileco, LLC.
|
||||
* @license http://www.agileco.com/agilebill/license1-4.txt
|
||||
* @author Tony Landis <tony@agileco.com>
|
||||
* @package AgileBill
|
||||
* @version 1.4.93
|
||||
*/
|
||||
|
||||
class currency
|
||||
{
|
||||
|
||||
# Open the constructor for this mod
|
||||
function currency()
|
||||
{
|
||||
# name of this module:
|
||||
$this->module = "currency";
|
||||
|
||||
# location of the construct XML file:
|
||||
$this->xml_construct = PATH_MODULES . "" . $this->module . "/" . $this->module . "_construct.xml";
|
||||
|
||||
# open the construct file for parsing
|
||||
$C_xml = new CORE_xml;
|
||||
$construct = $C_xml->xml_to_array($this->xml_construct);
|
||||
|
||||
$this->method = $construct["construct"]["method"];
|
||||
$this->trigger = $construct["construct"]["trigger"];
|
||||
$this->field = $construct["construct"]["field"];
|
||||
$this->table = $construct["construct"]["table"];
|
||||
$this->module = $construct["construct"]["module"];
|
||||
$this->cache = $construct["construct"]["cache"];
|
||||
$this->order_by = $construct["construct"]["order_by"];
|
||||
$this->limit = $construct["construct"]["limit"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
## ADD ##
|
||||
##############################
|
||||
function add($VAR)
|
||||
{
|
||||
$type = "add";
|
||||
$this->method["$type"] = split(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->add($VAR, $this, $type);
|
||||
}
|
||||
|
||||
##############################
|
||||
## VIEW ##
|
||||
##############################
|
||||
function view($VAR)
|
||||
{
|
||||
$type = "view";
|
||||
$this->method["$type"] = split(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->view($VAR, $this, $type);
|
||||
}
|
||||
|
||||
##############################
|
||||
## UPDATE ##
|
||||
##############################
|
||||
function update($VAR)
|
||||
{
|
||||
$type = "update";
|
||||
$this->method["$type"] = split(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->update($VAR, $this, $type);
|
||||
}
|
||||
|
||||
##############################
|
||||
## DELETE ##
|
||||
##############################
|
||||
function delete($VAR)
|
||||
{
|
||||
# this function removed in v1.4.2
|
||||
return false;
|
||||
|
||||
$db = new CORE_database;
|
||||
$db->mass_delete($VAR, $this, "");
|
||||
}
|
||||
|
||||
##############################
|
||||
## SEARCH FORM ##
|
||||
##############################
|
||||
function search_form($VAR)
|
||||
{
|
||||
$type = "search";
|
||||
$this->method["$type"] = split(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->search_form($VAR, $this, $type);
|
||||
}
|
||||
|
||||
##############################
|
||||
## SEARCH ##
|
||||
##############################
|
||||
function search($VAR)
|
||||
{
|
||||
$type = "search";
|
||||
$this->method["$type"] = split(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->search($VAR, $this, $type);
|
||||
}
|
||||
|
||||
##############################
|
||||
## SEARCH SHOW ##
|
||||
##############################
|
||||
|
||||
function search_show($VAR)
|
||||
{
|
||||
$type = "search";
|
||||
$this->method["$type"] = split(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->search_show($VAR, $this, $type);
|
||||
}
|
||||
}
|
||||
?>
|
68
modules/currency/currency_construct.xml
Normal file
68
modules/currency/currency_construct.xml
Normal file
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<construct>
|
||||
<!-- define the module name -->
|
||||
<module>currency</module>
|
||||
<!-- define the module table name -->
|
||||
<table>currency</table>
|
||||
<!-- define the module dependancy(s) -->
|
||||
<dependancy/>
|
||||
<!-- define the DB cache in seconds -->
|
||||
<cache>0</cache>
|
||||
<!-- define the default order_by field for SQL queries -->
|
||||
<order_by>name</order_by>
|
||||
<!-- define the methods -->
|
||||
<limit>25</limit>
|
||||
<!-- define the fields -->
|
||||
<field>
|
||||
<id>
|
||||
<type>I4</type>
|
||||
<unique>1</unique>
|
||||
<index>1</index>
|
||||
</id>
|
||||
<site_id>
|
||||
<type>I4</type>
|
||||
<index>1</index>
|
||||
</site_id>
|
||||
<name>
|
||||
<type>C(128)</type>
|
||||
<min_len>1</min_len>
|
||||
<max_len>128</max_len>
|
||||
<validate>any</validate>
|
||||
<unique>1</unique>
|
||||
</name>
|
||||
<status>
|
||||
<type>L</type>
|
||||
</status>
|
||||
<convert_array>
|
||||
<type>X2</type>
|
||||
<convert>array</convert>
|
||||
</convert_array>
|
||||
<notes>
|
||||
<type>C2(128)</type>
|
||||
</notes>
|
||||
<symbol>
|
||||
<type>C(16)</type>
|
||||
<min_len>1</min_len>
|
||||
<max_len>16</max_len>
|
||||
<validate>any</validate>
|
||||
</symbol>
|
||||
<three_digit>
|
||||
<type>C(3)</type>
|
||||
<min_len>3</min_len>
|
||||
<max_len>3</max_len>
|
||||
<validate>any</validate>
|
||||
<unique>1</unique>
|
||||
</three_digit>
|
||||
</field>
|
||||
<!-- define all the methods for this class, and the fields they have access to, if applicable. -->
|
||||
<method>
|
||||
<add>id,site_id,name,convert_array,status,notes,symbol,three_digit</add>
|
||||
<update>id,site_id,name,convert_array,status,notes,symbol,three_digit</update>
|
||||
<delete>id,site_id,name,convert_array,status,notes,symbol,three_digit</delete>
|
||||
<view>id,site_id,name,convert_array,status,notes,symbol,three_digit</view>
|
||||
<search>id,site_id,name,convert_array,status,notes,symbol,three_digit</search>
|
||||
<list>id,site_id,name,convert_array,status,notes,symbol,three_digit</list>
|
||||
</method>
|
||||
<!-- define the method triggers -->
|
||||
<trigger>0</trigger>
|
||||
</construct>
|
36
modules/currency/currency_install.xml
Normal file
36
modules/currency/currency_install.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<install>
|
||||
<module_properties>
|
||||
<name>currency</name>
|
||||
<parent>setup</parent>
|
||||
<notes><![CDATA[Administer the available currencies]]></notes>
|
||||
<menu_display>1</menu_display>
|
||||
</module_properties>
|
||||
<sql_inserts>
|
||||
<module_method>
|
||||
<search>
|
||||
<name>search</name>
|
||||
</search>
|
||||
<view>
|
||||
<name>view</name>
|
||||
<notes><![CDATA[Allow users to view records]]></notes>
|
||||
<page><![CDATA[core:search&module=%%&_escape=1&_next_page_one=view]]></page>
|
||||
<menu_display>1</menu_display>
|
||||
</view>
|
||||
<add>
|
||||
<name>add</name>
|
||||
<notes><![CDATA[Allow users to add records]]></notes>
|
||||
<menu_display>1</menu_display>
|
||||
</add>
|
||||
<delete>
|
||||
<name>delete</name>
|
||||
</delete>
|
||||
<update>
|
||||
<name>update</name>
|
||||
</update>
|
||||
<search_show>
|
||||
<name>search_show</name>
|
||||
<notes><![CDATA[Allow users to view the search results]]></notes>
|
||||
</search_show>
|
||||
</module_method>
|
||||
</sql_inserts>
|
||||
</install>
|
128
modules/currency/currency_install_data.xml
Normal file
128
modules/currency/currency_install_data.xml
Normal file
@@ -0,0 +1,128 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<install>
|
||||
<currency>
|
||||
<id>1</id>
|
||||
<site_id>1</site_id>
|
||||
<name>United States Dollars</name>
|
||||
<status>1</status>
|
||||
<convert_array><![CDATA[a:1:{i:1;a:2:{s:4:"rate";s:1:"1";s:3:"iso";s:3:"USD";}}]]></convert_array>
|
||||
<notes>Notes</notes>
|
||||
<symbol>$</symbol>
|
||||
<three_digit>USD</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>3</id>
|
||||
<site_id>1</site_id>
|
||||
<name>Japanese Yen</name>
|
||||
<status>0</status>
|
||||
<convert_array><![CDATA[a:3:{i:3;a:2:{s:4:"rate";s:1:"1";s:3:"iso";s:3:"JPY";}i:4;a:2:{s:4:"rate";s:0:"";s:3:"iso";s:3:"GBP";}i:1;a:2:{s:4:"rate";s:0:"";s:3:"iso";s:3:"USD";}}]]></convert_array>
|
||||
<symbol><EFBFBD></symbol>
|
||||
<three_digit>JPY</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>4</id>
|
||||
<site_id>1</site_id>
|
||||
<name>United Kingdom Pounds</name>
|
||||
<status>0</status>
|
||||
<convert_array><![CDATA[a:2:{i:4;a:2:{s:4:"rate";s:1:"1";s:3:"iso";s:3:"GBP";}i:1;a:2:{s:4:"rate";s:0:"";s:3:"iso";s:3:"USD";}}]]></convert_array>
|
||||
<symbol><EFBFBD></symbol>
|
||||
<three_digit>GBP</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>5</id>
|
||||
<site_id>1</site_id>
|
||||
<name>Canada Dollars</name>
|
||||
<status>0</status>
|
||||
<convert_array><![CDATA[a:5:{i:5;a:2:{s:4:"rate";s:1:"1";s:3:"iso";s:3:"CAD";}i:16;a:2:{s:4:"rate";s:0:"";s:3:"iso";s:3:"EUR";}i:3;a:2:{s:4:"rate";s:0:"";s:3:"iso";s:3:"JPY";}i:4;a:2:{s:4:"rate";s:0:"";s:3:"iso";s:3:"GBP";}i:1;a:2:{s:4:"rate";s:0:"";s:3:"iso";s:3:"USD";}}]]></convert_array>
|
||||
<symbol>$</symbol>
|
||||
<three_digit>CAD</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>6</id>
|
||||
<site_id>1</site_id>
|
||||
<name>Australia Dollars</name>
|
||||
<status>0</status>
|
||||
<convert_array><![CDATA[a:2:{i:6;a:2:{s:4:"rate";s:1:"1";s:3:"iso";s:3:"AUD";}i:1;a:2:{s:4:"rate";s:0:"";s:3:"iso";s:3:"USD";}}]]></convert_array>
|
||||
<symbol>$</symbol>
|
||||
<three_digit>AUD</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>7</id>
|
||||
<site_id>1</site_id>
|
||||
<name>Switzerland Francs</name>
|
||||
<symbol>$</symbol>
|
||||
<three_digit>CHF</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>8</id>
|
||||
<site_id>1</site_id>
|
||||
<name>Denmark Kroner</name>
|
||||
<status>0</status>
|
||||
<convert_array><![CDATA[a:7:{i:8;a:2:{s:4:"rate";s:1:"1";s:3:"iso";s:3:"DKK";}i:6;a:2:{s:4:"rate";s:7:".236179";s:3:"iso";s:3:"AUD";}i:5;a:2:{s:4:"rate";s:7:".222175";s:3:"iso";s:3:"CAD";}i:16;a:2:{s:4:"rate";s:7:".134471";s:3:"iso";s:3:"EUR";}i:3;a:2:{s:4:"rate";s:7:"17.9572";s:3:"iso";s:3:"JPY";}i:4;a:2:{s:4:"rate";s:8:".0896697";s:3:"iso";s:3:"GBP";}i:1;a:2:{s:4:"rate";s:7:".164627";s:3:"iso";s:3:"USD";}}]]></convert_array>
|
||||
<symbol><EFBFBD></symbol>
|
||||
<three_digit>DKK</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>9</id>
|
||||
<site_id>1</site_id>
|
||||
<name>Hong Kong Dollars</name>
|
||||
<symbol>$</symbol>
|
||||
<three_digit>HKD</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>10</id>
|
||||
<site_id>1</site_id>
|
||||
<name>Norway Kroner</name>
|
||||
<symbol><EFBFBD></symbol>
|
||||
<three_digit>NOK</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>11</id>
|
||||
<site_id>1</site_id>
|
||||
<name>Sweden Kroner</name>
|
||||
<symbol><EFBFBD></symbol>
|
||||
<three_digit>SEK</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>12</id>
|
||||
<site_id>1</site_id>
|
||||
<name>New Zealand Dollars</name>
|
||||
<symbol>$</symbol>
|
||||
<three_digit>NZD</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>13</id>
|
||||
<site_id>1</site_id>
|
||||
<name>Russian Rubles</name>
|
||||
<symbol>$</symbol>
|
||||
<three_digit>RUR</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>14</id>
|
||||
<site_id>1</site_id>
|
||||
<name>South Africa Rand</name>
|
||||
<symbol>$</symbol>
|
||||
<three_digit>ZAR</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>15</id>
|
||||
<site_id>1</site_id>
|
||||
<name>Mexican Pesos</name>
|
||||
<status>0</status>
|
||||
<convert_array><![CDATA[a:14:{i:6;s:0:"";i:5;s:0:"";i:8;s:0:"";i:2;s:0:"";i:9;s:0:"";i:3;s:0:"";i:15;s:0:"";i:12;s:0:"";i:10;s:0:"";i:13;s:0:"";i:14;s:0:"";i:11;s:0:"";i:7;s:0:"";i:4;s:0:"";}]]></convert_array>
|
||||
<symbol>$</symbol>
|
||||
<three_digit>MXN</three_digit>
|
||||
</currency>
|
||||
<currency>
|
||||
<id>16</id>
|
||||
<site_id>1</site_id>
|
||||
<name>Euro</name>
|
||||
<status>0</status>
|
||||
<convert_array><![CDATA[a:2:{i:16;a:2:{s:4:"rate";s:1:"1";s:3:"iso";s:3:"EUR";}i:1;a:2:{s:4:"rate";s:7:"1.20636";s:3:"iso";s:3:"USD";}}]]></convert_array>
|
||||
<symbol><EFBFBD></symbol>
|
||||
<three_digit>EUR</three_digit>
|
||||
</currency>
|
||||
<currency_id>
|
||||
<id>16</id>
|
||||
</currency_id>
|
||||
</install>
|
Reference in New Issue
Block a user