1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00

Upgrade to Laravel 5.2

This commit is contained in:
Hillel Coren 2016-03-02 15:36:42 +02:00
parent e5fac72e01
commit aef4c6be98
72 changed files with 878 additions and 611 deletions

View File

@ -27,7 +27,7 @@ class AccountApiController extends BaseAPIController
public function __construct(AccountRepository $accountRepo)
{
parent::__construct();
//parent::__construct();
$this->accountRepo = $accountRepo;
}
@ -52,7 +52,7 @@ class AccountApiController extends BaseAPIController
// Create a new token only if one does not already exist
$user = Auth::user();
$this->accountRepo->createTokens($user, $request->token_name);
$users = $this->accountRepo->findUsers($user, 'account.account_tokens');
$transformer = new UserAccountTransformer($user->account, $request->serializer, $request->token_name);
$data = $this->createCollection($users, $transformer, 'user_account');

View File

@ -41,7 +41,7 @@ class AccountController extends BaseController
public function __construct(AccountRepository $accountRepo, UserMailer $userMailer, ContactMailer $contactMailer, ReferralRepository $referralRepository)
{
parent::__construct();
//parent::__construct();
$this->accountRepo = $accountRepo;
$this->userMailer = $userMailer;

View File

@ -24,7 +24,7 @@ class AccountGatewayController extends BaseController
public function __construct(AccountGatewayService $accountGatewayService)
{
parent::__construct();
//parent::__construct();
$this->accountGatewayService = $accountGatewayService;
}

View File

@ -15,7 +15,7 @@ class ActivityController extends BaseController
public function __construct(ActivityService $activityService)
{
parent::__construct();
//parent::__construct();
$this->activityService = $activityService;
}

View File

@ -30,7 +30,7 @@ class AppController extends BaseController
public function __construct(AccountRepository $accountRepo, Mailer $mailer, EmailService $emailService)
{
parent::__construct();
//parent::__construct();
$this->accountRepo = $accountRepo;
$this->mailer = $mailer;
@ -78,7 +78,7 @@ class AppController extends BaseController
} elseif (!$valid) {
return Redirect::to('/setup')->withInput();
}
if (Utils::isDatabaseSetup() && Account::count() > 0) {
return Redirect::to('/');
}
@ -114,7 +114,7 @@ class AppController extends BaseController
}
Cache::flush();
Artisan::call('optimize', array('--force' => true));
$firstName = trim(Input::get('first_name'));
$lastName = trim(Input::get('last_name'));
$email = trim(strtolower(Input::get('email')));
@ -152,7 +152,7 @@ class AppController extends BaseController
$_ENV['DB_DATABASE'] = $db['type']['database'];
$_ENV['DB_USERNAME'] = $db['type']['username'];
$_ENV['DB_PASSWORD'] = $db['type']['password'];
if ($mail) {
$_ENV['MAIL_DRIVER'] = $mail['driver'];
$_ENV['MAIL_PORT'] = $mail['port'];
@ -184,7 +184,7 @@ class AppController extends BaseController
foreach ($database['connections'][$dbType] as $key => $val) {
Config::set("database.connections.{$dbType}.{$key}", $val);
}
try {
DB::reconnect();
$valid = DB::connection()->getDatabaseName() ? true : false;
@ -206,7 +206,7 @@ class AppController extends BaseController
Config::set('mail.from.address', $email);
Config::set('mail.from.name', $fromName);
$data = [
'text' => 'Test email',
];
@ -280,7 +280,7 @@ class AppController extends BaseController
{
$messageId = Input::get('MessageID');
return $this->emailService->markOpened($messageId) ? RESULT_SUCCESS : RESULT_FAILURE;
return RESULT_SUCCESS;
}

View File

@ -27,7 +27,6 @@ class AuthController extends Controller {
use AuthenticatesAndRegistersUsers;
protected $loginPath = '/login';
protected $redirectTo = '/dashboard';
protected $authService;
protected $accountRepo;

View File

@ -27,7 +27,7 @@ class BankAccountController extends BaseController
public function __construct(BankAccountService $bankAccountService, BankAccountRepository $bankAccountRepo)
{
parent::__construct();
//parent::__construct();
$this->bankAccountService = $bankAccountService;
$this->bankAccountRepo = $bankAccountRepo;
@ -91,7 +91,7 @@ class BankAccountController extends BaseController
$publicId = Input::get('public_id');
$username = trim(Input::get('bank_username'));
$password = trim(Input::get('bank_password'));
if ($publicId) {
$bankAccount = BankAccount::scope($publicId)->firstOrFail();
if ($username != $bankAccount->username) {

View File

@ -1,10 +1,10 @@
<?php namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesCommands;
use Illuminate\Foundation\Bus\DispatchesJobs;
class BaseController extends Controller
{
use DispatchesCommands;
use DispatchesJobs;
/**
* Setup the layout used by the controller.
@ -18,8 +18,10 @@ class BaseController extends Controller
}
}
/*
public function __construct()
{
$this->beforeFilter('csrf', array('on' => array('post', 'delete', 'put')));
}
*/
}

View File

@ -20,7 +20,7 @@ class ClientApiController extends BaseAPIController
public function __construct(ClientRepository $clientRepo, ClientService $clientService)
{
parent::__construct();
//parent::__construct();
$this->clientRepo = $clientRepo;
$this->clientService = $clientService;
@ -174,7 +174,7 @@ class ClientApiController extends BaseAPIController
if(!$client)
return $this->errorResponse(['message'=>'Client not found.'],400);
$transformer = new ClientTransformer(Auth::user()->account, Input::get('serializer'));
$data = $this->createItem($client, $transformer, ENTITY_CLIENT);
@ -203,7 +203,7 @@ class ClientApiController extends BaseAPIController
* )
* )
*/
public function destroy($publicId)
{

View File

@ -35,7 +35,7 @@ class ClientController extends BaseController
public function __construct(ClientRepository $clientRepo, ClientService $clientService)
{
parent::__construct();
//parent::__construct();
$this->clientRepo = $clientRepo;
$this->clientService = $clientService;

View File

@ -1,11 +1,11 @@
<?php namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesCommands;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
abstract class Controller extends BaseController {
use DispatchesCommands, ValidatesRequests;
use DispatchesJobs, ValidatesRequests;
}

View File

@ -20,7 +20,7 @@ class CreditController extends BaseController
public function __construct(CreditRepository $creditRepo, CreditService $creditService)
{
parent::__construct();
//parent::__construct();
$this->creditRepo = $creditRepo;
$this->creditService = $creditService;
@ -88,9 +88,9 @@ class CreditController extends BaseController
public function store(CreateCreditRequest $request)
{
$credit = $this->creditRepo->save($request->input());
Session::flash('message', trans('texts.created_credit'));
return redirect()->to($credit->client->getRoute());
}

View File

@ -18,7 +18,7 @@ class ExpenseApiController extends BaseAPIController
public function __construct(ExpenseRepository $expenseRepo, ExpenseService $expenseService)
{
parent::__construct();
//parent::__construct();
$this->expenseRepo = $expenseRepo;
$this->expenseService = $expenseService;

View File

@ -28,7 +28,7 @@ class ExpenseController extends BaseController
public function __construct(ExpenseRepository $expenseRepo, ExpenseService $expenseService)
{
parent::__construct();
//parent::__construct();
$this->expenseRepo = $expenseRepo;
$this->expenseService = $expenseService;

View File

@ -17,7 +17,7 @@ class HomeController extends BaseController
public function __construct(Mailer $mailer)
{
parent::__construct();
//parent::__construct();
$this->mailer = $mailer;
}

View File

@ -13,7 +13,7 @@ class ImportController extends BaseController
{
public function __construct(ImportService $importService)
{
parent::__construct();
//parent::__construct();
$this->importService = $importService;
}

View File

@ -28,7 +28,7 @@ class InvoiceApiController extends BaseAPIController
public function __construct(InvoiceService $invoiceService, InvoiceRepository $invoiceRepo, ClientRepository $clientRepo, PaymentRepository $paymentRepo, Mailer $mailer)
{
parent::__construct();
//parent::__construct();
$this->invoiceRepo = $invoiceRepo;
$this->clientRepo = $clientRepo;
@ -149,7 +149,7 @@ class InvoiceApiController extends BaseAPIController
$client = Client::scope()->whereHas('contacts', function($query) use ($email) {
$query->where('email', '=', $email);
})->first();
if (!$client) {
$validator = Validator::make(['email'=>$email], ['email' => 'email']);
if ($validator->fails()) {
@ -220,7 +220,7 @@ class InvoiceApiController extends BaseAPIController
{
$account = Auth::user()->account;
$account->loadLocalizationSettings($client);
// set defaults for optional fields
$fields = [
'discount' => 0,

View File

@ -37,7 +37,7 @@ class InvoiceController extends BaseController
public function __construct(Mailer $mailer, InvoiceRepository $invoiceRepo, ClientRepository $clientRepo, InvoiceService $invoiceService, RecurringInvoiceService $recurringInvoiceService)
{
parent::__construct();
//parent::__construct();
$this->mailer = $mailer;
$this->invoiceRepo = $invoiceRepo;

View File

@ -19,7 +19,7 @@ class PaymentApiController extends BaseAPIController
public function __construct(PaymentRepository $paymentRepo, ContactMailer $contactMailer)
{
parent::__construct();
//parent::__construct();
$this->paymentRepo = $paymentRepo;
$this->contactMailer = $contactMailer;

View File

@ -32,7 +32,7 @@ class PaymentController extends BaseController
{
public function __construct(PaymentRepository $paymentRepo, InvoiceRepository $invoiceRepo, AccountRepository $accountRepo, ContactMailer $contactMailer, PaymentService $paymentService)
{
parent::__construct();
//parent::__construct();
$this->paymentRepo = $paymentRepo;
$this->invoiceRepo = $invoiceRepo;

View File

@ -22,8 +22,8 @@ class PaymentTermController extends BaseController
public function __construct(PaymentTermService $paymentTermService)
{
parent::__construct();
//parent::__construct();
$this->paymentTermService = $paymentTermService;
}
@ -99,5 +99,5 @@ class PaymentTermController extends BaseController
return Redirect::to('settings/' . ACCOUNT_PAYMENT_TERMS);
}
}

View File

@ -25,7 +25,7 @@ class ProductApiController extends BaseAPIController
public function __construct(ProductService $productService, ProductRepository $productRepo)
{
parent::__construct();
//parent::__construct();
$this->productService = $productService;
$this->productRepo = $productRepo;

View File

@ -21,7 +21,7 @@ class ProductController extends BaseController
public function __construct(ProductService $productService)
{
parent::__construct();
//parent::__construct();
$this->productService = $productService;
}

View File

@ -15,7 +15,7 @@ class QuoteApiController extends BaseAPIController
public function __construct(InvoiceRepository $invoiceRepo)
{
parent::__construct();
//parent::__construct();
$this->invoiceRepo = $invoiceRepo;
}
@ -52,7 +52,7 @@ class QuoteApiController extends BaseAPIController
}
$invoices = $invoices->orderBy('created_at', 'desc')->paginate();
$transformer = new QuoteTransformer(\Auth::user()->account, Input::get('serializer'));
$paginator = $paginator->paginate();

View File

@ -36,7 +36,7 @@ class QuoteController extends BaseController
public function __construct(Mailer $mailer, InvoiceRepository $invoiceRepo, ClientRepository $clientRepo, InvoiceService $invoiceService)
{
parent::__construct();
//parent::__construct();
$this->mailer = $mailer;
$this->invoiceRepo = $invoiceRepo;
@ -99,7 +99,7 @@ class QuoteController extends BaseController
'title' => trans('texts.new_quote'),
];
$data = array_merge($data, self::getViewModel());
return View::make('invoices.edit', $data);
}
@ -136,7 +136,7 @@ class QuoteController extends BaseController
Session::flash('message', trans('texts.converted_to_invoice'));
return Redirect::to('invoices/'.$clone->public_id);
}
$count = $this->invoiceService->bulk($ids, $action);
if ($count > 0) {

View File

@ -9,7 +9,7 @@ class RecurringInvoiceController extends BaseController
public function __construct(InvoiceRepository $invoiceRepo)
{
parent::__construct();
//parent::__construct();
$this->invoiceRepo = $invoiceRepo;
}
@ -29,7 +29,7 @@ class RecurringInvoiceController extends BaseController
'action'
])
];
return response()->view('list', $data);
}

View File

@ -15,7 +15,7 @@ class TaskApiController extends BaseAPIController
public function __construct(TaskRepository $taskRepo)
{
parent::__construct();
//parent::__construct();
$this->taskRepo = $taskRepo;
}
@ -49,7 +49,7 @@ class TaskApiController extends BaseAPIController
$tasks->whereHas('client', $filter);
$paginator->whereHas('client', $filter);
}
$tasks = $tasks->orderBy('created_at', 'desc')->paginate();
$paginator = $paginator->paginate();
$transformer = new TaskTransformer(\Auth::user()->account, Input::get('serializer'));
@ -84,11 +84,11 @@ class TaskApiController extends BaseAPIController
{
$data = Input::all();
$taskId = isset($data['id']) ? $data['id'] : false;
if (isset($data['client_id']) && $data['client_id']) {
$data['client'] = $data['client_id'];
}
$task = $this->taskRepo->save($taskId, $data);
$task = Task::scope($task->public_id)->with('client')->first();

View File

@ -25,7 +25,7 @@ class TaskController extends BaseController
public function __construct(TaskRepository $taskRepo, InvoiceRepository $invoiceRepo, TaskService $taskService)
{
parent::__construct();
//parent::__construct();
$this->taskRepo = $taskRepo;
$this->invoiceRepo = $invoiceRepo;

View File

@ -16,7 +16,7 @@ class TaxRateApiController extends BaseAPIController
public function __construct(TaxRateService $taxRateService, TaxRateRepository $taxRateRepo)
{
parent::__construct();
//parent::__construct();
$this->taxRateService = $taxRateService;
$this->taxRateRepo = $taxRateRepo;

View File

@ -25,7 +25,7 @@ class TaxRateController extends BaseController
public function __construct(TaxRateService $taxRateService, TaxRateRepository $taxRateRepo)
{
parent::__construct();
//parent::__construct();
$this->taxRateService = $taxRateService;
$this->taxRateRepo = $taxRateRepo;
@ -76,9 +76,9 @@ class TaxRateController extends BaseController
public function update(UpdateTaxRateRequest $request, $publicId)
{
$taxRate = TaxRate::scope($publicId)->firstOrFail();
$this->taxRateRepo->save($request->input(), $taxRate);
Session::flash('message', trans('texts.updated_tax_rate'));
return Redirect::to('settings/' . ACCOUNT_TAX_RATES);
}

View File

@ -20,7 +20,7 @@ class TokenController extends BaseController
public function __construct(TokenService $tokenService)
{
parent::__construct();
//parent::__construct();
$this->tokenService = $tokenService;
}

View File

@ -16,7 +16,7 @@ class UserApiController extends BaseAPIController
public function __construct(UserService $userService, UserRepository $userRepo)
{
parent::__construct();
//parent::__construct();
$this->userService = $userService;
$this->userRepo = $userRepo;
@ -42,7 +42,7 @@ class UserApiController extends BaseAPIController
return $this->save($request);
}
*/
public function update(UpdateUserRequest $request, $userPublicId)
{
/*

View File

@ -30,7 +30,7 @@ class UserController extends BaseController
public function __construct(AccountRepository $accountRepo, ContactMailer $contactMailer, UserMailer $userMailer, UserService $userService)
{
parent::__construct();
//parent::__construct();
$this->accountRepo = $accountRepo;
$this->contactMailer = $contactMailer;
@ -130,7 +130,7 @@ class UserController extends BaseController
{
$action = Input::get('bulk_action');
$id = Input::get('bulk_public_id');
$user = User::where('account_id', '=', Auth::user()->account_id)
->where('public_id', '=', $id)
->withTrashed()
@ -219,7 +219,7 @@ class UserController extends BaseController
Session::flash('message', $message);
}
return Redirect::to('settings/' . ACCOUNT_USER_MANAGEMENT);
}
@ -243,7 +243,7 @@ class UserController extends BaseController
public function confirm($code, TokenRepositoryInterface $tokenRepo)
{
$user = User::where('confirmation_code', '=', $code)->get()->first();
if ($user) {
$notice_msg = trans('texts.security.confirmation');
@ -294,7 +294,7 @@ class UserController extends BaseController
return Redirect::to('/')->with('clearGuestKey', true);
}
*/
public function changePassword()
{
// check the current password is correct
@ -326,7 +326,7 @@ class UserController extends BaseController
$oldUserId = Auth::user()->id;
$referer = Request::header('referer');
$account = $this->accountRepo->findUserAccounts($newUserId, $oldUserId);
if ($account) {
if ($account->hasUserId($newUserId) && $account->hasUserId($oldUserId)) {
Auth::loginUsingId($newUserId);
@ -337,7 +337,7 @@ class UserController extends BaseController
Session::put('_token', str_random(40));
}
}
return Redirect::to($referer);
}

View File

@ -16,7 +16,7 @@ class VendorApiController extends BaseAPIController
public function __construct(VendorRepository $vendorRepo)
{
parent::__construct();
//parent::__construct();
$this->vendorRepo = $vendorRepo;
}
@ -83,7 +83,7 @@ class VendorApiController extends BaseAPIController
public function store(CreateVendorRequest $request)
{
$vendor = $this->vendorRepo->save($request->input());
$vendor = Vendor::scope($vendor->public_id)
->with('country', 'vendorcontacts', 'industry', 'size', 'currency')
->first();

View File

@ -33,7 +33,7 @@ class VendorController extends BaseController
public function __construct(VendorRepository $vendorRepo, VendorService $vendorService)
{
parent::__construct();
//parent::__construct();
$this->vendorRepo = $vendorRepo;
$this->vendorService = $vendorService;

View File

@ -1,6 +1,5 @@
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
@ -66,16 +65,16 @@ Route::post('/hook/email_bounced', 'AppController@emailBounced');
Route::post('/hook/email_opened', 'AppController@emailOpened');
// Laravel auth routes
get('/signup', array('as' => 'signup', 'uses' => 'Auth\AuthController@getRegister'));
post('/signup', array('as' => 'signup', 'uses' => 'Auth\AuthController@postRegister'));
get('/login', array('as' => 'login', 'uses' => 'Auth\AuthController@getLoginWrapper'));
post('/login', array('as' => 'login', 'uses' => 'Auth\AuthController@postLoginWrapper'));
get('/logout', array('as' => 'logout', 'uses' => 'Auth\AuthController@getLogoutWrapper'));
get('/forgot', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@getEmail'));
post('/forgot', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@postEmail'));
get('/password/reset/{token}', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@getReset'));
post('/password/reset', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@postReset'));
get('/user/confirm/{code}', 'UserController@confirm');
Route::get('/signup', array('as' => 'signup', 'uses' => 'Auth\AuthController@getRegister'));
Route::post('/signup', array('as' => 'signup', 'uses' => 'Auth\AuthController@postRegister'));
Route::get('/login', array('as' => 'login', 'uses' => 'Auth\AuthController@getLoginWrapper'));
Route::post('/login', array('as' => 'login', 'uses' => 'Auth\AuthController@postLoginWrapper'));
Route::get('/logout', array('as' => 'logout', 'uses' => 'Auth\AuthController@getLogoutWrapper'));
Route::get('/forgot', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@getEmail'));
Route::post('/forgot', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@postEmail'));
Route::get('/password/reset/{token}', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@getReset'));
Route::post('/password/reset', array('as' => 'forgot', 'uses' => 'Auth\PasswordController@postReset'));
Route::get('/user/confirm/{code}', 'UserController@confirm');
if (Utils::isNinja()) {
@ -194,8 +193,8 @@ Route::group(['middleware' => 'auth'], function() {
Route::get('api/credits/{client_id?}', array('as'=>'api.credits', 'uses'=>'CreditController@getDatatable'));
Route::post('credits/bulk', 'CreditController@bulk');
get('/resend_confirmation', 'AccountController@resendConfirmation');
post('/update_setup', 'AppController@updateSetup');
Route::get('/resend_confirmation', 'AccountController@resendConfirmation');
Route::post('/update_setup', 'AppController@updateSetup');
// vendor

View File

@ -42,7 +42,7 @@ class EntityModel extends Eloquent
{
$className = get_called_class();
return $className::scope($publicId)->withTrashed()->pluck('id');
return $className::scope($publicId)->withTrashed()->value('id');
}
public function getActivityKey()

View File

@ -1,6 +1,6 @@
<?php namespace App\Ninja\Mailers;
use HTML;
use Form;
use Utils;
use Event;
use URL;
@ -246,9 +246,9 @@ class ContactMailer extends Mailer
'$quote' => $invoice->invoice_number,
'$link' => $invitation->getLink(),
'$viewLink' => $invitation->getLink(),
'$viewButton' => HTML::emailViewButton($invitation->getLink(), $invoice->getEntityType()),
'$viewButton' => Form::emailViewButton($invitation->getLink(), $invoice->getEntityType()),
'$paymentLink' => $invitation->getLink('payment'),
'$paymentButton' => HTML::emailPaymentButton($invitation->getLink('payment')),
'$paymentButton' => Form::emailPaymentButton($invitation->getLink('payment')),
'$customClient1' => $account->custom_client_label1,
'$customClient2' => $account->custom_client_label2,
'$customInvoice1' => $account->custom_invoice_text_label1,
@ -260,7 +260,7 @@ class ContactMailer extends Mailer
$camelType = Gateway::getPaymentTypeName($type);
$type = Utils::toSnakeCase($camelType);
$variables["\${$camelType}Link"] = $invitation->getLink() . "/{$type}";
$variables["\${$camelType}Button"] = HTML::emailPaymentButton($invitation->getLink('payment') . "/{$type}");
$variables["\${$camelType}Button"] = Form::emailPaymentButton($invitation->getLink('payment') . "/{$type}");
}
$str = str_replace(array_keys($variables), array_values($variables), $template);

View File

@ -116,7 +116,7 @@ class PaymentRepository extends BaseRepository
public function save($input)
{
$publicId = isset($input['public_id']) ? $input['public_id'] : false;
if ($publicId) {
$payment = Payment::scope($publicId)->firstOrFail();
} else {
@ -136,7 +136,7 @@ class PaymentRepository extends BaseRepository
} else {
$payment->payment_date = date('Y-m-d');
}
if (isset($input['transaction_reference'])) {
$payment->transaction_reference = trim($input['transaction_reference']);
}

View File

@ -4,6 +4,7 @@ use Session;
use Auth;
use Utils;
use HTML;
use Form;
use URL;
use Request;
use Validator;
@ -18,18 +19,22 @@ class AppServiceProvider extends ServiceProvider {
*/
public function boot()
{
HTML::macro('nav_link', function($url, $text, $url2 = '', $extra = '') {
Form::macro('image_data', function($imagePath) {
return 'data:image/jpeg;base64,' . base64_encode(file_get_contents($imagePath));
});
Form::macro('nav_link', function($url, $text, $url2 = '', $extra = '') {
$class = ( Request::is($url) || Request::is($url.'/*') || Request::is($url2.'/*') ) ? ' class="active"' : '';
$title = ucwords(trans("texts.$text")) . Utils::getProLabel($text);
return '<li'.$class.'><a href="'.URL::to($url).'" '.$extra.'>'.$title.'</a></li>';
});
HTML::macro('tab_link', function($url, $text, $active = false) {
Form::macro('tab_link', function($url, $text, $active = false) {
$class = $active ? ' class="active"' : '';
return '<li'.$class.'><a href="'.URL::to($url).'" data-toggle="tab">'.$text.'</a></li>';
});
HTML::macro('menu_link', function($type) {
Form::macro('menu_link', function($type) {
$types = $type.'s';
$Type = ucfirst($type);
$Types = ucfirst($types);
@ -65,15 +70,11 @@ class AppServiceProvider extends ServiceProvider {
return $str;
});
HTML::macro('image_data', function($imagePath) {
return 'data:image/jpeg;base64,' . base64_encode(file_get_contents($imagePath));
});
HTML::macro('flatButton', function($label, $color) {
Form::macro('flatButton', function($label, $color) {
return '<input type="button" value="' . trans("texts.{$label}") . '" style="background-color:' . $color . ';border:0 none;border-radius:5px;padding:12px 40px;margin:0 6px;cursor:hand;display:inline-block;font-size:14px;color:#fff;text-transform:none;font-weight:bold;"/>';
});
HTML::macro('emailViewButton', function($link = '#', $entityType = ENTITY_INVOICE) {
Form::macro('emailViewButton', function($link = '#', $entityType = ENTITY_INVOICE) {
return view('partials.email_button')
->with([
'link' => $link,
@ -83,7 +84,7 @@ class AppServiceProvider extends ServiceProvider {
->render();
});
HTML::macro('emailPaymentButton', function($link = '#') {
Form::macro('emailPaymentButton', function($link = '#') {
return view('partials.email_button')
->with([
'link' => $link,
@ -93,7 +94,7 @@ class AppServiceProvider extends ServiceProvider {
->render();
});
HTML::macro('breadcrumbs', function($status = false) {
Form::macro('breadcrumbs', function($status = false) {
$str = '<ol class="breadcrumb">';
// Get the breadcrumbs by exploding the current path.
@ -135,7 +136,7 @@ class AppServiceProvider extends ServiceProvider {
return $str . '</ol>';
});
Validator::extend('positive', function($attribute, $value, $parameters) {
return Utils::parseFloat($value) >= 0;
});

View File

@ -38,11 +38,11 @@ class ActivityService extends BaseService
'activity_type_id',
function ($model) {
$data = [
'client' => link_to('/clients/' . $model->client_public_id, Utils::getClientDisplayName($model)),
'user' => $model->is_system ? '<i>' . trans('texts.system') . '</i>' : Utils::getPersonDisplayName($model->user_first_name, $model->user_last_name, $model->user_email),
'invoice' => $model->invoice ? link_to('/invoices/' . $model->invoice_public_id, $model->is_recurring ? trans('texts.recurring_invoice') : $model->invoice) : null,
'quote' => $model->invoice ? link_to('/quotes/' . $model->invoice_public_id, $model->invoice) : null,
'contact' => $model->contact_id ? link_to('/clients/' . $model->client_public_id, Utils::getClientDisplayName($model)) : Utils::getPersonDisplayName($model->user_first_name, $model->user_last_name, $model->user_email),
'client' => link_to('/clients/' . $model->client_public_id, Utils::getClientDisplayName($model))->toHtml(),
'user' => $model->is_system ? '<i>' . trans('texts.system') . '</i>' : Utils::getPersonDisplayName($model->user_first_name, $model->user_last_name, $model->user_email),
'invoice' => $model->invoice ? link_to('/invoices/' . $model->invoice_public_id, $model->is_recurring ? trans('texts.recurring_invoice') : $model->invoice)->toHtml() : null,
'quote' => $model->invoice ? link_to('/quotes/' . $model->invoice_public_id, $model->invoice)->toHtml() : null,
'contact' => $model->contact_id ? link_to('/clients/' . $model->client_public_id, Utils::getClientDisplayName($model))->toHtml() : Utils::getPersonDisplayName($model->user_first_name, $model->user_last_name, $model->user_email),
'payment' => $model->payment ?: '',
'credit' => Utils::formatMoney($model->credit, $model->currency_id, $model->country_id)
];

View File

@ -121,12 +121,12 @@ class BankAccountService extends BaseService
if ($transaction->amount >= 0) {
continue;
}
// if vendor has already been imported use current name
$vendorName = trim(substr($transaction->name, 0, 20));
$key = strtolower($vendorName);
$vendor = isset($vendorMap[$key]) ? $vendorMap[$key] : null;
$transaction->vendor = $vendor ? $vendor->name : $this->prepareValue($vendorName);
$transaction->info = $this->prepareValue(substr($transaction->name, 20));
$transaction->memo = $this->prepareValue($transaction->memo);
@ -228,7 +228,7 @@ class BankAccountService extends BaseService
[
'bank_name',
function ($model) {
return link_to("bank_accounts/{$model->public_id}/edit", $model->bank_name);
return link_to("bank_accounts/{$model->public_id}/edit", $model->bank_name)->toHtml();
},
],
[

View File

@ -1,11 +1,11 @@
<?php namespace App\Services;
use Illuminate\Foundation\Bus\DispatchesCommands;
use Illuminate\Foundation\Bus\DispatchesJobs;
use App\Services\DatatableService;
class BaseService
{
use DispatchesCommands;
use DispatchesJobs;
protected function getRepo()
{

View File

@ -46,19 +46,19 @@ class ClientService extends BaseService
[
'name',
function ($model) {
return link_to("clients/{$model->public_id}", $model->name ?: '');
return link_to("clients/{$model->public_id}", $model->name ?: '')->toHtml();
}
],
[
'first_name',
function ($model) {
return link_to("clients/{$model->public_id}", $model->first_name.' '.$model->last_name);
return link_to("clients/{$model->public_id}", $model->first_name.' '.$model->last_name)->toHtml();
}
],
[
'email',
function ($model) {
return link_to("clients/{$model->public_id}", $model->email ?: '');
return link_to("clients/{$model->public_id}", $model->email ?: '')->toHtml();
}
],
[

View File

@ -40,7 +40,7 @@ class CreditService extends BaseService
[
'client_name',
function ($model) {
return $model->client_public_id ? link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model)) : '';
return $model->client_public_id ? link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model))->toHtml() : '';
},
! $hideClient
],

View File

@ -1,5 +1,6 @@
<?php namespace App\Services;
use HtmlString;
use Utils;
use Datatable;

View File

@ -30,11 +30,11 @@ class ExpenseService extends BaseService
if (isset($data['client_id']) && $data['client_id']) {
$data['client_id'] = Client::getPrivateId($data['client_id']);
}
if (isset($data['vendor_id']) && $data['vendor_id']) {
$data['vendor_id'] = Vendor::getPrivateId($data['vendor_id']);
}
return $this->expenseRepo->save($data);
}
@ -63,7 +63,7 @@ class ExpenseService extends BaseService
function ($model)
{
if ($model->vendor_public_id) {
return link_to("vendors/{$model->vendor_public_id}", $model->vendor_name);
return link_to("vendors/{$model->vendor_public_id}", $model->vendor_name)->toHtml();
} else {
return '';
}
@ -74,7 +74,7 @@ class ExpenseService extends BaseService
function ($model)
{
if ($model->client_public_id) {
return link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model));
return link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model))->toHtml();
} else {
return '';
}
@ -83,7 +83,7 @@ class ExpenseService extends BaseService
[
'expense_date',
function ($model) {
return link_to("expenses/{$model->public_id}/edit", Utils::fromSqlDate($model->expense_date));
return link_to("expenses/{$model->public_id}/edit", Utils::fromSqlDate($model->expense_date))->toHtml();
}
],
[
@ -92,7 +92,7 @@ class ExpenseService extends BaseService
// show both the amount and the converted amount
if ($model->exchange_rate != 1) {
$converted = round($model->amount * $model->exchange_rate, 2);
return Utils::formatMoney($model->amount, $model->expense_currency_id) . ' | ' .
return Utils::formatMoney($model->amount, $model->expense_currency_id) . ' | ' .
Utils::formatMoney($converted, $model->invoice_currency_id);
} else {
return Utils::formatMoney($model->amount, $model->expense_currency_id);
@ -178,7 +178,7 @@ class ExpenseService extends BaseService
{
return [];
}
private function getStatusLabel($invoiceId, $shouldBeInvoiced)
{
if ($invoiceId) {

View File

@ -35,7 +35,7 @@ class InvoiceService extends BaseService
}
$invoice = $this->invoiceRepo->save($data);
$client = $invoice->client;
$client->load('contacts');
$sendInvoiceIds = [];
@ -45,7 +45,7 @@ class InvoiceService extends BaseService
$sendInvoiceIds[] = $contact->id;
}
}
foreach ($client->contacts as $contact) {
$invitation = Invitation::scope()->whereContactId($contact->id)->whereInvoiceId($invoice->id)->first();
@ -69,7 +69,7 @@ class InvoiceService extends BaseService
if (!$invitation) {
return $invoice;
}
foreach ($invoice->invitations as $invoiceInvitation) {
if ($invitation->contact_id == $invoiceInvitation->contact_id) {
return $invoiceInvitation->invitation_key;
@ -83,7 +83,7 @@ class InvoiceService extends BaseService
if (!$quote->is_quote || $quote->quote_invoice_id) {
return null;
}
if ($account->auto_convert_quote || ! $account->isPro()) {
$invoice = $this->convertQuote($quote, $invitation);
@ -94,7 +94,7 @@ class InvoiceService extends BaseService
$quote->markApproved();
event(new QuoteInvitationWasApproved($quote, null, $invitation));
foreach ($quote->invitations as $invoiceInvitation) {
if ($invitation->contact_id == $invoiceInvitation->contact_id) {
return $invoiceInvitation->invitation_key;
@ -117,13 +117,13 @@ class InvoiceService extends BaseService
[
'invoice_number',
function ($model) use ($entityType) {
return link_to("{$entityType}s/{$model->public_id}/edit", $model->invoice_number, ['class' => Utils::getEntityRowClass($model)]);
return link_to("{$entityType}s/{$model->public_id}/edit", $model->invoice_number, ['class' => Utils::getEntityRowClass($model)])->toHtml();
}
],
[
'client_name',
function ($model) {
return link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model));
return link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model))->toHtml();
},
! $hideClient
],
@ -160,7 +160,7 @@ class InvoiceService extends BaseService
[
'invoice_status_name',
function ($model) {
return $model->quote_invoice_id ? link_to("invoices/{$model->quote_invoice_id}/edit", trans('texts.converted')) : self::getStatusLabel($model);
return $model->quote_invoice_id ? link_to("invoices/{$model->quote_invoice_id}/edit", trans('texts.converted'))->toHtml() : self::getStatusLabel($model);
}
]
];
@ -266,5 +266,5 @@ class InvoiceService extends BaseService
}
return "<h4><div class=\"label label-{$class}\">$label</div></h4>";
}
}

View File

@ -202,7 +202,7 @@ class PaymentService extends BaseService
if ($response->isRedirect()) {
$token = $response->getTransactionReference();
}
Session::set($invitation->id . 'payment_type', PAYMENT_TYPE_CREDIT_CARD);
return $token;
@ -273,7 +273,7 @@ class PaymentService extends BaseService
// submit purchase/get response
$response = $gateway->purchase($details)->send();
if ($response->isSuccessful()) {
$ref = $response->getTransactionReference();
return $this->createPayment($invitation, $accountGateway, $ref);
@ -295,13 +295,13 @@ class PaymentService extends BaseService
[
'invoice_number',
function ($model) {
return link_to("invoices/{$model->invoice_public_id}/edit", $model->invoice_number, ['class' => Utils::getEntityRowClass($model)]);
return link_to("invoices/{$model->invoice_public_id}/edit", $model->invoice_number, ['class' => Utils::getEntityRowClass($model)])->toHtml();
}
],
[
'client_name',
function ($model) {
return $model->client_public_id ? link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model)) : '';
return $model->client_public_id ? link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model))->toHtml() : '';
},
! $hideClient
],

View File

@ -34,7 +34,7 @@ class PaymentTermService extends BaseService
[
'name',
function ($model) {
return link_to("payment_terms/{$model->public_id}/edit", $model->name);
return link_to("payment_terms/{$model->public_id}/edit", $model->name)->toHtml();
}
],
[

View File

@ -44,7 +44,7 @@ class ProductService extends BaseService
[
'product_key',
function ($model) {
return link_to('products/'.$model->public_id.'/edit', $model->product_key);
return link_to('products/'.$model->public_id.'/edit', $model->product_key)->toHtml();
}
],
[

View File

@ -28,13 +28,13 @@ class RecurringInvoiceService extends BaseService
[
'frequency',
function ($model) {
return link_to("invoices/{$model->public_id}", $model->frequency);
return link_to("invoices/{$model->public_id}", $model->frequency)->toHtml();
}
],
[
'client_name',
function ($model) {
return link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model));
return link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model))->toHtml();
},
! $hideClient
],

View File

@ -42,14 +42,14 @@ class TaskService extends BaseService
[
'client_name',
function ($model) {
return $model->client_public_id ? link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model)) : '';
return $model->client_public_id ? link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model))->toHtml() : '';
},
! $hideClient
],
[
'created_at',
function ($model) {
return link_to("tasks/{$model->public_id}/edit", Task::calcStartTime($model));
return link_to("tasks/{$model->public_id}/edit", Task::calcStartTime($model))->toHtml();
}
],
[

View File

@ -41,7 +41,7 @@ class TaxRateService extends BaseService
[
'name',
function ($model) {
return link_to("tax_rates/{$model->public_id}/edit", $model->name);
return link_to("tax_rates/{$model->public_id}/edit", $model->name)->toHtml();
}
],
[

View File

@ -40,7 +40,7 @@ class TokenService extends BaseService
[
'name',
function ($model) {
return link_to("tokens/{$model->public_id}/edit", $model->name);
return link_to("tokens/{$model->public_id}/edit", $model->name)->toHtml();
}
],
[

View File

@ -40,7 +40,7 @@ class UserService extends BaseService
[
'first_name',
function ($model) {
return $model->public_id ? link_to('users/'.$model->public_id.'/edit', $model->first_name.' '.$model->last_name) : ($model->first_name.' '.$model->last_name);
return $model->public_id ? link_to('users/'.$model->public_id.'/edit', $model->first_name.' '.$model->last_name)->toHtml() : ($model->first_name.' '.$model->last_name);
}
],
[

View File

@ -46,7 +46,7 @@ class VendorService extends BaseService
[
'name',
function ($model) {
return link_to("vendors/{$model->public_id}", $model->name ?: '');
return link_to("vendors/{$model->public_id}", $model->name ?: '')->toHtml();
}
],
[
@ -64,7 +64,7 @@ class VendorService extends BaseService
[
'email',
function ($model) {
return link_to("vendors/{$model->public_id}", $model->email ?: '');
return link_to("vendors/{$model->public_id}", $model->email ?: '')->toHtml();
}
],
[

0
bootstrap/app.php Normal file → Executable file
View File

0
bootstrap/autoload.php Normal file → Executable file
View File

0
bootstrap/environment.php Normal file → Executable file
View File

View File

@ -15,11 +15,14 @@
"omnipay/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248",
"omnipay/gocardless": "dev-master",
"omnipay/stripe": "2.3.0",
"laravel/framework": "5.1.*",
"laravel/framework": "5.2.*",
"laravelcollective/html": "5.2.*",
"laravelcollective/bus": "5.2.*",
"symfony/css-selector": "~3.0",
"patricktalmadge/bootstrapper": "5.5.x",
"anahkiasen/former": "4.0.*@dev",
"barryvdh/laravel-debugbar": "~2.0.2",
"chumper/datatable": "dev-develop#7fa47cb",
"barryvdh/laravel-debugbar": "~2.0",
"chumper/datatable": "dev-develop#04ef2bf",
"omnipay/omnipay": "~2.3.0",
"intervention/image": "dev-master",
"webpatser/laravel-countries": "dev-master",
@ -35,7 +38,6 @@
"alfaproject/omnipay-skrill": "dev-master",
"omnipay/bitpay": "dev-master",
"guzzlehttp/guzzle": "~6.0",
"laravelcollective/html": "~5.0",
"wildbit/laravel-postmark-provider": "2.0",
"Dwolla/omnipay-dwolla": "dev-master",
"laravel/socialite": "~2.0",
@ -71,7 +73,8 @@
"phpspec/phpspec": "~2.1",
"codeception/codeception": "*",
"codeception/c3": "~2.0",
"fzaninotto/faker": "^1.5"
"fzaninotto/faker": "^1.5",
"symfony/dom-crawler": "~3.0"
},
"autoload": {
"classmap": [

967
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,8 @@ return [
'debug' => env('APP_DEBUG', ''),
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application URL
@ -115,12 +117,11 @@ return [
/*
* Laravel Framework Service Providers...
*/
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Bus\BusServiceProvider',
'Collective\Html\HtmlServiceProvider',
'Collective\Bus\BusServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Routing\ControllerServiceProvider',
'Illuminate\Cookie\CookieServiceProvider',
'Illuminate\Database\DatabaseServiceProvider',
'Illuminate\Encryption\EncryptionServiceProvider',
@ -149,7 +150,6 @@ return [
'Intervention\Image\ImageServiceProvider',
'Webpatser\Countries\CountriesServiceProvider',
'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
'Illuminate\Html\HtmlServiceProvider',
'Laravel\Socialite\SocialiteServiceProvider',
'Jlapp\Swaggervel\SwaggervelServiceProvider',
'Maatwebsite\Excel\ExcelServiceProvider',
@ -158,7 +158,7 @@ return [
* Application Service Providers...
*/
'App\Providers\AppServiceProvider',
'App\Providers\BusServiceProvider',
//'App\Providers\BusServiceProvider',
'App\Providers\ConfigServiceProvider',
'App\Providers\EventServiceProvider',
'App\Providers\RouteServiceProvider',

View File

@ -2,66 +2,106 @@
return [
/*
|--------------------------------------------------------------------------
| Default Authentication Driver
|--------------------------------------------------------------------------
|
| This option controls the authentication driver that will be utilized.
| This driver manages the retrieval and authentication of the users
| attempting to get access to protected areas of your application.
|
| Supported: "database", "eloquent"
|
*/
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'driver' => 'eloquent',
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Model
|--------------------------------------------------------------------------
|
| When using the "Eloquent" authentication driver, we need to know which
| Eloquent model should be used to retrieve your users. Of course, it
| is often just the "User" model but you may use whatever you like.
|
*/
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session", "token"
|
*/
'model' => 'App\Models\User',
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Table
|--------------------------------------------------------------------------
|
| When using the "Database" authentication driver, we need to know which
| table should be used to retrieve your users. We have chosen a basic
| default value but you may easily change it to any table you like.
|
*/
'api' => [
'driver' => 'token',
'provider' => 'users',
],
],
'table' => 'users',
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
/*
|--------------------------------------------------------------------------
| Password Reset Settings
|--------------------------------------------------------------------------
|
| Here you may set the options for resetting passwords including the view
| that is your password reset e-mail. You can also set the name of the
| table that maintains all of the reset tokens for your application.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
'password' => [
'email' => 'emails.password',
'table' => 'password_resets',
'expire' => 60,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
];
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| Here you may set the options for resetting passwords including the view
| that is your password reset e-mail. You may also set the name of the
| table that maintains all of the reset tokens for your application.
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'email' => 'emails.password', //auth.emails.password
'table' => 'password_resets',
'expire' => 60,
],
],
];

View File

@ -51,6 +51,7 @@ class CurrenciesSeeder extends Seeder
['name' => 'Aruban Florin', 'code' => 'AWG', 'symbol' => 'Afl. ', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'],
['name' => 'Turkish Lira', 'code' => 'TRY', 'symbol' => 'TL ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'Romanian New Leu', 'code' => 'RON', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Croatian', 'code' => 'HKR', 'symbol' => 'kn', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
];
foreach ($currencies as $currency) {

View File

@ -212,9 +212,9 @@
"0001",
"0001",
"{{ URL::to('/view/...') }}",
'{!! HTML::flatButton('view_invoice', '#0b4d78') !!}',
'{!! Form::flatButton('view_invoice', '#0b4d78') !!}',
"{{ URL::to('/payment/...') }}",
'{!! HTML::flatButton('pay_now', '#36c157') !!}',
'{!! Form::flatButton('pay_now', '#36c157') !!}',
];
// Add blanks for custom values
@ -227,7 +227,7 @@
{!! "vals.push('" . URL::to('/payment/...') . "');" !!}
{!! "keys.push('" . \App\Models\Gateway::getPaymentTypeName($type).'Button' . "');" !!}
{!! "vals.push('" . HTML::flatButton('pay_now', '#36c157') . "');" !!}
{!! "vals.push('" . Form::flatButton('pay_now', '#36c157') . "');" !!}
@endforeach
for (var i=0; i<keys.length; i++) {

View File

@ -174,16 +174,16 @@
@endif
<ul class="nav nav-tabs nav-justified">
{!! HTML::tab_link('#activity', trans('texts.activity'), true) !!}
{!! Form::tab_link('#activity', trans('texts.activity'), true) !!}
@if ($hasTasks)
{!! HTML::tab_link('#tasks', trans('texts.tasks')) !!}
{!! Form::tab_link('#tasks', trans('texts.tasks')) !!}
@endif
@if ($hasQuotes && Utils::isPro())
{!! HTML::tab_link('#quotes', trans('texts.quotes')) !!}
{!! Form::tab_link('#quotes', trans('texts.quotes')) !!}
@endif
{!! HTML::tab_link('#invoices', trans('texts.invoices')) !!}
{!! HTML::tab_link('#payments', trans('texts.payments')) !!}
{!! HTML::tab_link('#credits', trans('texts.credits')) !!}
{!! Form::tab_link('#invoices', trans('texts.invoices')) !!}
{!! Form::tab_link('#payments', trans('texts.payments')) !!}
{!! Form::tab_link('#credits', trans('texts.credits')) !!}
</ul>
<div class="tab-content">

View File

@ -7,9 +7,9 @@
<thead>
<tr>
@foreach($columns as $i => $c)
<th align="center" valign="middle" class="head{{ $i }}"
<th align="center" valign="middle" class="head{{ $i }}"
@if ($c == 'checkbox')
style="width:20px"
style="width:20px"
@endif
>
@if ($c == 'checkbox' && $hasCheckboxes = true)
@ -48,7 +48,7 @@
function load_{{ $class }}() {
window.dataTable = jQuery('.{{ $class }}').dataTable({
"fnRowCallback": function(row, data) {
"fnRowCallback": function(row, data) {
if (data[0].indexOf('ENTITY_DELETED') > 0) {
$(row).addClass('entityDeleted');
}
@ -60,7 +60,7 @@
@if (isset($hasCheckboxes) && $hasCheckboxes)
'aaSorting': [['1', 'asc']],
// Disable sorting on the first column
"aoColumnDefs": [
"aoColumnDefs": [
{
'bSortable': false,
'aTargets': [ 0, {{ count($columns) - 1 }} ]

View File

@ -386,12 +386,12 @@
<div class="collapse navbar-collapse" id="navbar-collapse-1">
<ul class="nav navbar-nav" style="font-weight: bold">
{!! HTML::nav_link('dashboard', 'dashboard') !!}
{!! HTML::menu_link('client') !!}
{!! HTML::menu_link('task') !!}
{!! HTML::menu_link('expense') !!}
{!! HTML::menu_link('invoice') !!}
{!! HTML::menu_link('payment') !!}
{!! Form::nav_link('dashboard', 'dashboard') !!}
{!! Form::menu_link('client') !!}
{!! Form::menu_link('task') !!}
{!! Form::menu_link('expense') !!}
{!! Form::menu_link('invoice') !!}
{!! Form::menu_link('payment') !!}
</ul>
<div id="navbar-options">
@ -535,7 +535,7 @@
@endif
@if (!isset($showBreadcrumbs) || $showBreadcrumbs)
{!! HTML::breadcrumbs(isset($entityStatus) ? $entityStatus : '') !!}
{!! Form::breadcrumbs(isset($entityStatus) ? $entityStatus : '') !!}
@endif
@yield('content')

View File

@ -954,7 +954,7 @@
@endif
@if ($account->hasLogo())
invoice.image = "{{ HTML::image_data($account->getLogoPath()) }}";
invoice.image = "{{ Form::image_data($account->getLogoPath()) }}";
invoice.imageWidth = {{ $account->getLogoWidth() }};
invoice.imageHeight = {{ $account->getLogoHeight() }};
@endif

View File

@ -62,20 +62,20 @@
<script type="text/javascript">
window.logoImages = {};
logoImages.imageLogo1 = "{{ HTML::image_data('images/report_logo1.jpg') }}";
logoImages.imageLogo1 = "{{ Form::image_data('images/report_logo1.jpg') }}";
logoImages.imageLogoWidth1 =120;
logoImages.imageLogoHeight1 = 40
logoImages.imageLogo2 = "{{ HTML::image_data('images/report_logo2.jpg') }}";
logoImages.imageLogo2 = "{{ Form::image_data('images/report_logo2.jpg') }}";
logoImages.imageLogoWidth2 =325/2;
logoImages.imageLogoHeight2 = 81/2;
logoImages.imageLogo3 = "{{ HTML::image_data('images/report_logo3.jpg') }}";
logoImages.imageLogo3 = "{{ Form::image_data('images/report_logo3.jpg') }}";
logoImages.imageLogoWidth3 =325/2;
logoImages.imageLogoHeight3 = 81/2;
@if ($account->hasLogo())
window.accountLogo = "{{ HTML::image_data($account->getLogoPath()) }}";
window.accountLogo = "{{ Form::image_data($account->getLogoPath()) }}";
if (window.invoice) {
invoice.image = window.accountLogo;
invoice.imageWidth = {{ $account->getLogoWidth() }};

View File

@ -142,7 +142,7 @@
@endif
<ul class="nav nav-tabs nav-justified">
{!! HTML::tab_link('#expenses', trans('texts.expenses')) !!}
{!! Form::tab_link('#expenses', trans('texts.expenses')) !!}
</ul>
<div class="tab-content">