Changes to AgileBill
This commit is contained in:
@@ -1,25 +1,34 @@
|
||||
<?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/
|
||||
*
|
||||
* Originally authored by Tony Landis, AgileBill LLC
|
||||
*
|
||||
* Recent modifications by Deon George
|
||||
*
|
||||
* @author Deon George <deonATleenooksDOTnet>
|
||||
* @copyright 2009 Deon George
|
||||
* @link http://osb.leenooks.net
|
||||
*
|
||||
* @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>
|
||||
* @author Tony Landis <tony@agileco.com>
|
||||
* @package AgileBill
|
||||
* @version 1.4.93
|
||||
* @subpackage Module:Discount
|
||||
*/
|
||||
|
||||
class discount
|
||||
{
|
||||
|
||||
/**
|
||||
* The main AgileBill Discount Class
|
||||
*
|
||||
* @package AgileBill
|
||||
* @subpackage Module:Discount
|
||||
*/
|
||||
class discount extends OSB_module {
|
||||
/**
|
||||
* array of available discounts
|
||||
*
|
||||
@@ -48,13 +57,6 @@ class discount
|
||||
*/
|
||||
var $plugins=false;
|
||||
|
||||
/**
|
||||
* Setup the discount plugin array if needed
|
||||
*/
|
||||
function discount() {
|
||||
// $this->plugins = array('test');
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a specific discount plugin and validate the results
|
||||
*
|
||||
@@ -358,22 +360,6 @@ class discount
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function discount_construct() {
|
||||
$this->module = "discount";
|
||||
$this->xml_construct = PATH_MODULES . "" . $this->module . "/" . $this->module . "_construct.xml";
|
||||
$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"];
|
||||
}
|
||||
|
||||
function user_search($VAR) {
|
||||
# Lock the user only for his billing_records:
|
||||
if(!SESS_LOGGED) {
|
||||
@@ -381,7 +367,6 @@ class discount
|
||||
}
|
||||
# Lock the account_id
|
||||
$VAR['discount_avail_account_id'] = SESS_ACCOUNT;
|
||||
$this->discount_construct();
|
||||
$type = "search";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
@@ -393,61 +378,13 @@ class discount
|
||||
if(!SESS_LOGGED) {
|
||||
return false;
|
||||
}
|
||||
$this->discount_construct();
|
||||
$type = "search";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->search_show($VAR, $this, $type);
|
||||
}
|
||||
|
||||
function add($VAR) {
|
||||
$this->discount_construct();
|
||||
$type = "add";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->add($VAR, $this, $type);
|
||||
}
|
||||
|
||||
function view($VAR) {
|
||||
$this->discount_construct();
|
||||
$type = "view";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->view($VAR, $this, $type);
|
||||
}
|
||||
|
||||
function update($VAR) {
|
||||
$this->discount_construct();
|
||||
$type = "update";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->update($VAR, $this, $type);
|
||||
}
|
||||
|
||||
function delete($VAR) {
|
||||
$this->discount_construct();
|
||||
$db = new CORE_database;
|
||||
$db->mass_delete($VAR, $this, "");
|
||||
}
|
||||
|
||||
function search_form($VAR) {
|
||||
$this->discount_construct();
|
||||
$type = "search";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->search_form($VAR, $this, $type);
|
||||
}
|
||||
|
||||
function search($VAR) {
|
||||
$this->discount_construct();
|
||||
$type = "search";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$db = new CORE_database;
|
||||
$db->search($VAR, $this, $type);
|
||||
}
|
||||
|
||||
function search_show($VAR) {
|
||||
$this->discount_construct();
|
||||
$type = "search";
|
||||
$this->method["$type"] = explode(",", $this->method["$type"]);
|
||||
$dbc = new CORE_database;
|
||||
@@ -477,4 +414,4 @@ class discount
|
||||
$smarty->assign('discount', $smart);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user