Added Hosting Reports

This commit is contained in:
Deon George 2012-06-22 22:05:43 +10:00
parent df82268405
commit f50bea38a3
2 changed files with 67 additions and 1 deletions

View File

@ -77,7 +77,7 @@ class Model_Service_Plugin_Host extends Model_Service_Plugin {
if ($this->service->queue == 'PROVISION') if ($this->service->queue == 'PROVISION')
return _('To Be Provisioned'); 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) : '';
} }
} }
?> ?>

View File

@ -11,6 +11,7 @@
* @license http://dev.osbill.net/license.html * @license http://dev.osbill.net/license.html
*/ */
class Controller_Admin_Service extends Controller_TemplateDefault_Admin { class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
// @todo This "module" menu items should belong in the module dir.
protected $secure_actions = array( protected $secure_actions = array(
'autolist'=>FALSE, // @todo To Change 'autolist'=>FALSE, // @todo To Change
'adslstat'=>TRUE, 'adslstat'=>TRUE,
@ -20,7 +21,9 @@ class Controller_Admin_Service extends Controller_TemplateDefault_Admin {
'listadslservices'=>TRUE, 'listadslservices'=>TRUE,
'listdomainservices'=>TRUE, 'listdomainservices'=>TRUE,
'listdomainservicesbysupplier'=>TRUE, 'listdomainservicesbysupplier'=>TRUE,
'listdomainservicesbydnshost'=>TRUE,
'listhostservices'=>TRUE, 'listhostservices'=>TRUE,
'listhostservicesbysupplier'=>TRUE,
'listhspaservices'=>TRUE, 'listhspaservices'=>TRUE,
'listwebservices'=>TRUE, 'listwebservices'=>TRUE,
'listinvoicesoon'=>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() { public function action_listhostservices() {
$svs = ORM::factory('service')->list_bylistgroup('HOST'); $svs = ORM::factory('service')->list_bylistgroup('HOST');
Sort::MAsort($svs,'name()'); 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() { public function action_listwebservices() {
$svs = ORM::factory('service')->list_bylistgroup('WEB'); $svs = ORM::factory('service')->list_bylistgroup('WEB');
Sort::MAsort($svs,'name()'); Sort::MAsort($svs,'name()');