From 21d204f605237d558859b5705edb01ed9fdd78c4 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 25 Jul 2016 00:44:17 +1000 Subject: [PATCH] Fixed some more bootstrap rendering --- .../classes/Controller/Reseller/Account.php | 94 +------------- .../views/account/reseller/listlog.php | 15 +++ application/views/account/reseller/view.php | 3 + .../email/classes/Controller/User/Email.php | 19 +-- modules/email/views/email/user/list.php | 19 +++ .../classes/Controller/User/Invoice.php | 60 +-------- modules/invoice/classes/Invoice.php | 2 +- modules/invoice/views/invoice/render.php | 104 +++++++++++++++ modules/invoice/views/invoice/user/email.php | 19 +++ modules/invoice/views/invoice/user/memo.php | 14 ++ modules/invoice/views/invoice/user/next.php | 12 ++ modules/invoice/views/invoice/user/view.php | 121 ++++-------------- modules/lnapp | 2 +- .../payment/views/payment/admin/add_edit.php | 6 +- .../views/service/user/list/expiring.php | 2 +- .../views/service/user/list/inactive.php | 17 +++ 16 files changed, 239 insertions(+), 270 deletions(-) create mode 100644 application/views/account/reseller/listlog.php create mode 100644 modules/email/views/email/user/list.php create mode 100644 modules/invoice/views/invoice/render.php create mode 100644 modules/invoice/views/invoice/user/email.php create mode 100644 modules/invoice/views/invoice/user/memo.php create mode 100644 modules/invoice/views/invoice/user/next.php create mode 100644 modules/service/views/service/user/list/inactive.php diff --git a/application/classes/Controller/Reseller/Account.php b/application/classes/Controller/Reseller/Account.php index bf5270d8..1aacdc7e 100644 --- a/application/classes/Controller/Reseller/Account.php +++ b/application/classes/Controller/Reseller/Account.php @@ -22,7 +22,7 @@ class Controller_Reseller_Account extends Controller_Account { public function action_list() { Block::factory() ->title(_('Customer List')) - ->title_icon('icon-th-list') + ->title_icon('fa fa-list') ->body(Table::factory() ->data(ORM::factory('Account')->where_authorised($this->ao,'id')->find_all()) ->jssort('customer') @@ -33,7 +33,7 @@ class Controller_Reseller_Account extends Controller_Account { 'name(TRUE)'=>'Account', 'email'=>'Email', 'invoices_due_total(NULL,TRUE)'=>'Invoices', - 'service->list_count()'=>'Services', + 'service->find_all()->count()'=>'Services', )) ->prepend(array( 'id'=>array('url'=>URL::link('reseller','account/view/')), @@ -45,20 +45,7 @@ class Controller_Reseller_Account extends Controller_Account { * Show a list of account logins */ public function action_listlog() { - Block::factory() - ->title(_('Customer Login Activity')) - ->title_icon('icon-eye-open') - ->body(Table::factory() - ->data(ORM::factory('Account_Log')->where_authorised($this->ao)->find_all()) - ->page_items(25) - ->columns(array( - 'id'=>'ID', - 'date_orig'=>'Date', - 'account->name()'=>'Account', - 'ip'=>'IP Address', - 'details'=>'Details', - )) - ); + $this->template->content = View::factory('account/reseller/listlog'); } public function action_view() { @@ -67,80 +54,7 @@ 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'); - 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()) - ->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/')), - )) - ); - - $i = Invoice::instance(); - foreach ($ao->service->list_active() as $io) - if (! $io->suspend_billing AND ! $io->external_billing) - $i->add_service($io); - - Block::factory() - ->title(sprintf('Next Invoice Items for Account: %s',$ao->accnum())) - ->title_icon('icon-info-sign') - ->span(6) - ->body($i->render('html','body',array('noid'=>TRUE))); - - Block::factory() - ->title(sprintf('InActive Services for Account: %s',$ao->accnum())) - ->title_icon('icon-info-sign') - ->span(6) - ->body(Table::factory() - ->data($ao->service->where('status','!=',1)->or_where('status','IS',null)->find_all()) - ->columns(array( - 'id'=>'ID', - 'service_name()'=>'Service', - 'date_end'=>'Date', - )) - ->prepend(array( - 'id'=>array('url'=>URL::link('user','service/view/')), - )) - ); + $this->template->content = View::factory('account/reseller/view')->set('o',$ao); } } ?> diff --git a/application/views/account/reseller/listlog.php b/application/views/account/reseller/listlog.php new file mode 100644 index 00000000..3e4b0147 --- /dev/null +++ b/application/views/account/reseller/listlog.php @@ -0,0 +1,15 @@ +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 987fe7e1..7b8bfdac 100644 --- a/application/views/account/reseller/view.php +++ b/application/views/account/reseller/view.php @@ -1,3 +1,6 @@ + set('o',$o); ?> set('o',$o); ?> set('o',$o); ?> +set('o',$o); ?> +set('o',$o); ?> diff --git a/modules/email/classes/Controller/User/Email.php b/modules/email/classes/Controller/User/Email.php index 29384712..ae74eae2 100644 --- a/modules/email/classes/Controller/User/Email.php +++ b/modules/email/classes/Controller/User/Email.php @@ -19,24 +19,7 @@ class Controller_User_Email extends Controller_Email { * Show a list of emails */ public function action_list() { - Block::factory() - ->title(sprintf(_('System Emails Sent for %s: %s'),$this->ao->accnum(),$this->ao->name(TRUE))) - ->title_icon('icon-th') - ->body(Table::factory() - ->page_items(25) - ->data($this->ao->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), - )) - ); + $this->template->content = View::factory('email/user/list'); } public function action_view() { diff --git a/modules/email/views/email/user/list.php b/modules/email/views/email/user/list.php new file mode 100644 index 00000000..9221996a --- /dev/null +++ b/modules/email/views/email/user/list.php @@ -0,0 +1,19 @@ +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), + )) + ); diff --git a/modules/invoice/classes/Controller/User/Invoice.php b/modules/invoice/classes/Controller/User/Invoice.php index 535c4477..fe7ab3fa 100644 --- a/modules/invoice/classes/Controller/User/Invoice.php +++ b/modules/invoice/classes/Controller/User/Invoice.php @@ -75,7 +75,7 @@ class Controller_User_Invoice extends Controller_Invoice { public function action_list() { Block::factory() ->title(sprintf('Invoices for Account: %s',$this->ao->accnum())) - ->title_icon('icon-th-list') + ->title_icon('fa fa-list') ->body(Table::factory() ->jssort('invoices') ->data($this->ao->invoice->find_all()) @@ -107,64 +107,8 @@ class Controller_User_Invoice extends Controller_Invoice { $output .= Invoice::instance($io)->render('html','all'); - $output .= '
'; - $output .= HTML::anchor(URL::link('user','invoice/email/'.$io->id),'Email',array('class'=>'btn pull-right')); - $output .= HTML::anchor(URL::link('user','invoice/download/'.$io->id),'Download',array('class'=>'btn pull-right')); - - if ($io->due() AND ! $io->cart_exists()) - $output .= View::factory('invoice/user/view/pay') - ->set('mid',$io->mid()) - ->set('o',$io); - - if (! $io->status) { - Style::factory() - ->type('file') - ->data('media/css/pages/invoice.css'); - - $output .= '
Invoice CANCELLED.
'; - } - - Block::factory() - ->title(sprintf('%s: %s - %s',_('Invoice'),$io->refnum(),$io->account->name())) - ->title_icon('icon-list-alt') - ->body($output); - - $x = $io->invoice_memo->find_all(); - if ($x->count()) - Block::factory() - ->title('Invoice Memos') - ->title_icon('icon-list-alt') - ->span(6) - ->body(Table::factory() - ->data($x) - ->columns(array( - 'id'=>'ID', - 'date_orig'=>'Date', - 'account->name()'=>'Account', - 'memo'=>'Memo', - ))); - - $x = $io->email()->find_all(); - if ($x->count()) - Block::factory() - ->title('Invoice Emails') - ->title_icon('icon-list-alt') - ->span(6) - ->body(Table::factory() - ->data($x) - ->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'=>55), - )) - ); + $this->template->content = View::factory('invoice/user/view')->set('o',$io)->set('output',$output); } } ?> diff --git a/modules/invoice/classes/Invoice.php b/modules/invoice/classes/Invoice.php index a74ab59d..0eb27783 100644 --- a/modules/invoice/classes/Invoice.php +++ b/modules/invoice/classes/Invoice.php @@ -214,7 +214,7 @@ class Invoice { * Renders the invoice in HTML */ private function render_html() { - return View::factory('invoice/user/view') + return View::factory('invoice/render') ->set('o',$this->_io); } diff --git a/modules/invoice/views/invoice/render.php b/modules/invoice/views/invoice/render.php new file mode 100644 index 00000000..eb3109a2 --- /dev/null +++ b/modules/invoice/views/invoice/render.php @@ -0,0 +1,104 @@ +
+
+ + + + + +
+ name(); ?>
+ taxid(); ?>
+
+ address(); ?>
+
+ contacts(); ?> +
+
+ +
+
+
Tax Invoice
+
id(); ?>
+ +
Issue Date
+
display('date_orig'); ?>
+ +
Due Date
+
display('due_date'); ?>
+ +
Current Charges
+
total_charges(TRUE); ?>
+ +
Payments Received
+
payments_total(TRUE); ?>
+ +
Credits Applied
+
total_credits(TRUE); ?>
+ +
Still Due
+
due(TRUE); ?>
+
+
+
+ +
+
+

Charge Details

+ + render('html','body'); ?> +
+
+ +
+
+
Reminder Details
+ +
+ reminders() as $eto) : ?> +
reminders($eto->name,TRUE); ?>
+
name(); ?>
+ +
+
+ +
+
+ +
Sub Total
+
subtotal(TRUE); ?>
+ + + + total_credits()) : ?> +
Credits
+
total_credits(TRUE); ?>
+ + + + + total_discounts()) : ?> +
Discounts
+
total_discounts(TRUE); ?>
+ + + + +
Taxes Included:
+ tax_summary() as $tid => $amount) : + $m = ORM::factory('Tax',$tid); ?> +
description); ?>
+ + + + +
Total Invoice:
+
total(TRUE); ?>
+ + + +
Account Due:
+
account->invoices_due_total(NULL,TRUE); ?>
+ +
+
+
diff --git a/modules/invoice/views/invoice/user/email.php b/modules/invoice/views/invoice/user/email.php new file mode 100644 index 00000000..700a6350 --- /dev/null +++ b/modules/invoice/views/invoice/user/email.php @@ -0,0 +1,19 @@ + +title('Invoice Emails') + ->title_icon('fa fa-list') + ->span(6) + ->body(Table::factory() + ->data($o->email()->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'=>52), + )) + ); diff --git a/modules/invoice/views/invoice/user/memo.php b/modules/invoice/views/invoice/user/memo.php new file mode 100644 index 00000000..7cac06aa --- /dev/null +++ b/modules/invoice/views/invoice/user/memo.php @@ -0,0 +1,14 @@ + +title('Invoice Memos') + ->title_icon('fa fa-list') + ->span(6) + ->body(Table::factory() + ->data($o->invoice_memo->find_all()) + ->columns(array( + 'id'=>'ID', + 'date_orig'=>'Date', + 'account->name()'=>'Account', + 'memo'=>'Memo', + )) + ); diff --git a/modules/invoice/views/invoice/user/next.php b/modules/invoice/views/invoice/user/next.php new file mode 100644 index 00000000..16f0be28 --- /dev/null +++ b/modules/invoice/views/invoice/user/next.php @@ -0,0 +1,12 @@ + +service->list_active() as $io) + if (! $io->suspend_billing AND ! $io->external_billing) + $i->add_service($io); + + echo Block::factory() + ->title(sprintf('Next Invoice Items for Account: %s',$o->accnum())) + ->title_icon('fa fa-shopping-cart') + ->span(6) + ->body($i->render('html','body',array('noid'=>TRUE))); diff --git a/modules/invoice/views/invoice/user/view.php b/modules/invoice/views/invoice/user/view.php index 0a581df5..89a953c2 100644 --- a/modules/invoice/views/invoice/user/view.php +++ b/modules/invoice/views/invoice/user/view.php @@ -1,104 +1,29 @@ -
-
- - - - - -
- name(); ?>
- taxid(); ?>
-
- address(); ?>
-
- contacts(); ?> -
-
+ + +'; -
-
-
Tax Invoice
-
id(); ?>
+$output .= HTML::anchor(URL::link('user','invoice/email/'.$o->id),'Email',array('class'=>'btn pull-right')); +$output .= HTML::anchor(URL::link('user','invoice/download/'.$o->id),'Download',array('class'=>'btn pull-right')); -
Issue Date
-
display('date_orig'); ?>
+if ($o->due() AND ! $o->cart_exists()) + $output .= View::factory('invoice/user/view/pay') + ->set('mid',$o->mid()) + ->set('o',$o); -
Due Date
-
display('due_date'); ?>
+if (! $o->status) { + Style::factory() + ->type('file') + ->data('media/css/pages/invoice.css'); -
Current Charges
-
total_charges(TRUE); ?>
+ $output .= '
Invoice CANCELLED.
'; +} -
Payments Received
-
payments_total(TRUE); ?>
+echo Block::factory() + ->title(sprintf('%s: %s - %s',_('Invoice'),$o->refnum(),$o->account->name())) + ->title_icon('fa fa-edit') + ->body($output); +?> -
Credits Applied
-
total_credits(TRUE); ?>
- -
Still Due
-
due(TRUE); ?>
-
-
-
- -
-
-

Charge Details

- - render('html','body'); ?> -
-
- -
-
-
Reminder Details
- -
- reminders() as $eto) : ?> -
reminders($eto->name,TRUE); ?>
-
name(); ?>
- -
-
- -
-
- -
Sub Total
-
subtotal(TRUE); ?>
- - - - total_credits()) : ?> -
Credits
-
total_credits(TRUE); ?>
- - - - - total_discounts()) : ?> -
Discounts
-
total_discounts(TRUE); ?>
- - - - -
Taxes Included:
- tax_summary() as $tid => $amount) : - $m = ORM::factory('Tax',$tid); ?> -
description); ?>
- - - - -
Total Invoice:
-
total(TRUE); ?>
- - - -
Account Due:
-
account->invoices_due_total(NULL,TRUE); ?>
- -
-
-
+set('o',$o); ?> +set('o',$o); ?> diff --git a/modules/lnapp b/modules/lnapp index 8f659c50..3bbab271 160000 --- a/modules/lnapp +++ b/modules/lnapp @@ -1 +1 @@ -Subproject commit 8f659c50c675c427e60a103a19fd3415d0cbbd07 +Subproject commit 3bbab271e75e079e8c3d5371064153cabdd3c98d diff --git a/modules/payment/views/payment/admin/add_edit.php b/modules/payment/views/payment/admin/add_edit.php index cb795f36..eec51398 100644 --- a/modules/payment/views/payment/admin/add_edit.php +++ b/modules/payment/views/payment/admin/add_edit.php @@ -4,10 +4,10 @@
- +
- + date_payment); ?> list_select(),$o->checkout_id,array('label'=>'Payment Method','required')); ?> total_amt,array('label'=>'Amount','placeholder'=>'Total','help-block'=>sprintf('Credits: %s, Balance: %s',$o->credit(),$o->total()))); ?> @@ -26,4 +26,4 @@ - + diff --git a/modules/service/views/service/user/list/expiring.php b/modules/service/views/service/user/list/expiring.php index 621e9371..f9a50e54 100644 --- a/modules/service/views/service/user/list/expiring.php +++ b/modules/service/views/service/user/list/expiring.php @@ -7,7 +7,7 @@ ->data($o->service->list_expiring()) ->columns(array( 'id'=>'ID', - 'service_name(60)'=>'Service', + 'service_name(59)'=>'Service', 'expire(TRUE)'=>'Date', )) ->prepend(array( diff --git a/modules/service/views/service/user/list/inactive.php b/modules/service/views/service/user/list/inactive.php new file mode 100644 index 00000000..cc2535a2 --- /dev/null +++ b/modules/service/views/service/user/list/inactive.php @@ -0,0 +1,17 @@ + +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/')), + )) + ); +?>