L5 Syntax Changes and Namespacing

This commit is contained in:
Jeramy Simpson 2015-03-26 16:24:02 +10:00
parent 7c78753a2d
commit 1080d9e2f6
16 changed files with 224 additions and 137 deletions

View File

@ -1,10 +1,27 @@
<?php namespace App\Http\Controllers; <?php namespace App\Http\Controllers;
use Auth;
use Confide;
use Input;
use Redirect;
use Session;
use Utils;
use View;
use App\Models\Account;
use App\Models\Country;
use App\Models\Currency;
use App\Models\DateFormat;
use App\Models\DatetimeFormat;
use App\Models\Language;
use App\Models\Size;
use App\Models\Timezone;
use App\Models\Industry;
use App\Ninja\Repositories\AccountRepository; use App\Ninja\Repositories\AccountRepository;
use App\Ninja\Mailers\UserMailer; use App\Ninja\Mailers\UserMailer;
use App\Ninja\Mailers\ContactMailer; use App\Ninja\Mailers\ContactMailer;
class AccountController extends \BaseController class AccountController extends BaseController
{ {
protected $accountRepo; protected $accountRepo;
protected $userMailer; protected $userMailer;
@ -103,6 +120,7 @@ class AccountController extends \BaseController
public function showSection($section = ACCOUNT_DETAILS, $subSection = false) public function showSection($section = ACCOUNT_DETAILS, $subSection = false)
{ {
if ($section == ACCOUNT_DETAILS) { if ($section == ACCOUNT_DETAILS) {
/* Update Remember Function
$data = [ $data = [
'account' => Account::with('users')->findOrFail(Auth::user()->account_id), 'account' => Account::with('users')->findOrFail(Auth::user()->account_id),
'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'countries' => Country::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(),
@ -115,6 +133,19 @@ class AccountController extends \BaseController
'languages' => Language::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'languages' => Language::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(),
'showUser' => Auth::user()->id === Auth::user()->account->users()->first()->id, 'showUser' => Auth::user()->id === Auth::user()->account->users()->first()->id,
]; ];
*/
$data = [
'account' => Account::with('users')->findOrFail(Auth::user()->account_id),
'countries' => Country::orderBy('name')->get(),
'sizes' => Size::orderBy('id')->get(),
'industries' => Industry::orderBy('name')->get(),
'timezones' => Timezone::orderBy('location')->get(),
'dateFormats' => DateFormat::get(),
'datetimeFormats' => DatetimeFormat::get(),
'currencies' => Currency::orderBy('name')->get(),
'languages' => Language::orderBy('name')->get(),
'showUser' => Auth::user()->id === Auth::user()->account->users()->first()->id,
];
return View::make('accounts.details', $data); return View::make('accounts.details', $data);
} elseif ($section == ACCOUNT_PAYMENTS) { } elseif ($section == ACCOUNT_PAYMENTS) {

View File

@ -1,24 +1,24 @@
<?php namespace App\Http\Controllers; <?php namespace App\Http\Controllers;
/*
|--------------------------------------------------------------------------
| Confide Controller Template
|--------------------------------------------------------------------------
|
| This is the default Confide controller template for controlling user
| authentication. Feel free to change to your needs.
|
*/
use Auth;
use Datatable;
use DB;
use Input;
use Redirect;
use Session;
use View;
use App\Models\Gateway;
use App\Ninja\Repositories\AccountRepository; use App\Ninja\Repositories\AccountRepository;
class AccountGatewayController extends BaseController class AccountGatewayController extends BaseController
{ {
public function getDatatable() public function getDatatable()
{ {
$query = \DB::table('account_gateways') $query = DB::table('account_gateways')
->join('gateways', 'gateways.id', '=', 'account_gateways.gateway_id') ->join('gateways', 'gateways.id', '=', 'account_gateways.gateway_id')
->where('account_gateways.deleted_at', '=', null) ->where('account_gateways.deleted_at', '=', null)
->where('account_gateways.account_id', '=', \Auth::user()->account_id) ->where('account_gateways.account_id', '=', Auth::user()->account_id)
->select('account_gateways.public_id', 'gateways.name', 'account_gateways.deleted_at'); ->select('account_gateways.public_id', 'gateways.name', 'account_gateways.deleted_at');
return Datatable::query($query) return Datatable::query($query)
@ -95,8 +95,9 @@ class AccountGatewayController extends BaseController
$selectedCards = $accountGateway ? $accountGateway->accepted_credit_cards : 0; $selectedCards = $accountGateway ? $accountGateway->accepted_credit_cards : 0;
$account = Auth::user()->account; $account = Auth::user()->account;
$recommendedGateways = Gateway::remember(DEFAULT_QUERY_CACHE) // $recommendedGateways = Gateway::remember(DEFAULT_QUERY_CACHE)
->where('recommended', '=', '1') // ->where('recommended', '=', '1')
$recommendedGateways = Gateway::where('recommended', '=', '1')
->orderBy('sort_order') ->orderBy('sort_order')
->get(); ->get();
$recommendedGatewayArray = array(); $recommendedGatewayArray = array();

View File

@ -1,8 +1,18 @@
<?php <?php namespace App\Http\Controllers;
use Auth;
use Utils;
use View;
use App\Models\Client;
use App\Models\Size;
use App\Models\PaymentTerm;
use App\Models\Industry;
use App\Models\Currency;
use App\Models\Country;
use App\Ninja\Repositories\ClientRepository; use App\Ninja\Repositories\ClientRepository;
class ClientController extends \BaseController class ClientController extends BaseController
{ {
protected $clientRepo; protected $clientRepo;
@ -158,6 +168,7 @@ class ClientController extends \BaseController
private static function getViewModel() private static function getViewModel()
{ {
/* Remember function no longer works
return [ return [
'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'sizes' => Size::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(),
'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']), 'paymentTerms' => PaymentTerm::remember(DEFAULT_QUERY_CACHE)->orderBy('num_days')->get(['name', 'num_days']),
@ -167,6 +178,16 @@ class ClientController extends \BaseController
'customLabel1' => Auth::user()->account->custom_client_label1, 'customLabel1' => Auth::user()->account->custom_client_label1,
'customLabel2' => Auth::user()->account->custom_client_label2, 'customLabel2' => Auth::user()->account->custom_client_label2,
]; ];
*/
return [
'sizes' => Size::orderBy('id')->get(),
'paymentTerms' => PaymentTerm::orderBy('num_days')->get(['name', 'num_days']),
'industries' => Industry::orderBy('name')->get(),
'currencies' => Currency::orderBy('name')->get(),
'countries' => Country::orderBy('name')->get(),
'customLabel1' => Auth::user()->account->custom_client_label1,
'customLabel2' => Auth::user()->account->custom_client_label2,
];
} }
/** /**

View File

@ -1,8 +1,15 @@
<?php namespace App\Http\Controllers; <?php namespace App\Http\Controllers;
use Datatable;
use Input;
use Redirect;
use Session;
use Utils;
use View;
use App\Ninja\Repositories\CreditRepository; use App\Ninja\Repositories\CreditRepository;
class CreditController extends \BaseController class CreditController extends BaseController
{ {
protected $creditRepo; protected $creditRepo;

View File

@ -1,11 +1,18 @@
<?php namespace App\Http\Controllers; <?php namespace App\Http\Controllers;
use Auth;
use DB; use DB;
use View;
use App\Models\Activity;
use App\Models\Invoice;
class DashboardController extends \BaseController class DashboardController extends BaseController
{ {
public function index() public function index()
{ {
// For Debuging : Need to remove when it is not longer needed.
// Auth::login(\App\Models\User::first());
// dd(Auth::user());
// total_income, billed_clients, invoice_sent and active_clients // total_income, billed_clients, invoice_sent and active_clients
$select = DB::raw('COUNT(DISTINCT CASE WHEN invoices.id IS NOT NULL THEN clients.id ELSE null END) billed_clients, $select = DB::raw('COUNT(DISTINCT CASE WHEN invoices.id IS NOT NULL THEN clients.id ELSE null END) billed_clients,
SUM(CASE WHEN invoices.invoice_status_id >= '.INVOICE_STATUS_SENT.' THEN 1 ELSE 0 END) invoices_sent, SUM(CASE WHEN invoices.invoice_status_id >= '.INVOICE_STATUS_SENT.' THEN 1 ELSE 0 END) invoices_sent,

View File

@ -1,8 +1,11 @@
<?php namespace App\Http\Controllers; <?php namespace App\Http\Controllers;
use Auth; use Auth;
use Session;
use Utils; use Utils;
use View;
use App\Models\Invoice;
use App\Ninja\Mailers\ContactMailer as Mailer; use App\Ninja\Mailers\ContactMailer as Mailer;
use App\Ninja\Repositories\InvoiceRepository; use App\Ninja\Repositories\InvoiceRepository;
use App\Ninja\Repositories\ClientRepository; use App\Ninja\Repositories\ClientRepository;
@ -400,10 +403,12 @@ class InvoiceController extends BaseController
Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT, $url); Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT, $url);
} }
/*
This causes an error message. Commenting out. will return later.
if (!empty(Input::get('pdfupload')) && strpos(Input::get('pdfupload'), 'data:application/pdf;base64,') === 0) { if (!empty(Input::get('pdfupload')) && strpos(Input::get('pdfupload'), 'data:application/pdf;base64,') === 0) {
$this->storePDF(Input::get('pdfupload'), $invoice->id); $this->storePDF(Input::get('pdfupload'), $invoice->id);
} }
*/
if ($action == 'clone') { if ($action == 'clone') {
return $this->cloneInvoice($publicId); return $this->cloneInvoice($publicId);
} elseif ($action == 'convert') { } elseif ($action == 'convert') {

View File

@ -1,11 +1,18 @@
<?php namespace App\Http\Controllers; <?php namespace App\Http\Controllers;
use Ninja\Repositories\PaymentRepository; use Datatable;
use Ninja\Repositories\InvoiceRepository; use Input;
use Ninja\Repositories\AccountRepository; use Redirect;
use Ninja\Mailers\ContactMailer; use Session;
use Utils;
use View;
class PaymentController extends \BaseController use App\Ninja\Repositories\PaymentRepository;
use App\Ninja\Repositories\InvoiceRepository;
use App\Ninja\Repositories\AccountRepository;
use App\Ninja\Mailers\ContactMailer;
class PaymentController extends BaseController
{ {
protected $creditRepo; protected $creditRepo;

View File

@ -1,12 +1,16 @@
<?php namespace App\Http\Controllers; <?php namespace App\Http\Controllers;
use Auth;
use Input;
use Redirect;
use Utils; use Utils;
use View;
use App\Ninja\Mailers\ContactMailer as Mailer; use App\Ninja\Mailers\ContactMailer as Mailer;
use App\Ninja\Repositories\InvoiceRepository; use App\Ninja\Repositories\InvoiceRepository;
use App\Ninja\Repositories\ClientRepository; use App\Ninja\Repositories\ClientRepository;
use App\Ninja\Repositories\TaxRateRepository; use App\Ninja\Repositories\TaxRateRepository;
class QuoteController extends \BaseController class QuoteController extends BaseController
{ {
protected $mailer; protected $mailer;
protected $invoiceRepo; protected $invoiceRepo;

View File

@ -263,6 +263,7 @@ Client::deleting(function ($client) {
Activity::archiveClient($client); Activity::archiveClient($client);
}); });
Client::restoring(function ($client) { /*Client::restoring(function ($client) {
Activity::restoreClient($client); Activity::restoreClient($client);
}); });
*/

View File

@ -1,5 +1,7 @@
<?php namespace App\Models; <?php namespace App\Models;
use Eloquent;
class Country extends Eloquent class Country extends Eloquent
{ {
public $timestamps = false; public $timestamps = false;

View File

@ -1,6 +1,7 @@
<?php namespace App\Models; <?php namespace App\Models;
use Eloquent; use Eloquent;
use Omnipay;
class Gateway extends Eloquent class Gateway extends Eloquent
{ {
@ -9,7 +10,7 @@ class Gateway extends Eloquent
public function paymentlibrary() public function paymentlibrary()
{ {
return $this->belongsTo('PaymentLibrary', 'payment_library_id'); return $this->belongsTo('\App\Models\PaymentLibrary', 'payment_library_id');
} }
public function getLogoUrl() public function getLogoUrl()

View File

@ -2,44 +2,44 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
{{ Former::legend('Organization') }} {!! Former::legend('Organization') !!}
{{ Former::text('name') }} {!! Former::text('name') !!}
{{ Former::text('id_number') }} {!! Former::text('id_number') !!}
{{ Former::text('vat_number') }} {!! Former::text('vat_number') !!}
{{ Former::text('work_phone')->label('Phone') }} {!! Former::text('work_phone')->label('Phone') !!}
{{ Former::textarea('notes') }} {!! Former::textarea('notes') !!}
{{ Former::legend('Address') }} {!! Former::legend('Address') !!}
{{ Former::text('address1')->label('Street') }} {!! Former::text('address1')->label('Street') !!}
{{ Former::text('address2')->label('Apt/Floor') }} {!! Former::text('address2')->label('Apt/Floor') !!}
{{ Former::text('city') }} {!! Former::text('city') !!}
{{ Former::text('state') }} {!! Former::text('state') !!}
{{ Former::text('postal_code') }} {!! Former::text('postal_code') !!}
{{ Former::select('country_id')->addOption('','')->label('Country') {!! Former::select('country_id')->addOption('','')->label('Country')
->fromQuery($countries, 'name', 'id') }} ->fromQuery($countries, 'name', 'id') !!}
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{{ Former::legend('Contacts') }} {!! Former::legend('Contacts') !!}
<div data-bind='template: { foreach: contacts, <div data-bind='template: { foreach: contacts,
beforeRemove: hideContact, beforeRemove: hideContact,
afterAdd: showContact }'> afterAdd: showContact }'>
{{ Former::hidden('public_id')->data_bind("value: public_id, valueUpdate: 'afterkeydown'") }} {!! Former::hidden('public_id')->data_bind("value: public_id, valueUpdate: 'afterkeydown'") !!}
{{ Former::text('first_name')->data_bind("value: first_name, valueUpdate: 'afterkeydown'") }} {!! Former::text('first_name')->data_bind("value: first_name, valueUpdate: 'afterkeydown'") !!}
{{ Former::text('last_name')->data_bind("value: last_name, valueUpdate: 'afterkeydown'") }} {!! Former::text('last_name')->data_bind("value: last_name, valueUpdate: 'afterkeydown'") !!}
{{ Former::text('email')->data_bind("value: email, valueUpdate: 'afterkeydown'") }} {!! Former::text('email')->data_bind("value: email, valueUpdate: 'afterkeydown'") !!}
{{ Former::text('phone')->data_bind("value: phone, valueUpdate: 'afterkeydown'") }} {!! Former::text('phone')->data_bind("value: phone, valueUpdate: 'afterkeydown'") !!}
<div class="form-group"> <div class="form-group">
<div class="col-lg-8 col-lg-offset-4"> <div class="col-lg-8 col-lg-offset-4">
<span data-bind="visible: $parent.contacts().length > 1"> <span data-bind="visible: $parent.contacts().length > 1">
{{ link_to('#', 'Remove contact', array('data-bind'=>'click: $parent.removeContact')) }} {!! link_to('#', 'Remove contact', array('data-bind'=>'click: $parent.removeContact')) !!}
</span> </span>
<span data-bind="visible: $index() === ($parent.contacts().length - 1)" class="pull-right"> <span data-bind="visible: $index() === ($parent.contacts().length - 1)" class="pull-right">
{{ link_to('#', 'Add contact', array('onclick'=>'return addContact()')) }} {!! link_to('#', 'Add contact', array('onclick'=>'return addContact()')) !!}
</span> </span>
</div> </div>
</div> </div>
@ -50,7 +50,7 @@
</div> </div>
{{ Former::hidden('data')->data_bind("value: ko.toJSON(model)") }} {!! Former::hidden('data')->data_bind("value: ko.toJSON(model)") !!}
<script type="text/javascript"> <script type="text/javascript">

View File

@ -9,86 +9,86 @@
<div class="row"> <div class="row">
<!--<h3>{{ $title }} Client</h3>--> <!--<h3>{{ $title }} Client</h3>-->
{{ Former::open($url)->addClass('col-md-12 warn-on-exit')->method($method)->rules(array( {!! Former::open($url)->addClass('col-md-12 warn-on-exit')->method($method)->rules(array(
'email' => 'email|required' 'email' => 'email|required'
)); }} )); !!}
@if ($client) @if ($client)
{{ Former::populate($client) }} {!! Former::populate($client) !!}
@endif @endif
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
{{ Former::legend('organization') }} {!! Former::legend('organization') !!}
{{ Former::text('name')->data_bind("attr { placeholder: placeholderName }") }} {!! Former::text('name')->data_bind("attr { placeholder: placeholderName }") !!}
{{ Former::text('id_number') }} {!! Former::text('id_number') !!}
{{ Former::text('vat_number') }} {!! Former::text('vat_number') !!}
{{ Former::text('website') }} {!! Former::text('website') !!}
{{ Former::text('work_phone') }} {!! Former::text('work_phone') !!}
@if (Auth::user()->isPro()) @if (Auth::user()->isPro())
@if ($customLabel1) @if ($customLabel1)
{{ Former::text('custom_value1')->label($customLabel1) }} {!! Former::text('custom_value1')->label($customLabel1) !!}
@endif @endif
@if ($customLabel2) @if ($customLabel2)
{{ Former::text('custom_value2')->label($customLabel2) }} {!! Former::text('custom_value2')->label($customLabel2) !!}
@endif @endif
@endif @endif
{{ Former::legend('address') }} {!! Former::legend('address') !!}
{{ Former::text('address1') }} {!! Former::text('address1') !!}
{{ Former::text('address2') }} {!! Former::text('address2') !!}
{{ Former::text('city') }} {!! Former::text('city') !!}
{{ Former::text('state') }} {!! Former::text('state') !!}
{{ Former::text('postal_code') }} {!! Former::text('postal_code') !!}
{{ Former::select('country_id')->addOption('','') {!! Former::select('country_id')->addOption('','')
->fromQuery($countries, 'name', 'id') }} ->fromQuery($countries, 'name', 'id') !!}
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{{ Former::legend('contacts') }} {!! Former::legend('contacts') !!}
<div data-bind='template: { foreach: contacts, <div data-bind='template: { foreach: contacts,
beforeRemove: hideContact, beforeRemove: hideContact,
afterAdd: showContact }'> afterAdd: showContact }'>
{{ Former::hidden('public_id')->data_bind("value: public_id, valueUpdate: 'afterkeydown'") }} {!! Former::hidden('public_id')->data_bind("value: public_id, valueUpdate: 'afterkeydown'") !!}
{{ Former::text('first_name')->data_bind("value: first_name, valueUpdate: 'afterkeydown'") }} {!! Former::text('first_name')->data_bind("value: first_name, valueUpdate: 'afterkeydown'") !!}
{{ Former::text('last_name')->data_bind("value: last_name, valueUpdate: 'afterkeydown'") }} {!! Former::text('last_name')->data_bind("value: last_name, valueUpdate: 'afterkeydown'") !!}
{{ Former::text('email')->data_bind('value: email, valueUpdate: \'afterkeydown\', attr: {id:\'email\'+$index()}') }} {!! Former::text('email')->data_bind('value: email, valueUpdate: \'afterkeydown\', attr: {id:\'email\'+$index()}') !!}
{{ Former::text('phone')->data_bind("value: phone, valueUpdate: 'afterkeydown'") }} {!! Former::text('phone')->data_bind("value: phone, valueUpdate: 'afterkeydown'") !!}
<div class="form-group"> <div class="form-group">
<div class="col-lg-8 col-lg-offset-4 bold"> <div class="col-lg-8 col-lg-offset-4 bold">
<span class="redlink bold" data-bind="visible: $parent.contacts().length > 1"> <span class="redlink bold" data-bind="visible: $parent.contacts().length > 1">
{{ link_to('#', trans('texts.remove_contact').' -', array('data-bind'=>'click: $parent.removeContact')) }} {!! link_to('#', trans('texts.remove_contact').' -', array('data-bind'=>'click: $parent.removeContact')) !!}
</span> </span>
<span data-bind="visible: $index() === ($parent.contacts().length - 1)" class="pull-right greenlink bold"> <span data-bind="visible: $index() === ($parent.contacts().length - 1)" class="pull-right greenlink bold">
{{ link_to('#', trans('texts.add_contact').' +', array('onclick'=>'return addContact()')) }} {!! link_to('#', trans('texts.add_contact').' +', array('onclick'=>'return addContact()')) !!}
</span> </span>
</div> </div>
</div> </div>
</div> </div>
{{ Former::legend('additional_info') }} {!! Former::legend('additional_info') !!}
{{ Former::select('payment_terms')->addOption('','') {!! Former::select('payment_terms')->addOption('','')
->fromQuery($paymentTerms, 'name', 'num_days') }} ->fromQuery($paymentTerms, 'name', 'num_days') !!}
{{ Former::select('currency_id')->addOption('','') {!! Former::select('currency_id')->addOption('','')
->fromQuery($currencies, 'name', 'id') }} ->fromQuery($currencies, 'name', 'id') !!}
{{ Former::select('size_id')->addOption('','') {!! Former::select('size_id')->addOption('','')
->fromQuery($sizes, 'name', 'id') }} ->fromQuery($sizes, 'name', 'id') !!}
{{ Former::select('industry_id')->addOption('','') {!! Former::select('industry_id')->addOption('','')
->fromQuery($industries, 'name', 'id') }} ->fromQuery($industries, 'name', 'id') !!}
{{ Former::textarea('private_notes') }} {!! Former::textarea('private_notes') !!}
</div> </div>
</div> </div>
{{ Former::hidden('data')->data_bind("value: ko.toJSON(model)") }} {!! Former::hidden('data')->data_bind("value: ko.toJSON(model)") !!}
<script type="text/javascript"> <script type="text/javascript">
@ -159,10 +159,10 @@
</script> </script>
<center class="buttons"> <center class="buttons">
{{ Button::lg_primary_submit_success(trans('texts.save'))->append_with_icon('floppy-disk') }} {!! Button::primary(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!}
{{ Button::lg_default_link('clients/' . ($client ? $client->public_id : ''), trans('texts.cancel'))->append_with_icon('remove-circle'); }} {!! Button::normal(trans('texts.cancel'))->large()->asLinkTo('clients/' . ($client ? $client->public_id : ''))->appendIcon(Icon::create('remove-circle')) !!}
</center> </center>
{{ Former::close() }} {!! Former::close() !!}
</div> </div>
@stop @stop

View File

@ -4,10 +4,10 @@
<div class="pull-right"> <div class="pull-right">
{{ Former::open('clients/bulk')->addClass('mainForm') }} {!! Former::open('clients/bulk')->addClass('mainForm') !!}
<div style="display:none"> <div style="display:none">
{{ Former::text('action') }} {!! Former::text('action') !!}
{{ Former::text('id')->value($client->public_id) }} {!! Former::text('id')->value($client->public_id) !!}
</div> </div>
@if ($gatewayLink) @if ($gatewayLink)
@ -26,11 +26,11 @@
[trans('texts.delete_client'), "javascript:onDeleteClick()"], [trans('texts.delete_client'), "javascript:onDeleteClick()"],
] ]
) )
, ['id'=>'normalDropDown'])->split(); }} , ['id'=>'normalDropDown'])->split() }}
{{ DropdownButton::primary(trans('texts.create_invoice'), Navigation::links($actionLinks), ['id'=>'primaryDropDown'])->split(); }} {{ DropdownButton::primary(trans('texts.create_invoice'), Navigation::links($actionLinks), ['id'=>'primaryDropDown'])->split() }}
@endif @endif
{{ Former::close() }} {!! Former::close() !!}
</div> </div>
@ -38,7 +38,7 @@
<h2>{{ $client->getDisplayName() }}</h2> <h2>{{ $client->getDisplayName() }}</h2>
@if ($client->last_login > 0) @if ($client->last_login > 0)
<h3 style="margin-top:0px"><small> <h3 style="margin-top:0px"><small>
{{ trans('texts.last_logged_in') }} {{ Utils::timestampToDateTimeString(strtotime($client->last_login)); }} {{ trans('texts.last_logged_in') }} {{ Utils::timestampToDateTimeString(strtotime($client->last_login)) }}
</small></h3> </small></h3>
@endif @endif
@ -69,16 +69,16 @@
<table class="table" style="width:300px"> <table class="table" style="width:300px">
<tr> <tr>
<td><small>{{ trans('texts.paid_to_date') }}</small></td> <td><small>{{ trans('texts.paid_to_date') }}</small></td>
<td style="text-align: right">{{ Utils::formatMoney($client->paid_to_date, $client->currency_id); }}</td> <td style="text-align: right">{{ Utils::formatMoney($client->paid_to_date, $client->currency_id) }}</td>
</tr> </tr>
<tr> <tr>
<td><small>{{ trans('texts.balance') }}</small></td> <td><small>{{ trans('texts.balance') }}</small></td>
<td style="text-align: right">{{ Utils::formatMoney($client->balance, $client->currency_id); }}</td> <td style="text-align: right">{{ Utils::formatMoney($client->balance, $client->currency_id) }}</td>
</tr> </tr>
@if ($credit > 0) @if ($credit > 0)
<tr> <tr>
<td><small>{{ trans('texts.credit') }}</small></td> <td><small>{{ trans('texts.credit') }}</small></td>
<td style="text-align: right">{{ Utils::formatMoney($credit, $client->currency_id); }}</td> <td style="text-align: right">{{ Utils::formatMoney($credit, $client->currency_id) }}</td>
</tr> </tr>
@endif @endif
</table> </table>
@ -90,20 +90,20 @@
<p>&nbsp;</p> <p>&nbsp;</p>
<ul class="nav nav-tabs nav-justified"> <ul class="nav nav-tabs nav-justified">
{{ HTML::tab_link('#activity', trans('texts.activity'), true) }} {!! HTML::tab_link('#activity', trans('texts.activity'), true) !!}
@if (Utils::isPro()) @if (Utils::isPro())
{{ HTML::tab_link('#quotes', trans('texts.quotes')) }} {!! HTML::tab_link('#quotes', trans('texts.quotes')) !!}
@endif @endif
{{ HTML::tab_link('#invoices', trans('texts.invoices')) }} {!! HTML::tab_link('#invoices', trans('texts.invoices')) !!}
{{ HTML::tab_link('#payments', trans('texts.payments')) }} {!! HTML::tab_link('#payments', trans('texts.payments')) !!}
{{ HTML::tab_link('#credits', trans('texts.credits')) }} {!! HTML::tab_link('#credits', trans('texts.credits')) !!}
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane active" id="activity"> <div class="tab-pane active" id="activity">
{{ Datatable::table() {!! Datatable::table()
->addColumn( ->addColumn(
trans('texts.date'), trans('texts.date'),
trans('texts.message'), trans('texts.message'),
@ -113,14 +113,14 @@
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false) ->setOptions('bFilter', false)
->setOptions('aaSorting', [['0', 'desc']]) ->setOptions('aaSorting', [['0', 'desc']])
->render('datatable') }} ->render('datatable') !!}
</div> </div>
@if (Utils::isPro()) @if (Utils::isPro())
<div class="tab-pane" id="quotes"> <div class="tab-pane" id="quotes">
{{ Datatable::table() {!! Datatable::table()
->addColumn( ->addColumn(
trans('texts.quote_number'), trans('texts.quote_number'),
trans('texts.quote_date'), trans('texts.quote_date'),
@ -131,7 +131,7 @@
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false) ->setOptions('bFilter', false)
->setOptions('aaSorting', [['0', 'desc']]) ->setOptions('aaSorting', [['0', 'desc']])
->render('datatable') }} ->render('datatable') !!}
</div> </div>
@endif @endif
@ -139,7 +139,7 @@
<div class="tab-pane" id="invoices"> <div class="tab-pane" id="invoices">
@if ($hasRecurringInvoices) @if ($hasRecurringInvoices)
{{ Datatable::table() {!! Datatable::table()
->addColumn( ->addColumn(
trans('texts.frequency_id'), trans('texts.frequency_id'),
trans('texts.start_date'), trans('texts.start_date'),
@ -149,10 +149,10 @@
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false) ->setOptions('bFilter', false)
->setOptions('aaSorting', [['0', 'asc']]) ->setOptions('aaSorting', [['0', 'asc']])
->render('datatable') }} ->render('datatable') !!}
@endif @endif
{{ Datatable::table() {!! Datatable::table()
->addColumn( ->addColumn(
trans('texts.invoice_number'), trans('texts.invoice_number'),
trans('texts.invoice_date'), trans('texts.invoice_date'),
@ -164,12 +164,12 @@
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false) ->setOptions('bFilter', false)
->setOptions('aaSorting', [['0', 'asc']]) ->setOptions('aaSorting', [['0', 'asc']])
->render('datatable') }} ->render('datatable') !!}
</div> </div>
<div class="tab-pane" id="payments"> <div class="tab-pane" id="payments">
{{ Datatable::table() {!! Datatable::table()
->addColumn( ->addColumn(
trans('texts.invoice'), trans('texts.invoice'),
trans('texts.transaction_reference'), trans('texts.transaction_reference'),
@ -180,12 +180,12 @@
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false) ->setOptions('bFilter', false)
->setOptions('aaSorting', [['0', 'asc']]) ->setOptions('aaSorting', [['0', 'asc']])
->render('datatable') }} ->render('datatable') !!}
</div> </div>
<div class="tab-pane" id="credits"> <div class="tab-pane" id="credits">
{{ Datatable::table() {!! Datatable::table()
->addColumn( ->addColumn(
trans('texts.credit_amount'), trans('texts.credit_amount'),
trans('texts.credit_balance'), trans('texts.credit_balance'),
@ -195,7 +195,7 @@
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false) ->setOptions('bFilter', false)
->setOptions('aaSorting', [['0', 'asc']]) ->setOptions('aaSorting', [['0', 'asc']])
->render('datatable') }} ->render('datatable') !!}
</div> </div>
</div> </div>

View File

@ -89,15 +89,15 @@
</div> </div>
</button> </button>
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li>{{ link_to('company/details', uctrans('texts.company_details')) }}</li> <li>{!! link_to('company/details', uctrans('texts.company_details')) !!}</li>
<li>{{ link_to('company/payments', uctrans('texts.online_payments')) }}</li> <li>{!! link_to('company/payments', uctrans('texts.online_payments')) !!}</li>
<li>{{ link_to('company/products', uctrans('texts.product_library')) }}</li> <li>{!! link_to('company/products', uctrans('texts.product_library')) !!}</li>
<li>{{ link_to('company/notifications', uctrans('texts.notifications')) }}</li> <li>{!! link_to('company/notifications', uctrans('texts.notifications')) !!}</li>
<li>{{ link_to('company/import_export', uctrans('texts.import_export')) }}</li> <li>{!! link_to('company/import_export', uctrans('texts.import_export')) !!}</li>
<li><a href="{{ url('company/advanced_settings/invoice_settings') }}">{{ uctrans('texts.advanced_settings') . Utils::getProLabel(ACCOUNT_ADVANCED_SETTINGS) }}</a></li> <li><a href="{{ url('company/advanced_settings/invoice_settings') }}">{{ uctrans('texts.advanced_settings') . Utils::getProLabel(ACCOUNT_ADVANCED_SETTINGS) }}</a></li>
<li class="divider"></li> <li class="divider"></li>
<li>{{ link_to('#', trans('texts.logout'), array('onclick'=>'logout()')) }}</li> <li>{!! link_to('#', trans('texts.logout'), array('onclick'=>'logout()')) !!}</li>
</ul> </ul>
</div> </div>

View File

@ -2,21 +2,21 @@
@section('content') @section('content')
{{ Former::open($entityType . 's/bulk')->addClass('listForm') }} {!! Former::open($entityType . 's/bulk')->addClass('listForm') !!}
<div style="display:none"> <div style="display:none">
{{ Former::text('action') }} {!! Former::text('action') !!}
{{ Former::text('statusId') }} {!! Former::text('statusId') !!}
{{ Former::text('id') }} {!! Former::text('id') !!}
</div> </div>
{{ DropdownButton::normal(trans('texts.archive'), {!! DropdownButton::normal(trans('texts.archive'),
Navigation::links( Navigation::links(
array( array(
array(trans('texts.archive_'.$entityType), "javascript:submitForm('archive')"), array(trans('texts.archive_'.$entityType), "javascript:submitForm('archive')"),
array(trans('texts.delete_'.$entityType), "javascript:submitForm('delete')"), array(trans('texts.delete_'.$entityType), "javascript:submitForm('delete')"),
) )
) )
, array('id'=>'archive'))->split(); }} , array('id'=>'archive'))->split() !!}
&nbsp;<label for="trashed" style="font-weight:normal; margin-left: 10px;"> &nbsp;<label for="trashed" style="font-weight:normal; margin-left: 10px;">
<input id="trashed" type="checkbox" onclick="setTrashVisible()" <input id="trashed" type="checkbox" onclick="setTrashVisible()"
@ -25,25 +25,25 @@
<div id="top_right_buttons" class="pull-right"> <div id="top_right_buttons" class="pull-right">
<input id="tableFilter" type="text" style="width:140px;margin-right:17px" class="form-control pull-left" placeholder="{{ trans('texts.filter') }}"/> <input id="tableFilter" type="text" style="width:140px;margin-right:17px" class="form-control pull-left" placeholder="{{ trans('texts.filter') }}"/>
{{ Button::success_link(URL::to($entityType . 's/create'), trans("texts.new_$entityType"), array('class' => 'pull-right'))->append_with_icon('plus-sign'); }} {!! Button::normal(trans("texts.new_$entityType"))->asLinkTo(URL::to($entityType . 's/create'))->withAttributes(array('class' => 'pull-right'))->appendIcon(Icon::create('plus-sign')) !!}
</div> </div>
@if (isset($secEntityType)) @if (isset($secEntityType))
{{ Datatable::table() {!! Datatable::table()
->addColumn($secColumns) ->addColumn($secColumns)
->setUrl(route('api.' . $secEntityType . 's')) ->setUrl(route('api.' . $secEntityType . 's'))
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->render('datatable') }} ->render('datatable') !!}
@endif @endif
{{ Datatable::table() {!! Datatable::table()
->addColumn($columns) ->addColumn($columns)
->setUrl(route('api.' . $entityType . 's')) ->setUrl(route('api.' . $entityType . 's'))
->setOptions('sPaginationType', 'bootstrap') ->setOptions('sPaginationType', 'bootstrap')
->render('datatable') }} ->render('datatable') !!}
{{ Former::close() }} {!! Former::close() !!}
<script type="text/javascript"> <script type="text/javascript">