diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index 5433e2e1b1cd..1494c077147e 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -132,8 +132,11 @@ class InvoiceController extends \BaseController { return View::make('invoices.deleted'); } - Activity::viewInvoice($invitation); - Event::fire('invoice.viewed', $invoice); + if (!Auth::check() || Auth::user()->account_id != $invoice->account_id) + { + Activity::viewInvoice($invitation); + Event::fire('invoice.viewed', $invoice); + } $client->account->loadLocalizationSettings(); diff --git a/app/lang/de/texts.php b/app/lang/de/texts.php index 549de74e0f2c..50266028d614 100644 --- a/app/lang/de/texts.php +++ b/app/lang/de/texts.php @@ -262,7 +262,7 @@ return array( 'user_email_footer' => 'To adjust your email notification settings please visit http://www.invoiceninja.com/company/notifications', 'invoice_link_message' => 'To view your client invoice click the link below:', 'notification_paid_subject' => 'Invoice :invoice was paid by :client', - 'notification_sent_subject' => 'Invoice :invoice was sent by :client', + 'notification_sent_subject' => 'Invoice :invoice was sent to :client', 'notification_viewed_subject' => 'Invoice :invoice was viewed by :client', 'notification_paid' => 'A payment of :amount was made by client :client towards Invoice :invoice.', 'notification_sent' => 'The following client :client was emailed Invoice :invoice for :amount.', diff --git a/app/lang/en/texts.php b/app/lang/en/texts.php index d3bd37b4c64f..558dbc15ec42 100644 --- a/app/lang/en/texts.php +++ b/app/lang/en/texts.php @@ -262,7 +262,7 @@ return array( 'user_email_footer' => 'To adjust your email notification settings please visit http://www.invoiceninja.com/company/notifications', 'invoice_link_message' => 'To view your client invoice click the link below:', 'notification_paid_subject' => 'Invoice :invoice was paid by :client', - 'notification_sent_subject' => 'Invoice :invoice was sent by :client', + 'notification_sent_subject' => 'Invoice :invoice was sent to :client', 'notification_viewed_subject' => 'Invoice :invoice was viewed by :client', 'notification_paid' => 'A payment of :amount was made by client :client towards Invoice :invoice.', 'notification_sent' => 'The following client :client was emailed Invoice :invoice for :amount.', diff --git a/app/lang/es/texts.php b/app/lang/es/texts.php index d8818a66dee9..c27be2db0810 100644 --- a/app/lang/es/texts.php +++ b/app/lang/es/texts.php @@ -261,7 +261,7 @@ return array( 'user_email_footer' => 'To adjust your email notification settings please visit http://www.invoiceninja.com/company/notifications', 'invoice_link_message' => 'To view your client invoice click the link below:', 'notification_paid_subject' => 'Invoice :invoice was paid by :client', - 'notification_sent_subject' => 'Invoice :invoice was sent by :client', + 'notification_sent_subject' => 'Invoice :invoice was sent to :client', 'notification_viewed_subject' => 'Invoice :invoice was viewed by :client', 'notification_paid' => 'A payment of :amount was made by client :client towards Invoice :invoice.', 'notification_sent' => 'The following client :client was emailed Invoice :invoice for :amount.', diff --git a/app/lang/fr/texts.php b/app/lang/fr/texts.php index 2bb9a9a54a6e..aad1c86e3e59 100644 --- a/app/lang/fr/texts.php +++ b/app/lang/fr/texts.php @@ -262,7 +262,7 @@ return array( 'user_email_footer' => 'To adjust your email notification settings please visit http://www.invoiceninja.com/company/notifications', 'invoice_link_message' => 'To view your client invoice click the link below:', 'notification_paid_subject' => 'Invoice :invoice was paid by :client', - 'notification_sent_subject' => 'Invoice :invoice was sent by :client', + 'notification_sent_subject' => 'Invoice :invoice was sent to :client', 'notification_viewed_subject' => 'Invoice :invoice was viewed by :client', 'notification_paid' => 'A payment of :amount was made by client :client towards Invoice :invoice.', 'notification_sent' => 'The following client :client was emailed Invoice :invoice for :amount.', diff --git a/app/lang/it/texts.php b/app/lang/it/texts.php index eb06f33f7036..591243a23837 100644 --- a/app/lang/it/texts.php +++ b/app/lang/it/texts.php @@ -262,7 +262,7 @@ return array( 'user_email_footer' => 'To adjust your email notification settings please visit http://www.invoiceninja.com/company/notifications', 'invoice_link_message' => 'To view your client invoice click the link below:', 'notification_paid_subject' => 'Invoice :invoice was paid by :client', - 'notification_sent_subject' => 'Invoice :invoice was sent by :client', + 'notification_sent_subject' => 'Invoice :invoice was sent to :client', 'notification_viewed_subject' => 'Invoice :invoice was viewed by :client', 'notification_paid' => 'A payment of :amount was made by client :client towards Invoice :invoice.', 'notification_sent' => 'The following client :client was emailed Invoice :invoice for :amount.', diff --git a/app/lang/pt_BR/texts.php b/app/lang/pt_BR/texts.php index 957d40d66a39..7a467c4a6163 100644 --- a/app/lang/pt_BR/texts.php +++ b/app/lang/pt_BR/texts.php @@ -261,7 +261,7 @@ return array( 'user_email_footer' => 'To adjust your email notification settings please visit http://www.invoiceninja.com/company/notifications', 'invoice_link_message' => 'To view your client invoice click the link below:', 'notification_paid_subject' => 'Invoice :invoice was paid by :client', - 'notification_sent_subject' => 'Invoice :invoice was sent by :client', + 'notification_sent_subject' => 'Invoice :invoice was sent to :client', 'notification_viewed_subject' => 'Invoice :invoice was viewed by :client', 'notification_paid' => 'A payment of :amount was made by client :client towards Invoice :invoice.', 'notification_sent' => 'The following client :client was emailed Invoice :invoice for :amount.', diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index 8d775f793a9f..d395a04949f9 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -471,6 +471,12 @@ $('input[name=client]').val({{ $client->public_id }}); @endif + /* + if (clients.length == 0) { + $('.client_select input.form-control').prop('disabled', true); + } + */ + var $input = $('select#client'); $input.combobox().on('change', function(e) { var clientId = parseInt($('input[name=client]').val(), 10); @@ -481,7 +487,7 @@ model.invoice().client().country = false; } refreshPDF(); - }); //.trigger('change'); + }); //.trigger('change'); $('#terms, #public_notes, #invoice_number, #invoice_date, #due_date, #po_number, #discount, #currency_id, #invoice_design_id').change(function() { refreshPDF();