Changes to AgileBill
This commit is contained in:
@@ -1,58 +1,57 @@
|
||||
<?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 Core
|
||||
*/
|
||||
|
||||
class CORE_trigger
|
||||
{
|
||||
function trigger($trigger, $type, $VAR)
|
||||
{
|
||||
if($type)
|
||||
{
|
||||
# do success trigger(s)
|
||||
if(isset($trigger["success"]))
|
||||
$this->run_triggers($trigger["success"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
# do failure trigger(s)
|
||||
if(isset($trigger["failure"]))
|
||||
$this->run_triggers($trigger["failure"]);
|
||||
}
|
||||
}
|
||||
|
||||
# run the trigger(s):
|
||||
function run_triggers($trigger)
|
||||
{
|
||||
global $C_method;
|
||||
$triggers = explode(',', $trigger);
|
||||
for($i=0; $i<count($triggers); $i++)
|
||||
{
|
||||
if(isset($triggers[$i]))
|
||||
{
|
||||
$triggerss = explode(':',$triggers[$i]);
|
||||
# added to remove php error: Undefined offset
|
||||
if(isset($triggerss) && count($triggerss) > 1)
|
||||
{
|
||||
$C_method->exe($triggerss[0], $triggerss[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The main AgileBill CORE Trigger Class
|
||||
*
|
||||
* @package AgileBill
|
||||
* @subpackage Core
|
||||
*/
|
||||
class CORE_trigger {
|
||||
public function trigger($trigger,$type,$VAR) {
|
||||
if ($type) {
|
||||
# Do success trigger(s)
|
||||
if (isset($trigger['success']))
|
||||
$this->run_triggers($trigger['success']);
|
||||
|
||||
} else {
|
||||
# Do failure trigger(s)
|
||||
if (isset($trigger['failure']))
|
||||
$this->run_triggers($trigger['failure']);
|
||||
}
|
||||
}
|
||||
|
||||
# Run the trigger(s):
|
||||
private function run_triggers($trigger) {
|
||||
global $C_method;
|
||||
|
||||
foreach (explode(',',$trigger) as $details) {
|
||||
$tss = explode(':',$details);
|
||||
|
||||
if (count($tss)==2)
|
||||
$C_method->exe($tss[0],$tss[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user