Link in clone.

This commit is contained in:
James Cole 2020-09-03 06:52:09 +02:00
parent b0f18a0419
commit 9ae41b1645
4 changed files with 4 additions and 11 deletions

View File

@ -71,8 +71,9 @@ class CreateController extends Controller
app('preferences')->mark(); app('preferences')->mark();
$title = $newGroup->title ?? $newGroup->transactionJournals->first()->description; $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', trans('firefly.stored_journal', ['description' => $title]));
session()->flash('success_uri', $link);
return redirect(route('transactions.show', [$newGroup->id])); return redirect(route('transactions.show', [$newGroup->id]));
} }

View File

@ -27,14 +27,8 @@ $(function () {
makeAutoComplete(); makeAutoComplete();
}) })
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
$('#clone_button').click(cloneNewFunction);
}); });
function cloneNewFunction() {
return confirm(newCloneInstructions);
}
function getLinkModal(e) { function getLinkModal(e) {
var button = $(e.currentTarget); var button = $(e.currentTarget);
var journalId = parseInt(button.data('journal')); var journalId = parseInt(button.data('journal'));

View File

@ -59,7 +59,6 @@ return [
'no_rules_for_bill' => 'This bill has no rules associated to it.', 'no_rules_for_bill' => 'This bill has no rules associated to it.',
'go_to_asset_accounts' => 'View your asset accounts', 'go_to_asset_accounts' => 'View your asset accounts',
'go_to_budgets' => 'Go to your budgets', '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)', 'clones_journal_x' => 'This transaction is a clone of ":description" (#:id)',
'go_to_categories' => 'Go to your categories', 'go_to_categories' => 'Go to your categories',
'go_to_bills' => 'Go to your bills', 'go_to_bills' => 'Go to your bills',

View File

@ -37,7 +37,7 @@
{% if groupArray.transactions[0].type != 'opening balance' and groupArray.transactions[0].type != 'reconciliation' %} {% if groupArray.transactions[0].type != 'opening balance' and groupArray.transactions[0].type != 'reconciliation' %}
<!-- since 5.1.0 --> <!-- since 5.1.0 -->
<li role="separator" class="divider"></li> <li role="separator" class="divider"></li>
<li><a href="{{ route('transactions.clone', [transactionGroup.id]) }}" id="clone_button"><i class="fa fa-copy"></i> {{ 'clone'|_ }}</a></li> <li><a href="{{ route('transactions.clone', [transactionGroup.id]) }}"><i class="fa fa-copy"></i> {{ 'clone'|_ }}</a></li>
{% endif %} {% endif %}
</ul> </ul>
</div> </div>
@ -209,7 +209,7 @@
{% if groupArray.transactions[0].type != 'opening balance' and groupArray.transactions[0].type != 'reconciliation' %} {% if groupArray.transactions[0].type != 'opening balance' and groupArray.transactions[0].type != 'reconciliation' %}
<!-- since 5.1.0 --> <!-- since 5.1.0 -->
<li role="separator" class="divider"></li> <li role="separator" class="divider"></li>
<li><a href="{{ route('transactions.clone', [transactionGroup.id]) }}" id="clone_button"><i class="fa fa-copy"></i> {{ 'clone'|_ }}</a></li> <li><a href="{{ route('transactions.clone', [transactionGroup.id]) }}"><i class="fa fa-copy"></i> {{ 'clone'|_ }}</a></li>
{% endif %} {% endif %}
<li><a href="#" class="link-modal" data-journal="{{ journal.transaction_journal_id }}"><i class="fa fa-fw fa-link"></i>{{ 'link_transaction'|_ }}</a></li> <li><a href="#" class="link-modal" data-journal="{{ journal.transaction_journal_id }}"><i class="fa fa-fw fa-link"></i>{{ 'link_transaction'|_ }}</a></li>
@ -425,7 +425,6 @@
var modalDialogURI = '{{ route('transactions.link.modal', ['%JOURNAL%']) }}'; var modalDialogURI = '{{ route('transactions.link.modal', ['%JOURNAL%']) }}';
var acURI = '{{ route('api.v1.autocomplete.transactions-with-id') }}'; var acURI = '{{ route('api.v1.autocomplete.transactions-with-id') }}';
var groupURI = '{{ route('transactions.show',['%GROUP%']) }}'; var groupURI = '{{ route('transactions.show',['%GROUP%']) }}';
var newCloneInstructions = '{{ 'new_clone_instructions'|_|escape('js') }}';
</script> </script>
<script type="text/javascript" src="v1/js/lib/typeahead/typeahead.bundle.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script> <script type="text/javascript" src="v1/js/lib/typeahead/typeahead.bundle.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/transactions/show.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script> <script type="text/javascript" src="v1/js/ff/transactions/show.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>