diff --git a/.env.development.php b/.env.development.php new file mode 100644 index 000000000000..53166e5b13a0 --- /dev/null +++ b/.env.development.php @@ -0,0 +1,9 @@ + true, + //'TAG_MANAGER_KEY' => '', + //'ANALYTICS_KEY' => '', + +); diff --git a/.gitignore b/.gitignore index 955906ddce9d..a344f570bfdb 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ /bootstrap/compiled.php /bootstrap/environment.php /vendor -/.env.development.php /.DS_Store /Thumbs.db /ninja.sublime-project diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 65121b904348..7bec168e9c63 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -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'); diff --git a/app/controllers/HomeController.php b/app/controllers/HomeController.php index adc8f5d59136..dcf8f30fe36a 100755 --- a/app/controllers/HomeController.php +++ b/app/controllers/HomeController.php @@ -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); diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index bb16afc146b0..0f6bbb9c6a32 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -147,11 +147,12 @@ class InvoiceController extends \BaseController { ->where('invitations.account_id', '=', Auth::user()->account_id) ->where('invitations.deleted_at', '=', null) ->select('contacts.public_id')->lists('public_id'); - + if ($clone) { $invoice->id = null; - $invoice->invoice_number = Auth::user()->account->getNextInvoiceNumber(); + $invoice->invoice_number = Auth::user()->account->getNextInvoiceNumber(); + $invoice->balance = $invoice->amount; $method = 'POST'; $url = "{$entityType}s"; } diff --git a/app/libraries/utils.php b/app/libraries/utils.php index 7ad83368f3c7..a1278bf11271 100755 --- a/app/libraries/utils.php +++ b/app/libraries/utils.php @@ -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(); diff --git a/app/views/credits/edit.blade.php b/app/views/credits/edit.blade.php index 41abc7477004..052c6b8ad0f9 100755 --- a/app/views/credits/edit.blade.php +++ b/app/views/credits/edit.blade.php @@ -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()); }); diff --git a/app/views/emails/contact_html.blade.php b/app/views/emails/contact_html.blade.php index 6ea25fd2b4c8..120f94c0f1bf 100644 --- a/app/views/emails/contact_html.blade.php +++ b/app/views/emails/contact_html.blade.php @@ -1,3 +1 @@ -Name: {{ $name }}
-Email: {{ $email }}

-Message: {{ nl2br($text) }} +{{ nl2br($text) }} diff --git a/app/views/emails/contact_text.blade.php b/app/views/emails/contact_text.blade.php index 628d256f35b3..8c1a40ba956a 100644 --- a/app/views/emails/contact_text.blade.php +++ b/app/views/emails/contact_text.blade.php @@ -1,4 +1 @@ -Name: {{ $name }} -Email: {{ $email }} - -Message: {{ $text }} \ No newline at end of file +{{ $text }} \ No newline at end of file diff --git a/app/views/emails/invoice_html.blade.php b/app/views/emails/invoice_html.blade.php index b9a985ca6f4f..8c32f6bfab12 100755 --- a/app/views/emails/invoice_html.blade.php +++ b/app/views/emails/invoice_html.blade.php @@ -8,7 +8,7 @@ {{ $clientName }},

{{ trans("texts.{$entityType}_message", ['amount' => $invoiceAmount]) }}

- {{ $link }}

+ {{ $link }}

@if ($emailFooter) {{ nl2br($emailFooter) }} @@ -19,7 +19,7 @@ @if ($showNinjaFooter)

- {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} + {{ trans('texts.ninja_email_footer', ['site' => 'Invoice Ninja']) }} @endif diff --git a/app/views/emails/invoice_paid_html.blade.php b/app/views/emails/invoice_paid_html.blade.php index 010b528acdd3..1b86890ea216 100755 --- a/app/views/emails/invoice_paid_html.blade.php +++ b/app/views/emails/invoice_paid_html.blade.php @@ -10,7 +10,7 @@ {{ trans("texts.notification_{$entityType}_paid", ['amount' => $paymentAmount, 'client' => $clientName, 'invoice' => $invoiceNumber]) }}

{{ trans("texts.{$entityType}_link_message") }}
- {{ $invoiceLink }}

+ {{ $invoiceLink }}

{{ trans('texts.email_signature') }}
{{ trans('texts.email_from') }}

diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index f202239b244c..ed71207acfff 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -1134,7 +1134,7 @@ }); this.totals.rawPaidToDate = ko.computed(function() { - return accounting.toFixed(self.amount(),2) - accounting.toFixed(self.balance(),2); + return accounting.toFixed(self.amount(),2) - accounting.toFixed(self.balance(),2); }); this.totals.paidToDate = ko.computed(function() { diff --git a/app/views/payments/edit.blade.php b/app/views/payments/edit.blade.php index 8042e396e56f..0852d6fae97a 100755 --- a/app/views/payments/edit.blade.php +++ b/app/views/payments/edit.blade.php @@ -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()); }); diff --git a/bootstrap/environment.default.php b/bootstrap/environment.default.php new file mode 100755 index 000000000000..c12ddd0b5998 --- /dev/null +++ b/bootstrap/environment.default.php @@ -0,0 +1,4 @@ +