From 9ae41b164519c13b14f38307deaf968877874ffe Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 3 Sep 2020 06:52:09 +0200 Subject: [PATCH] Link in clone. --- app/Http/Controllers/Transaction/CreateController.php | 3 ++- public/v1/js/ff/transactions/show.js | 6 ------ resources/lang/en_US/firefly.php | 1 - resources/views/v1/transactions/show.twig | 5 ++--- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php index ecd39cb1e3..4af431b334 100644 --- a/app/Http/Controllers/Transaction/CreateController.php +++ b/app/Http/Controllers/Transaction/CreateController.php @@ -71,8 +71,9 @@ class CreateController extends Controller app('preferences')->mark(); $title = $newGroup->title ?? $newGroup->transactionJournals->first()->description; - + $link = route('transactions.show', [$newGroup->id]); session()->flash('success', trans('firefly.stored_journal', ['description' => $title])); + session()->flash('success_uri', $link); return redirect(route('transactions.show', [$newGroup->id])); } diff --git a/public/v1/js/ff/transactions/show.js b/public/v1/js/ff/transactions/show.js index 192a038391..ada41fc76b 100644 --- a/public/v1/js/ff/transactions/show.js +++ b/public/v1/js/ff/transactions/show.js @@ -27,14 +27,8 @@ $(function () { makeAutoComplete(); }) $('[data-toggle="tooltip"]').tooltip(); - - $('#clone_button').click(cloneNewFunction); }); -function cloneNewFunction() { - return confirm(newCloneInstructions); -} - function getLinkModal(e) { var button = $(e.currentTarget); var journalId = parseInt(button.data('journal')); diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 537a7767cb..fbf2bf46b5 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -59,7 +59,6 @@ return [ 'no_rules_for_bill' => 'This bill has no rules associated to it.', 'go_to_asset_accounts' => 'View your asset accounts', 'go_to_budgets' => 'Go to your budgets', - 'new_clone_instructions' => 'This button will automatically clone the transaction and set the date to today. Are you sure?', 'clones_journal_x' => 'This transaction is a clone of ":description" (#:id)', 'go_to_categories' => 'Go to your categories', 'go_to_bills' => 'Go to your bills', diff --git a/resources/views/v1/transactions/show.twig b/resources/views/v1/transactions/show.twig index 27cd880d1e..ffddb9f9a9 100644 --- a/resources/views/v1/transactions/show.twig +++ b/resources/views/v1/transactions/show.twig @@ -37,7 +37,7 @@ {% if groupArray.transactions[0].type != 'opening balance' and groupArray.transactions[0].type != 'reconciliation' %} -
  • {{ 'clone'|_ }}
  • +
  • {{ 'clone'|_ }}
  • {% endif %} @@ -209,7 +209,7 @@ {% if groupArray.transactions[0].type != 'opening balance' and groupArray.transactions[0].type != 'reconciliation' %} -
  • {{ 'clone'|_ }}
  • +
  • {{ 'clone'|_ }}
  • {% endif %}
  • {{ 'link_transaction'|_ }}
  • @@ -425,7 +425,6 @@ var modalDialogURI = '{{ route('transactions.link.modal', ['%JOURNAL%']) }}'; var acURI = '{{ route('api.v1.autocomplete.transactions-with-id') }}'; var groupURI = '{{ route('transactions.show',['%GROUP%']) }}'; - var newCloneInstructions = '{{ 'new_clone_instructions'|_|escape('js') }}';