Changes to AgileBill
This commit is contained in:
@@ -18,37 +18,8 @@
|
||||
* @version 1.4.93
|
||||
*/
|
||||
|
||||
class affiliate
|
||||
{
|
||||
# Open the constructor for this mod
|
||||
function affiliate()
|
||||
{
|
||||
# name of affiliate id prefix
|
||||
$this->id_prefix = 'AB-';
|
||||
|
||||
# name of this module:
|
||||
$this->module = "affiliate";
|
||||
|
||||
if(!defined('AJAX'))
|
||||
{
|
||||
# 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"];
|
||||
}
|
||||
}
|
||||
|
||||
class affiliate extends OSB_module {
|
||||
private $id_prefix = 'AB-';
|
||||
|
||||
###########################################
|
||||
### AJAX Auto-selector
|
||||
@@ -858,8 +829,7 @@ class affiliate
|
||||
##############################
|
||||
## VIEW ##
|
||||
##############################
|
||||
function view($VAR)
|
||||
{
|
||||
function view($VAR) {
|
||||
$type = "view";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
|
||||
@@ -1007,11 +977,8 @@ class affiliate
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
global $smarty;
|
||||
$smarty->assign($this->table, $smart);
|
||||
$smarty->assign('record', array_pop($smart));
|
||||
$smarty->assign('plugin_data', $plugin_data);
|
||||
$smarty->assign('results', $search->results);
|
||||
}
|
||||
@@ -1239,23 +1206,10 @@ class affiliate
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
##############################
|
||||
## SEARCH FORM ##
|
||||
##############################
|
||||
function search_form($VAR)
|
||||
{
|
||||
$type = "search";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->search_form($VAR, $this, $type);
|
||||
}
|
||||
|
||||
##############################
|
||||
## SEARCH ##
|
||||
##############################
|
||||
function search($VAR)
|
||||
function xsearch($VAR)
|
||||
{
|
||||
$type = "search";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
@@ -1549,7 +1503,7 @@ class affiliate
|
||||
## SEARCH SHOW ##
|
||||
##############################
|
||||
|
||||
function search_show($VAR)
|
||||
function xsearch_show($VAR)
|
||||
{
|
||||
$type = "search";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
@@ -1803,4 +1757,4 @@ class affiliate
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
@@ -1,104 +1,155 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<construct>
|
||||
<!-- define the module name -->
|
||||
<module>affiliate</module>
|
||||
<!-- define the module table name -->
|
||||
<table>affiliate</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>id</order_by>
|
||||
<!-- define the methods -->
|
||||
<limit>25</limit>
|
||||
<!-- define database indexes -->
|
||||
<index>
|
||||
<account>account_id</account>
|
||||
<parent>parent_affiliate_id</parent>
|
||||
</index>
|
||||
<!-- define the fields -->
|
||||
<field>
|
||||
<id>
|
||||
<type>C(32)</type>
|
||||
<unique>1</unique>
|
||||
<index>1</index>
|
||||
</id>
|
||||
<site_id>
|
||||
<type>I4</type>
|
||||
<index>1</index>
|
||||
</site_id>
|
||||
<date_orig>
|
||||
<type>I8</type>
|
||||
<convert>date-time</convert>
|
||||
</date_orig>
|
||||
<date_last>
|
||||
<type>I8</type>
|
||||
<validate>any</validate>
|
||||
<convert>date-now</convert>
|
||||
</date_last>
|
||||
<status>
|
||||
<type>L</type>
|
||||
</status>
|
||||
<account_id>
|
||||
<type>I8</type>
|
||||
<validate>any</validate>
|
||||
</account_id>
|
||||
<avail_campaign_id>
|
||||
<type>X2</type>
|
||||
<convert>array</convert>
|
||||
</avail_campaign_id>
|
||||
<affiliate_plugin>
|
||||
<type>C(32)</type>
|
||||
</affiliate_plugin>
|
||||
<parent_affiliate_id>
|
||||
<type>C(16)</type>
|
||||
<asso_table>affiliate</asso_table>
|
||||
<asso_field>id</asso_field>
|
||||
</parent_affiliate_id>
|
||||
<max_tiers>
|
||||
<type>I4</type>
|
||||
</max_tiers>
|
||||
<commission_minimum>
|
||||
<type>F</type>
|
||||
</commission_minimum>
|
||||
<new_commission_type>
|
||||
<type>L</type>
|
||||
</new_commission_type>
|
||||
<new_commission_rate>
|
||||
<type>X2</type>
|
||||
<convert>array</convert>
|
||||
</new_commission_rate>
|
||||
<recurr_commission_type>
|
||||
<type>L</type>
|
||||
</recurr_commission_type>
|
||||
<recurr_commission_rate>
|
||||
<type>X2</type>
|
||||
<convert>array</convert>
|
||||
</recurr_commission_rate>
|
||||
<recurr_max_commission_periods>
|
||||
<type>I4</type>
|
||||
</recurr_max_commission_periods>
|
||||
<plugin_data>
|
||||
<type>X2</type>
|
||||
<convert>array</convert>
|
||||
</plugin_data>
|
||||
</field>
|
||||
<!-- define all the methods for this class, and the fields they have access to, if applicable. -->
|
||||
<method>
|
||||
<add>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods,plugin_data</add>
|
||||
<update>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods,plugin_data</update>
|
||||
<delete>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods,plugin_data</delete>
|
||||
<view>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods,plugin_data</view>
|
||||
<search>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods,plugin_data</search>
|
||||
<user_update>date_last,affiliate_plugin,plugin_data</user_update>
|
||||
<search_export>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods</search_export>
|
||||
<export_excel>id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods</export_excel>
|
||||
<export_pdf>id,date_orig,date_last,status,account_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,recurr_commission_type,recurr_max_commission_periods</export_pdf>
|
||||
<export_csv>id,date_orig,date_last,status,account_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,recurr_commission_type,recurr_max_commission_periods</export_csv>
|
||||
<export_tab>id,date_orig,date_last,status,account_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,recurr_commission_type,recurr_max_commission_periods</export_tab>
|
||||
<export_xml>id,date_orig,date_last,status,account_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,recurr_commission_type,recurr_max_commission_periods</export_xml>
|
||||
</method>
|
||||
<!-- define the method triggers -->
|
||||
<trigger>0</trigger>
|
||||
<!-- Module name -->
|
||||
<module>affiliate</module>
|
||||
<!-- Module supporting database table -->
|
||||
<table>affiliate</table>
|
||||
<!-- Module dependancy(s) (module wont install if these modules are not yet installed) -->
|
||||
<dependancy></dependancy>
|
||||
<!-- DB cache in seconds -->
|
||||
<cache>0</cache>
|
||||
<!-- Default order_by field for SQL queries -->
|
||||
<order_by>id</order_by>
|
||||
<!-- Default SQL limit for SQL queries -->
|
||||
<limit>25</limit>
|
||||
<!-- Schema version (used to determine if the schema has change during upgrades) -->
|
||||
<version>0</version>
|
||||
|
||||
<!-- Database indexes -->
|
||||
<index>
|
||||
<account>account_id</account>
|
||||
<parent>parent_affiliate_id</parent>
|
||||
</index>
|
||||
|
||||
<!-- Database fields -->
|
||||
<field>
|
||||
<!-- Record ID -->
|
||||
<id>
|
||||
<index>1</index>
|
||||
<type>C(32)</type>
|
||||
<unique>1</unique>
|
||||
</id>
|
||||
<!-- Site ID -->
|
||||
<site_id>
|
||||
<index>1</index>
|
||||
<type>I4</type>
|
||||
</site_id>
|
||||
<!-- Date record created -->
|
||||
<date_orig>
|
||||
<convert>date-now</convert>
|
||||
<display>Date Created</display>
|
||||
<type>I8</type>
|
||||
</date_orig>
|
||||
<!-- Date record updated -->
|
||||
<date_last>
|
||||
<convert>date-now</convert>
|
||||
<display>Date Updated</display>
|
||||
<type>I8</type>
|
||||
</date_last>
|
||||
<!-- Record active (BOOL)-->
|
||||
<status>
|
||||
<display>Active</display>
|
||||
<type>L</type>
|
||||
</status>
|
||||
<account_id>
|
||||
<type>I8</type>
|
||||
<validate>any</validate>
|
||||
</account_id>
|
||||
<avail_campaign_id>
|
||||
<type>X2</type>
|
||||
<convert>array</convert>
|
||||
</avail_campaign_id>
|
||||
<affiliate_plugin>
|
||||
<type>C(32)</type>
|
||||
</affiliate_plugin>
|
||||
<parent_affiliate_id>
|
||||
<type>C(16)</type>
|
||||
<asso_table>affiliate</asso_table>
|
||||
<asso_field>id</asso_field>
|
||||
</parent_affiliate_id>
|
||||
<max_tiers>
|
||||
<type>I4</type>
|
||||
</max_tiers>
|
||||
<commission_minimum>
|
||||
<type>F</type>
|
||||
</commission_minimum>
|
||||
<new_commission_type>
|
||||
<type>L</type>
|
||||
</new_commission_type>
|
||||
<new_commission_rate>
|
||||
<type>X2</type>
|
||||
<convert>array</convert>
|
||||
</new_commission_rate>
|
||||
<recurr_commission_type>
|
||||
<type>L</type>
|
||||
</recurr_commission_type>
|
||||
<recurr_commission_rate>
|
||||
<type>X2</type>
|
||||
<convert>array</convert>
|
||||
</recurr_commission_rate>
|
||||
<recurr_max_commission_periods>
|
||||
<type>I4</type>
|
||||
</recurr_max_commission_periods>
|
||||
<plugin_data>
|
||||
<type>X2</type>
|
||||
<convert>array</convert>
|
||||
</plugin_data>
|
||||
</field>
|
||||
|
||||
<!-- Methods for this class, and the fields they have access to, if applicable -->
|
||||
<method>
|
||||
<add>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods,plugin_data</add>
|
||||
<update>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods,plugin_data</update>
|
||||
<delete>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods,plugin_data</delete>
|
||||
<view>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods,plugin_data</view>
|
||||
<search>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods,plugin_data</search>
|
||||
<user_update>date_last,affiliate_plugin,plugin_data</user_update>
|
||||
<search_export>id,site_id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods</search_export>
|
||||
<export_excel>id,date_orig,date_last,status,account_id,avail_campaign_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,new_commission_rate,recurr_commission_type,recurr_commission_rate,recurr_max_commission_periods</export_excel>
|
||||
<export_pdf>id,date_orig,date_last,status,account_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,recurr_commission_type,recurr_max_commission_periods</export_pdf>
|
||||
<export_csv>id,date_orig,date_last,status,account_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,recurr_commission_type,recurr_max_commission_periods</export_csv>
|
||||
<export_tab>id,date_orig,date_last,status,account_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,recurr_commission_type,recurr_max_commission_periods</export_tab>
|
||||
<export_xml>id,date_orig,date_last,status,account_id,affiliate_plugin,parent_affiliate_id,max_tiers,commission_minimum,new_commission_type,recurr_commission_type,recurr_max_commission_periods</export_xml>
|
||||
</method>
|
||||
|
||||
<!-- Method triggers -->
|
||||
<trigger></trigger>
|
||||
|
||||
<!-- Template page display titles -->
|
||||
<title>
|
||||
<new_tier_iframe>Commissions New Charges</new_tier_iframe>
|
||||
<recurr_tier_iframe>Commissions Recurring Charges</recurr_tier_iframe>
|
||||
</title>
|
||||
|
||||
<!-- Template helpers -->
|
||||
<tpl>
|
||||
<search_show>
|
||||
<checkbox>
|
||||
<field>id</field>
|
||||
<type>checkbox</type>
|
||||
<width>25px</width>
|
||||
</checkbox>
|
||||
<id>
|
||||
<field>id</field>
|
||||
</id>
|
||||
<sessions>
|
||||
<field>sessions</field>
|
||||
</sessions>
|
||||
<accounts>
|
||||
<field>accounts</field>
|
||||
</accounts>
|
||||
<invoices>
|
||||
<field>invoices</field>
|
||||
</invoices>
|
||||
<commissions>
|
||||
<field>commissions</field>
|
||||
</commissions>
|
||||
<status>
|
||||
<field>status</field>
|
||||
<width>20px</width>
|
||||
</status>
|
||||
<icon>
|
||||
</icon>
|
||||
</search_show>
|
||||
</tpl>
|
||||
</construct>
|
||||
|
@@ -1,49 +1,68 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<install>
|
||||
<!-- Tree Menu Module Properties -->
|
||||
<module_properties>
|
||||
<name>affiliate</name>
|
||||
<parent>affiliate</parent>
|
||||
<notes><![CDATA[This module controls the various affiliate accounts and settings, commissions, etc.]]></notes>
|
||||
<!-- MODULE Dependancy, this module wont be installed if the dependant modules dont exist -->
|
||||
<dependancy></dependancy>
|
||||
<!-- Translated display to use on the tree -->
|
||||
<display>Affiliates</display>
|
||||
<!-- Display a module in the menu tree -->
|
||||
<menu_display>1</menu_display>
|
||||
<!-- MODULE Name -->
|
||||
<name>affiliate</name>
|
||||
<!-- MODULE Notes, these notes show up in the modules table, as a description of the module -->
|
||||
<notes><![CDATA[This module controls the various affiliate accounts and settings, commissions, etc.]]></notes>
|
||||
<!-- MODULE Parent, the parent node in the tree -->
|
||||
<parent>account</parent>
|
||||
<!-- SUB Modules to install with this one -->
|
||||
<sub_modules>affiliate_commission,affiliate_template,campaign</sub_modules>
|
||||
<!-- MODULE Type (core|base), core modules cannot be deleted, unrecognised types are ignored. -->
|
||||
<type></type>
|
||||
</module_properties>
|
||||
<sql_inserts>
|
||||
<module_method>
|
||||
<search_form>
|
||||
<name>search_form</name>
|
||||
</search_form>
|
||||
<search_show>
|
||||
<name>search_show</name>
|
||||
</search_show>
|
||||
<search>
|
||||
<name>search</name>
|
||||
<page><![CDATA[%%:search_form]]></page>
|
||||
<menu_display>1</menu_display>
|
||||
</search>
|
||||
<view>
|
||||
<name>view</name>
|
||||
<page><![CDATA[core:search&module=%%&_escape=1&_page_next_one=view]]></page>
|
||||
<menu_display>1</menu_display>
|
||||
</view>
|
||||
<delete>
|
||||
<name>delete</name>
|
||||
</delete>
|
||||
<update>
|
||||
<name>update</name>
|
||||
</update>
|
||||
<add>
|
||||
<name>add</name>
|
||||
<page><![CDATA[%%:add]]></page>
|
||||
<menu_display>1</menu_display>
|
||||
</add>
|
||||
<search_export>
|
||||
<name>search_export</name>
|
||||
</search_export>
|
||||
<mail_multi>
|
||||
<name>mail_multi</name>
|
||||
</mail_multi>
|
||||
<autoselect>
|
||||
<name>autoselect</name>
|
||||
</autoselect>
|
||||
</module_method>
|
||||
</sql_inserts>
|
||||
</install>
|
||||
|
||||
<!-- Tree Menu & Module Methods to load, they will be assigned the group permissions on install time, as selected by the user. -->
|
||||
<module_method>
|
||||
<add>
|
||||
<display>Add</display>
|
||||
<menu_display>1</menu_display>
|
||||
<name>add</name>
|
||||
<notes><![CDATA[Add records]]></notes>
|
||||
</add>
|
||||
<delete>
|
||||
<name>delete</name>
|
||||
<notes><![CDATA[Delete records]]></notes>
|
||||
</delete>
|
||||
<search>
|
||||
<display>List</display>
|
||||
<menu_display>1</menu_display>
|
||||
<name>search</name>
|
||||
<notes><![CDATA[List records]]></notes>
|
||||
<page><![CDATA[core:search&module=%%&_next_page_one=view]]></page>
|
||||
</search>
|
||||
<search_form>
|
||||
<name>search_form</name>
|
||||
<notes><![CDATA[Search for records]]></notes>
|
||||
</search_form>
|
||||
<search_show>
|
||||
<name>search_show</name>
|
||||
<notes><![CDATA[Show the results of a search]]></notes>
|
||||
</search_show>
|
||||
<update>
|
||||
<name>update</name>
|
||||
<notes><![CDATA[Update a record]]></notes>
|
||||
</update>
|
||||
<view>
|
||||
<name>view</name>
|
||||
<notes><![CDATA[View a record]]></notes>
|
||||
</view>
|
||||
<search_export>
|
||||
<name>search_export</name>
|
||||
</search_export>
|
||||
<mail_multi>
|
||||
<name>mail_multi</name>
|
||||
</mail_multi>
|
||||
<autoselect>
|
||||
<name>autoselect</name>
|
||||
</autoselect>
|
||||
</module_method>
|
||||
</install>
|
||||
|
Reference in New Issue
Block a user