Fixes as a result of KH 3.3

This commit is contained in:
Deon George 2013-01-10 22:25:19 +11:00
parent 79bdd4ce51
commit f08215717c
8 changed files with 11 additions and 14 deletions

View File

@ -10,7 +10,7 @@
* @copyright (c) 2010 Open Source Billing * @copyright (c) 2010 Open Source Billing
* @license http://dev.osbill.net/license.html * @license http://dev.osbill.net/license.html
*/ */
class Model_Service_Plugin_ADSL extends Model_Service_Plugin { class Model_Service_Plugin_Adsl extends Model_Service_Plugin {
protected $_table_name = 'service__adsl'; protected $_table_name = 'service__adsl';
protected $_updated_column = FALSE; protected $_updated_column = FALSE;
@ -132,7 +132,7 @@ class Model_Service_Plugin_ADSL extends Model_Service_Plugin {
if (is_null($period)) if (is_null($period))
$period = strtotime('yesterday'); $period = strtotime('yesterday');
$t = ORM::factory('Service_Plugin_ADSL_Traffic') $t = ORM::factory('Service_Plugin_Adsl_Traffic')
->where('service','=',$this->service_username) ->where('service','=',$this->service_username)
->and_where('date','>=',date('Y-m-d',mktime(0,0,0,date('m',$period),1,date('Y',$period)))) ->and_where('date','>=',date('Y-m-d',mktime(0,0,0,date('m',$period),1,date('Y',$period))))
->and_where('date','<=',date('Y-m-d',strtotime('last day of '.date('M Y',$period)))) ->and_where('date','<=',date('Y-m-d',strtotime('last day of '.date('M Y',$period))))
@ -160,7 +160,7 @@ class Model_Service_Plugin_ADSL extends Model_Service_Plugin {
if (is_null($period)) if (is_null($period))
$period = strtotime('yesterday'); $period = strtotime('yesterday');
$t = ORM::factory('Service_Plugin_ADSL_Traffic') $t = ORM::factory('Service_Plugin_Adsl_Traffic')
->select( ->select(
array('date_format(date,\'%y-%m\')','month'), array('date_format(date,\'%y-%m\')','month'),
array('sum(up_peak)','up_peak'), array('sum(up_peak)','up_peak'),

View File

@ -10,7 +10,7 @@
* @copyright (c) 2010 Open Source Billing * @copyright (c) 2010 Open Source Billing
* @license http://dev.osbill.net/license.html * @license http://dev.osbill.net/license.html
*/ */
class Model_Service_Plugin_DOMAIN extends Model_Service_Plugin { class Model_Service_Plugin_Domain extends Model_Service_Plugin {
protected $_table_name = 'service__domain'; protected $_table_name = 'service__domain';
protected $_updated_column = FALSE; protected $_updated_column = FALSE;
@ -18,7 +18,7 @@ class Model_Service_Plugin_DOMAIN extends Model_Service_Plugin {
protected $_has_one = array( protected $_has_one = array(
'domain_TLD'=>array('foreign_key'=>'id','far_key'=>'domain_tld_id'), 'domain_TLD'=>array('foreign_key'=>'id','far_key'=>'domain_tld_id'),
'domain_registrar'=>array('foreign_key'=>'id','far_key'=>'domain_registrar_id'), 'domain_registrar'=>array('foreign_key'=>'id','far_key'=>'domain_registrar_id'),
'service_plugin_HOST'=>array('through'=>'service','far_key'=>'service_id','foreign_key'=>'service_id'), 'service_plugin_host'=>array('through'=>'service','far_key'=>'service_id','foreign_key'=>'service_id'),
); );
protected $_belongs_to = array( protected $_belongs_to = array(
'service'=>array(), 'service'=>array(),
@ -31,9 +31,6 @@ class Model_Service_Plugin_DOMAIN extends Model_Service_Plugin {
'domain_name'=>array( 'domain_name'=>array(
array('strtoupper',array(':value')), array('strtoupper',array(':value')),
), ),
'registrar_ns'=>array(
array('Domain::NS',array(':model')),
),
'registrar_lastsync'=>array( 'registrar_lastsync'=>array(
array('Config::date',array(':value')), array('Config::date',array(':value')),
), ),
@ -81,7 +78,7 @@ class Model_Service_Plugin_DOMAIN extends Model_Service_Plugin {
} }
public function manage_dns_button() { public function manage_dns_button() {
return $this->service_plugin_HOST->manage_button('service_plugin_host'); return $this->service_plugin_host->manage_button('service_plugin_host');
} }
} }
?> ?>

View File

@ -22,7 +22,7 @@ class Model_Host_Server extends ORM_OSB {
* Return the object of the product plugin * Return the object of the product plugin
*/ */
public function plugin($type='') { public function plugin($type='') {
$c = sprintf('Host_Plugin_%s',$this->provision_plugin); $c = sprintf('Host_Plugin_%s',ucfirst(strtolower($this->provision_plugin)));
if (! $this->provision_plugin OR ! class_exists($c)) if (! $this->provision_plugin OR ! class_exists($c))
return NULL; return NULL;

View File

@ -358,12 +358,12 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
public function action_listdomainservicesbydnshost() { public function action_listdomainservicesbydnshost() {
$svs = ORM::factory('Service')->list_bylistgroup('DOMAIN'); $svs = ORM::factory('Service')->list_bylistgroup('DOMAIN');
Sort::MAsort($svs,'plugin()->service_plugin_HOST,name()'); Sort::MAsort($svs,'plugin()->service_plugin_host,name()');
$list = array(); $list = array();
foreach ($svs as $so) foreach ($svs as $so)
$list[$so->plugin()->service_plugin_HOST->host_server_id][] = $so; $list[$so->plugin()->service_plugin_host->host_server_id][] = $so;
foreach (array_keys($list) as $sid) foreach (array_keys($list) as $sid)
Block::add(array( Block::add(array(

View File

@ -56,7 +56,7 @@ class Model_Service extends ORM_OSB {
if (! is_numeric($this->product->prod_plugin_data)) if (! is_numeric($this->product->prod_plugin_data))
throw new Kohana_Exception('Missing plugin_id for :product (:type)',array(':product'=>$this->product->id,':type'=>$this->product->prod_plugin_file)); throw new Kohana_Exception('Missing plugin_id for :product (:type)',array(':product'=>$this->product->id,':type'=>$this->product->prod_plugin_file));
$o = ORM::factory(sprintf('Service_Plugin_%s',$this->product->prod_plugin_file),array('service_id'=>$this->id)); $o = ORM::factory(sprintf('Service_Plugin_%s',ucwords(strtolower($this->product->prod_plugin_file))),array('service_id'=>$this->id));
return $type ? $o->$type : $o; return $type ? $o->$type : $o;
} }

View File

@ -10,7 +10,7 @@
* @copyright (c) 2010 Open Source Billing * @copyright (c) 2010 Open Source Billing
* @license http://dev.osbill.net/license.html * @license http://dev.osbill.net/license.html
*/ */
class Model_Service_Plugin_SSL extends Model_Service_Plugin { class Model_Service_Plugin_Ssl extends Model_Service_Plugin {
protected $_table_name = 'service__ssl'; protected $_table_name = 'service__ssl';
protected $_updated_column = FALSE; protected $_updated_column = FALSE;