From: Moritz Bunkus Date: Wed, 23 Feb 2011 17:12:21 +0000 (+0100) Subject: form_customers_vendors.html nach form.html umbenannt; Kosmetik X-Git-Tag: release-2.7.0beta1~396^2~57 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f5594740f7cb5481956b12c28a2547b924f9f4ee;p=kivitendo-erp.git form_customers_vendors.html nach form.html umbenannt; Kosmetik --- diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index 2406362cb..6bacf9242 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -107,21 +107,13 @@ sub render_inputs { $self->$sub(($char_map{$type}->{$char} || [])->[0] || $char); } - if ($self->type eq 'customers_vendors') { - $self->render('csv_import/form_customers_vendors', title => $::locale->text('CSV import: customers and vendors')); + my $title = $self->type eq 'customers_vendors' ? $::locale->text('CSV import: customers and vendors') + : $self->type eq 'addresses' ? $::locale->text('CSV import: shipping addresses') + : $self->type eq 'contacts' ? $::locale->text('CSV import: contacts') + : $self->type eq 'parts' ? $::locale->text('CSV import: parts, services and assemblies') + : die; - } elsif ($self->type eq 'addresses') { - $self->render('csv_import/form_addresses', title => $::locale->text('CSV import: shipping addresses')); - - } elsif ($self->type eq 'contacts') { - $self->render('csv_import/form_contacts', title => $::locale->text('CSV import: contacts')); - - } elsif ($self->type eq 'parts') { - $self->render('csv_import/form_parts', title => $::locale->text('CSV import: parts, services and assemblies')); - - } else { - die; - } + $self->render('csv_import/form', title => $title); } sub test_and_import { diff --git a/templates/webpages/csv_import/form.html b/templates/webpages/csv_import/form.html new file mode 100644 index 000000000..0725a3f3c --- /dev/null +++ b/templates/webpages/csv_import/form.html @@ -0,0 +1,131 @@ +[% USE HTML %][% USE LxERP %][% USE L %] + + +
[% FORM.title %]
+ + [%- INCLUDE 'common/flash.html' %] + +
+ [% L.hidden_tag('action', 'CsvImport/dispatch') %] + [% L.hidden_tag('profile.type', SELF.profile.type) %] + +

[%- LxERP.t8('Import profiles') %]

+ + + [%- IF SELF.profile.id %] + + + + + [%- END %] + + [%- IF SELF.all_profiles.size %] + + + + + + [%- END %] + + + + + + +
[%- LxERP.t8('Current profile') %]:[%- HTML.escape(SELF.profile.name) %]
[%- LxERP.t8('Existing profiles') %]: + [% L.select_tag('profile.id', L.options_for_select(SELF.all_profiles, title => 'name', default => SELF.profile.id), style => 'width: 300px') %] + + [% L.submit_tag('action_new', LxERP.t8('Load profile')) %] + [% L.submit_tag('action_destroy', LxERP.t8('Delete profile'), confirm => LxERP.t8('Do you really want to delete this object?')) %] +
[%- LxERP.t8('Save settings as') %]: + [% L.input_tag('profile.name', '', style => 'width: 300px') %] +
+ [% L.checkbox_tag('profile.is_default', label => LxERP.t8('Make default profile')) %] +
[% L.submit_tag('action_save', LxERP.t8('Save profile')) %]
+ +
+ +

[%- LxERP.t8('Settings') %]

+ + + + + + + + + + + + + + + [% SET custom_sep_char = SELF.sep_char %] + [% FOREACH entry = SELF.all_sep_chars %] + + [%- END %] + + + + + + + [% SET custom_quote_char = SELF.quote_char %] + [% FOREACH entry = SELF.all_quote_chars %] + + [%- END %] + + + + + + + [% SET custom_escape_char = SELF.escape_char %] + [% FOREACH entry = SELF.all_escape_chars %] + + [%- END %] + + + + +
[%- LxERP.t8('Number format') %]: + [% SET options = L.options_for_select([ '1.000,00', '1000,00', '1,000.00', '1000.00' ], default => SELF.profile.get('numberformat')) %] + [% L.select_tag('settings.numberformat', options, style => 'width: 300px') %] +
[%- LxERP.t8('Charset') %]:[% L.select_tag('settings.charset', L.options_for_select(SELF.all_charsets, default => SELF.profile.get('charset')), style => 'width: 300px') %]
[%- LxERP.t8('Separator') %]: + [% IF SELF.sep_char == entry.first %] [% SET custom_sep_char = '' %] [%- END %] + [% L.radio_button_tag('sep_char', value => entry.first, label => entry.last, checked => SELF.sep_char == entry.first) %] + + [% L.radio_button_tag('sep_char', value => 'custom', checked => custom_sep_char != '') %] + [% L.input_tag('custom_sep_char', custom_sep_char, size => 3, maxlength => 1) %] +
[%- LxERP.t8('Quote character') %]: + [% IF SELF.quote_char == entry.first %] [% SET custom_quote_char = '' %] [%- END %] + [% L.radio_button_tag('quote_char', value => entry.first, label => entry.last, checked => SELF.quote_char == entry.first) %] + + [% L.radio_button_tag('quote_char', value => 'custom', checked => custom_quote_char != '') %] + [% L.input_tag('custom_quote_char', custom_quote_char, size => 3, maxlength => 1) %] +
[%- LxERP.t8('Escape character') %]: + [% IF SELF.escape_char == entry.first %] [% SET custom_escape_char = '' %] [%- END %] + [% L.radio_button_tag('escape_char', value => entry.first, label => entry.last, checked => SELF.escape_char == entry.first) %] + + [% L.radio_button_tag('escape_char', value => 'custom', checked => custom_escape_char != '') %] + [% L.input_tag('custom_escape_char', custom_escape_char, size => 3, maxlength => 1) %] +
+ + [% L.submit_tag('action_test', LxERP.t8('Gogogo')) %] + +
+ + + + diff --git a/templates/webpages/csv_import/form_customers_vendors.html b/templates/webpages/csv_import/form_customers_vendors.html deleted file mode 100644 index 50b2438a1..000000000 --- a/templates/webpages/csv_import/form_customers_vendors.html +++ /dev/null @@ -1,123 +0,0 @@ -[% USE HTML %][% USE LxERP %][% USE L %] - - -
[% FORM.title %]
- - [%- INCLUDE 'common/flash.html' %] - -
- [% L.hidden_tag('action', 'CsvImport/dispatch') %] - [% L.hidden_tag('profile.type', SELF.profile.type) %] - -

[%- LxERP.t8('Import profiles') %]

- - - [%- IF SELF.profile.id %] - - - - - [%- END %] - - [%- IF SELF.all_profiles.size %] - - - - - - [%- END %] - - - - - - -
[%- LxERP.t8('Current profile') %]:[%- HTML.escape(SELF.profile.name) %]
[%- LxERP.t8('Existing profiles') %]: - [% L.select_tag('profile.id', L.options_for_select(SELF.all_profiles, title => 'name', default => SELF.profile.id), style => 'width: 300px') %] - - [% L.submit_tag('action_new', LxERP.t8('Load profile')) %] - [% L.submit_tag('action_destroy', LxERP.t8('Delete profile'), confirm => LxERP.t8('Do you really want to delete this object?')) %] -
[%- LxERP.t8('Save settings as') %]: - [% L.input_tag('profile.name', '', style => 'width: 300px') %] -
- [% L.checkbox_tag('profile.is_default', label => LxERP.t8('Make default profile')) %] -
[% L.submit_tag('action_save', LxERP.t8('Save profile')) %]
- -
- -

[%- LxERP.t8('Settings') %]

- - - - - - - - - - [% SET custom_sep_char = SELF.sep_char %] - [% FOREACH entry = SELF.all_sep_chars %] - - [%- END %] - - - - - - - [% SET custom_quote_char = SELF.quote_char %] - [% FOREACH entry = SELF.all_quote_chars %] - - [%- END %] - - - - - - - [% SET custom_escape_char = SELF.escape_char %] - [% FOREACH entry = SELF.all_escape_chars %] - - [%- END %] - - - - -
[%- LxERP.t8('Charset') %]:[% L.select_tag('settings.charset', L.options_for_select(SELF.all_charsets, default => SELF.profile.get('charset'))) %]
[%- LxERP.t8('Separator') %]: - [% IF SELF.sep_char == entry.first %] [% SET custom_sep_char = '' %] [%- END %] - [% L.radio_button_tag('sep_char', value => entry.first, label => entry.last, checked => SELF.sep_char == entry.first) %] - - [% L.radio_button_tag('sep_char', value => 'custom', checked => custom_sep_char != '') %] - [% L.input_tag('custom_sep_char', custom_sep_char, size => 3, maxlength => 1) %] -
[%- LxERP.t8('Quote character') %]: - [% IF SELF.quote_char == entry.first %] [% SET custom_quote_char = '' %] [%- END %] - [% L.radio_button_tag('quote_char', value => entry.first, label => entry.last, checked => SELF.quote_char == entry.first) %] - - [% L.radio_button_tag('quote_char', value => 'custom', checked => custom_quote_char != '') %] - [% L.input_tag('custom_quote_char', custom_quote_char, size => 3, maxlength => 1) %] -
[%- LxERP.t8('Escape character') %]: - [% IF SELF.escape_char == entry.first %] [% SET custom_escape_char = '' %] [%- END %] - [% L.radio_button_tag('escape_char', value => entry.first, label => entry.last, checked => SELF.escape_char == entry.first) %] - - [% L.radio_button_tag('escape_char', value => 'custom', checked => custom_escape_char != '') %] - [% L.input_tag('custom_escape_char', custom_escape_char, size => 3, maxlength => 1) %] -
- - [% L.submit_tag('action_test', LxERP.t8('Gogogo')) %] - -
- - - -