Moved all service tasks to minion

This commit is contained in:
Deon George
2013-07-07 00:00:10 +10:00
parent 0a0e149e56
commit 3ba7eea48d
7 changed files with 103 additions and 39 deletions

View File

@@ -0,0 +1,22 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Alert ADSL Traffic to Customers
*
* @package ADSL
* @category Tasks
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Task_Adsl_Trafficalert extends Task_Adsl_Trafficget {
protected function _execute(array $params) {
foreach ($this->_traffic_suppliers(TRUE) as $aso) {
if ($params['verbose'])
echo $aso->name."\n";
Service_Traffic_Adsl::instance($aso->name)->alert_traffic();
}
}
}
?>

View File

@@ -0,0 +1,22 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Charge ADSL Traffic to Customers
*
* @package ADSL
* @category Tasks
* @author Deon George
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
*/
class Task_Adsl_Trafficcharge extends Task_Adsl_Trafficget {
protected function _execute(array $params) {
foreach ($this->_traffic_suppliers(TRUE) as $aso) {
if ($params['verbose'])
echo $aso->name."\n";
Service_Traffic_Adsl::instance($aso->name)->charge_excess_traffic();
}
}
}
?>

View File

@@ -10,7 +10,7 @@
* @license http://dev.osbill.net/license.html
*/
class Task_Adsl_Trafficget extends Minion_Task {
private function _traffic_suppliers($active=FALSE) {
protected function _traffic_suppliers($active=FALSE) {
$suppliers = ORM::factory('ADSL_Supplier');
return $active ? $suppliers->list_active() : $suppliers->find_all();