First start at retiring Affiliate in favour of RTM

This commit is contained in:
Deon George
2013-04-05 09:42:29 +11:00
parent 9d4b2f50ff
commit 43dfd88bce
49 changed files with 680 additions and 570 deletions

View File

@@ -26,7 +26,7 @@ class Controller_Affiliate_Service extends Controller_TemplateDefault_Affiliate
Block::add(array(
'title'=>_('Customer Services'),
'body'=>Table::display(
$this->filter(ORM::factory('Service')->list_active(),$this->ao->affiliate->id),
$this->filter(ORM::factory('Service')->list_active(),$this->ao->RTM->customers($this->ao->RTM),NULL,'account_id'),
25,
array(
'id'=>array('label'=>'ID','url'=>URL::link('user','service/view/')),
@@ -55,7 +55,7 @@ class Controller_Affiliate_Service extends Controller_TemplateDefault_Affiliate
foreach (ORM::factory('Account')->list_active() as $ao)
if ($ao->has_any('group',array($go)))
foreach ($this->filter($ao->service->list_active(),$this->ao->affiliate->id,'name()') as $so)
foreach ($this->filter($ao->service->list_active(),$this->ao->RTM->customers($this->ao->RTM),NULL,'account_id') as $so)
if (! $so->service_billing->checkout_plugin_id)
array_push($svs,$so);
@@ -92,7 +92,7 @@ class Controller_Affiliate_Service extends Controller_TemplateDefault_Affiliate
$svs = array();
foreach ($co->account->find_all() as $ao)
foreach ($this->filter($ao->service->list_active(),$this->ao->affiliate->id,'name()') as $so)
foreach ($this->filter($ao->service->list_active(),$this->ao->RTM->customers($this->ao->RTM),NULL,'account_id') as $so)
if ($so->service_billing->checkout_plugin_id == $co->id)
array_push($svs,$so);
@@ -155,7 +155,7 @@ class Controller_Affiliate_Service extends Controller_TemplateDefault_Affiliate
}
public function action_listadslservices() {
$svs = $this->filter(ORM::factory('Service')->list_bylistgroup('ADSL'),$this->ao->affiliate->id,'name()');
$svs = $this->filter(ORM::factory('Service')->list_bylistgroup('ADSL'),$this->ao->RTM->customers($this->ao->RTM),'name()','account_id');
$data = $this->consoltraffic($svs,time());
$google = GoogleChart::factory('Legacy')
@@ -196,7 +196,7 @@ class Controller_Affiliate_Service extends Controller_TemplateDefault_Affiliate
}
public function action_listhspaservices() {
$svs = $this->filter(ORM::factory('Service')->list_bylistgroup('HSPA'),$this->ao->affiliate->id,'name()');
$svs = $this->filter(ORM::factory('Service')->list_bylistgroup('HSPA'),$this->ao->RTM->customers($this->ao->RTM),'name()','account_id');
$data = $this->consoltraffic($svs,time());
$google = GoogleChart::factory('Legacy')
@@ -240,7 +240,7 @@ class Controller_Affiliate_Service extends Controller_TemplateDefault_Affiliate
Block::add(array(
'title'=>_('Domain Names'),
'body'=>Table::display(
$this->filter(ORM::factory('Service')->list_bylistgroup('DOMAIN'),$this->ao->affiliate->id,'name()'),
$this->filter(ORM::factory('Service')->list_bylistgroup('DOMAIN'),$this->ao->RTM->customers($this->ao->RTM),'name()','account_id'),
25,
array(
'id'=>array('label'=>'ID','url'=>URL::link('user','service/view/')),
@@ -264,7 +264,7 @@ class Controller_Affiliate_Service extends Controller_TemplateDefault_Affiliate
Block::add(array(
'title'=>_('Hosting Services'),
'body'=>Table::display(
$this->filter(ORM::factory('Service')->list_bylistgroup('HOST'),$this->ao->affiliate->id,'name()'),
$this->filter(ORM::factory('Service')->list_bylistgroup('HOST'),$this->ao->RTM->customers($this->ao->RTM),'name()','account_id'),
25,
array(
'id'=>array('label'=>'ID','url'=>URL::link('user','service/view/')),