mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
First (almost) functional CSV importer.
This commit is contained in:
@@ -26,8 +26,11 @@ return [
|
||||
'csv_upload_form' => 'Upload form',
|
||||
'upload_csv_file' => 'Upload CSV file',
|
||||
'csv_header_help' => 'Check this when bla bla',
|
||||
'csv_date_help' => 'Date time format in your CSV. Follow the format like <a href="https://secure.' .
|
||||
'php.net/manual/en/datetime.createfromformat.php#refsect1-datetime.createfromformat-parameters">this' .
|
||||
' page</a> indicates.',
|
||||
'csv_row' => 'row',
|
||||
'upload_not_writeable' => 'Cannot write to the path mentioned here. Cannot upload',
|
||||
'upload_not_writeable' => 'Cannot write to the path mentioned here. Cannot upload',
|
||||
|
||||
// create new stuff:
|
||||
'create_new_withdrawal' => 'Create new withdrawal',
|
||||
|
@@ -47,6 +47,7 @@ return [
|
||||
'code' => 'Code',
|
||||
'csv' => 'CSV file',
|
||||
'has_headers' => 'Headers',
|
||||
'date_format' => 'Date format',
|
||||
|
||||
'store_new_withdrawal' => 'Store new withdrawal',
|
||||
'store_new_deposit' => 'Store new deposit',
|
||||
|
@@ -47,6 +47,7 @@ return [
|
||||
'code' => 'Code',
|
||||
'csv' => 'CSV-bestand',
|
||||
'has_headers' => 'Eerste rij zijn kolomnamen',
|
||||
'date_format' => 'Datumformaat',
|
||||
|
||||
'store_new_withdrawal' => 'Nieuwe uitgave opslaan',
|
||||
'store_new_deposit' => 'Nieuwe inkomsten opslaan',
|
||||
|
@@ -20,7 +20,9 @@
|
||||
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{ 'csv_process_text'|_ }}
|
||||
<p>{{ 'csv_process_text'|_ }}</p>
|
||||
<h4>{{ 'csv_more_information' }}</h4>
|
||||
<p>{{ 'csv_more_information_text'|_ }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -39,7 +41,8 @@
|
||||
|
||||
</div>
|
||||
<div class="box-body">
|
||||
|
||||
<form action="{{ route('csv.initial_parse') }}" method="post">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th>{{ 'cvs_column_name'|_ }}</th>
|
||||
@@ -52,16 +55,21 @@
|
||||
<td>{{ header }}</td>
|
||||
<td>{{ example[index] }}</td>
|
||||
<td>
|
||||
{{ Form.select(('role_'~index), roles) }}
|
||||
{{ Form.select(('role['~index~']'), roles) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ Form.checkbox(('map_'~index),false) }}
|
||||
{{ Form.checkbox(('map['~index~']'),1,false) }}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<p>
|
||||
<button type="submit" class="btn btn-success">
|
||||
{{ 'process_csv_file'|_ }}
|
||||
</button>
|
||||
</p>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
@@ -21,6 +21,8 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{ 'csv_index_text'|_ }}
|
||||
<h4>{{ 'csv_more_information' }}</h4>
|
||||
{{ 'csv_more_information_text'|_ }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -44,6 +46,7 @@
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
{{ ExpandedForm.checkbox('has_headers',false,null,{helpText: 'csv_header_help'|_}) }}
|
||||
{{ ExpandedForm.text('date_format','Ymd',{helpText: 'csv_date_help'|_}) }}
|
||||
|
||||
{{ ExpandedForm.file('csv') }}
|
||||
|
||||
|
83
resources/twig/csv/map.twig
Normal file
83
resources/twig/csv/map.twig
Normal file
@@ -0,0 +1,83 @@
|
||||
{% extends "./layout/default.twig" %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'csv_map'|_ }}</h3>
|
||||
|
||||
<!-- ACTIONS MENU -->
|
||||
<div class="box-tools pull-right">
|
||||
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>{{ 'csv_map_text'|_ }}</p>
|
||||
<h4>{{ 'csv_more_information' }}</h4>
|
||||
|
||||
<p>{{ 'csv_more_information_text'|_ }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<form action="{{ route('csv.save_mapping') }}" method="post">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
|
||||
|
||||
{% for index,columnName in map %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ columnName }}</h3>
|
||||
|
||||
<!-- ACTIONS MENU -->
|
||||
<div class="box-tools pull-right">
|
||||
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th>{{ 'cvs_field_value'|_ }}</th>
|
||||
<th>{{ 'csv_field_mapped_to'|_ }}</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for value in values[index] %}
|
||||
<tr>
|
||||
<td>{{ value }}</td>
|
||||
<td>
|
||||
{{ Form.select('mapping['~index~']['~value~']',options[index]) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<p>
|
||||
<button type="submit" class="btn btn-success">
|
||||
{{ 'save_mapping'|_ }}
|
||||
</button>
|
||||
</p>
|
||||
</form>
|
||||
|
||||
|
||||
{% endblock %}
|
@@ -1,3 +1,3 @@
|
||||
{% if options.helpText %}
|
||||
<p class="help-block">{{ options.helpText }}</p>
|
||||
<p class="help-block">{{ options.helpText|raw }}</p>
|
||||
{% endif %}
|
||||
|
@@ -3,6 +3,7 @@
|
||||
|
||||
<div class="col-sm-8">
|
||||
{{ Form.input('text', name, value, options) }}
|
||||
{% include 'form/help.twig' %}
|
||||
{% include 'form/feedback.twig' %}
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user