Bug fixes

This commit is contained in:
Hillel Coren 2014-06-30 14:42:25 +03:00
parent ada7246b2b
commit a787427688
14 changed files with 35 additions and 19 deletions

9
.env.development.php Normal file
View File

@ -0,0 +1,9 @@
<?php
return array(
//'DISABLE_REGISTRATION' => true,
//'TAG_MANAGER_KEY' => '',
//'ANALYTICS_KEY' => '',
);

1
.gitignore vendored
View File

@ -11,7 +11,6 @@
/bootstrap/compiled.php
/bootstrap/environment.php
/vendor
/.env.development.php
/.DS_Store
/Thumbs.db
/ninja.sublime-project

View File

@ -21,6 +21,11 @@ class AccountController extends \BaseController {
public function getStarted()
{
if (Utils::isRegistrationDisabled())
{
return Redirect::away(NINJA_URL.'/invoice_now');
}
if (Auth::check())
{
return Redirect::to('invoices/create');

View File

@ -76,12 +76,10 @@ class HomeController extends BaseController {
$message = Input::get('message');
$data = [
'name' => $name,
'email' => $email,
'text' => $message
];
$this->mailer->sendTo(CONTACT_EMAIL, CONTACT_EMAIL, CONTACT_NAME, 'Invoice Ninja Feedback', 'contact', $data);
$this->mailer->sendTo(CONTACT_EMAIL, $email, $name, 'Invoice Ninja Feedback', 'contact', $data);
$message = trans('texts.sent_message');
Session::flash('message', $message);

View File

@ -152,6 +152,7 @@ class InvoiceController extends \BaseController {
{
$invoice->id = null;
$invoice->invoice_number = Auth::user()->account->getNextInvoiceNumber();
$invoice->balance = $invoice->amount;
$method = 'POST';
$url = "{$entityType}s";
}

View File

@ -32,6 +32,11 @@ class Utils
return isset($_ENV['NINJA_DEV']) && $_ENV['NINJA_DEV'];
}
public static function isRegistrationDisabled()
{
return isset($_ENV['DISABLE_REGISTRATION']) && $_ENV['DISABLE_REGISTRATION'];
}
public static function isPro()
{
return Auth::check() && Auth::user()->isPro();

View File

@ -55,7 +55,7 @@
$clientSelect.combobox();
$('#currency_id').combobox();
$('#credit_date').datepicker('update', new Date({{ strtotime(Utils::today()) * 1000 }}));
$('#credit_date').datepicker('update', new Date());
});

View File

@ -1,3 +1 @@
Name: {{ $name }}<br/>
Email: {{ $email }}<p/>
Message: {{ nl2br($text) }}
{{ nl2br($text) }}

View File

@ -1,4 +1 @@
Name: {{ $name }}
Email: {{ $email }}
Message: {{ $text }}
{{ $text }}

View File

@ -8,7 +8,7 @@
{{ $clientName }},<p/>
{{ trans("texts.{$entityType}_message", ['amount' => $invoiceAmount]) }}<p/>
{{ $link }}<p/>
<a href="{{ $link }}">{{ $link }}</a><p/>
@if ($emailFooter)
{{ nl2br($emailFooter) }}
@ -19,7 +19,7 @@
@if ($showNinjaFooter)
<p/>
{{ trans('texts.ninja_email_footer', ['site' => '<a href="https://www.invoiceninja.com/?utm_source=view_email_footer">Invoice Ninja</a>']) }}
{{ trans('texts.ninja_email_footer', ['site' => '<a href="https://www.invoiceninja.com/?utm_source=invoice_email_footer">Invoice Ninja</a>']) }}
@endif
</body>

View File

@ -10,7 +10,7 @@
{{ trans("texts.notification_{$entityType}_paid", ['amount' => $paymentAmount, 'client' => $clientName, 'invoice' => $invoiceNumber]) }} <p/>
{{ trans("texts.{$entityType}_link_message") }} <br/>
{{ $invoiceLink }} <p/>
<a href="{{ $invoiceLink }}">{{ $invoiceLink }}</a><p/>
{{ trans('texts.email_signature') }} <br/>
{{ trans('texts.email_from') }} <p/>

View File

@ -50,7 +50,7 @@
populateInvoiceComboboxes({{ $clientPublicId }}, {{ $invoicePublicId }});
$('#payment_type_id').combobox();
$('#payment_date').datepicker('update', new Date({{ strtotime(Utils::today()) * 1000 }}));
$('#payment_date').datepicker('update', new Date());
});

View File

@ -0,0 +1,4 @@
<?php
return 'development';