Internal overhaul

This commit is contained in:
Deon George
2013-11-28 17:41:34 +11:00
parent 0ed5e5163d
commit f8a5b153cf
91 changed files with 1570 additions and 1619 deletions

View File

@@ -10,10 +10,6 @@
* @license http://dev.osbill.net/license.html
*/
class Model_Product_Plugin_Host extends Model_Product_Plugin {
// @todo This model doesnt have a database table
public function __construct() {
}
// Our required abstract methods
public function cost($annual=FALSE) {
// @todo
@@ -22,8 +18,6 @@ class Model_Product_Plugin_Host extends Model_Product_Plugin {
return $annual ? $x*12 : $x;
}
public function feature_summary() {}
public function render_edit() {}
// @todo
@@ -31,6 +25,17 @@ class Model_Product_Plugin_Host extends Model_Product_Plugin {
return 'internal';
}
// Overload functions
// @todo This model doesnt have a database table
public function __construct() {
}
// Not used
public function render_view() {}
// Local functions
// @todo This is not used, but should be.
public function order_features() {}
}

View File

@@ -19,8 +19,8 @@ class Model_Service_Plugin_Host extends Model_Service_Plugin {
// Relationships
protected $_has_one = array(
'domain_TLD'=>array('foreign_key'=>'id','far_key'=>'domain_tld_id'),
'host_server'=>array('far_key'=>'host_server_id','foreign_key'=>'id'),
'host'=>array('model'=>'Host_Server','far_key'=>'host_server_id','foreign_key'=>'id'),
'tld'=>array('model'=>'Domain_TLD','foreign_key'=>'id','far_key'=>'domain_tld_id'),
);
protected $_belongs_to = array(
'service'=>array(),
@@ -35,40 +35,41 @@ class Model_Service_Plugin_Host extends Model_Service_Plugin {
),
);
protected $_save_message = TRUE;
// Required abstract functions
public function admin_update() {
return '';
}
public function expire() {
return $this->host_expire;
}
public function name() {
return sprintf('%s.%s',$this->display('domain_name'),$this->domain_TLD->display('name'));
return sprintf('%s.%s',$this->display('domain_name'),$this->tld->display('name'));
}
public function username_value() {
public function password() {
return $this->host_password;
}
public function username() {
return $this->host_username;
}
public function password_value() {
return $this->host_password;
}
// Local functions
/**
* This provides us with a manage button to jump to the hosting server
* to manage the domain.
*/
public function manage_button($t='') {
if (! parent::manage_button($t))
return NULL;
// @todo Convert this to a Static_List display
if ($this->service->queue == 'PROVISION')
return _('To Be Provisioned');
return ($this->username_value() AND $this->password_value() AND $a=$this->host_server->plugin()) ? $a->manage_button($this,$t) : '';
if (! parent::manage($t))
return NULL;
return ($this->username() AND $this->password() AND $a=$this->host->plugin()) ? $a->manage_button($this,$t) : '';
}
/**