From f08215717c6101d29f8d1516574791dae305ba7f Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 10 Jan 2013 22:25:19 +1100 Subject: [PATCH] Fixes as a result of KH 3.3 --- .../classes/Model/Service/Plugin/{ADSL.php => Adsl.php} | 6 +++--- .../Model/Service/Plugin/{ADSL => Adsl}/Traffic.php | 0 .../Model/Service/Plugin/{DOMAIN.php => Domain.php} | 9 +++------ modules/host/classes/Model/Host/Server.php | 2 +- .../classes/Model/Service/Plugin/{HOST.php => Host.php} | 0 modules/service/classes/Controller/Admin/Service.php | 4 ++-- modules/service/classes/Model/Service.php | 2 +- .../classes/Model/Service/Plugin/{SSL.php => Ssl.php} | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) rename modules/adsl/classes/Model/Service/Plugin/{ADSL.php => Adsl.php} (98%) rename modules/adsl/classes/Model/Service/Plugin/{ADSL => Adsl}/Traffic.php (100%) rename modules/domain/classes/Model/Service/Plugin/{DOMAIN.php => Domain.php} (88%) rename modules/host/classes/Model/Service/Plugin/{HOST.php => Host.php} (100%) rename modules/ssl/classes/Model/Service/Plugin/{SSL.php => Ssl.php} (98%) diff --git a/modules/adsl/classes/Model/Service/Plugin/ADSL.php b/modules/adsl/classes/Model/Service/Plugin/Adsl.php similarity index 98% rename from modules/adsl/classes/Model/Service/Plugin/ADSL.php rename to modules/adsl/classes/Model/Service/Plugin/Adsl.php index a7e9765b..7460c909 100644 --- a/modules/adsl/classes/Model/Service/Plugin/ADSL.php +++ b/modules/adsl/classes/Model/Service/Plugin/Adsl.php @@ -10,7 +10,7 @@ * @copyright (c) 2010 Open Source Billing * @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 $_updated_column = FALSE; @@ -132,7 +132,7 @@ class Model_Service_Plugin_ADSL extends Model_Service_Plugin { if (is_null($period)) $period = strtotime('yesterday'); - $t = ORM::factory('Service_Plugin_ADSL_Traffic') + $t = ORM::factory('Service_Plugin_Adsl_Traffic') ->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',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)) $period = strtotime('yesterday'); - $t = ORM::factory('Service_Plugin_ADSL_Traffic') + $t = ORM::factory('Service_Plugin_Adsl_Traffic') ->select( array('date_format(date,\'%y-%m\')','month'), array('sum(up_peak)','up_peak'), diff --git a/modules/adsl/classes/Model/Service/Plugin/ADSL/Traffic.php b/modules/adsl/classes/Model/Service/Plugin/Adsl/Traffic.php similarity index 100% rename from modules/adsl/classes/Model/Service/Plugin/ADSL/Traffic.php rename to modules/adsl/classes/Model/Service/Plugin/Adsl/Traffic.php diff --git a/modules/domain/classes/Model/Service/Plugin/DOMAIN.php b/modules/domain/classes/Model/Service/Plugin/Domain.php similarity index 88% rename from modules/domain/classes/Model/Service/Plugin/DOMAIN.php rename to modules/domain/classes/Model/Service/Plugin/Domain.php index 7daba177..af43d699 100644 --- a/modules/domain/classes/Model/Service/Plugin/DOMAIN.php +++ b/modules/domain/classes/Model/Service/Plugin/Domain.php @@ -10,7 +10,7 @@ * @copyright (c) 2010 Open Source Billing * @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 $_updated_column = FALSE; @@ -18,7 +18,7 @@ class Model_Service_Plugin_DOMAIN extends Model_Service_Plugin { protected $_has_one = array( 'domain_TLD'=>array('foreign_key'=>'id','far_key'=>'domain_tld_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( 'service'=>array(), @@ -31,9 +31,6 @@ class Model_Service_Plugin_DOMAIN extends Model_Service_Plugin { 'domain_name'=>array( array('strtoupper',array(':value')), ), - 'registrar_ns'=>array( - array('Domain::NS',array(':model')), - ), 'registrar_lastsync'=>array( array('Config::date',array(':value')), ), @@ -81,7 +78,7 @@ class Model_Service_Plugin_DOMAIN extends Model_Service_Plugin { } 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'); } } ?> diff --git a/modules/host/classes/Model/Host/Server.php b/modules/host/classes/Model/Host/Server.php index 034b2055..637d402a 100644 --- a/modules/host/classes/Model/Host/Server.php +++ b/modules/host/classes/Model/Host/Server.php @@ -22,7 +22,7 @@ class Model_Host_Server extends ORM_OSB { * Return the object of the product plugin */ 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)) return NULL; diff --git a/modules/host/classes/Model/Service/Plugin/HOST.php b/modules/host/classes/Model/Service/Plugin/Host.php similarity index 100% rename from modules/host/classes/Model/Service/Plugin/HOST.php rename to modules/host/classes/Model/Service/Plugin/Host.php diff --git a/modules/service/classes/Controller/Admin/Service.php b/modules/service/classes/Controller/Admin/Service.php index 2aacaadd..28a7b31f 100644 --- a/modules/service/classes/Controller/Admin/Service.php +++ b/modules/service/classes/Controller/Admin/Service.php @@ -358,12 +358,12 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin { public function action_listdomainservicesbydnshost() { $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(); 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) Block::add(array( diff --git a/modules/service/classes/Model/Service.php b/modules/service/classes/Model/Service.php index a97155e9..6fcd852a 100644 --- a/modules/service/classes/Model/Service.php +++ b/modules/service/classes/Model/Service.php @@ -56,7 +56,7 @@ class Model_Service extends ORM_OSB { 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)); - $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; } diff --git a/modules/ssl/classes/Model/Service/Plugin/SSL.php b/modules/ssl/classes/Model/Service/Plugin/Ssl.php similarity index 98% rename from modules/ssl/classes/Model/Service/Plugin/SSL.php rename to modules/ssl/classes/Model/Service/Plugin/Ssl.php index 7b2d9e03..3a48ca26 100644 --- a/modules/ssl/classes/Model/Service/Plugin/SSL.php +++ b/modules/ssl/classes/Model/Service/Plugin/Ssl.php @@ -10,7 +10,7 @@ * @copyright (c) 2010 Open Source Billing * @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 $_updated_column = FALSE;