From 7273e39f1e109d2c7f66535487e7b19eefe35812 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 11 Nov 2015 14:17:58 +0200 Subject: [PATCH] Bug fixes --- app/Ninja/Repositories/InvoiceRepository.php | 2 +- public/js/built.js | 10 ++++++++++ public/js/script.js | 12 +++++++++++- resources/lang/en/texts.php | 3 ++- resources/views/accounts/api_tokens.blade.php | 13 +++---------- resources/views/accounts/payments.blade.php | 13 ++----------- resources/views/accounts/products.blade.php | 11 +---------- resources/views/accounts/tax_rates.blade.php | 11 +---------- .../views/accounts/user_management.blade.php | 12 ++---------- resources/views/invoices/edit.blade.php | 8 ++++++-- resources/views/invoices/knockout.blade.php | 8 ++++++++ resources/views/list.blade.php | 17 ++--------------- 12 files changed, 49 insertions(+), 71 deletions(-) diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index 44ce5d4c9a4c..7bcf9c710e53 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -144,7 +144,7 @@ class InvoiceRepository extends BaseRepository if ((isset($data['set_default_terms']) && $data['set_default_terms']) || (isset($data['set_default_footer']) && $data['set_default_footer'])) { if (isset($data['set_default_terms']) && $data['set_default_terms']) { - $account->{"{$entityType}_terms"} = trim($data['terms']); + $account->{"{$invoice->getEntityType()}_terms"} = trim($data['terms']); } if (isset($data['set_default_footer']) && $data['set_default_footer']) { $account->invoice_footer = trim($data['invoice_footer']); diff --git a/public/js/built.js b/public/js/built.js index 7e1ea06b3edf..06371208b549 100644 --- a/public/js/built.js +++ b/public/js/built.js @@ -31571,6 +31571,16 @@ function truncate(string, length){ return string; } }; + +function actionListHandler() { + $('tbody tr').mouseover(function() { + $(this).closest('tr').find('.tr-action').css('display', 'inline-block'); + $(this).closest('tr').find('.tr-status').css('display', 'none'); + }).mouseout(function() { + $(this).closest('tr').find('.tr-action').css('display', 'none'); + $(this).closest('tr').find('.tr-status').css('display', 'inline-block'); + }); +} var NINJA = NINJA || {}; NINJA.TEMPLATES = { diff --git a/public/js/script.js b/public/js/script.js index da30e0d4c4ac..98970a373ecb 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1692,4 +1692,14 @@ function truncate(string, length){ } else { return string; } -}; \ No newline at end of file +}; + +function actionListHandler() { + $('tbody tr').mouseover(function() { + $(this).closest('tr').find('.tr-action').css('display', 'inline-block'); + $(this).closest('tr').find('.tr-status').css('display', 'none'); + }).mouseout(function() { + $(this).closest('tr').find('.tr-action').css('display', 'none'); + $(this).closest('tr').find('.tr-status').css('display', 'inline-block'); + }); +} \ No newline at end of file diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 5d0993ebad58..c528f6f98674 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -911,6 +911,7 @@ return array( 'before' => 'Before', 'after' => 'After', + 'reset_terms_help' => 'Reset to the default account terms', + 'reset_footer_help' => 'Reset to the default account footer', - ); diff --git a/resources/views/accounts/api_tokens.blade.php b/resources/views/accounts/api_tokens.blade.php index d9e4b4498bee..efbd41e283e1 100644 --- a/resources/views/accounts/api_tokens.blade.php +++ b/resources/views/accounts/api_tokens.blade.php @@ -37,21 +37,14 @@ ->render('datatable') !!} @stop diff --git a/resources/views/accounts/payments.blade.php b/resources/views/accounts/payments.blade.php index 096d29fb0541..18ae1a638b97 100644 --- a/resources/views/accounts/payments.blade.php +++ b/resources/views/accounts/payments.blade.php @@ -27,16 +27,7 @@ ->render('datatable') !!} + window.onDatatableReady = actionListHandler; + @stop \ No newline at end of file diff --git a/resources/views/accounts/products.blade.php b/resources/views/accounts/products.blade.php index a44a6292c591..03a465413fe5 100644 --- a/resources/views/accounts/products.blade.php +++ b/resources/views/accounts/products.blade.php @@ -42,16 +42,7 @@ ->render('datatable') !!} diff --git a/resources/views/accounts/tax_rates.blade.php b/resources/views/accounts/tax_rates.blade.php index 09df9b04dad4..2079d72f2155 100644 --- a/resources/views/accounts/tax_rates.blade.php +++ b/resources/views/accounts/tax_rates.blade.php @@ -65,16 +65,7 @@ ->render('datatable') !!} diff --git a/resources/views/accounts/user_management.blade.php b/resources/views/accounts/user_management.blade.php index ed63482f8ae5..f3930c677338 100644 --- a/resources/views/accounts/user_management.blade.php +++ b/resources/views/accounts/user_management.blade.php @@ -34,16 +34,8 @@ ->render('datatable') !!}