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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,10 +1,10 @@
<?php namespace App\Http\Controllers; <?php namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesCommands; use Illuminate\Foundation\Bus\DispatchesJobs;
class BaseController extends Controller class BaseController extends Controller
{ {
use DispatchesCommands; use DispatchesJobs;
/** /**
* Setup the layout used by the controller. * Setup the layout used by the controller.
@ -18,8 +18,10 @@ class BaseController extends Controller
} }
} }
/*
public function __construct() public function __construct()
{ {
$this->beforeFilter('csrf', array('on' => array('post', 'delete', 'put'))); $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) public function __construct(ClientRepository $clientRepo, ClientService $clientService)
{ {
parent::__construct(); //parent::__construct();
$this->clientRepo = $clientRepo; $this->clientRepo = $clientRepo;
$this->clientService = $clientService; $this->clientService = $clientService;
@ -174,7 +174,7 @@ class ClientApiController extends BaseAPIController
if(!$client) if(!$client)
return $this->errorResponse(['message'=>'Client not found.'],400); return $this->errorResponse(['message'=>'Client not found.'],400);
$transformer = new ClientTransformer(Auth::user()->account, Input::get('serializer')); $transformer = new ClientTransformer(Auth::user()->account, Input::get('serializer'));
$data = $this->createItem($client, $transformer, ENTITY_CLIENT); $data = $this->createItem($client, $transformer, ENTITY_CLIENT);
@ -203,7 +203,7 @@ class ClientApiController extends BaseAPIController
* ) * )
* ) * )
*/ */
public function destroy($publicId) public function destroy($publicId)
{ {

View File

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

View File

@ -1,11 +1,11 @@
<?php namespace App\Http\Controllers; <?php namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesCommands; use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController; use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Validation\ValidatesRequests;
abstract class Controller extends BaseController { 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) public function __construct(CreditRepository $creditRepo, CreditService $creditService)
{ {
parent::__construct(); //parent::__construct();
$this->creditRepo = $creditRepo; $this->creditRepo = $creditRepo;
$this->creditService = $creditService; $this->creditService = $creditService;
@ -88,9 +88,9 @@ class CreditController extends BaseController
public function store(CreateCreditRequest $request) public function store(CreateCreditRequest $request)
{ {
$credit = $this->creditRepo->save($request->input()); $credit = $this->creditRepo->save($request->input());
Session::flash('message', trans('texts.created_credit')); Session::flash('message', trans('texts.created_credit'));
return redirect()->to($credit->client->getRoute()); return redirect()->to($credit->client->getRoute());
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -19,7 +19,7 @@ class PaymentApiController extends BaseAPIController
public function __construct(PaymentRepository $paymentRepo, ContactMailer $contactMailer) public function __construct(PaymentRepository $paymentRepo, ContactMailer $contactMailer)
{ {
parent::__construct(); //parent::__construct();
$this->paymentRepo = $paymentRepo; $this->paymentRepo = $paymentRepo;
$this->contactMailer = $contactMailer; $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) public function __construct(PaymentRepository $paymentRepo, InvoiceRepository $invoiceRepo, AccountRepository $accountRepo, ContactMailer $contactMailer, PaymentService $paymentService)
{ {
parent::__construct(); //parent::__construct();
$this->paymentRepo = $paymentRepo; $this->paymentRepo = $paymentRepo;
$this->invoiceRepo = $invoiceRepo; $this->invoiceRepo = $invoiceRepo;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,6 +4,7 @@ use Session;
use Auth; use Auth;
use Utils; use Utils;
use HTML; use HTML;
use Form;
use URL; use URL;
use Request; use Request;
use Validator; use Validator;
@ -18,18 +19,22 @@ class AppServiceProvider extends ServiceProvider {
*/ */
public function boot() 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"' : ''; $class = ( Request::is($url) || Request::is($url.'/*') || Request::is($url2.'/*') ) ? ' class="active"' : '';
$title = ucwords(trans("texts.$text")) . Utils::getProLabel($text); $title = ucwords(trans("texts.$text")) . Utils::getProLabel($text);
return '<li'.$class.'><a href="'.URL::to($url).'" '.$extra.'>'.$title.'</a></li>'; 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"' : ''; $class = $active ? ' class="active"' : '';
return '<li'.$class.'><a href="'.URL::to($url).'" data-toggle="tab">'.$text.'</a></li>'; 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'; $types = $type.'s';
$Type = ucfirst($type); $Type = ucfirst($type);
$Types = ucfirst($types); $Types = ucfirst($types);
@ -65,15 +70,11 @@ class AppServiceProvider extends ServiceProvider {
return $str; return $str;
}); });
HTML::macro('image_data', function($imagePath) { Form::macro('flatButton', function($label, $color) {
return 'data:image/jpeg;base64,' . base64_encode(file_get_contents($imagePath));
});
HTML::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;"/>'; 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') return view('partials.email_button')
->with([ ->with([
'link' => $link, 'link' => $link,
@ -83,7 +84,7 @@ class AppServiceProvider extends ServiceProvider {
->render(); ->render();
}); });
HTML::macro('emailPaymentButton', function($link = '#') { Form::macro('emailPaymentButton', function($link = '#') {
return view('partials.email_button') return view('partials.email_button')
->with([ ->with([
'link' => $link, 'link' => $link,
@ -93,7 +94,7 @@ class AppServiceProvider extends ServiceProvider {
->render(); ->render();
}); });
HTML::macro('breadcrumbs', function($status = false) { Form::macro('breadcrumbs', function($status = false) {
$str = '<ol class="breadcrumb">'; $str = '<ol class="breadcrumb">';
// Get the breadcrumbs by exploding the current path. // Get the breadcrumbs by exploding the current path.
@ -135,7 +136,7 @@ class AppServiceProvider extends ServiceProvider {
return $str . '</ol>'; return $str . '</ol>';
}); });
Validator::extend('positive', function($attribute, $value, $parameters) { Validator::extend('positive', function($attribute, $value, $parameters) {
return Utils::parseFloat($value) >= 0; return Utils::parseFloat($value) >= 0;
}); });

View File

@ -38,11 +38,11 @@ class ActivityService extends BaseService
'activity_type_id', 'activity_type_id',
function ($model) { function ($model) {
$data = [ $data = [
'client' => link_to('/clients/' . $model->client_public_id, Utils::getClientDisplayName($model)), '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), '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, '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) : 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)) : Utils::getPersonDisplayName($model->user_first_name, $model->user_last_name, $model->user_email), '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 ?: '', 'payment' => $model->payment ?: '',
'credit' => Utils::formatMoney($model->credit, $model->currency_id, $model->country_id) '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) { if ($transaction->amount >= 0) {
continue; continue;
} }
// if vendor has already been imported use current name // if vendor has already been imported use current name
$vendorName = trim(substr($transaction->name, 0, 20)); $vendorName = trim(substr($transaction->name, 0, 20));
$key = strtolower($vendorName); $key = strtolower($vendorName);
$vendor = isset($vendorMap[$key]) ? $vendorMap[$key] : null; $vendor = isset($vendorMap[$key]) ? $vendorMap[$key] : null;
$transaction->vendor = $vendor ? $vendor->name : $this->prepareValue($vendorName); $transaction->vendor = $vendor ? $vendor->name : $this->prepareValue($vendorName);
$transaction->info = $this->prepareValue(substr($transaction->name, 20)); $transaction->info = $this->prepareValue(substr($transaction->name, 20));
$transaction->memo = $this->prepareValue($transaction->memo); $transaction->memo = $this->prepareValue($transaction->memo);
@ -228,7 +228,7 @@ class BankAccountService extends BaseService
[ [
'bank_name', 'bank_name',
function ($model) { 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; <?php namespace App\Services;
use Illuminate\Foundation\Bus\DispatchesCommands; use Illuminate\Foundation\Bus\DispatchesJobs;
use App\Services\DatatableService; use App\Services\DatatableService;
class BaseService class BaseService
{ {
use DispatchesCommands; use DispatchesJobs;
protected function getRepo() protected function getRepo()
{ {

View File

@ -46,19 +46,19 @@ class ClientService extends BaseService
[ [
'name', 'name',
function ($model) { function ($model) {
return link_to("clients/{$model->public_id}", $model->name ?: ''); return link_to("clients/{$model->public_id}", $model->name ?: '')->toHtml();
} }
], ],
[ [
'first_name', 'first_name',
function ($model) { 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', 'email',
function ($model) { 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', 'client_name',
function ($model) { 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 ! $hideClient
], ],

View File

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

View File

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

View File

@ -35,7 +35,7 @@ class InvoiceService extends BaseService
} }
$invoice = $this->invoiceRepo->save($data); $invoice = $this->invoiceRepo->save($data);
$client = $invoice->client; $client = $invoice->client;
$client->load('contacts'); $client->load('contacts');
$sendInvoiceIds = []; $sendInvoiceIds = [];
@ -45,7 +45,7 @@ class InvoiceService extends BaseService
$sendInvoiceIds[] = $contact->id; $sendInvoiceIds[] = $contact->id;
} }
} }
foreach ($client->contacts as $contact) { foreach ($client->contacts as $contact) {
$invitation = Invitation::scope()->whereContactId($contact->id)->whereInvoiceId($invoice->id)->first(); $invitation = Invitation::scope()->whereContactId($contact->id)->whereInvoiceId($invoice->id)->first();
@ -69,7 +69,7 @@ class InvoiceService extends BaseService
if (!$invitation) { if (!$invitation) {
return $invoice; return $invoice;
} }
foreach ($invoice->invitations as $invoiceInvitation) { foreach ($invoice->invitations as $invoiceInvitation) {
if ($invitation->contact_id == $invoiceInvitation->contact_id) { if ($invitation->contact_id == $invoiceInvitation->contact_id) {
return $invoiceInvitation->invitation_key; return $invoiceInvitation->invitation_key;
@ -83,7 +83,7 @@ class InvoiceService extends BaseService
if (!$quote->is_quote || $quote->quote_invoice_id) { if (!$quote->is_quote || $quote->quote_invoice_id) {
return null; return null;
} }
if ($account->auto_convert_quote || ! $account->isPro()) { if ($account->auto_convert_quote || ! $account->isPro()) {
$invoice = $this->convertQuote($quote, $invitation); $invoice = $this->convertQuote($quote, $invitation);
@ -94,7 +94,7 @@ class InvoiceService extends BaseService
$quote->markApproved(); $quote->markApproved();
event(new QuoteInvitationWasApproved($quote, null, $invitation)); event(new QuoteInvitationWasApproved($quote, null, $invitation));
foreach ($quote->invitations as $invoiceInvitation) { foreach ($quote->invitations as $invoiceInvitation) {
if ($invitation->contact_id == $invoiceInvitation->contact_id) { if ($invitation->contact_id == $invoiceInvitation->contact_id) {
return $invoiceInvitation->invitation_key; return $invoiceInvitation->invitation_key;
@ -117,13 +117,13 @@ class InvoiceService extends BaseService
[ [
'invoice_number', 'invoice_number',
function ($model) use ($entityType) { 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', 'client_name',
function ($model) { 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 ! $hideClient
], ],
@ -160,7 +160,7 @@ class InvoiceService extends BaseService
[ [
'invoice_status_name', 'invoice_status_name',
function ($model) { 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>"; return "<h4><div class=\"label label-{$class}\">$label</div></h4>";
} }
} }

View File

@ -202,7 +202,7 @@ class PaymentService extends BaseService
if ($response->isRedirect()) { if ($response->isRedirect()) {
$token = $response->getTransactionReference(); $token = $response->getTransactionReference();
} }
Session::set($invitation->id . 'payment_type', PAYMENT_TYPE_CREDIT_CARD); Session::set($invitation->id . 'payment_type', PAYMENT_TYPE_CREDIT_CARD);
return $token; return $token;
@ -273,7 +273,7 @@ class PaymentService extends BaseService
// submit purchase/get response // submit purchase/get response
$response = $gateway->purchase($details)->send(); $response = $gateway->purchase($details)->send();
if ($response->isSuccessful()) { if ($response->isSuccessful()) {
$ref = $response->getTransactionReference(); $ref = $response->getTransactionReference();
return $this->createPayment($invitation, $accountGateway, $ref); return $this->createPayment($invitation, $accountGateway, $ref);
@ -295,13 +295,13 @@ class PaymentService extends BaseService
[ [
'invoice_number', 'invoice_number',
function ($model) { 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', 'client_name',
function ($model) { 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 ! $hideClient
], ],

View File

@ -34,7 +34,7 @@ class PaymentTermService extends BaseService
[ [
'name', 'name',
function ($model) { 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', 'product_key',
function ($model) { 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', 'frequency',
function ($model) { function ($model) {
return link_to("invoices/{$model->public_id}", $model->frequency); return link_to("invoices/{$model->public_id}", $model->frequency)->toHtml();
} }
], ],
[ [
'client_name', 'client_name',
function ($model) { 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 ! $hideClient
], ],

View File

@ -42,14 +42,14 @@ class TaskService extends BaseService
[ [
'client_name', 'client_name',
function ($model) { 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 ! $hideClient
], ],
[ [
'created_at', 'created_at',
function ($model) { 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', 'name',
function ($model) { 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', 'name',
function ($model) { 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', 'first_name',
function ($model) { 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', 'name',
function ($model) { 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', 'email',
function ($model) { 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/2checkout": "dev-master#e9c079c2dde0d7ba461903b3b7bd5caf6dee1248",
"omnipay/gocardless": "dev-master", "omnipay/gocardless": "dev-master",
"omnipay/stripe": "2.3.0", "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", "patricktalmadge/bootstrapper": "5.5.x",
"anahkiasen/former": "4.0.*@dev", "anahkiasen/former": "4.0.*@dev",
"barryvdh/laravel-debugbar": "~2.0.2", "barryvdh/laravel-debugbar": "~2.0",
"chumper/datatable": "dev-develop#7fa47cb", "chumper/datatable": "dev-develop#04ef2bf",
"omnipay/omnipay": "~2.3.0", "omnipay/omnipay": "~2.3.0",
"intervention/image": "dev-master", "intervention/image": "dev-master",
"webpatser/laravel-countries": "dev-master", "webpatser/laravel-countries": "dev-master",
@ -35,7 +38,6 @@
"alfaproject/omnipay-skrill": "dev-master", "alfaproject/omnipay-skrill": "dev-master",
"omnipay/bitpay": "dev-master", "omnipay/bitpay": "dev-master",
"guzzlehttp/guzzle": "~6.0", "guzzlehttp/guzzle": "~6.0",
"laravelcollective/html": "~5.0",
"wildbit/laravel-postmark-provider": "2.0", "wildbit/laravel-postmark-provider": "2.0",
"Dwolla/omnipay-dwolla": "dev-master", "Dwolla/omnipay-dwolla": "dev-master",
"laravel/socialite": "~2.0", "laravel/socialite": "~2.0",
@ -71,7 +73,8 @@
"phpspec/phpspec": "~2.1", "phpspec/phpspec": "~2.1",
"codeception/codeception": "*", "codeception/codeception": "*",
"codeception/c3": "~2.0", "codeception/c3": "~2.0",
"fzaninotto/faker": "^1.5" "fzaninotto/faker": "^1.5",
"symfony/dom-crawler": "~3.0"
}, },
"autoload": { "autoload": {
"classmap": [ "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', ''), 'debug' => env('APP_DEBUG', ''),
'env' => env('APP_ENV', 'production'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application URL | Application URL
@ -115,12 +117,11 @@ return [
/* /*
* Laravel Framework Service Providers... * Laravel Framework Service Providers...
*/ */
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider', 'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Bus\BusServiceProvider', 'Collective\Html\HtmlServiceProvider',
'Collective\Bus\BusServiceProvider',
'Illuminate\Cache\CacheServiceProvider', 'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider', 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Routing\ControllerServiceProvider',
'Illuminate\Cookie\CookieServiceProvider', 'Illuminate\Cookie\CookieServiceProvider',
'Illuminate\Database\DatabaseServiceProvider', 'Illuminate\Database\DatabaseServiceProvider',
'Illuminate\Encryption\EncryptionServiceProvider', 'Illuminate\Encryption\EncryptionServiceProvider',
@ -149,7 +150,6 @@ return [
'Intervention\Image\ImageServiceProvider', 'Intervention\Image\ImageServiceProvider',
'Webpatser\Countries\CountriesServiceProvider', 'Webpatser\Countries\CountriesServiceProvider',
'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider', 'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
'Illuminate\Html\HtmlServiceProvider',
'Laravel\Socialite\SocialiteServiceProvider', 'Laravel\Socialite\SocialiteServiceProvider',
'Jlapp\Swaggervel\SwaggervelServiceProvider', 'Jlapp\Swaggervel\SwaggervelServiceProvider',
'Maatwebsite\Excel\ExcelServiceProvider', 'Maatwebsite\Excel\ExcelServiceProvider',
@ -158,7 +158,7 @@ return [
* Application Service Providers... * Application Service Providers...
*/ */
'App\Providers\AppServiceProvider', 'App\Providers\AppServiceProvider',
'App\Providers\BusServiceProvider', //'App\Providers\BusServiceProvider',
'App\Providers\ConfigServiceProvider', 'App\Providers\ConfigServiceProvider',
'App\Providers\EventServiceProvider', 'App\Providers\EventServiceProvider',
'App\Providers\RouteServiceProvider', 'App\Providers\RouteServiceProvider',

View File

@ -2,66 +2,106 @@
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default Authentication Driver | Authentication Defaults
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This option controls the authentication driver that will be utilized. | This option controls the default authentication "guard" and password
| This driver manages the retrieval and authentication of the users | reset options for your application. You may change these defaults
| attempting to get access to protected areas of your application. | as required, but they're a perfect start for most applications.
| |
| Supported: "database", "eloquent" */
|
*/
'driver' => 'eloquent', 'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Authentication Model | Authentication Guards
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| When using the "Eloquent" authentication driver, we need to know which | Next, you may define every authentication guard for your application.
| Eloquent model should be used to retrieve your users. Of course, it | Of course, a great default configuration has been defined for you
| is often just the "User" model but you may use whatever you like. | 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',
],
/* 'api' => [
|-------------------------------------------------------------------------- 'driver' => 'token',
| Authentication Table 'provider' => 'users',
|-------------------------------------------------------------------------- ],
| ],
| 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.
|
*/
'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"
|
*/
/* 'providers' => [
|-------------------------------------------------------------------------- 'users' => [
| Password Reset Settings 'driver' => 'eloquent',
|-------------------------------------------------------------------------- 'model' => App\Models\User::class,
| ],
| 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.
|
*/
'password' => [ // 'users' => [
'email' => 'emails.password', // 'driver' => 'database',
'table' => 'password_resets', // 'table' => 'users',
'expire' => 60, // ],
], ],
]; /*
|--------------------------------------------------------------------------
| 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' => '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' => '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' => '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) { foreach ($currencies as $currency) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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