From 564d00642824c966e4ce5bfceba1fa145273680c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 13 Apr 2015 10:54:51 +0300 Subject: [PATCH] Working on L5 --- app/Exceptions/Handler.php | 8 +++++--- app/Http/Controllers/HomeController.php | 7 ++++--- app/Http/Controllers/InvoiceApiController.php | 13 +++++++++++-- app/Http/Controllers/TokenController.php | 5 ----- app/Http/routes.php | 2 +- app/Libraries/Utils.php | 1 + config/app.php | 2 +- readme.md | 2 +- resources/views/header.blade.php | 2 +- resources/views/invoices/edit.blade.php | 6 +++--- 10 files changed, 28 insertions(+), 20 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index c7a75d356dd5..1475cbb5cb09 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -1,5 +1,6 @@ where('invoices.is_quote', '=', false)->orderBy('created_at', 'desc')->get(); - $invoices = Utils::remapPublicIds($invoices->toArray()); + $invoices = Invoice::scope()->with('invitations')->where('invoices.is_quote', '=', false)->orderBy('created_at', 'desc')->get(); + // Add the first invitation link to the data + foreach ($invoices as $key => $invoice) { + foreach ($invoice->invitations as $subKey => $invitation) { + $invoices[$key]['link'] = $invitation->getLink(); + } + unset($invoice['invitations']); + } + + $invoices = Utils::remapPublicIds($invoices->toArray()); + $response = json_encode($invoices, JSON_PRETTY_PRINT); $headers = Utils::getApiHeaders(count($invoices)); diff --git a/app/Http/Controllers/TokenController.php b/app/Http/Controllers/TokenController.php index f84411a60243..3b9d546849ab 100644 --- a/app/Http/Controllers/TokenController.php +++ b/app/Http/Controllers/TokenController.php @@ -93,11 +93,6 @@ class TokenController extends BaseController */ public function create() { - if (!Auth::user()->confirmed) { - Session::flash('error', trans('texts.register_to_add_user')); - return Redirect::to('company/advanced_settings/user_management'); - } - $data = [ 'showBreadcrumbs' => false, 'token' => null, diff --git a/app/Http/routes.php b/app/Http/routes.php index d090b43ec94a..eb5656b0880d 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -321,7 +321,7 @@ define('NINJA_GATEWAY_ID', GATEWAY_AUTHORIZE_NET); define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}'); define('NINJA_WEB_URL', 'https://www.invoiceninja.com'); define('NINJA_APP_URL', 'https://app.invoiceninja.com'); -define('NINJA_VERSION', '2.0'); +define('NINJA_VERSION', '1.7.2'); define('NINJA_DATE', '2000-01-01'); define('NINJA_FROM_EMAIL', 'maildelivery@invoiceninja.com'); define('RELEASES_URL', 'https://github.com/hillelcoren/invoice-ninja/releases/'); diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 33d799e4acb7..08a4e5d50a63 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -165,6 +165,7 @@ class Utils 'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '', 'ip' => Request::getClientIp(), 'count' => Session::get('error_count', 0), + 'input' => Input::all() ]; Log::error($error."\n", $data); diff --git a/config/app.php b/config/app.php index 4568f97c6fdd..a8dd21bff24c 100644 --- a/config/app.php +++ b/config/app.php @@ -13,7 +13,7 @@ return [ | */ - 'debug' => true, + 'debug' => env('APP_DEBUG', ''), /* |-------------------------------------------------------------------------- diff --git a/readme.md b/readme.md index 19c0729c75de..37236a85d6c3 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,7 @@ ### [https://www.invoiceninja.com](https://www.invoiceninja.com) -#### Please [click here](https://bitnami.com/stack/invoice-ninja) to vote for us to be added to Bitnami's one-click install library +##### Please [click here](https://bitnami.com/stack/invoice-ninja) to vote for us to be added to Bitnami's one-click install library If you'd like to use our code to sell your own invoicing app we have an affiliate program. Get in touch for more details. diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index f8198e2504ae..abc37c633b15 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -164,7 +164,7 @@ @elseif (Session::has('news_feed_message'))
- {{ Session::get('news_feed_message') }} + {!! Session::get('news_feed_message') !!} {{ trans('texts.hide') }}
@endif diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index fc67dcce8b5e..2bf24232c4e8 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -672,11 +672,11 @@ invoice.is_quote = {{ $entityType == ENTITY_QUOTE ? 'true' : 'false' }}; invoice.contact = _.findWhere(invoice.client.contacts, {send_invoice: true}); - if (!invoice.terms) { - invoice.terms = "{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_terms)) }}"; + if (!invoice.terms) { + invoice.terms = wordWrapText('{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_terms)) }}', 300); } if (!invoice.invoice_footer) { - invoice.invoice_footer = "{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_footer)) }}"; + invoice.invoice_footer = wordWrapText('{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_footer)) }}', 600); } @if (file_exists($account->getLogoPath()))