New code for import routine.

This commit is contained in:
James Cole
2016-07-02 17:33:57 +02:00
parent cbe3fb73a8
commit a56a5fc228
11 changed files with 264 additions and 129 deletions

View File

@@ -10,11 +10,11 @@
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'import_csv_configure_title'|_ }}</h3>
<h3 class="box-title">{{ trans('csv.import_configure_title') }}</h3>
</div>
<div class="box-body">
<p>
{{ 'import_csv_configure_intro'|_ }}
{{ trans('csv.import_configure_intro') }}
</p>
</div>
</div>
@@ -29,17 +29,14 @@
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'import_csv_configure_form'|_ }}</h3>
<h3 class="box-title">{{ trans('csv.import_configure_form') }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.checkbox('has_headers',1,null,{helpText: 'csv_header_help'|_}) }}
{{ ExpandedForm.text('date_format','Ymd',{helpText: trans('firefly.csv_date_help', {dateExample: phpdate('Ymd')}) }) }}
{{ ExpandedForm.select('csv_delimiter', data.delimiters, 0, {helpText: 'csv_delimiter_help'|_} ) }}
{{ ExpandedForm.file('csv_config',{helpText: 'csv_csv_config_file_help'|_}) }}
{{ ExpandedForm.select('csv_import_account', data.accounts, 0, {helpText: 'csv_import_account_help'|_} ) }}
{{ ExpandedForm.checkbox('has_headers',1,job.configuration['has-headers'],{helpText: trans('csv.header_help')}) }}
{{ ExpandedForm.text('date_format',job.configuration['date-format'],{helpText: trans('csv.date_help', {dateExample: phpdate('Ymd')}) }) }}
{{ ExpandedForm.select('csv_delimiter', data.delimiters, job.configuration['delimiter'], {helpText: trans('csv.delimiter_help') } ) }}
{{ ExpandedForm.select('csv_import_account', data.accounts, 0, {helpText: trans('csv.import_account_help')} ) }}
{% for type, specific in data.specifics %}
<div class="form-group">
@@ -49,7 +46,8 @@
<div class="col-sm-8">
<div class="radio"><label>
{{ Form.checkbox('specifics['~type~']', '1', Input.old('specifics')[type] == '1', {'id': type ~ '_label'}) }}
{{ Form.checkbox('specifics['~type~']', '1',
job.configuration.specifics[type] == '1', {'id': type ~ '_label'}) }}
{{ specific.description }}
</label>
</div>
@@ -66,7 +64,7 @@
<div class="col-sm-8">
<pre>{{ data.upload_path }}</pre>
<p class="text-danger">
{{ 'csv_upload_not_writeable'|_ }}
{{ trans('csv.upload_not_writeable') }}
</p>
</div>
</div>
@@ -82,7 +80,7 @@
<div class="box">
<div class="box-body">
<button type="submit" class="pull-right btn btn-success">
{{ 'csv_upload_button'|_ }}
{{ 'import_finish_configuration'|_ }}
</button>
</div>
</div>

View File

@@ -10,10 +10,10 @@
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'csv_column_roles_title'|_ }}</h3>
<h3 class="box-title">{{ trans('csv.column_roles_title') }}</h3>
</div>
<div class="box-body">
<p>{{ 'csv_column_roles_text'|_ }}</p>
<p>{{ trans('csv.column_roles_text') }}</p>
</div>
</div>
@@ -21,30 +21,32 @@
</div>
<form action="{{ route('import.postSettings', job.key) }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<input type="hidden" name="settings" value="roles"/>
<div class="row">
<div class="col-lg-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'csv_column_roles_table'|_ }}</h3>
<h3 class="box-title">{{ trans('csv.column_roles_table') }}</h3>
</div>
<div class="box-body">
<table class="table">
<thead>
<tr>
<th style="width:20%;">{{ 'csv_column_name'|_ }}</th>
<th style="width:40%;">{{ 'csv_column_example'|_ }}</th>
<th style="width:30%;">{{ 'csv_column_role'|_ }}</th>
<th style="width:10%;">{{ 'csv_do_map_value'|_ }}</th>
<th style="width:20%;">{{ trans('csv.column_name') }}</th>
<th style="width:40%;">{{ trans('csv.column_example') }}</th>
<th style="width:30%;">{{ trans('csv.column_role') }}</th>
<th style="width:10%;">{{ trans('csv.do_map_value') }}</th>
</tr>
</thead>
{% for i in 0..data.columnCount %}
{% for i in 0..(data.columnCount-1) %}
<tr>
<td>Column #{{ loop.index }}</td>
<td>{{ trans('csv.column') }} #{{ loop.index }}</td>
<td>
{% if data.columns[i]|length == 0 %}
<em>No example data available</em>
<em>{{ trans('csv.no_example_data') }}</em>
{% else %}
{% for example in data.columns[i] %}
<code>{{ example }}</code><br />
@@ -52,10 +54,10 @@
{% endif %}
<td>
{{ Form.select(('role['~index~']'), data.available_roles,data.set_roles[index],{class: 'form-control'}) }}
{{ Form.select(('role['~loop.index0~']'), data.available_roles,data.set_roles[index],{class: 'form-control'}) }}
</td>
<td>
{# Form.checkbox(('map['~index~']'),1,map[index]) #}
{{ Form.checkbox(('map['~loop.index0~']'),1,map[index]) }}
</td>
</tr>
@@ -74,9 +76,8 @@
<div class="col-lg-12">
<div class="box">
<div class="box-body">
<a href="{{ route('import.index') }}" class="btn btn-danger"><i class="fa fa-arrow-left"></i> {{ 'csv_go_back'|_ }}</a>
<button type="submit" class="btn btn-success pull-right">
{{ 'csv_continue'|_ }} <i class="fa fa-arrow-right"></i>
{{ trans('csv.store_column_roles') }} <i class="fa fa-arrow-right"></i>
</button>
</div>
</div>

View File

@@ -26,6 +26,7 @@
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-12">
{{ ExpandedForm.file('import_file', {helpText: 'import_file_help'|_}) }}
{{ ExpandedForm.file('configuration_file', {helpText: 'configuration_file_help'|_}) }}
{{ ExpandedForm.select('import_file_type', importFileTypes, defaultImportType, {'helpText' : 'import_file_type_help'|_}) }}

View File

@@ -59,7 +59,7 @@
{% for data in transactions %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ data[1].name }}</h3>
<h3 class="box-title"><a href="{{ route('accounts.show', data[1].id) }}">{{ data[1].name }}</a></h3>
<!-- ACTIONS MENU -->
<div class="box-tools pull-right">