Added meta title to pages

This commit is contained in:
Deon George 2016-07-29 11:19:30 +10:00
parent f426502707
commit e0b45be758
22 changed files with 73 additions and 49 deletions

View File

@ -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<br/>',$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<br/>',$mmo->module->name,$mmo->name,$mmo->url());
Block::factory()
->title('Available Methods')
->body($output);
}
}
?>

View File

@ -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')

View File

@ -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));
}

View File

@ -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);
}
}

View File

@ -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');
}
}
?>

View File

@ -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);

View File

@ -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')

View File

@ -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
*/

View File

@ -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())

View File

@ -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);

View File

@ -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())

View File

@ -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')

@ -1 +1 @@
Subproject commit c5b2785e82ed2bf914e7df3107373e24098df794
Subproject commit c57e16683499491a56ff177a10896a531e4ae8d0

View File

@ -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())

View File

@ -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())

View File

@ -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);
}

View File

@ -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())

View File

@ -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);

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -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())