diff --git a/application/classes/Controller/Reseller/Account.php b/application/classes/Controller/Reseller/Account.php index 6059075b..46225c58 100644 --- a/application/classes/Controller/Reseller/Account.php +++ b/application/classes/Controller/Reseller/Account.php @@ -14,6 +14,7 @@ class Controller_Reseller_Account extends Controller_Account { 'ajaxlist'=>TRUE, 'list'=>TRUE, 'listlog'=>TRUE, + 'view'=>TRUE, ); /** @@ -77,5 +78,60 @@ class Controller_Reseller_Account extends Controller_Account { )), )); } + + public function action_view() { + $ao = ORM::factory('Account',$this->request->param('id')); + if (! $ao->loaded() OR ! $ao->status) + HTTP::redirect(URL::link('reseller','welcome')); + + Block::factory() + ->title(sprintf('Active Service for Account: %s',$ao->accnum())) + ->title_icon('icon-info-sign') + ->span(6) + ->body(Table::factory() + ->data($ao->service->list_active()) + ->jssort('service') + ->columns(array( + 'id'=>'ID', + 'service_name()'=>'Service', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','service/view/')), + )) + ); + + Block::factory() + ->title(sprintf('Invoices Due Account: %s (%s)',$ao->accnum(),$ao->invoice->list_due_total(TRUE))) + ->title_icon('icon-info-sign') + ->span(6) + ->body(Table::factory() + ->data($ao->invoice->list_due()) + ->columns(array( + 'id'=>'ID', + 'due_date'=>'Date Due', + 'total(TRUE)'=>'Invoice Total', + 'due(TRUE)'=>'Amount Due', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','invoice/view/')), + )) + ); + + Block::factory() + ->title(sprintf('Services Expiring for Account: %s',$ao->accnum())) + ->title_icon('icon-info-sign') + ->span(6) + ->body(Table::factory() + ->data($ao->service->list_expiring()) + ->columns(array( + 'id'=>'ID', + 'service_name()'=>'Service', + 'expire(TRUE)'=>'Date', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','service/view/')), + )) + ); + } } ?> diff --git a/application/classes/Controller/User/Search.php b/application/classes/Controller/User/Search.php index 923d3901..96c56023 100644 --- a/application/classes/Controller/User/Search.php +++ b/application/classes/Controller/User/Search.php @@ -21,7 +21,7 @@ class Controller_User_Search extends Controller_Search { $result = array(); if (isset($_REQUEST['term']) AND trim($_REQUEST['term'])) { - $result = Arr::merge($result,ORM::factory('Account')->list_autocomplete($_REQUEST['term'],'url','id',array('ACC %s: %s'=>array('id','name(TRUE)')),array(),array('urlprefix'=>'a/service/list/'))); + $result = Arr::merge($result,ORM::factory('Account')->list_autocomplete($_REQUEST['term'],'url','id',array('ACC %s: %s'=>array('id','name(TRUE)')),array(),array('urlprefix'=>'r/account/view/'))); $result = Arr::merge($result,ORM::factory('Invoice')->list_autocomplete($_REQUEST['term'],'url','id',array('INV %s: %s'=>array('id','account->name(TRUE)')),array(),array('urlprefix'=>'u/invoice/view/'))); $result = Arr::merge($result,ORM::factory('Service')->list_autocomplete($_REQUEST['term'],'url','id',array('SVC %s: %s'=>array('id','service_name()')),array(),array('urlprefix'=>'u/service/view/'))); diff --git a/modules/service/classes/Controller/Affiliate/Service.php b/modules/service/classes/Controller/Affiliate/Service.php index 7bdf1078..ec1f793a 100644 --- a/modules/service/classes/Controller/Affiliate/Service.php +++ b/modules/service/classes/Controller/Affiliate/Service.php @@ -173,7 +173,7 @@ class Controller_Affiliate_Service extends Controller_TemplateDefault_Affiliate 'title'=>_('ADSL Services'), 'body'=>Table::display( $svs, - NULL, + 50, array( 'id'=>array('label'=>'ID','url'=>URL::link('user','service/view/')), 'name()'=>array('label'=>'Service'),