diff --git a/application/classes/Controller/Account.php b/application/classes/Controller/Account.php index a82f03de..437603ec 100644 --- a/application/classes/Controller/Account.php +++ b/application/classes/Controller/Account.php @@ -10,5 +10,6 @@ * @license http://dev.osbill.net/license.html */ class Controller_Account extends Controller_TemplateDefault { + protected $icon = 'fa fa-users'; } ?> diff --git a/application/classes/Controller/Reseller/Account.php b/application/classes/Controller/Reseller/Account.php index 91c3cad4..60d4eed6 100644 --- a/application/classes/Controller/Reseller/Account.php +++ b/application/classes/Controller/Reseller/Account.php @@ -20,34 +20,24 @@ class Controller_Reseller_Account extends Controller_Account { * Show a list of accounts */ public function action_list() { - $this->meta->title = 'Customer List'; + $this->meta->title = 'R|Customer List'; Block::factory() ->title(_('Customer List')) - ->title_icon('fa fa-list') - ->body(Table::factory() - ->data(ORM::factory('Account')->where_authorised($this->ao,'id')->find_all()) - ->jssort('customer') - ->columns(array( - 'id'=>'ID', - 'status'=>'Active', - 'accnum()'=>'Num', - 'name(TRUE)'=>'Account', - 'email'=>'Email', - 'invoices_due_total(NULL,TRUE)'=>'Invoices', - 'service->find_all()->count()'=>'Services', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('reseller','account/view/')), - )) - ); + ->title_icon($this->icon) + ->body(View::factory('account/list')->set('o',ORM::factory('Account')->where_authorised($this->ao,'id')->find_all())); } /** * Show a list of account logins */ public function action_listlog() { - $this->template->content = View::factory('account/reseller/listlog'); + $this->meta->title = 'R|Customer Logins'; + + Block::factory() + ->title(_('Customer List')) + ->title_icon('fa fa-eye') + ->body(View::factory('account/listlog')->set('o',ORM::factory('Account_Log')->where_authorised($this->ao)->find_all())); } public function action_view() { diff --git a/application/classes/Controller/Reseller/Welcome.php b/application/classes/Controller/Reseller/Welcome.php index ee34c1d6..713929ef 100644 --- a/application/classes/Controller/Reseller/Welcome.php +++ b/application/classes/Controller/Reseller/Welcome.php @@ -19,89 +19,29 @@ class Controller_Reseller_Welcome extends Controller_Welcome { public function action_index() { $t = time(); - // Show outstanding invoices - $o = ORM::factory('Invoice'); - - Block::factory() - ->title($this->ao->RTM->display('name')) - ->body(''); - Block::factory() ->title('Invoices Overdue - No Auto Billing') - ->title_icon('icon-info-sign') + ->title_icon('fa fa-pencil-square-o') ->span(6) - ->body(Table::factory() - ->data($o->list_overdue_billing($t)) - ->columns(array( - 'id'=>'ID', - 'due_date'=>'Due', - 'account->accnum()'=>'Num', - 'account->name()'=>'Account', - 'total(TRUE)'=>'Total', - 'due(TRUE)'=>'Due', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','invoice/view/')), - )) - ); + ->body(View::factory('invoice/list')->set('o',ORM::factory('Invoice')->list_overdue_billing($t))); Block::factory() ->title('Invoices Overdue - Auto Billing') - ->title_icon('icon-info-sign') + ->title_icon('fa fa-pencil-square-o') ->span(6) - ->body(Table::factory() - ->data($o->list_overdue_billing($t,TRUE)) - ->columns(array( - 'id'=>'ID', - 'due_date'=>'Due', - 'account->accnum()'=>'Num', - 'account->name()'=>'Account', - 'total(TRUE)'=>'Total', - 'due(TRUE)'=>'Due', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','invoice/view/')), - )) - ); + ->body(View::factory('invoice/list')->set('o',ORM::factory('Invoice')->list_overdue_billing($t,TRUE))); Block::factory() ->title('Upcoming Invoices') - ->title_icon('icon-info-sign') + ->title_icon('fa fa-pencil-square-o') ->span(6) - ->body(Table::factory() - ->data($o->list_due(time())) - ->columns(array( - 'id'=>'ID', - 'due_date'=>'Due', - 'account->accnum()'=>'Num', - 'account->name()'=>'Account', - 'total(TRUE)'=>'Total', - 'due(TRUE)'=>'Due', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','invoice/view/')), - )) - ); + ->body(View::factory('invoice/list')->set('o',ORM::factory('Invoice')->list_due($t))); Block::factory() ->title('Un-applied payments') - ->title_icon('icon-info-sign') + ->title_icon('fa fa-money') ->span(6) - ->body(Table::factory() - ->data(ORM::factory('Payment')->where_authorised()->list_unapplied()) - ->columns(array( - 'id'=>'ID', - 'date_payment'=>'Pay Date', - 'account->accnum()'=>'Num', - 'account->name()'=>'Account', - 'account->display("status")'=>'Active', - 'total(TRUE)'=>'Total', - 'balance(TRUE)'=>'Balance', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('reseller','payment/view/')), - )) - ); + ->body(View::factory('payment/list')->set('o',ORM::factory('Payment')->where_authorised()->list_unapplied())); } /** diff --git a/application/classes/Controller/User/Account.php b/application/classes/Controller/User/Account.php index f274c520..f5d90d2b 100644 --- a/application/classes/Controller/User/Account.php +++ b/application/classes/Controller/User/Account.php @@ -23,7 +23,7 @@ class Controller_User_Account extends Controller_Account { $this->ao->reload(); Block::factory() - ->title(sprintf('Account: %s',$this->ao->accnum())) + ->title(sprintf('Account: %s',$this->ao->refnum())) ->title_icon('icon-wrench') ->type('form-horizontal') ->body(View::factory('account/user/edit')->set('o',$this->ao)); @@ -94,7 +94,7 @@ $("#reset").validate({ '); Block::factory() - ->title(sprintf('Password Reset: %s',$this->ao->accnum())) + ->title(sprintf('Password Reset: %s',$this->ao->refnum())) ->title_icon('icon-cog') ->id('reset') ->type('form-horizontal') diff --git a/application/classes/Model/Account.php b/application/classes/Model/Account.php index 7174fc01..002a893d 100644 --- a/application/classes/Model/Account.php +++ b/application/classes/Model/Account.php @@ -9,7 +9,7 @@ * @copyright (c) 2009-2013 Open Source Billing * @license http://dev.osbill.net/license.html */ -class Model_Account extends Model_Auth_UserDefault { +class Model_Account extends lnApp_Model_Account { // Relationships protected $_has_many = array( 'user_tokens'=>array('model'=>'user_token'), @@ -39,35 +39,12 @@ class Model_Account extends Model_Auth_UserDefault { ), ); - protected $_form = array('id'=>'id','value'=>'name(TRUE)'); - - protected $_save_message = TRUE; - - /** - * Our account number format - */ - public function accnum() { - return sprintf('%s-%04s',Company::instance()->site(TRUE),$this->id); - } + /** OTHER METHODS **/ public function activated() { return $this->has('group'); } - /** - * Get the groups that an account belongs to - */ - public function groups() { - $result = array(); - - foreach ($this->group->where_active()->find_all() as $go) - foreach ($go->list_parentgrps(TRUE) as $cgo) - if (empty($result[$cgo->id])) - $result[$cgo->id] = $cgo; - - return $result; - } - /** * Get a list of all invoices for this account */ @@ -77,14 +54,6 @@ class Model_Account extends Model_Auth_UserDefault { return $processed ? $o->find_all() : $o->where_unprocessed()->find_all(); } - public function isAdmin() { - return ($this->RTM->loaded() AND is_null($this->RTM->parent_id)); - } - - public function isReseller() { - return $this->RTM->loaded(); - } - /** * Get a list of due invoices for this account * @@ -112,36 +81,12 @@ class Model_Account extends Model_Auth_UserDefault { return $format ? Currency::display($result) : $result; } - public function log($message) { - // Log a message for this account - $alo = ORM::factory('Account_Log'); - $alo->account_id = $this->id; - $alo->ip = Request::$client_ip; - $alo->details = $message; - $alo->save(); - - return $alo->saved(); + public function isAdmin() { + return ($this->RTM->loaded() AND is_null($this->RTM->parent_id)); } - /** - * This function will extract the available methods for this account - * This is used both for menu options and method security - */ - public function methods() { - static $result = array(); - - // @todo We may want to optimise this with some session caching. - if ($result) - return $result; - - foreach ($this->groups() as $go) - foreach ($go->module_method->find_all() as $mmo) - if (empty($result[$mmo->id])) - $result[$mmo->id] = $mmo; - - Sort::MAsort($result,array('module->name','menu_display')); - - return $result; + public function isReseller() { + return $this->RTM->loaded(); } /** diff --git a/application/views/account/list.php b/application/views/account/list.php new file mode 100644 index 00000000..33a2f0b2 --- /dev/null +++ b/application/views/account/list.php @@ -0,0 +1,17 @@ + +data($o) + ->jssort('customer') + ->columns(array( + 'id'=>'ID', + 'status'=>'Active', + 'refnum()'=>'Num', + 'name(TRUE)'=>'Account', + 'email'=>'Email', + 'invoices_due_total(NULL,TRUE)'=>'Invoices', + 'service->find_all()->count()'=>'Services', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('reseller','account/view/')), + )); +?> diff --git a/application/views/account/listlog.php b/application/views/account/listlog.php new file mode 100644 index 00000000..29bea36f --- /dev/null +++ b/application/views/account/listlog.php @@ -0,0 +1,13 @@ + +data($o) + ->page_items(25) + ->columns(array( + 'id'=>'ID', + 'date_orig'=>'Date', + 'account->refnum()'=>'Acc ID', + 'account->name()'=>'Acc Name', + 'ip'=>'IP Address', + 'details'=>'Details', + )); +?> diff --git a/application/views/account/reseller/listlog.php b/application/views/account/reseller/listlog.php deleted file mode 100644 index 3e4b0147..00000000 --- a/application/views/account/reseller/listlog.php +++ /dev/null @@ -1,15 +0,0 @@ -get_user(); -echo Block::factory() - ->title(_('Customer Login Activity')) - ->title_icon('fa fa-eye') - ->body(Table::factory() - ->data(ORM::factory('Account_Log')->where_authorised($o)->find_all()) - ->page_items(25) - ->columns(array( - 'id'=>'ID', - 'date_orig'=>'Date', - 'account->name()'=>'Account', - 'ip'=>'IP Address', - 'details'=>'Details', - )) - ); diff --git a/application/views/account/reseller/view.php b/application/views/account/reseller/view.php index 7b8bfdac..bba9f861 100644 --- a/application/views/account/reseller/view.php +++ b/application/views/account/reseller/view.php @@ -1,6 +1,10 @@ -set('o',$o); ?> -set('o',$o); ?> -set('o',$o); ?> -set('o',$o); ?> +set('o',$o); ?> + +title(sprintf('InActive Services for Account: %s',$o->refnum())) + ->title_icon('fa fa-barcode') + ->span(6) + ->body(View::factory('service/user/list/inactive')->set('o',$o->service->where('status','!=',1)->or_where('status','IS',null)->find_all())); ?> + set('o',$o); ?> diff --git a/application/views/welcome/user/view.php b/application/views/welcome/user/view.php index 987fe7e1..74b8f4e0 100644 --- a/application/views/welcome/user/view.php +++ b/application/views/welcome/user/view.php @@ -1,3 +1,17 @@ -set('o',$o); ?> -set('o',$o); ?> -set('o',$o); ?> +title(sprintf('Active Services Account: %s',$o->refnum())) + ->title_icon('fa fa-barcode') + ->span(6) + ->body(View::factory('service/user/list/brief')->set('o',$o->service->list_active())); ?> + +title(sprintf('Invoices Due Account: %s (%s)',$o->refnum(),$o->invoice->list_due_total(TRUE))) + ->title_icon('fa fa-money') + ->span(6) + ->body(View::factory('invoice/user/list/due')->set('o',$o->invoice->list_due())); ?> + +title(sprintf('Expiring Services Account: %s',$o->refnum())) + ->title_icon('fa fa-barcode') + ->span(6) + ->body(View::factory('service/user/list/expiring')->set('o',$o->service->list_expiring())); ?> diff --git a/modules/adsl/classes/Controller/Reseller/Service/Adsl.php b/modules/adsl/classes/Controller/Reseller/Service/Adsl.php index a3e67ccc..de013da0 100644 --- a/modules/adsl/classes/Controller/Reseller/Service/Adsl.php +++ b/modules/adsl/classes/Controller/Reseller/Service/Adsl.php @@ -75,7 +75,7 @@ class Controller_Reseller_Service_Adsl extends Controller_Service { 'plugin()->traffic_month(strtotime("first day of last month"),TRUE,TRUE)'=>'Last Month', 'recur_schedule'=>'Billing', 'price(TRUE,TRUE)'=>'Price', - 'account->accnum()'=>'Cust ID', + 'account->refnum()'=>'Cust ID', 'account->name()'=>'Customer', 'date_next_invoice'=>'Next Invoice', 'due(TRUE)'=>'Due Invoices', diff --git a/modules/charge/classes/Controller/Reseller/Charge.php b/modules/charge/classes/Controller/Reseller/Charge.php index 39d0b8c7..c1a48087 100644 --- a/modules/charge/classes/Controller/Reseller/Charge.php +++ b/modules/charge/classes/Controller/Reseller/Charge.php @@ -137,33 +137,12 @@ $(document).ready(function() { * Show a list of invoices */ public function action_list() { - $this->meta->title = 'Customer Charges'; + $this->meta->title = 'R|Customer Charges'; Block::factory() ->title('Customer Charges') ->title_icon('fa fa-list') - ->body(Table::factory() - ->page_items(50) - ->data(ORM::factory('Charge')->where_authorised($this->ao)->where('void','is',NULL)->order_by('id','DESC')->find_all()) - ->columns(array( - 'id'=>'ID', - 'date_charge'=>'Date', - 'processed'=>'Processed', - 'invoice_item->invoice_id'=>'Invoice', - 'sweep_type'=>'Sweep', - 'quantity'=>'Quantity', - 'amount'=>'Amount', - 'total(TRUE)'=>'Total', - 'description'=>'Description', - 'service_id'=>'Service', - 'account->accnum()'=>'Cust ID', - 'account->name()'=>'Customer', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('reseller','charge/edit/')), - 'invoice_item->invoice_id'=>array('url'=>URL::link('user','invoice/view/')), - )) - ); + ->body(View::factory('charge/list')->set('o',ORM::factory('Charge')->where_authorised($this->ao)->where('void','is',NULL)->order_by('id','DESC')->find_all())); } } ?> diff --git a/modules/charge/classes/Model/Charge.php b/modules/charge/classes/Model/Charge.php index 756e4bdd..2b0c49e6 100644 --- a/modules/charge/classes/Model/Charge.php +++ b/modules/charge/classes/Model/Charge.php @@ -15,9 +15,6 @@ class Model_Charge extends ORM_OSB implements Invoicable { 'product'=>array(), 'service'=>array(), ); - protected $_has_one = array( - 'invoice_item'=>array('far_key'=>'id'), - ); protected $_compress_column = array( 'attributes', @@ -82,6 +79,20 @@ class Model_Charge extends ORM_OSB implements Invoicable { } } + /** + * Return the Invoice Item object for this charge + */ + public function iio() { + $iio = ORM::factory('Invoice_Item'); + if ($this->processed) { + $iio->where('module_id','=',$this->mid()) + ->where('module_ref','=',$this->id) + ->find(); + } + + return $iio; + } + public function invoice_item($item_type) { switch ($item_type) { case 5: diff --git a/modules/charge/views/charge/list.php b/modules/charge/views/charge/list.php new file mode 100644 index 00000000..c9ec7ac3 --- /dev/null +++ b/modules/charge/views/charge/list.php @@ -0,0 +1,24 @@ + +page_items(50) + ->data($o) + ->columns(array( + 'id'=>'ID', + 'date_charge'=>'Date', + 'processed'=>'Processed', + 'iio()->invoice_id'=>'Invoice', + 'sweep_type'=>'Sweep', + 'quantity'=>'Quantity', + 'amount'=>'Amount', + 'total(TRUE)'=>'Total', + 'description'=>'Description', + 'service_id'=>'Service', + 'account->refnum()'=>'Cust ID', + 'account->name()'=>'Customer', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('reseller','charge/edit/')), + 'service_id'=>array('url'=>URL::link('user','service/view/')), + 'iio()->invoice_id'=>array('url'=>URL::link('user','invoice/view/')), + )); +?> diff --git a/modules/domain/classes/Controller/Admin/Service/Domain.php b/modules/domain/classes/Controller/Admin/Service/Domain.php index cec24d64..50ce9e79 100644 --- a/modules/domain/classes/Controller/Admin/Service/Domain.php +++ b/modules/domain/classes/Controller/Admin/Service/Domain.php @@ -30,7 +30,7 @@ class Controller_Admin_Service_Domain extends Controller_Domain { 'plugin()->display("domain_expire")'=>'Expire', 'recur_schedule'=>'Billing', 'price(TRUE,TRUE)'=>'Charge', - 'account->accnum()'=>'Cust ID', + 'account->refnum()'=>'Cust ID', 'account->name()'=>'Customer', 'plugin()->registrar->name'=>'Registrar', )) diff --git a/modules/domain/classes/Controller/Reseller/Service/Domain.php b/modules/domain/classes/Controller/Reseller/Service/Domain.php index 0b267bf8..16541b00 100644 --- a/modules/domain/classes/Controller/Reseller/Service/Domain.php +++ b/modules/domain/classes/Controller/Reseller/Service/Domain.php @@ -27,7 +27,7 @@ class Controller_Reseller_Service_Domain extends Controller_Service { 'plugin()->display("domain_expire")'=>'Expire', 'recur_schedule'=>'Billing', 'price(TRUE,TRUE)'=>'Price', - 'account->accnum()'=>'Cust ID', + 'account->refnum()'=>'Cust ID', 'account->name()'=>'Customer', 'date_next_invoice'=>'Next Invoice', 'due(TRUE)'=>'Due Invoices', diff --git a/modules/email/classes/Controller/Email.php b/modules/email/classes/Controller/Email.php index 198f2211..709f40e9 100644 --- a/modules/email/classes/Controller/Email.php +++ b/modules/email/classes/Controller/Email.php @@ -10,5 +10,6 @@ * @license http://dev.osbill.net/license.html */ class Controller_Email extends Controller_TemplateDefault { + protected $icon = 'fa fa-envelope'; } ?> diff --git a/modules/email/classes/Controller/Reseller/Email.php b/modules/email/classes/Controller/Reseller/Email.php index 5c78e231..4782ea7e 100644 --- a/modules/email/classes/Controller/Reseller/Email.php +++ b/modules/email/classes/Controller/Reseller/Email.php @@ -18,29 +18,12 @@ class Controller_Reseller_Email extends Controller_Email { * Show a list of emails */ public function action_list() { - $this->meta->title = 'Emails Sent'; + $this->meta->title = 'R|Emails Sent'; Block::factory() ->title(_('Emails Sent')) - ->title_icon('fa fa-envelope') - ->body(Table::factory() - ->page_items(25) - ->data(ORM::factory('Email_Log')->where_authorised($this->ao)->find_all()) - ->columns(array( - 'id'=>'ID', - 'date_orig'=>'Date', - 'email'=>'To', - 'resolve("subject")'=>'Subject', - 'account->accnum()'=>'Cust ID', - 'account->name()'=>'Customer', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','email/view/')), - )) - ->postproc(array( - 'resolve("subject")'=>array('trim'=>60), - )) - ); + ->title_icon($this->icon) + ->body(View::factory('email/list')->set('o',ORM::factory('Email_Log')->where_authorised($this->ao)->find_all())); } } ?> diff --git a/modules/email/classes/Controller/User/Email.php b/modules/email/classes/Controller/User/Email.php index 62bfa5c1..c41cde76 100644 --- a/modules/email/classes/Controller/User/Email.php +++ b/modules/email/classes/Controller/User/Email.php @@ -21,7 +21,10 @@ class Controller_User_Email extends Controller_Email { public function action_list() { $this->meta->title = 'Email List'; - $this->template->content = View::factory('email/user/list'); + Block::factory() + ->title(sprintf(_('System Emails Sent for %s: %s'),$this->ao->refnum(),$this->ao->name(TRUE))) + ->title_icon($this->icon) + ->body(View::factory('email/user/list')->set('o',$this->ao->email_log->find_all())); } public function action_view() { diff --git a/modules/email/views/email/list.php b/modules/email/views/email/list.php new file mode 100644 index 00000000..da1a822b --- /dev/null +++ b/modules/email/views/email/list.php @@ -0,0 +1,19 @@ + +page_items(25) + ->data($o) + ->columns(array( + 'id'=>'ID', + 'date_orig'=>'Date', + 'email'=>'To', + 'resolve("subject")'=>'Subject', + 'account->refnum()'=>'Cust ID', + 'account->name()'=>'Customer', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','email/view/')), + )) + ->postproc(array( + 'resolve("subject")'=>array('trim'=>60), + )); +?> diff --git a/modules/email/views/email/user/list.php b/modules/email/views/email/user/list.php index 9221996a..3d94ea4f 100644 --- a/modules/email/views/email/user/list.php +++ b/modules/email/views/email/user/list.php @@ -1,19 +1,16 @@ -get_user(); -echo Block::factory() - ->title(sprintf(_('System Emails Sent for %s: %s'),$o->accnum(),$o->name(TRUE))) - ->title_icon('fa fa-list') - ->body(Table::factory() - ->page_items(25) - ->data($o->email_log->find_all()) - ->columns(array( - 'id'=>'ID', - 'date_orig'=>'Date', - 'resolve("subject")'=>'Subject', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','email/view/')), - )) - ->postproc(array( - 'resolve("subject")'=>array('trim'=>60), - )) - ); + +page_items(25) + ->data($o) + ->columns(array( + 'id'=>'ID', + 'date_orig'=>'Date', + 'resolve("subject")'=>'Subject', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','email/view/')), + )) + ->postproc(array( + 'resolve("subject")'=>array('trim'=>60), + )); +?> diff --git a/modules/host/classes/Controller/Reseller/Service/Host.php b/modules/host/classes/Controller/Reseller/Service/Host.php index 55365e92..1fc3d461 100644 --- a/modules/host/classes/Controller/Reseller/Service/Host.php +++ b/modules/host/classes/Controller/Reseller/Service/Host.php @@ -27,7 +27,7 @@ class Controller_Reseller_Service_Host extends Controller_Service { 'plugin()->display("host_expire")'=>'Expire', 'recur_schedule'=>'Billing', 'price(TRUE,TRUE)'=>'Price', - 'account->accnum()'=>'Cust ID', + 'account->refnum()'=>'Cust ID', 'account->name()'=>'Customer', 'date_next_invoice'=>'Next Invoice', 'due(TRUE)'=>'Due Invoices', diff --git a/modules/invoice/classes/Controller/Invoice.php b/modules/invoice/classes/Controller/Invoice.php index 283bf025..8af70139 100644 --- a/modules/invoice/classes/Controller/Invoice.php +++ b/modules/invoice/classes/Controller/Invoice.php @@ -10,5 +10,6 @@ * @license http://dev.osbill.net/license.html */ class Controller_Invoice extends Controller_TemplateDefault { + protected $icon = 'fa fa-pencil-square-o'; } ?> diff --git a/modules/invoice/classes/Controller/Reseller/Invoice.php b/modules/invoice/classes/Controller/Reseller/Invoice.php index 09985393..6d9a24ed 100644 --- a/modules/invoice/classes/Controller/Reseller/Invoice.php +++ b/modules/invoice/classes/Controller/Reseller/Invoice.php @@ -15,28 +15,12 @@ class Controller_Reseller_Invoice extends Controller_Invoice { ); public function action_list() { - $this->meta->title = 'Customer Invoice List'; + $this->meta->title = 'R|Customer Invoice List'; Block::factory() ->title('Customer Invoices') - ->title_icon('fa fa-edit') - ->body(Table::factory() - ->jssort('invoices') - ->data(ORM::factory('Invoice')->where_authorised($this->ao)->where_active()->find_all()) - ->page_items(25) - ->columns(array( - 'id'=>'ID', - 'date_orig'=>'Date Created', - 'due_date'=>'Date Due', - 'total(TRUE)'=>'Total', - 'due(TRUE)'=>'Due', - 'account->accnum()'=>'Cust ID', - 'account->name()'=>'Customer', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','invoice/view/')), - )) - ); + ->title_icon($this->icon) + ->body(View::factory('invoice/list')->set('o',ORM::factory('Invoice')->where_authorised($this->ao)->where_active()->find_all())); } } ?> diff --git a/modules/invoice/classes/Controller/User/Invoice.php b/modules/invoice/classes/Controller/User/Invoice.php index a3c1ed30..b3bf549f 100644 --- a/modules/invoice/classes/Controller/User/Invoice.php +++ b/modules/invoice/classes/Controller/User/Invoice.php @@ -76,24 +76,9 @@ class Controller_User_Invoice extends Controller_Invoice { $this->meta->title = 'Invoice List'; Block::factory() - ->title(sprintf('Invoices for Account: %s',$this->ao->accnum())) - ->title_icon('fa fa-list') - ->body(Table::factory() - ->jssort('invoices') - ->data($this->ao->invoice->find_all()) - ->columns(array( - 'id'=>'ID', - 'date_orig'=>'Date Issued', - 'due_date'=>'Date Due', - 'total(TRUE)'=>'Total', - 'total_credits(TRUE)'=>'Credits', - 'payments_total(TRUE)'=>'Payments', - 'due(TRUE)'=>'Still Due', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','invoice/view/')), - )) - ); + ->title(sprintf('Invoices for Account: %s',$this->ao->refnum())) + ->title_icon($this->icon) + ->body(View::factory('invoice/user/list')->set('o',$this->ao->invoice->find_all())); } /** diff --git a/modules/invoice/classes/Invoice/Tcpdf/Default.php b/modules/invoice/classes/Invoice/Tcpdf/Default.php index 63284fee..afd39903 100644 --- a/modules/invoice/classes/Invoice/Tcpdf/Default.php +++ b/modules/invoice/classes/Invoice/Tcpdf/Default.php @@ -80,7 +80,7 @@ class Invoice_TCPDF_Default extends Invoice_Tcpdf { $this->SetFont('helvetica','',10); $this->SetXY($x,$y); $this->Cell(0,0,_('Account Number')); $this->SetFont('helvetica','B',11); - $this->SetXY($x,$y); $this->Cell(0,0,$this->io->account->accnum(),0,0,'R'); + $this->SetXY($x,$y); $this->Cell(0,0,$this->io->account->refnum(),0,0,'R'); // Invoice number $y = 210; diff --git a/modules/invoice/classes/Model/Invoice.php b/modules/invoice/classes/Model/Invoice.php index 52a8c5eb..136d80ad 100644 --- a/modules/invoice/classes/Model/Invoice.php +++ b/modules/invoice/classes/Model/Invoice.php @@ -52,7 +52,16 @@ class Model_Invoice extends ORM_OSB implements Cartable { private $_render = array(); - // Our required Interface Methods + /** REQUIRED ABSTRACT METHODS **/ + /** + * Display the Invoice Reference Number + */ + public function refnum($short=FALSE) { + return ($short ? '' : $this->account->refnum(FALSE).'-').sprintf('%06s',$this->id); + } + + + /** REQUIRED INTERFACE METHODS **/ public function cart_item() { return new Cart_Item(1,sprintf('Invoice: %s',$this->refnum()),$this->due()); @@ -221,13 +230,6 @@ class Model_Invoice extends ORM_OSB implements Cartable { } } - /** - * Display the Invoice Reference Number - */ - public function refnum() { - return sprintf('%s-%06s',$this->account->accnum(),$this->id); - } - /** * Check the reminder value */ diff --git a/modules/invoice/views/invoice/list.php b/modules/invoice/views/invoice/list.php new file mode 100644 index 00000000..87dc2d08 --- /dev/null +++ b/modules/invoice/views/invoice/list.php @@ -0,0 +1,16 @@ + +data($o) + ->page_items(25) + ->columns(array( + 'id'=>'ID', + 'due_date'=>'Due', + 'account->refnum()'=>'Num', + 'account->name()'=>'Account', + 'total(TRUE)'=>'Total', + 'due(TRUE)'=>'Due', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','invoice/view/')), + )); +?> diff --git a/modules/invoice/views/invoice/user/list.php b/modules/invoice/views/invoice/user/list.php new file mode 100644 index 00000000..025e43e2 --- /dev/null +++ b/modules/invoice/views/invoice/user/list.php @@ -0,0 +1,17 @@ + +page_items(25) + ->data($o) + ->columns(array( + 'id'=>'ID', + 'date_orig'=>'Date Issued', + 'due_date'=>'Date Due', + 'total(TRUE)'=>'Total', + 'total_credits(TRUE)'=>'Credits', + 'payments_total(TRUE)'=>'Payments', + 'due(TRUE)'=>'Still Due', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','invoice/view/')), + )); +?> diff --git a/modules/invoice/views/invoice/user/list/due.php b/modules/invoice/views/invoice/user/list/due.php index 1e434d07..666a695f 100644 --- a/modules/invoice/views/invoice/user/list/due.php +++ b/modules/invoice/views/invoice/user/list/due.php @@ -1,18 +1,13 @@ - -title(sprintf('Invoices Due Account: %s (%s)',$o->accnum(),$o->invoice->list_due_total(TRUE))) - ->title_icon('fa fa-money') - ->span(6) - ->body(Table::factory() - ->data($o->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/')), - )) - ); + +data($o) + ->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/')), + )); ?> diff --git a/modules/invoice/views/invoice/user/next.php b/modules/invoice/views/invoice/user/next.php index 16f0be28..ae72a735 100644 --- a/modules/invoice/views/invoice/user/next.php +++ b/modules/invoice/views/invoice/user/next.php @@ -6,7 +6,7 @@ $i->add_service($io); echo Block::factory() - ->title(sprintf('Next Invoice Items for Account: %s',$o->accnum())) + ->title(sprintf('Next Invoice Items for Account: %s',$o->refnum())) ->title_icon('fa fa-shopping-cart') ->span(6) ->body($i->render('html','body',array('noid'=>TRUE))); diff --git a/modules/payment/classes/Controller/Payment.php b/modules/payment/classes/Controller/Payment.php index ad224729..62f873c2 100644 --- a/modules/payment/classes/Controller/Payment.php +++ b/modules/payment/classes/Controller/Payment.php @@ -10,5 +10,6 @@ * @license http://dev.osbill.net/license.html */ class Controller_Payment extends Controller_TemplateDefault { + protected $icon = 'fa fa-money'; } ?> diff --git a/modules/payment/classes/Controller/Reseller/Payment.php b/modules/payment/classes/Controller/Reseller/Payment.php index 89cefb8d..433539ef 100644 --- a/modules/payment/classes/Controller/Reseller/Payment.php +++ b/modules/payment/classes/Controller/Reseller/Payment.php @@ -18,28 +18,12 @@ class Controller_Reseller_Payment extends Controller_Payment { * Show a list of payments */ public function action_list() { - $this->meta->title = 'Customer Payments'; + $this->meta->title = 'R|Customer Payments'; Block::factory() ->title('Customer Payments') - ->title_icon('fa fa-money') - ->body(Table::factory() - ->page_items(50) - ->data(ORM::factory('Payment')->where_authorised($this->ao)->find_all()) - ->columns(array( - 'id'=>'ID', - 'date_payment'=>'Date', - 'checkout->display("name")'=>'Method', - 'total(TRUE)'=>'Total', - 'balance(TRUE)'=>'Balance', - 'invoicelist()'=>'Invoices', - 'account->accnum()'=>'Cust ID', - 'account->name()'=>'Customer', - )) - ->prepend(array( - //'id'=>array('url'=>URL::link('reseller','payment/edit/')), //@todo To Implement - )) - ); + ->title_icon($this->icon) + ->body(View::factory('payment/reseller/list')->set('o',ORM::factory('Payment')->where_authorised($this->ao)->find_all())); } } ?> diff --git a/modules/payment/classes/Controller/User/Payment.php b/modules/payment/classes/Controller/User/Payment.php index 6b836fd5..83ecbc5d 100644 --- a/modules/payment/classes/Controller/User/Payment.php +++ b/modules/payment/classes/Controller/User/Payment.php @@ -21,20 +21,9 @@ class Controller_User_Payment extends Controller_Payment { $this->meta->title = 'Payments Received'; Block::factory() - ->title(sprintf('%s: %s - %s',_('Payments Received For'),$this->ao->accnum(),$this->ao->name(TRUE))) - ->title_icon('fa fa-money') - ->body(Table::factory() - ->page_items(50) - ->data($this->ao->payment->find_all()) - ->columns(array( - 'id'=>'ID', - 'date_payment'=>'Date', - 'checkout->display("name")'=>'Method', - 'total(TRUE)'=>'Total', - 'balance(TRUE)'=>'Balance', - 'invoicelist()'=>'Invoices', - )) - ); + ->title(sprintf('%s: %s - %s',_('Payments Received For'),$this->ao->refnum(),$this->ao->name(TRUE))) + ->title_icon($this->icon) + ->body(View::factory('payment/user/list')->set('o',$this->ao->payment->find_all())); } } ?> diff --git a/modules/payment/classes/Payment/Bulk/Ezypay.php b/modules/payment/classes/Payment/Bulk/Ezypay.php index 6060b004..668cdcc1 100644 --- a/modules/payment/classes/Payment/Bulk/Ezypay.php +++ b/modules/payment/classes/Payment/Bulk/Ezypay.php @@ -100,7 +100,7 @@ class Payment_Bulk_Ezypay { 'checkout->display("name")'=>'Method', 'total_amt'=>'Amount', 'fees_amt'=>'Fees', - 'account->accnum()'=>'Cust ID', + 'account->refnum()'=>'Cust ID', 'account->name()'=>'Customer', )) ->prepend(array( diff --git a/modules/payment/views/payment/list.php b/modules/payment/views/payment/list.php new file mode 100644 index 00000000..2f809832 --- /dev/null +++ b/modules/payment/views/payment/list.php @@ -0,0 +1,16 @@ + +data($o) + ->columns(array( + 'id'=>'ID', + 'date_payment'=>'Pay Date', + 'account->refnum()'=>'Num', + 'account->name()'=>'Account', + 'account->display("status")'=>'Active', + 'total(TRUE)'=>'Total', + 'balance(TRUE)'=>'Balance', + )) + ->prepend( + Auth::instance()->get_user()->isAdmin() ? array('id'=>array('url'=>URL::link('admin','payment/edit/'))) : array() + ) +?> diff --git a/modules/payment/views/payment/reseller/list.php b/modules/payment/views/payment/reseller/list.php new file mode 100644 index 00000000..522de257 --- /dev/null +++ b/modules/payment/views/payment/reseller/list.php @@ -0,0 +1,18 @@ + +page_items(50) + ->data($o) + ->columns(array( + 'id'=>'ID', + 'date_payment'=>'Date', + 'checkout->display("name")'=>'Method', + 'total(TRUE)'=>'Total', + 'balance(TRUE)'=>'Balance', + 'invoicelist()'=>'Invoices', + 'account->refnum()'=>'Cust ID', + 'account->name()'=>'Customer', + )) + ->prepend( + Auth::instance()->get_user()->isAdmin() ? array('id'=>array('url'=>URL::link('admin','payment/edit/'))) : array() + ); +?> diff --git a/modules/payment/views/payment/user/list.php b/modules/payment/views/payment/user/list.php new file mode 100644 index 00000000..08bd681a --- /dev/null +++ b/modules/payment/views/payment/user/list.php @@ -0,0 +1,13 @@ + +page_items(50) + ->data($o) + ->columns(array( + 'id'=>'ID', + 'date_payment'=>'Date', + 'checkout->display("name")'=>'Method', + 'total(TRUE)'=>'Total', + 'balance(TRUE)'=>'Balance', + 'invoicelist()'=>'Invoices', + )); +?> diff --git a/modules/product/classes/Controller/Admin/Product.php b/modules/product/classes/Controller/Admin/Product.php index b763aee8..0d2a5257 100644 --- a/modules/product/classes/Controller/Admin/Product.php +++ b/modules/product/classes/Controller/Admin/Product.php @@ -248,20 +248,7 @@ $.ajax({ Block::factory() ->title(sprintf('%s: %s',_('Current Services Using this Product'),$po->title())) ->title_icon('icon-th-list') - ->body(Table::factory() - ->data($po->service->where_active()->find_all()) - ->page_items(25) - ->columns(array( - 'id'=>'ID', - 'account->accnum()'=>'Acc Num', - 'account->name()'=>'Account', - 'name()'=>'Details', - 'status'=>'Active', - 'price(TRUE,TRUE)'=>'Price', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - ))); + ->body(View::factory('service/reseller/list')->set('o',$po->service->where_active()->find_all())); } } ?> diff --git a/modules/service/classes/Controller/Reseller/Service.php b/modules/service/classes/Controller/Reseller/Service.php index b471889a..6030d661 100644 --- a/modules/service/classes/Controller/Reseller/Service.php +++ b/modules/service/classes/Controller/Reseller/Service.php @@ -25,23 +25,8 @@ class Controller_Reseller_Service extends Controller_Service { Block::factory() ->title('Customer Services') - ->title_icon('fa fa-list') - ->body(Table::factory() - ->jssort('services') - ->data(ORM::factory('Service')->where_authorised($this->ao)->find_all()) - ->columns(array( - 'id'=>'ID', - 'service_name()'=>'Service', - 'recur_schedule'=>'Billing', - 'price(TRUE,TRUE)'=>'Price', - 'status'=>'Active', - 'account->accnum()'=>'Cust ID', - 'account->name()'=>'Customer', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); + ->title_icon($this->icon) + ->body(View::factory('service/reseller/list')->set('o',ORM::factory('Service')->where_authorised($this->ao)->find_all())); } /** @@ -61,24 +46,8 @@ class Controller_Reseller_Service extends Controller_Service { if ($svs) Block::factory() ->title('Services that should be auto-billed') - ->title_icon('icon-pencil') - ->body(Table::factory() - ->jssort('services') - ->data($svs) - ->columns(array( - 'id'=>'ID', - 'service_name()'=>'Service', - 'recur_schedule'=>'Billing', - 'price(TRUE,TRUE)'=>'Price', - 'account->accnum()'=>'Cust ID', - 'account->name()'=>'Customer', - 'date_next_invoice'=>'Next Invoice', - 'due(TRUE)'=>'Due Invoices', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); + ->title_icon($this->icon) + ->body(View::factory('service/reseller/list')->set('o',$svs)); foreach (ORM::factory('Checkout')->find_all() as $co) { $svs = array(); @@ -89,7 +58,7 @@ class Controller_Reseller_Service extends Controller_Service { if ($svs) Block::factory() ->title($co->name) - ->title_icon('icon-repeat') + ->title_icon('fa fa-bank') ->body(Table::factory() ->jssort($co->id) ->data($svs) @@ -98,7 +67,7 @@ class Controller_Reseller_Service extends Controller_Service { 'service_name()'=>'Service', 'recur_schedule'=>'Billing', 'price(TRUE,TRUE)'=>'Price', - 'account->accnum()'=>'Cust ID', + 'account->refnum()'=>'Cust ID', 'account->name()'=>'Customer', 'date_next_invoice'=>'Next Invoice', 'due(TRUE)'=>'Due Invoices', @@ -117,23 +86,8 @@ class Controller_Reseller_Service extends Controller_Service { public function action_listexpiring() { Block::factory() ->title('Customer Services Expiring') - ->title_icon('icon-th-list') - ->body(Table::factory() - ->jssort('services') - ->data(ORM::factory('Service')->where_authorised($this->ao)->list_expiring()) - ->columns(array( - 'id'=>'ID', - 'expire(TRUE)'=>'Expiry', - 'service_name()'=>'Service', - 'recur_schedule'=>'Billing', - 'price(TRUE,TRUE)'=>'Price', - 'account->accnum()'=>'Cust ID', - 'account->name()'=>'Customer', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); + ->title_icon($this->icon) + ->body(View::factory('service/reseller/list')->set('o',ORM::factory('Service')->where_authorised($this->ao)->list_expiring())); } /** @@ -142,25 +96,8 @@ class Controller_Reseller_Service extends Controller_Service { public function action_listinvoicesoon() { Block::factory() ->title('Customer Services soon to be Invoiced') - ->title_icon('icon-th-list') - ->body(Table::factory() - ->jssort('services') - ->data(ORM::factory('Service')->where_authorised($this->ao)->list_invoicesoon(ORM::factory('Invoice')->config('GEN_SOON_DAYS')+30)) - ->columns(array( - 'id'=>'ID', - 'expire(TRUE)'=>'Expiry', - 'service_name()'=>'Service', - 'recur_schedule'=>'Billing', - 'price(TRUE,TRUE)'=>'Price', - 'charges(TRUE,TRUE)'=>'Charges', - 'account->accnum()'=>'Cust ID', - 'account->name()'=>'Customer', - 'date_next_invoice'=>'Next Invoice', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); + ->title_icon($this->icon) + ->body(View::factory('service/reseller/list')->set('o',ORM::factory('Service')->where_authorised($this->ao)->list_invoicesoon(ORM::factory('Invoice')->config('GEN_SOON_DAYS')+30))); } } ?> diff --git a/modules/service/classes/Controller/User/Service.php b/modules/service/classes/Controller/User/Service.php index 6f631148..1b0512b8 100644 --- a/modules/service/classes/Controller/User/Service.php +++ b/modules/service/classes/Controller/User/Service.php @@ -40,22 +40,9 @@ class Controller_User_Service extends Controller_Service { $this->meta->title = 'Service List'; Block::factory() - ->title(sprintf('Services for Account: %s',$this->ao->accnum())) - ->title_icon('icon-th-list') - ->body(Table::factory() - ->jssort('services') - ->data($this->ao->service->find_all()) - ->columns(array( - 'id'=>'ID', - 'service_name()'=>'Service', - 'recur_schedule'=>'Billing', - 'price(TRUE,TRUE)'=>'Price', - 'status'=>'Active', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); + ->title(sprintf('Services for Account: %s',$this->ao->refnum())) + ->title_icon($this->icon) + ->body(View::factory('service/user/list')->set('o',$this->ao->service->find_all())); } public function action_view() { diff --git a/modules/service/views/service/info.php b/modules/service/views/service/info.php index 344f37ad..219e6d6c 100644 --- a/modules/service/views/service/info.php +++ b/modules/service/views/service/info.php @@ -4,7 +4,7 @@
Account
-
account->name(),$o->account->accnum()); ?>
+
account->name(),$o->account->refnum(TRUE)); ?>
external_billing) : ?>
External Billed
diff --git a/modules/service/views/service/reseller/list.php b/modules/service/views/service/reseller/list.php new file mode 100644 index 00000000..e6108fc5 --- /dev/null +++ b/modules/service/views/service/reseller/list.php @@ -0,0 +1,20 @@ + +jssort('services') + ->data($o) + ->columns(array( + 'id'=>'ID', + 'service_name()'=>'Service', + 'recur_schedule'=>'Billing', + 'price(TRUE,TRUE)'=>'Price', + 'charges(TRUE,TRUE)'=>'Charges', + 'status'=>'Active', + 'account->refnum()'=>'Cust ID', + 'account->name()'=>'Customer', + 'date_next_invoice'=>'Next Invoice', + 'due(TRUE)'=>'Due Invoices', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','service/view/')), + )); +?> diff --git a/modules/service/views/service/user/list.php b/modules/service/views/service/user/list.php deleted file mode 100644 index 87e087b7..00000000 --- a/modules/service/views/service/user/list.php +++ /dev/null @@ -1,16 +0,0 @@ - -title(sprintf('Active Service for Account: %s',$o->accnum())) - ->title_icon('fa-server') - ->span(6) - ->body(Table::factory() - ->data($o->service->list_active()) - ->columns(array( - 'id'=>'ID', - 'service_name()'=>'Service', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); -?> diff --git a/modules/service/views/service/user/list/brief.php b/modules/service/views/service/user/list/brief.php new file mode 100644 index 00000000..2817a5ce --- /dev/null +++ b/modules/service/views/service/user/list/brief.php @@ -0,0 +1,11 @@ + +data($o) + ->columns(array( + 'id'=>'ID', + 'service_name()'=>'Service', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','service/view/')), + )); +?> diff --git a/modules/service/views/service/user/list/expiring.php b/modules/service/views/service/user/list/expiring.php index f9a50e54..d9528432 100644 --- a/modules/service/views/service/user/list/expiring.php +++ b/modules/service/views/service/user/list/expiring.php @@ -1,17 +1,12 @@ - -title(sprintf('Services Expiring for Account: %s',$o->accnum())) - ->title_icon('fa fa-level-down') - ->span(6) - ->body(Table::factory() - ->data($o->service->list_expiring()) - ->columns(array( - 'id'=>'ID', - 'service_name(59)'=>'Service', - 'expire(TRUE)'=>'Date', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); + +data($o) + ->columns(array( + 'id'=>'ID', + 'service_name(59)'=>'Service', + 'expire(TRUE)'=>'Date', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','service/view/')), + )); ?> diff --git a/modules/service/views/service/user/list/inactive.php b/modules/service/views/service/user/list/inactive.php index cc2535a2..a5b0b31e 100644 --- a/modules/service/views/service/user/list/inactive.php +++ b/modules/service/views/service/user/list/inactive.php @@ -1,17 +1,12 @@ - -title(sprintf('InActive Services for Account: %s',$o->accnum())) - ->title_icon('fa fa-stop') - ->span(6) - ->body(Table::factory() - ->data($o->service->where('status','!=',1)->or_where('status','IS',null)->find_all()) - ->columns(array( - 'id'=>'ID', - 'service_name(60)'=>'Service', - 'date_end'=>'Date', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); + +data($o) + ->columns(array( + 'id'=>'ID', + 'service_name(60)'=>'Service', + 'date_end'=>'Date', + )) + ->prepend(array( + 'id'=>array('url'=>URL::link('user','service/view/')), + )); ?> diff --git a/modules/service/views/service/user/view.php b/modules/service/views/service/user/view.php index 64b49fad..79c46e93 100644 --- a/modules/service/views/service/user/view.php +++ b/modules/service/views/service/user/view.php @@ -12,7 +12,7 @@ ?>
-
+
service_view(); ?>
diff --git a/modules/ssl/classes/Controller/Reseller/Service/Ssl.php b/modules/ssl/classes/Controller/Reseller/Service/Ssl.php index 2553d8d6..5f7ec59a 100644 --- a/modules/ssl/classes/Controller/Reseller/Service/Ssl.php +++ b/modules/ssl/classes/Controller/Reseller/Service/Ssl.php @@ -19,25 +19,8 @@ class Controller_Reseller_Service_Ssl extends Controller_Service { public function action_list() { Block::factory() ->title('SSL Services') - ->title_icon('icon-th-list') - ->body(Table::factory() - ->jssort('host') - ->data(ORM::factory('Service')->where_authorised($this->ao)->list_byplugin('SSL')) - ->columns(array( - 'id'=>'ID', - 'name()'=>'Service', - 'plugin()->expire(TRUE)'=>'Expire', - 'recur_schedule'=>'Billing', - 'price(TRUE,TRUE)'=>'Price', - 'account->accnum()'=>'Cust ID', - 'account->name()'=>'Customer', - 'date_next_invoice'=>'Next Invoice', - 'due(TRUE)'=>'Due Invoices', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); + ->title_icon($this->icon) + ->body(View::factory('service/list')->set('o',ORM::factory('Service')->where_authorised($this->ao)->list_byplugin('SSL'))); } } ?> diff --git a/modules/ssl/classes/Controller/Ssl.php b/modules/ssl/classes/Controller/Ssl.php index 7ffb994a..7e72fe9b 100644 --- a/modules/ssl/classes/Controller/Ssl.php +++ b/modules/ssl/classes/Controller/Ssl.php @@ -11,6 +11,7 @@ */ class Controller_SSL extends Controller_TemplateDefault { protected $auth_required = false; + protected $icon = 'fa fa-certificate'; /** * Render out an SSL CA certificate diff --git a/modules/statement/classes/Controller/Reseller/Statement.php b/modules/statement/classes/Controller/Reseller/Statement.php index bf9a7d77..80dc23bb 100644 --- a/modules/statement/classes/Controller/Reseller/Statement.php +++ b/modules/statement/classes/Controller/Reseller/Statement.php @@ -70,7 +70,7 @@ class Controller_Reseller_Statement extends Controller_Statement { krsort($result); Block::factory() - ->title(sprintf('%s: %s - %s',_('Transactions For'),$ao->accnum(),$ao->name(TRUE))) + ->title(sprintf('%s: %s - %s',_('Transactions For'),$ao->refnum(),$ao->name(TRUE))) ->title_icon('icon-tasks') ->body(View::factory('statement/user/show')->set('result',$result)->set('total',$total)); } diff --git a/modules/statement/classes/Controller/User/Statement.php b/modules/statement/classes/Controller/User/Statement.php index 7d80e819..962a01b4 100644 --- a/modules/statement/classes/Controller/User/Statement.php +++ b/modules/statement/classes/Controller/User/Statement.php @@ -48,7 +48,7 @@ class Controller_User_Statement extends Controller_Statement { krsort($result); Block::factory() - ->title(sprintf('%s: %s - %s',_('Transactions For'),$this->ao->accnum(),$this->ao->name(TRUE))) + ->title(sprintf('%s: %s - %s',_('Transactions For'),$this->ao->refnum(),$this->ao->name(TRUE))) ->title_icon('icon-tasks') ->body(View::factory('statement/user/show')->set('result',$result)->set('total',$total)); }