Revision f5594740
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/Controller/CsvImport.pm | ||
---|---|---|
107 | 107 |
$self->$sub(($char_map{$type}->{$char} || [])->[0] || $char); |
108 | 108 |
} |
109 | 109 |
|
110 |
if ($self->type eq 'customers_vendors') { |
|
111 |
$self->render('csv_import/form_customers_vendors', title => $::locale->text('CSV import: customers and vendors')); |
|
110 |
my $title = $self->type eq 'customers_vendors' ? $::locale->text('CSV import: customers and vendors') |
|
111 |
: $self->type eq 'addresses' ? $::locale->text('CSV import: shipping addresses') |
|
112 |
: $self->type eq 'contacts' ? $::locale->text('CSV import: contacts') |
|
113 |
: $self->type eq 'parts' ? $::locale->text('CSV import: parts, services and assemblies') |
|
114 |
: die; |
|
112 | 115 |
|
113 |
} elsif ($self->type eq 'addresses') { |
|
114 |
$self->render('csv_import/form_addresses', title => $::locale->text('CSV import: shipping addresses')); |
|
115 |
|
|
116 |
} elsif ($self->type eq 'contacts') { |
|
117 |
$self->render('csv_import/form_contacts', title => $::locale->text('CSV import: contacts')); |
|
118 |
|
|
119 |
} elsif ($self->type eq 'parts') { |
|
120 |
$self->render('csv_import/form_parts', title => $::locale->text('CSV import: parts, services and assemblies')); |
|
121 |
|
|
122 |
} else { |
|
123 |
die; |
|
124 |
} |
|
116 |
$self->render('csv_import/form', title => $title); |
|
125 | 117 |
} |
126 | 118 |
|
127 | 119 |
sub test_and_import { |
templates/webpages/csv_import/form.html | ||
---|---|---|
1 |
[% USE HTML %][% USE LxERP %][% USE L %] |
|
2 |
<body> |
|
3 |
|
|
4 |
<div class="listtop">[% FORM.title %]</div> |
|
5 |
|
|
6 |
[%- INCLUDE 'common/flash.html' %] |
|
7 |
|
|
8 |
<form method="post" action="controller.pl"> |
|
9 |
[% L.hidden_tag('action', 'CsvImport/dispatch') %] |
|
10 |
[% L.hidden_tag('profile.type', SELF.profile.type) %] |
|
11 |
|
|
12 |
<h2>[%- LxERP.t8('Import profiles') %]</h2> |
|
13 |
|
|
14 |
<table> |
|
15 |
[%- IF SELF.profile.id %] |
|
16 |
<tr> |
|
17 |
<th align="right">[%- LxERP.t8('Current profile') %]:</th> |
|
18 |
<td>[%- HTML.escape(SELF.profile.name) %]</td> |
|
19 |
</tr> |
|
20 |
[%- END %] |
|
21 |
|
|
22 |
[%- IF SELF.all_profiles.size %] |
|
23 |
<tr> |
|
24 |
<th align="right">[%- LxERP.t8('Existing profiles') %]:</th> |
|
25 |
<td> |
|
26 |
[% L.select_tag('profile.id', L.options_for_select(SELF.all_profiles, title => 'name', default => SELF.profile.id), style => 'width: 300px') %] |
|
27 |
</td> |
|
28 |
<td> |
|
29 |
[% L.submit_tag('action_new', LxERP.t8('Load profile')) %] |
|
30 |
[% L.submit_tag('action_destroy', LxERP.t8('Delete profile'), confirm => LxERP.t8('Do you really want to delete this object?')) %] |
|
31 |
</td> |
|
32 |
</tr> |
|
33 |
[%- END %] |
|
34 |
|
|
35 |
<tr> |
|
36 |
<th align="right" valign="top">[%- LxERP.t8('Save settings as') %]:</th> |
|
37 |
<td valign="top"> |
|
38 |
[% L.input_tag('profile.name', '', style => 'width: 300px') %] |
|
39 |
<br> |
|
40 |
[% L.checkbox_tag('profile.is_default', label => LxERP.t8('Make default profile')) %] |
|
41 |
</td> |
|
42 |
<td valign="top">[% L.submit_tag('action_save', LxERP.t8('Save profile')) %]</td> |
|
43 |
</tr> |
|
44 |
</table> |
|
45 |
|
|
46 |
<hr> |
|
47 |
|
|
48 |
<h2>[%- LxERP.t8('Settings') %]</h2> |
|
49 |
|
|
50 |
<table> |
|
51 |
<tr> |
|
52 |
<th align="right">[%- LxERP.t8('Number format') %]:</th> |
|
53 |
<td colspan="10"> |
|
54 |
[% SET options = L.options_for_select([ '1.000,00', '1000,00', '1,000.00', '1000.00' ], default => SELF.profile.get('numberformat')) %] |
|
55 |
[% L.select_tag('settings.numberformat', options, style => 'width: 300px') %] |
|
56 |
</td> |
|
57 |
</tr> |
|
58 |
|
|
59 |
<tr> |
|
60 |
<th align="right">[%- LxERP.t8('Charset') %]:</th> |
|
61 |
<td colspan="10">[% L.select_tag('settings.charset', L.options_for_select(SELF.all_charsets, default => SELF.profile.get('charset')), style => 'width: 300px') %]</td> |
|
62 |
</tr> |
|
63 |
|
|
64 |
<tr> |
|
65 |
<th align="right">[%- LxERP.t8('Separator') %]:</th> |
|
66 |
[% SET custom_sep_char = SELF.sep_char %] |
|
67 |
[% FOREACH entry = SELF.all_sep_chars %] |
|
68 |
<td> |
|
69 |
[% IF SELF.sep_char == entry.first %] [% SET custom_sep_char = '' %] [%- END %] |
|
70 |
[% L.radio_button_tag('sep_char', value => entry.first, label => entry.last, checked => SELF.sep_char == entry.first) %] |
|
71 |
</td> |
|
72 |
[%- END %] |
|
73 |
|
|
74 |
<td> |
|
75 |
[% L.radio_button_tag('sep_char', value => 'custom', checked => custom_sep_char != '') %] |
|
76 |
[% L.input_tag('custom_sep_char', custom_sep_char, size => 3, maxlength => 1) %] |
|
77 |
</td> |
|
78 |
</tr> |
|
79 |
|
|
80 |
<tr> |
|
81 |
<th align="right">[%- LxERP.t8('Quote character') %]:</th> |
|
82 |
[% SET custom_quote_char = SELF.quote_char %] |
|
83 |
[% FOREACH entry = SELF.all_quote_chars %] |
|
84 |
<td> |
|
85 |
[% IF SELF.quote_char == entry.first %] [% SET custom_quote_char = '' %] [%- END %] |
|
86 |
[% L.radio_button_tag('quote_char', value => entry.first, label => entry.last, checked => SELF.quote_char == entry.first) %] |
|
87 |
</td> |
|
88 |
[%- END %] |
|
89 |
|
|
90 |
<td> |
|
91 |
[% L.radio_button_tag('quote_char', value => 'custom', checked => custom_quote_char != '') %] |
|
92 |
[% L.input_tag('custom_quote_char', custom_quote_char, size => 3, maxlength => 1) %] |
|
93 |
</td> |
|
94 |
</tr> |
|
95 |
|
|
96 |
<tr> |
|
97 |
<th align="right">[%- LxERP.t8('Escape character') %]:</th> |
|
98 |
[% SET custom_escape_char = SELF.escape_char %] |
|
99 |
[% FOREACH entry = SELF.all_escape_chars %] |
|
100 |
<td> |
|
101 |
[% IF SELF.escape_char == entry.first %] [% SET custom_escape_char = '' %] [%- END %] |
|
102 |
[% L.radio_button_tag('escape_char', value => entry.first, label => entry.last, checked => SELF.escape_char == entry.first) %] |
|
103 |
</td> |
|
104 |
[%- END %] |
|
105 |
|
|
106 |
<td> |
|
107 |
[% L.radio_button_tag('escape_char', value => 'custom', checked => custom_escape_char != '') %] |
|
108 |
[% L.input_tag('custom_escape_char', custom_escape_char, size => 3, maxlength => 1) %] |
|
109 |
</td> |
|
110 |
</tr> |
|
111 |
|
|
112 |
</table> |
|
113 |
|
|
114 |
[% L.submit_tag('action_test', LxERP.t8('Gogogo')) %] |
|
115 |
|
|
116 |
</form> |
|
117 |
|
|
118 |
<script type="text/javascript"> |
|
119 |
<!-- |
|
120 |
$(document).ready(function() { |
|
121 |
$('#action_save').click(function() { |
|
122 |
if ($('#profile_name').attr('value') != '') |
|
123 |
return true; |
|
124 |
alert('[% LxERP.t8('Please enter a profile name.') %]'); |
|
125 |
return false; |
|
126 |
}) |
|
127 |
}); |
|
128 |
--> |
|
129 |
</script> |
|
130 |
</body> |
|
131 |
</html> |
templates/webpages/csv_import/form_customers_vendors.html | ||
---|---|---|
1 |
[% USE HTML %][% USE LxERP %][% USE L %] |
|
2 |
<body> |
|
3 |
|
|
4 |
<div class="listtop">[% FORM.title %]</div> |
|
5 |
|
|
6 |
[%- INCLUDE 'common/flash.html' %] |
|
7 |
|
|
8 |
<form method="post" action="controller.pl"> |
|
9 |
[% L.hidden_tag('action', 'CsvImport/dispatch') %] |
|
10 |
[% L.hidden_tag('profile.type', SELF.profile.type) %] |
|
11 |
|
|
12 |
<h2>[%- LxERP.t8('Import profiles') %]</h2> |
|
13 |
|
|
14 |
<table> |
|
15 |
[%- IF SELF.profile.id %] |
|
16 |
<tr> |
|
17 |
<th align="right">[%- LxERP.t8('Current profile') %]:</th> |
|
18 |
<td>[%- HTML.escape(SELF.profile.name) %]</td> |
|
19 |
</tr> |
|
20 |
[%- END %] |
|
21 |
|
|
22 |
[%- IF SELF.all_profiles.size %] |
|
23 |
<tr> |
|
24 |
<th align="right">[%- LxERP.t8('Existing profiles') %]:</th> |
|
25 |
<td> |
|
26 |
[% L.select_tag('profile.id', L.options_for_select(SELF.all_profiles, title => 'name', default => SELF.profile.id), style => 'width: 300px') %] |
|
27 |
</td> |
|
28 |
<td> |
|
29 |
[% L.submit_tag('action_new', LxERP.t8('Load profile')) %] |
|
30 |
[% L.submit_tag('action_destroy', LxERP.t8('Delete profile'), confirm => LxERP.t8('Do you really want to delete this object?')) %] |
|
31 |
</td> |
|
32 |
</tr> |
|
33 |
[%- END %] |
|
34 |
|
|
35 |
<tr> |
|
36 |
<th align="right" valign="top">[%- LxERP.t8('Save settings as') %]:</th> |
|
37 |
<td valign="top"> |
|
38 |
[% L.input_tag('profile.name', '', style => 'width: 300px') %] |
|
39 |
<br> |
|
40 |
[% L.checkbox_tag('profile.is_default', label => LxERP.t8('Make default profile')) %] |
|
41 |
</td> |
|
42 |
<td valign="top">[% L.submit_tag('action_save', LxERP.t8('Save profile')) %]</td> |
|
43 |
</tr> |
|
44 |
</table> |
|
45 |
|
|
46 |
<hr> |
|
47 |
|
|
48 |
<h2>[%- LxERP.t8('Settings') %]</h2> |
|
49 |
|
|
50 |
<table> |
|
51 |
<tr> |
|
52 |
<th align="right">[%- LxERP.t8('Charset') %]:</th> |
|
53 |
<td colspan="10">[% L.select_tag('settings.charset', L.options_for_select(SELF.all_charsets, default => SELF.profile.get('charset'))) %]</td> |
|
54 |
</tr> |
|
55 |
|
|
56 |
<tr> |
|
57 |
<th align="right">[%- LxERP.t8('Separator') %]:</th> |
|
58 |
[% SET custom_sep_char = SELF.sep_char %] |
|
59 |
[% FOREACH entry = SELF.all_sep_chars %] |
|
60 |
<td> |
|
61 |
[% IF SELF.sep_char == entry.first %] [% SET custom_sep_char = '' %] [%- END %] |
|
62 |
[% L.radio_button_tag('sep_char', value => entry.first, label => entry.last, checked => SELF.sep_char == entry.first) %] |
|
63 |
</td> |
|
64 |
[%- END %] |
|
65 |
|
|
66 |
<td> |
|
67 |
[% L.radio_button_tag('sep_char', value => 'custom', checked => custom_sep_char != '') %] |
|
68 |
[% L.input_tag('custom_sep_char', custom_sep_char, size => 3, maxlength => 1) %] |
|
69 |
</td> |
|
70 |
</tr> |
|
71 |
|
|
72 |
<tr> |
|
73 |
<th align="right">[%- LxERP.t8('Quote character') %]:</th> |
|
74 |
[% SET custom_quote_char = SELF.quote_char %] |
|
75 |
[% FOREACH entry = SELF.all_quote_chars %] |
|
76 |
<td> |
|
77 |
[% IF SELF.quote_char == entry.first %] [% SET custom_quote_char = '' %] [%- END %] |
|
78 |
[% L.radio_button_tag('quote_char', value => entry.first, label => entry.last, checked => SELF.quote_char == entry.first) %] |
|
79 |
</td> |
|
80 |
[%- END %] |
|
81 |
|
|
82 |
<td> |
|
83 |
[% L.radio_button_tag('quote_char', value => 'custom', checked => custom_quote_char != '') %] |
|
84 |
[% L.input_tag('custom_quote_char', custom_quote_char, size => 3, maxlength => 1) %] |
|
85 |
</td> |
|
86 |
</tr> |
|
87 |
|
|
88 |
<tr> |
|
89 |
<th align="right">[%- LxERP.t8('Escape character') %]:</th> |
|
90 |
[% SET custom_escape_char = SELF.escape_char %] |
|
91 |
[% FOREACH entry = SELF.all_escape_chars %] |
|
92 |
<td> |
|
93 |
[% IF SELF.escape_char == entry.first %] [% SET custom_escape_char = '' %] [%- END %] |
|
94 |
[% L.radio_button_tag('escape_char', value => entry.first, label => entry.last, checked => SELF.escape_char == entry.first) %] |
|
95 |
</td> |
|
96 |
[%- END %] |
|
97 |
|
|
98 |
<td> |
|
99 |
[% L.radio_button_tag('escape_char', value => 'custom', checked => custom_escape_char != '') %] |
|
100 |
[% L.input_tag('custom_escape_char', custom_escape_char, size => 3, maxlength => 1) %] |
|
101 |
</td> |
|
102 |
</tr> |
|
103 |
|
|
104 |
</table> |
|
105 |
|
|
106 |
[% L.submit_tag('action_test', LxERP.t8('Gogogo')) %] |
|
107 |
|
|
108 |
</form> |
|
109 |
|
|
110 |
<script type="text/javascript"> |
|
111 |
<!-- |
|
112 |
$(document).ready(function() { |
|
113 |
$('#action_save').click(function() { |
|
114 |
if ($('#profile_name').attr('value') != '') |
|
115 |
return true; |
|
116 |
alert('[% LxERP.t8('Please enter a profile name.') %]'); |
|
117 |
return false; |
|
118 |
}) |
|
119 |
}); |
|
120 |
--> |
|
121 |
</script> |
|
122 |
</body> |
|
123 |
</html> |
Auch abrufbar als: Unified diff
form_customers_vendors.html nach form.html umbenannt; Kosmetik