[%- IF SELF.type == 'contacts' %]
<p>
+ [%- LxERP.t8("You can update existing contacts by providing the 'cp_id' column with their database IDs. Otherwise: ") %]
[%- LxERP.t8('At least one of the columns #1, customer, customernumber, vendor, vendornumber (depending on the target table) is required for matching the entry to an existing customer or vendor.', 'cp_cv_id') %]
</p>
[%- LxERP.t8("If the article type is set to 'mixed' then a column called 'type' must be present.") %]
[% LxERP.t8("Type can be either 'part' or 'service'.") %]
</p>
+
+ <p>
+ [1]:
+ [% LxERP.t8('The three columns "make_X", "model_X" and "lastcost_X" with the same number "X" are used to import vendor part numbers and vendor prices.') %]
+ [% LxERP.t8('The column triplets can occur multiple times with different numbers "X" each time (e.g. "make_1", "model_1", "lastcost_1", "make_2", "model_2", "lastcost_2", "make_3", "model_3", "lastcost_3" etc).') %]
+ [% LxERP.t8('The items are imported accoring do their number "X" regardless of the column order inside the file.') %]
+ [% LxERP.t8('The column "make_X" can contain either a vendor\'s database ID, a vendor number or a vendor\'s name.') %]
+ </p>
[%- END %]
<p>
<h2>[%- LxERP.t8('Settings') %]</h2>
+ <div class="settings_toggle"[% UNLESS SELF.deferred || SELF.import_status %] style="display:none"[% END %]>
+ <a href="#" onClick="javascript:$('.settings_toggle').toggle()">[% LxERP.t8("Show settings") %]</a>
+ </div>
+
+ <div class="settings_toggle"[% IF SELF.deferred || SELF.import_status %] style="display:none"[% END %]>
+ <p><a href="#" onClick="javascript:$('.settings_toggle').toggle()">[% LxERP.t8("Hide settings") %]</a></p>
+
<table>
<tr>
<th align="right">[%- LxERP.t8('Number Format') %]:</th>
<td colspan=10>
[% FOREACH key = duplicate_fields.keys %]
- <input type="checkbox" name="settings.duplicates_[% key | html %]" id="settings.duplicates_[% key | html %]" value="1"[% IF ( SELF.profile.get('duplicates_'_ key) || (duplicate_fields.$key.default && !FORM.form_sent ) ) %] checked="checked"[% END %]\>
+ <input type="checkbox" name="settings.duplicates_[% key | html %]" id="settings.duplicates_[% key | html %]" value="1"[% IF ( SELF.profile.get('duplicates_'_ key) || (duplicate_fields.$key.default && !FORM.form_sent ) ) %] checked="checked"[% END %]>
<label for="settings.duplicates_[% key | html %]">[% duplicate_fields.$key.label | html %]</label>
[% END %]
</td>
[%- INCLUDE 'csv_import/_form_parts.html' %]
[%- ELSIF SELF.type == 'customers_vendors' %]
[%- INCLUDE 'csv_import/_form_customers_vendors.html' %]
+[%- ELSIF SELF.type == 'contacts' %]
+ [%- INCLUDE 'csv_import/_form_contacts.html' %]
[%- END %]
<tr>
</table>
+ </div>
+ <hr>
+
[% L.submit_tag('action_test', LxERP.t8('Test and preview')) %]
- [% IF (SELF.import_status == 'tested') && SELF.num_importable %]
- [% L.submit_tag('action_import', LxERP.t8('Import')) %]
- [%- END %]
+ [% L.submit_tag('action_import', LxERP.t8('Import'), style='display:none') %]
</form>
- [%- IF SELF.import_status %]
- [%- IF SELF.errors %]
- [%- PROCESS 'csv_import/_errors.html' %]
- [%- END %]
-
- [%- PROCESS 'csv_import/_result.html' %]
- [%- PROCESS 'csv_import/_preview.html' %]
+ <div id='results'>
+ [%- IF SELF.deferred %]
+ [%- PROCESS 'csv_import/_deferred_results.html' %]
+ [%- ELSIF SELF.import_status %]
+ [%- PROCESS 'csv_import/_results.html' %]
[%- END %]
+ </div>
+
<script type="text/javascript">
<!--
$(document).ready(function() {
$('#action_save').click(function() {
- if ($('#profile_name').attr('value') != '')
+ if ($('#profile_name').val() != '')
return true;
alert('[% LxERP.t8('Please enter a profile name.') %]');
return false;