Working on L5

This commit is contained in:
Hillel Coren 2015-04-13 10:54:51 +03:00
parent 9dcc4e0e52
commit 564d006428
10 changed files with 28 additions and 20 deletions

View File

@ -1,5 +1,6 @@
<?php namespace App\Exceptions; <?php namespace App\Exceptions;
use Utils;
use Exception; use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
@ -24,7 +25,9 @@ class Handler extends ExceptionHandler {
*/ */
public function report(Exception $e) public function report(Exception $e)
{ {
return parent::report($e); Utils::logError(Utils::getErrorString($e));
return false;
//return parent::report($e);
} }
/** /**
@ -36,7 +39,6 @@ class Handler extends ExceptionHandler {
*/ */
public function render($request, Exception $e) public function render($request, Exception $e)
{ {
return parent::render($request, $e); return parent::render($request, $e);
} }
} }

View File

@ -1,12 +1,13 @@
<?php namespace App\Http\Controllers; <?php namespace App\Http\Controllers;
use App\Libraries\Utils;
use App\Ninja\Mailers\Mailer;
use Redirect; use Redirect;
use App\Models\Account;
use Auth; use Auth;
use View; use View;
use Input; use Input;
use Session;
use App\Models\Account;
use App\Libraries\Utils;
use App\Ninja\Mailers\Mailer;
class HomeController extends BaseController class HomeController extends BaseController
{ {

View File

@ -23,9 +23,18 @@ class InvoiceApiController extends Controller
public function index() public function index()
{ {
$invoices = Invoice::scope()->where('invoices.is_quote', '=', false)->orderBy('created_at', 'desc')->get(); $invoices = Invoice::scope()->with('invitations')->where('invoices.is_quote', '=', false)->orderBy('created_at', 'desc')->get();
$invoices = Utils::remapPublicIds($invoices->toArray());
// 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); $response = json_encode($invoices, JSON_PRETTY_PRINT);
$headers = Utils::getApiHeaders(count($invoices)); $headers = Utils::getApiHeaders(count($invoices));

View File

@ -93,11 +93,6 @@ class TokenController extends BaseController
*/ */
public function create() 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 = [ $data = [
'showBreadcrumbs' => false, 'showBreadcrumbs' => false,
'token' => null, 'token' => null,

View File

@ -321,7 +321,7 @@ define('NINJA_GATEWAY_ID', GATEWAY_AUTHORIZE_NET);
define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}'); define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}');
define('NINJA_WEB_URL', 'https://www.invoiceninja.com'); define('NINJA_WEB_URL', 'https://www.invoiceninja.com');
define('NINJA_APP_URL', 'https://app.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_DATE', '2000-01-01');
define('NINJA_FROM_EMAIL', 'maildelivery@invoiceninja.com'); define('NINJA_FROM_EMAIL', 'maildelivery@invoiceninja.com');
define('RELEASES_URL', 'https://github.com/hillelcoren/invoice-ninja/releases/'); define('RELEASES_URL', 'https://github.com/hillelcoren/invoice-ninja/releases/');

View File

@ -165,6 +165,7 @@ class Utils
'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '', 'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '',
'ip' => Request::getClientIp(), 'ip' => Request::getClientIp(),
'count' => Session::get('error_count', 0), 'count' => Session::get('error_count', 0),
'input' => Input::all()
]; ];
Log::error($error."\n", $data); Log::error($error."\n", $data);

View File

@ -13,7 +13,7 @@ return [
| |
*/ */
'debug' => true, 'debug' => env('APP_DEBUG', ''),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
### [https://www.invoiceninja.com](https://www.invoiceninja.com) ### [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. 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.

View File

@ -164,7 +164,7 @@
</div> </div>
@elseif (Session::has('news_feed_message')) @elseif (Session::has('news_feed_message'))
<div class="alert alert-info"> <div class="alert alert-info">
{{ Session::get('news_feed_message') }} {!! Session::get('news_feed_message') !!}
<a href="#" onclick="hideMessage()" class="pull-right">{{ trans('texts.hide') }}</a> <a href="#" onclick="hideMessage()" class="pull-right">{{ trans('texts.hide') }}</a>
</div> </div>
@endif @endif

View File

@ -672,11 +672,11 @@
invoice.is_quote = {{ $entityType == ENTITY_QUOTE ? 'true' : 'false' }}; invoice.is_quote = {{ $entityType == ENTITY_QUOTE ? 'true' : 'false' }};
invoice.contact = _.findWhere(invoice.client.contacts, {send_invoice: true}); invoice.contact = _.findWhere(invoice.client.contacts, {send_invoice: true});
if (!invoice.terms) { if (!invoice.terms) {
invoice.terms = "{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_terms)) }}"; invoice.terms = wordWrapText('{{ str_replace(["\r\n","\r","\n"], '\n', addslashes($account->invoice_terms)) }}', 300);
} }
if (!invoice.invoice_footer) { 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())) @if (file_exists($account->getLogoPath()))