Skip to content

Firefly III: a personal finances manager

Fix form and upload thing.

James Colea34782575f92
diff --git a/resources/lang/en/form.php b/resources/lang/en/form.php
index 4f570dfeb9..4a962baa67 100644
--- a/resources/lang/en/form.php
+++ b/resources/lang/en/form.php
@@ -52,7 +52,7 @@ return [
'csv_config' => 'CSV import configuration',
'specifix' => 'Bank- or file specific fixes',
'csv_import_account' => 'Default import account',
- 'attachments' => 'Attachments',
+ 'attachments[]' => 'Attachments',
'store_new_withdrawal' => 'Store new withdrawal',
'store_new_deposit' => 'Store new deposit',
'store_new_transfer' => 'Store new transfer',
diff --git a/resources/lang/nl/form.php b/resources/lang/nl/form.php
index 4d6366f73f..771eb4edb1 100644
--- a/resources/lang/nl/form.php
+++ b/resources/lang/nl/form.php
@@ -51,7 +51,7 @@ return [
'date_format' => 'Datumformaat',
'csv_config' => 'Configuratiebestand',
'specifix' => 'Bank- or of bestandsspecifieke opties',
- 'attachments' => 'Bijlagen',
+ 'attachments[]' => 'Bijlagen',
'store_new_withdrawal' => 'Nieuwe uitgave opslaan',
'store_new_deposit' => 'Nieuwe inkomsten opslaan',
diff --git a/resources/twig/transactions/create.twig b/resources/twig/transactions/create.twig
index d67ef828d3..f88e569f29 100644
--- a/resources/twig/transactions/create.twig
+++ b/resources/twig/transactions/create.twig
@@ -5,97 +5,99 @@
{% endblock %}
{% block content %}
- {{ Form.open({'class' : 'form-horizontal','id' : 'store','url' : route('transactions.store',what)}) }}
- <input type="hidden" name="what" value="{{ what }}"/>
- <div class="row">
- <div class="col-lg-6 col-md-12 col-sm-12">
- <div class="box box-primary">
- <div class="box-header with-border">
- <h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
- </div>
- <div class="box-body">
- <div class="form-group">
- <label class="col-sm-4 control-label">Quickswitch</label>
-
- <div class="col-sm-8">
- <div class="btn-group btn-group-justified">
- <a href="#" data-what="withdrawal" class="switch btn btn-default"> {{ 'withdrawal'|_ }}</a>
- <a href="#" data-what="deposit" class="switch btn btn-default"> {{ 'deposit'|_ }}</a>
- <a href="#" data-what="transfer" class="switch btn btn-default">{{ 'transfer'|_ }}</a>
+ <form method="POST" action="{{ route('transactions.store',what) }}" accept-charset="UTF-8" class="form-horizontal" id="store" enctype="multipart/form-data">
+ <input name="_token" type="hidden" value="{{ csrf_token() }}">
+ <input type="hidden" name="what" value="{{ what }}"/>
+
+ <div class="row">
+ <div class="col-lg-6 col-md-12 col-sm-12">
+ <div class="box box-primary">
+ <div class="box-header with-border">
+ <h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
+ </div>
+ <div class="box-body">
+ <div class="form-group">
+ <label class="col-sm-4 control-label">Quickswitch</label>
+
+ <div class="col-sm-8">
+ <div class="btn-group btn-group-justified">
+ <a href="#" data-what="withdrawal" class="switch btn btn-default"> {{ 'withdrawal'|_ }}</a>
+ <a href="#" data-what="deposit" class="switch btn btn-default"> {{ 'deposit'|_ }}</a>
+ <a href="#" data-what="transfer" class="switch btn btn-default">{{ 'transfer'|_ }}</a>
+ </div>
</div>
</div>
- </div>
- <!-- DESCRIPTION ALWAYS AVAILABLE -->
- {{ ExpandedForm.text('description') }}
+ <!-- DESCRIPTION ALWAYS AVAILABLE -->
+ {{ ExpandedForm.text('description') }}
- <!-- ACCOUNT ONLY FOR DEPOSITS AND WITHDRAWALS -->
- {{ ExpandedForm.select('account_id',accounts) }}
+ <!-- ACCOUNT ONLY FOR DEPOSITS AND WITHDRAWALS -->
+ {{ ExpandedForm.select('account_id',accounts) }}
- <!-- SHOW EXPENSE ACCOUNT ONLY FOR WITHDRAWALS -->
- {{ ExpandedForm.text('expense_account') }}
+ <!-- SHOW EXPENSE ACCOUNT ONLY FOR WITHDRAWALS -->
+ {{ ExpandedForm.text('expense_account') }}
- <!-- SHOW REVENUE ACCOUNT ONLY FOR DEPOSITS -->
- {{ ExpandedForm.text('revenue_account') }}
+ <!-- SHOW REVENUE ACCOUNT ONLY FOR DEPOSITS -->
+ {{ ExpandedForm.text('revenue_account') }}
- <!-- ONLY SHOW FROM/TO ACCOUNT WHEN CREATING TRANSFER -->
- {{ ExpandedForm.select('account_from_id',accounts) }}
- {{ ExpandedForm.select('account_to_id',accounts) }}
+ <!-- ONLY SHOW FROM/TO ACCOUNT WHEN CREATING TRANSFER -->
+ {{ ExpandedForm.select('account_from_id',accounts) }}
+ {{ ExpandedForm.select('account_to_id',accounts) }}
- <!-- ALWAYS SHOW AMOUNT -->
- {{ ExpandedForm.amount('amount') }}
+ <!-- ALWAYS SHOW AMOUNT -->
+ {{ ExpandedForm.amount('amount') }}
- <!-- ALWAYS SHOW DATE -->
- {{ ExpandedForm.date('date', phpdate('Y-m-d')) }}
+ <!-- ALWAYS SHOW DATE -->
+ {{ ExpandedForm.date('date', phpdate('Y-m-d')) }}
+ </div>
</div>
</div>
- </div>
- <div class="col-lg-6 col-md-12 col-sm-12">
- <div class="box">
- <div class="box-header with-border">
- <h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
- </div>
- <div class="box-body">
- <!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL -->
- {{ ExpandedForm.select('budget_id',budgets,0) }}
- <!-- CATEGORY ALWAYS -->
- {{ ExpandedForm.text('category') }}
-
- <!-- TAGS -->
- {{ ExpandedForm.text('tags') }}
+ <div class="col-lg-6 col-md-12 col-sm-12">
+ <div class="box">
+ <div class="box-header with-border">
+ <h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
+ </div>
+ <div class="box-body">
+ <!-- BUDGET ONLY WHEN CREATING A WITHDRAWAL -->
+ {{ ExpandedForm.select('budget_id',budgets,0) }}
+ <!-- CATEGORY ALWAYS -->
+ {{ ExpandedForm.text('category') }}
+ <!-- TAGS -->
+ {{ ExpandedForm.text('tags') }}
- <!-- RELATE THIS TRANSFER TO A PIGGY BANK -->
- {{ ExpandedForm.select('piggy_bank_id',piggies) }}
- <!-- ATTACHMENTS -->
- {{ ExpandedForm.file('attachments', {'multiple': 'multiple'}) }}
+ <!-- RELATE THIS TRANSFER TO A PIGGY BANK -->
+ {{ ExpandedForm.select('piggy_bank_id',piggies) }}
- </div>
+ <!-- ATTACHMENTS -->
+ {{ ExpandedForm.file('attachments[]', {'multiple': 'multiple'}) }}
- </div>
+ </div>
- <!-- panel for options -->
- <div class="box">
- <div class="box-header with-border">
- <h3 class="box-title">{{ 'options'|_ }}</h3>
- </div>
- <div class="box-body">
- {{ ExpandedForm.optionsList('create','transaction') }}
</div>
- <div class="box-footer">
- <button type="submit" id="transaction-btn" class="btn btn-success pull-right">
- {{ trans('form.store_new_'~what) }}
- </button>
+
+ <!-- panel for options -->
+ <div class="box">
+ <div class="box-header with-border">
+ <h3 class="box-title">{{ 'options'|_ }}</h3>
+ </div>
+ <div class="box-body">
+ {{ ExpandedForm.optionsList('create','transaction') }}
+ </div>
+ <div class="box-footer">
+ <button type="submit" id="transaction-btn" class="btn btn-success pull-right">
+ {{ trans('form.store_new_'~what) }}
+ </button>
+ </div>
</div>
</div>
</div>
- </div>
- {{ Form.close|raw }}
+ </form>
{% endblock %}
{% block scripts %}