From af37de4feb4ff73423a761fc2fda27db0a736c7f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 19 Feb 2014 15:28:29 +0200 Subject: [PATCH] bug fixes --- .gitignore | 2 -- README.md | 3 +-- app/config/packages/zizaco/confide/config.php | 2 +- app/models/Credit.php | 4 ++-- app/models/Invoice.php | 2 +- app/models/Payment.php | 4 ++-- app/ninja/mailers/Mailer.php | 4 +++- app/views/dashboard.blade.php | 2 +- app/views/emails/invoice_html.blade.php | 2 +- app/views/emails/passwordreset_html.blade.php | 8 ++++++++ app/views/emails/payment_confirmation_html.blade.php | 2 +- app/views/invoices/edit.blade.php | 2 +- app/views/users/forgot_password.blade.php | 2 ++ app/views/users/reset_password.blade.php | 2 ++ 14 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 app/views/emails/passwordreset_html.blade.php diff --git a/.gitignore b/.gitignore index a35d8c344d14..0981b45f552c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,6 @@ /composer.lock /.DS_Store /Thumbs.db -/app.yaml -/database.sql /ninja.sublime-project /ninja.sublime-workspace /tests/_log diff --git a/README.md b/README.md index 3ec48382d0cd..e38b87e05918 100644 --- a/README.md +++ b/README.md @@ -65,5 +65,4 @@ Configure config/database.php and then initialize the database * [mozilla/pdf.js](https://github.com/mozilla/pdf.js) - PDF Reader in JavaScript * [nnnick/Chart.js](https://github.com/nnnick/Chart.js) - Simple HTML5 Charts using the tag * [josscrowcroft/accounting.js](https://github.com/josscrowcroft/accounting.js) - A lightweight JavaScript library for number, money and currency formatting -* [jashkenas/underscore](https://github.com/jashkenas/underscore) - JavaScript's utility _ belt -* [davejamesmiller/laravel-breadcrumbs](https://github.com/davejamesmiller/laravel-breadcrumbs) - A simple Laravel-style way to create breadcrumbs in Laravel 4 \ No newline at end of file +* [jashkenas/underscore](https://github.com/jashkenas/underscore) - JavaScript's utility _ belt \ No newline at end of file diff --git a/app/config/packages/zizaco/confide/config.php b/app/config/packages/zizaco/confide/config.php index 29535d884596..2e60fdad1c63 100755 --- a/app/config/packages/zizaco/confide/config.php +++ b/app/config/packages/zizaco/confide/config.php @@ -70,7 +70,7 @@ return array( | */ - 'email_reset_password' => 'confide::emails.passwordreset', // with $user and $token. + 'email_reset_password' => 'emails.passwordreset_html', // with $user and $token. 'email_account_confirmation' => 'emails.confirm_html', // with $user /* diff --git a/app/models/Credit.php b/app/models/Credit.php index 677dbd4e1eca..da98ba8968e7 100755 --- a/app/models/Credit.php +++ b/app/models/Credit.php @@ -4,12 +4,12 @@ class Credit extends EntityModel { public function invoice() { - return $this->belongsTo('Invoice'); + return $this->belongsTo('Invoice')->withTrashed(); } public function client() { - return $this->belongsTo('Client'); + return $this->belongsTo('Client')->withTrashed(); } public function getName() diff --git a/app/models/Invoice.php b/app/models/Invoice.php index 51d49e756144..7b446d65dfa3 100755 --- a/app/models/Invoice.php +++ b/app/models/Invoice.php @@ -9,7 +9,7 @@ class Invoice extends EntityModel public function client() { - return $this->belongsTo('Client'); + return $this->belongsTo('Client')->withTrashed(); } public function invoice_items() diff --git a/app/models/Payment.php b/app/models/Payment.php index fd81faf14677..d97102d7e9b2 100755 --- a/app/models/Payment.php +++ b/app/models/Payment.php @@ -4,7 +4,7 @@ class Payment extends EntityModel { public function invoice() { - return $this->belongsTo('Invoice'); + return $this->belongsTo('Invoice')->withTrashed();; } public function invitation() @@ -14,7 +14,7 @@ class Payment extends EntityModel public function client() { - return $this->belongsTo('Client'); + return $this->belongsTo('Client')->withTrashed();; } public function account() diff --git a/app/ninja/mailers/Mailer.php b/app/ninja/mailers/Mailer.php index 42a202c2340b..0a3f6dd07710 100755 --- a/app/ninja/mailers/Mailer.php +++ b/app/ninja/mailers/Mailer.php @@ -11,7 +11,9 @@ abstract class Mailer { 'emails.'.$view.'_text' ]; - Mail::queue($views, $data, function($message) use ($toEmail, $fromEmail, $subject) + $view = 'emails.' . $view; + + Mail::queue($view, $data, function($message) use ($toEmail, $fromEmail, $subject) { $message->to($toEmail)->replyTo($fromEmail)->subject($subject); }); diff --git a/app/views/dashboard.blade.php b/app/views/dashboard.blade.php index fc7b7c52c39c..89a28a2456aa 100644 --- a/app/views/dashboard.blade.php +++ b/app/views/dashboard.blade.php @@ -132,7 +132,7 @@
{{ Utils::pluralize('active client', $activeClients) }}
-
average invoice
+
Average invoice
{{ $invoiceAvg }}
diff --git a/app/views/emails/invoice_html.blade.php b/app/views/emails/invoice_html.blade.php index 4bdf2e6bcffc..129f7bf15c7a 100755 --- a/app/views/emails/invoice_html.blade.php +++ b/app/views/emails/invoice_html.blade.php @@ -12,7 +12,7 @@ {{ $link }}

@if ($emailFooter) - {{ $emailFooter }} + {{ nl2br($emailFooter) }} @else Best regards,
{{ $accountName }} diff --git a/app/views/emails/passwordreset_html.blade.php b/app/views/emails/passwordreset_html.blade.php new file mode 100644 index 000000000000..fd259d328e83 --- /dev/null +++ b/app/views/emails/passwordreset_html.blade.php @@ -0,0 +1,8 @@ +Hi there! {{ $user->username }}

+ +You can reset your account password by clicking the following link {{{ (Confide::checkAction('UserController@reset_password', array($token))) ? : URL::to('user/reset/'.$token) }}}

+ +Regards,
+The InvoiceNinja Team

+ +If you did not request this password reset please email our support: admin@invoiceninja.com

diff --git a/app/views/emails/payment_confirmation_html.blade.php b/app/views/emails/payment_confirmation_html.blade.php index 689cc98a8dd7..ef73ee755351 100644 --- a/app/views/emails/payment_confirmation_html.blade.php +++ b/app/views/emails/payment_confirmation_html.blade.php @@ -10,7 +10,7 @@ Thank you for your payment of {{ $paymentAmount }}.

@if ($emailFooter) - {{ $emailFooter }} + {{ nl2br($emailFooter) }} @else Best regards,
{{ $accountName }} diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index 13c06930f4a5..8f6bc4675b73 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -209,7 +209,7 @@ {{ Button::normal('Download PDF', array('onclick' => 'onDownloadClick()')) }} - @if (!$invoice || !$invoice->trashed()) + @if (!$invoice || (!$invoice->trashed() && !$invoice->client->trashed())) @if ($invoice)

diff --git a/app/views/users/forgot_password.blade.php b/app/views/users/forgot_password.blade.php index ff9058cd7ff4..1b4d330f7ab2 100755 --- a/app/views/users/forgot_password.blade.php +++ b/app/views/users/forgot_password.blade.php @@ -2,6 +2,8 @@ @section('head') + +