From f50bea38a3658cd849cf5bc62f4756643c739e90 Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 22 Jun 2012 22:05:43 +1000 Subject: [PATCH] Added Hosting Reports --- .../classes/model/service/plugin/host.php | 2 +- .../classes/controller/admin/service.php | 66 +++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/modules/host/classes/model/service/plugin/host.php b/modules/host/classes/model/service/plugin/host.php index b1c0f3a0..3a9d2a26 100644 --- a/modules/host/classes/model/service/plugin/host.php +++ b/modules/host/classes/model/service/plugin/host.php @@ -77,7 +77,7 @@ class Model_Service_Plugin_Host extends Model_Service_Plugin { if ($this->service->queue == 'PROVISION') return _('To Be Provisioned'); - return ($this->username_value() AND $this->password_value()) ? $this->host_server->manage_button($this,$t) : _('Please contact us'); + return ($this->username_value() AND $this->password_value()) ? $this->host_server->manage_button($this,$t) : ''; } } ?> diff --git a/modules/service/classes/controller/admin/service.php b/modules/service/classes/controller/admin/service.php index 5185585c..e9b4e9e5 100644 --- a/modules/service/classes/controller/admin/service.php +++ b/modules/service/classes/controller/admin/service.php @@ -11,6 +11,7 @@ * @license http://dev.osbill.net/license.html */ class Controller_Admin_Service extends Controller_TemplateDefault_Admin { + // @todo This "module" menu items should belong in the module dir. protected $secure_actions = array( 'autolist'=>FALSE, // @todo To Change 'adslstat'=>TRUE, @@ -20,7 +21,9 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin { 'listadslservices'=>TRUE, 'listdomainservices'=>TRUE, 'listdomainservicesbysupplier'=>TRUE, + 'listdomainservicesbydnshost'=>TRUE, 'listhostservices'=>TRUE, + 'listhostservicesbysupplier'=>TRUE, 'listhspaservices'=>TRUE, 'listwebservices'=>TRUE, 'listinvoicesoon'=>TRUE, @@ -312,6 +315,36 @@ 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()'); + + $list = array(); + + foreach ($svs as $so) + $list[$so->plugin()->service_plugin_host->host_server_id][] = $so; + + foreach (array_keys($list) as $sid) + Block::add(array( + 'title'=>sprintf(_('Domain Names by DNS Host [%s]'),$sid), + 'body'=>Table::display( + $list[$sid], + 25, + array( + 'id'=>array('label'=>'ID','url'=>'user/service/view/'), + 'service_name()'=>array('label'=>'Details'), + 'plugin()->domain_registrar->id'=>array('label'=>'SID'), + 'plugin()->domain_registrar->name'=>array('label'=>'Supplier'), + 'display("date_next_invoice")'=>array('label'=>'Next Invoice'), + ), + array( + 'page'=>TRUE, + 'type'=>'select', + 'form'=>'user/service/view', + )), + )); + } + public function action_listhostservices() { $svs = ORM::factory('service')->list_bylistgroup('HOST'); Sort::MAsort($svs,'name()'); @@ -339,6 +372,39 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin { )); } + public function action_listhostservicesbysupplier() { + $svs = ORM::factory('service')->list_bylistgroup('HOST'); + Sort::MAsort($svs,'plugin()->host_server,name()'); + + $list = array(); + + foreach ($svs as $so) + $list[$so->plugin()->host_server_id][] = $so; + + foreach (array_keys($list) as $sid) + Block::add(array( + 'title'=>sprintf(_('Hosting by Supplier %s'),$sid), + 'body'=>Table::display( + $list[$sid], + 25, + array( + 'id'=>array('label'=>'ID','url'=>'user/service/view/'), + 'service_name()'=>array('label'=>'Details'), + 'plugin()->display("host_expire")'=>array('label'=>'Expire'), + 'recur_schedule'=>array('label'=>'Billing'), + 'price(TRUE,TRUE)'=>array('label'=>'Price','class'=>'right'), + 'account->accnum()'=>array('label'=>'Cust ID'), + 'account->name()'=>array('label'=>'Customer'), + 'display("date_next_invoice")'=>array('label'=>'Next Invoice'), + ), + array( + 'page'=>TRUE, + 'type'=>'select', + 'form'=>'user/service/view', + )), + )); + } + public function action_listwebservices() { $svs = ORM::factory('service')->list_bylistgroup('WEB'); Sort::MAsort($svs,'name()');