Overhaul ADSL traffic reporting/graphing
This commit is contained in:
@@ -13,33 +13,39 @@ abstract class Model_Service_Plugin extends ORM_OSB {
|
||||
// Reset any sorting that may be defined in our parent
|
||||
protected $_sorting = array();
|
||||
|
||||
/**
|
||||
* Our service name as defined in the DB
|
||||
*/
|
||||
abstract public function name();
|
||||
|
||||
/**
|
||||
* When does our service expire
|
||||
*/
|
||||
abstract public function expire();
|
||||
|
||||
/**
|
||||
* Show our service name as defined in the DB with product suffix.
|
||||
* Our service name as defined in the DB
|
||||
*/
|
||||
public function service_name() {
|
||||
return sprintf('%s - %s',$this->service->product->title(),$this->name());
|
||||
}
|
||||
|
||||
/**
|
||||
* View details of the service
|
||||
*/
|
||||
abstract public function service_view();
|
||||
abstract public function name();
|
||||
|
||||
/**
|
||||
* The table attributes that provide username/password values
|
||||
*/
|
||||
abstract public function username_value();
|
||||
abstract public function password_value();
|
||||
abstract public function username_value();
|
||||
|
||||
/**
|
||||
* Get specific service details for use in other modules
|
||||
* For Example: Invoice
|
||||
*
|
||||
* @todo Make the rendered items configurable
|
||||
* @todo Change this method name, now that it is public
|
||||
*/
|
||||
public function _details($type) {
|
||||
switch ($type) {
|
||||
// Nothing to add for invoices
|
||||
case 'invoice_detail_items':
|
||||
return array();
|
||||
|
||||
default:
|
||||
throw new Kohana_Exception('Unkown detail request :type',array(':type'=>$type));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Form info for admins to update
|
||||
@@ -49,6 +55,9 @@ abstract class Model_Service_Plugin extends ORM_OSB {
|
||||
->set('o',$this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide the button that launches the management of this service, generally from a 3rd party
|
||||
*/
|
||||
public function manage_button() {
|
||||
if (! $this->service->status OR $this->service->expiring())
|
||||
return FALSE;
|
||||
@@ -79,26 +88,26 @@ function() { $("form[id=id_"+t[0]+"_"+t[1]+"]").submit(); });
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the plugin
|
||||
*/
|
||||
protected function plugin() {
|
||||
return strtolower(preg_replace('/(.*)_([a-zA-Z]+)$/',"$2",get_class($this)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get specific service details for use in other modules
|
||||
* For Example: Invoice
|
||||
*
|
||||
* @todo Make the rendered items configurable
|
||||
* @todo Change this method name, now that it is public
|
||||
* Show our service name as defined in the DB with product suffix.
|
||||
*/
|
||||
public function _details($type) {
|
||||
switch ($type) {
|
||||
// Nothing to add for invoices
|
||||
case 'invoice_detail_items':
|
||||
return array();
|
||||
public function service_name() {
|
||||
return sprintf('%s - %s',$this->service->product->title(),$this->name());
|
||||
}
|
||||
|
||||
default:
|
||||
throw new Kohana_Exception('Unkown detail request :type',array(':type'=>$type));
|
||||
}
|
||||
/**
|
||||
* View details of the service
|
||||
*/
|
||||
public function service_view() {
|
||||
return View::factory(sprintf('service/user/plugin/%s/view',$this->plugin()))
|
||||
->set('o',$this);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user