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 }}