From e0b45be758123454aea2b2e2ccd3522a64cba6eb Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 29 Jul 2016 11:19:30 +1000 Subject: [PATCH] Added meta title to pages --- application/classes/Controller/Account.php | 21 ------------------- .../classes/Controller/Admin/Module.php | 4 ++++ .../classes/Controller/Admin/Setup.php | 4 ++-- .../classes/Controller/Reseller/Account.php | 4 ++++ application/classes/Controller/Welcome.php | 11 +--------- .../adsl/classes/Controller/Admin/Adsl.php | 10 +++++++++ .../classes/Controller/Reseller/Charge.php | 4 ++++ modules/charge/classes/Model/Charge.php | 4 ++++ .../classes/Controller/Reseller/Email.php | 6 ++++-- .../email/classes/Controller/User/Email.php | 4 ++++ .../classes/Controller/Reseller/Invoice.php | 4 +++- .../classes/Controller/User/Invoice.php | 2 ++ modules/lnapp | 2 +- .../classes/Controller/Reseller/Payment.php | 4 +++- .../classes/Controller/User/Payment.php | 4 +++- .../product/classes/Controller/Product.php | 6 ++---- .../classes/Controller/Reseller/Service.php | 4 +++- .../classes/Controller/User/Service.php | 4 ++++ .../ssl/classes/Controller/Reseller/Ssl.php | 12 +++++++---- .../classes/Controller/Reseller/Statement.php | 2 ++ .../classes/Controller/User/Statement.php | 2 ++ .../task/classes/Controller/Admin/Task.php | 4 +++- 22 files changed, 73 insertions(+), 49 deletions(-) diff --git a/application/classes/Controller/Account.php b/application/classes/Controller/Account.php index 25a7fce2..a82f03de 100644 --- a/application/classes/Controller/Account.php +++ b/application/classes/Controller/Account.php @@ -10,26 +10,5 @@ * @license http://dev.osbill.net/license.html */ class Controller_Account extends Controller_TemplateDefault { - protected function group() { - // List all available groups for this user. - $output = ''; - - foreach ($this->ao->groups() as $go) - $output .= sprintf('Group %s: %s
',$go->id,$go->display('name')); - - Block::factory() - ->title('Group Structure') - ->body($output); - - // List all available methods for this user. - $output = ''; - - foreach ($this->ao->methods() as $mmo) - $output .= sprintf('Module: %s, Method %s: %s
',$mmo->module->name,$mmo->name,$mmo->url()); - - Block::factory() - ->title('Available Methods') - ->body($output); - } } ?> diff --git a/application/classes/Controller/Admin/Module.php b/application/classes/Controller/Admin/Module.php index b919fe35..c70286f8 100644 --- a/application/classes/Controller/Admin/Module.php +++ b/application/classes/Controller/Admin/Module.php @@ -95,6 +95,8 @@ class Controller_Admin_Module extends Controller_Module { $id = $this->request->param('id'); $mo = ORM::factory('Module',$id); + $this->meta->title = 'Module: '.$mo->name(); + $methods = array(); if (! $mo->loaded()) { @@ -171,6 +173,8 @@ class Controller_Admin_Module extends Controller_Module { * List our installed modules */ public function action_list() { + $this->meta->title = 'Module List'; + Block::factory() ->title('Defined Modules') ->title_icon('fa fa-cog') diff --git a/application/classes/Controller/Admin/Setup.php b/application/classes/Controller/Admin/Setup.php index 581803d5..84f833ef 100644 --- a/application/classes/Controller/Admin/Setup.php +++ b/application/classes/Controller/Admin/Setup.php @@ -25,13 +25,13 @@ class Controller_Admin_Setup extends Controller_TemplateDefault { Block::factory() ->title('Update Site Configuration') - ->title_icon('icon-wrench') + ->title_icon('fa fa-wrench') ->type('form-horizontal') ->body(View::factory('setup/admin/edit')->set('o',$o)); Block::factory() ->title('Update Module Configuration') - ->title_icon('icon-wrench') + ->title_icon('fa fa-wrench') ->type('form-horizontal') ->body(View::factory('setup/admin/module')->set('o',$o)->set('mid',NULL)); } diff --git a/application/classes/Controller/Reseller/Account.php b/application/classes/Controller/Reseller/Account.php index 1aacdc7e..91c3cad4 100644 --- a/application/classes/Controller/Reseller/Account.php +++ b/application/classes/Controller/Reseller/Account.php @@ -20,6 +20,8 @@ class Controller_Reseller_Account extends Controller_Account { * Show a list of accounts */ public function action_list() { + $this->meta->title = 'Customer List'; + Block::factory() ->title(_('Customer List')) ->title_icon('fa fa-list') @@ -54,6 +56,8 @@ class Controller_Reseller_Account extends Controller_Account { if (! $ao->loaded() OR ! $ao->status OR ! Auth::instance()->authorised($ao)) throw HTTP_Exception::factory(403,'Account either doesnt exist, or you are not authorised to see it'); + $this->meta->title = 'Customer: '.$ao->name(); + $this->template->content = View::factory('account/reseller/view')->set('o',$ao); } } diff --git a/application/classes/Controller/Welcome.php b/application/classes/Controller/Welcome.php index a36058ea..483505c7 100644 --- a/application/classes/Controller/Welcome.php +++ b/application/classes/Controller/Welcome.php @@ -12,24 +12,15 @@ class Controller_Welcome extends Controller_TemplateDefault { protected $auth_required = FALSE; - public function action_breadcrumb() { - $this->auto_render = FALSE; - - $this->response->body(Session::instance()->get_once('breadcrumb')); - } - public function action_index() { if (! Kohana::$config->load('config')->appname) HTTP::redirect('guide/app'); - $output = ''; - - $output = View::factory('pages/welcome'); Style::factory() ->type('file') ->data('media/css/pages/welcome.css'); - $this->template->content = $output; + $this->template->content = View::factory('pages/welcome'); } } ?> diff --git a/modules/adsl/classes/Controller/Admin/Adsl.php b/modules/adsl/classes/Controller/Admin/Adsl.php index 31a2e35a..d698ffa8 100644 --- a/modules/adsl/classes/Controller/Admin/Adsl.php +++ b/modules/adsl/classes/Controller/Admin/Adsl.php @@ -33,6 +33,8 @@ class Controller_Admin_Adsl extends Controller_Adsl { } public function action_list() { + $this->meta->title = 'ADSL Plans'; + Block::factory() ->title('ADSL Plans') ->title_icon('icon-th-list') @@ -62,6 +64,12 @@ class Controller_Admin_Adsl extends Controller_Adsl { public function action_edit() { $apo = ORM::factory('Product_Plugin_Adsl',$this->request->param('id')); + + if (! $qpo->loaded()) + throw HTTP_Exception::factory(403,'Plan either doesnt exist, or you are not authorised to see it'); + + $this->meta->title = 'ADSL Plan: '.$qpo->name(); + $test_result = array(); if (! $apo->loaded()) @@ -106,6 +114,8 @@ class Controller_Admin_Adsl extends Controller_Adsl { * Usage statistics for the previous moth */ public function action_stat() { + $this->meta->title = 'ADSL Stats'; + // @todo This needs to be configurable. $traffic = array(1,2,5,10,25,50,75,100,150,200); diff --git a/modules/charge/classes/Controller/Reseller/Charge.php b/modules/charge/classes/Controller/Reseller/Charge.php index c98a461b..39d0b8c7 100644 --- a/modules/charge/classes/Controller/Reseller/Charge.php +++ b/modules/charge/classes/Controller/Reseller/Charge.php @@ -54,6 +54,8 @@ class Controller_Reseller_Charge extends Controller_Charge { private function add_edit($id=NULL,$output='') { $co = ORM::factory('Charge',$id); + $this->meta->title = sprintf('Charge: %s (%s)',$co->name(),$co->account->name()); + if ($_POST AND $co->values($_POST)->changed() AND (! $this->save($co))) $co->reload(); @@ -135,6 +137,8 @@ $(document).ready(function() { * Show a list of invoices */ public function action_list() { + $this->meta->title = 'Customer Charges'; + Block::factory() ->title('Customer Charges') ->title_icon('fa fa-list') diff --git a/modules/charge/classes/Model/Charge.php b/modules/charge/classes/Model/Charge.php index 93ac17cb..756e4bdd 100644 --- a/modules/charge/classes/Model/Charge.php +++ b/modules/charge/classes/Model/Charge.php @@ -98,6 +98,10 @@ class Model_Charge extends ORM_OSB implements Invoicable { } } + public function xtitle() { + return $this->invoice_item(5); + } + /** * Render some details for specific calls, eg: invoice */ diff --git a/modules/email/classes/Controller/Reseller/Email.php b/modules/email/classes/Controller/Reseller/Email.php index c7acd748..5c78e231 100644 --- a/modules/email/classes/Controller/Reseller/Email.php +++ b/modules/email/classes/Controller/Reseller/Email.php @@ -18,9 +18,11 @@ class Controller_Reseller_Email extends Controller_Email { * Show a list of emails */ public function action_list() { + $this->meta->title = 'Emails Sent'; + Block::factory() - ->title(_('System Emails Sent')) - ->title_icon('icon-th') + ->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()) diff --git a/modules/email/classes/Controller/User/Email.php b/modules/email/classes/Controller/User/Email.php index ae74eae2..62bfa5c1 100644 --- a/modules/email/classes/Controller/User/Email.php +++ b/modules/email/classes/Controller/User/Email.php @@ -19,6 +19,8 @@ class Controller_User_Email extends Controller_Email { * Show a list of emails */ public function action_list() { + $this->meta->title = 'Email List'; + $this->template->content = View::factory('email/user/list'); } @@ -30,6 +32,8 @@ class Controller_User_Email extends Controller_Email { if (! $elo->loaded() OR ! Auth::instance()->authorised($elo->account)) throw HTTP_Exception::factory(403,'Service either doesnt exist, or you are not authorised to see it'); + $this->meta->title = 'Email: '.$elo->name(); + $output .= View::factory('email/user/view') ->set('elo',$elo); diff --git a/modules/invoice/classes/Controller/Reseller/Invoice.php b/modules/invoice/classes/Controller/Reseller/Invoice.php index bc899d2d..09985393 100644 --- a/modules/invoice/classes/Controller/Reseller/Invoice.php +++ b/modules/invoice/classes/Controller/Reseller/Invoice.php @@ -15,9 +15,11 @@ class Controller_Reseller_Invoice extends Controller_Invoice { ); public function action_list() { + $this->meta->title = 'Customer Invoice List'; + Block::factory() ->title('Customer Invoices') - ->title_icon('icon-th-list') + ->title_icon('fa fa-edit') ->body(Table::factory() ->jssort('invoices') ->data(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 fe7ab3fa..a3c1ed30 100644 --- a/modules/invoice/classes/Controller/User/Invoice.php +++ b/modules/invoice/classes/Controller/User/Invoice.php @@ -73,6 +73,8 @@ class Controller_User_Invoice extends Controller_Invoice { * Show a list of invoices */ public function action_list() { + $this->meta->title = 'Invoice List'; + Block::factory() ->title(sprintf('Invoices for Account: %s',$this->ao->accnum())) ->title_icon('fa fa-list') diff --git a/modules/lnapp b/modules/lnapp index c5b2785e..c57e1668 160000 --- a/modules/lnapp +++ b/modules/lnapp @@ -1 +1 @@ -Subproject commit c5b2785e82ed2bf914e7df3107373e24098df794 +Subproject commit c57e16683499491a56ff177a10896a531e4ae8d0 diff --git a/modules/payment/classes/Controller/Reseller/Payment.php b/modules/payment/classes/Controller/Reseller/Payment.php index 957844fd..89cefb8d 100644 --- a/modules/payment/classes/Controller/Reseller/Payment.php +++ b/modules/payment/classes/Controller/Reseller/Payment.php @@ -18,9 +18,11 @@ class Controller_Reseller_Payment extends Controller_Payment { * Show a list of payments */ public function action_list() { + $this->meta->title = 'Customer Payments'; + Block::factory() ->title('Customer Payments') - ->title_icon('icon-th-list') + ->title_icon('fa fa-money') ->body(Table::factory() ->page_items(50) ->data(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 95da0030..6b836fd5 100644 --- a/modules/payment/classes/Controller/User/Payment.php +++ b/modules/payment/classes/Controller/User/Payment.php @@ -18,9 +18,11 @@ class Controller_User_Payment extends Controller_Payment { * Show payments received */ public function action_list() { + $this->meta->title = 'Payments Received'; + Block::factory() ->title(sprintf('%s: %s - %s',_('Payments Received For'),$this->ao->accnum(),$this->ao->name(TRUE))) - ->title_icon('icon-th-list') + ->title_icon('fa fa-money') ->body(Table::factory() ->page_items(50) ->data($this->ao->payment->find_all()) diff --git a/modules/product/classes/Controller/Product.php b/modules/product/classes/Controller/Product.php index 15758205..85f1700d 100644 --- a/modules/product/classes/Controller/Product.php +++ b/modules/product/classes/Controller/Product.php @@ -27,6 +27,8 @@ class Controller_Product extends Controller_TemplateDefault { if (! $pco->loaded() OR ((! $pco->status AND ! Kohana::$config->load('debug')->show_inactive))) HTTP::redirect('welcome/index'); + $this->meta->title = $pco->name(); + Style::factory() ->type('file') ->data('media/css/pages/welcome.css'); @@ -45,10 +47,6 @@ class Controller_Product extends Controller_TemplateDefault { if (! $po->loaded()) HTTP::redirect('welcome/index'); - // @todo This breadcrumb may not be working anymore. - #BreadCrumb::name($this->request->uri(),$po->product_translate->find()->name); - #BreadCrumb::url('product','product/categorys'); - $this->template->content = (string)View::factory('product/view') ->set('o',$po); } diff --git a/modules/service/classes/Controller/Reseller/Service.php b/modules/service/classes/Controller/Reseller/Service.php index 3096f9ad..b471889a 100644 --- a/modules/service/classes/Controller/Reseller/Service.php +++ b/modules/service/classes/Controller/Reseller/Service.php @@ -21,9 +21,11 @@ class Controller_Reseller_Service extends Controller_Service { * Show a list of services */ public function action_list() { + $this->meta->title = 'Customer Services'; + Block::factory() ->title('Customer Services') - ->title_icon('icon-th-list') + ->title_icon('fa fa-list') ->body(Table::factory() ->jssort('services') ->data(ORM::factory('Service')->where_authorised($this->ao)->find_all()) diff --git a/modules/service/classes/Controller/User/Service.php b/modules/service/classes/Controller/User/Service.php index e0ecb0d2..6f631148 100644 --- a/modules/service/classes/Controller/User/Service.php +++ b/modules/service/classes/Controller/User/Service.php @@ -37,6 +37,8 @@ class Controller_User_Service extends Controller_Service { * Show a list of services */ public function action_list() { + $this->meta->title = 'Service List'; + Block::factory() ->title(sprintf('Services for Account: %s',$this->ao->accnum())) ->title_icon('icon-th-list') @@ -64,6 +66,8 @@ class Controller_User_Service extends Controller_Service { if (! $so->loaded() OR ! Auth::instance()->authorised($so->account)) throw HTTP_Exception::factory(403,'Service either doesnt exist, or you are not authorised to see it'); + $this->meta->title = 'Service: '.$so->name(); + $output .= View::factory('service/user/view') ->set('o',$so); diff --git a/modules/ssl/classes/Controller/Reseller/Ssl.php b/modules/ssl/classes/Controller/Reseller/Ssl.php index f8693f2e..e1d87b76 100644 --- a/modules/ssl/classes/Controller/Reseller/Ssl.php +++ b/modules/ssl/classes/Controller/Reseller/Ssl.php @@ -9,7 +9,7 @@ * @copyright (c) 2009-2013 Open Source Billing * @license http://dev.osbill.net/license.html */ -class Controller_Reseller_SSL extends Controller_SSL { +class Controller_Reseller_Ssl extends Controller_Ssl { protected $auth_required = TRUE; protected $secure_actions = array( @@ -26,9 +26,11 @@ class Controller_Reseller_SSL extends Controller_SSL { if ($this->request->param('id') != 'Y') $o->where_active(); + $this->meta->title = 'SSL List'; + Block::factory() ->title('SSL CA Certificates') - ->title_icon('icon-th-list') + ->title_icon('fa fa-shield') ->body(Table::factory() ->jssort('ca') ->data($o->find_all()) @@ -105,7 +107,7 @@ class Controller_Reseller_SSL extends Controller_SSL { Block::factory() ->type('form-horizontal') ->title('Add/View SSL CA') - ->title_icon('icon-wrench') + ->title_icon('fa fa-wrench') ->body($this->add_edit()); } @@ -115,7 +117,7 @@ class Controller_Reseller_SSL extends Controller_SSL { Block::factory() ->type('form-horizontal') ->title(sprintf('%s: %s',_('Add/View SSL CA'),$id)) - ->title_icon('icon-wrench') + ->title_icon('fa fa-wrench') ->body($this->add_edit($id,$output)); } @@ -146,6 +148,8 @@ class Controller_Reseller_SSL extends Controller_SSL { $sco->reload(); } + $this->meta->title = 'SSL: '.$sco->name(); + return View::factory('ssl/reseller/add_edit') ->set('o',$sco); } diff --git a/modules/statement/classes/Controller/Reseller/Statement.php b/modules/statement/classes/Controller/Reseller/Statement.php index c2c57c52..bf9a7d77 100644 --- a/modules/statement/classes/Controller/Reseller/Statement.php +++ b/modules/statement/classes/Controller/Reseller/Statement.php @@ -40,6 +40,8 @@ class Controller_Reseller_Statement extends Controller_Statement { if (! $ao->loaded() OR ! Auth::instance()->authorised($ao)) throw HTTP_Exception::factory(403,'Service either doesnt exist, or you are not authorised to see it'); + $this->meta->title = 'Statement: '.$ao->name(); + $result = array(); $total = 0; diff --git a/modules/statement/classes/Controller/User/Statement.php b/modules/statement/classes/Controller/User/Statement.php index 40f68d4e..7d80e819 100644 --- a/modules/statement/classes/Controller/User/Statement.php +++ b/modules/statement/classes/Controller/User/Statement.php @@ -18,6 +18,8 @@ class Controller_User_Statement extends Controller_Statement { * Show a payments received */ public function action_show() { + $this->meta->title = 'Statement'; + $result = array(); $total = 0; diff --git a/modules/task/classes/Controller/Admin/Task.php b/modules/task/classes/Controller/Admin/Task.php index f719832f..2864bc3e 100644 --- a/modules/task/classes/Controller/Admin/Task.php +++ b/modules/task/classes/Controller/Admin/Task.php @@ -20,9 +20,11 @@ class Controller_Admin_Task extends Controller_Task { * Show a list of tasks run */ public function action_log() { + $this->meta->title = 'Task Log'; + Block::factory() ->title(_('Task Log')) - ->title_icon('icon-th-list') + ->title_icon('fa fa-list') ->body(Table::factory() ->page_items(50) ->data(ORM::factory('Task_Log')->find_all())