- <tr>
- <th align="right">[%- LxERP.t8('Check for duplicates') %]:</th>
- <td colspan="10">
- [% opts = [ [ 'no_check', LxERP.t8('Do not check for duplicates') ],
- [ 'check_csv', LxERP.t8('Discard duplicate entries in CSV file') ],
- [ 'check_db', LxERP.t8('Discard entries with duplicates in database or CSV file') ] ] %]
- [% L.select_tag('settings.duplicates', L.options_for_select(opts, default => SELF.profile.get('duplicates')), style => 'width: 300px') %]
- </td>
- </tr>
+ [% duplicate_fields = SELF.worker.get_duplicate_check_fields() %]
+ [% IF ( duplicate_fields.size ) %]
+ <tr>
+ <th align="right">[%- LxERP.t8('Check for duplicates') %]:</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 %]>
+ <label for="settings.duplicates_[% key | html %]">[% duplicate_fields.$key.label | html %]</label>
+ [% END %]
+ </td>
+ </tr>
+
+ <tr>
+ <th align="right"></th>
+
+ <td colspan=10>
+ [% opts = [ [ 'no_check', LxERP.t8('Do not check for duplicates') ],
+ [ 'check_csv', LxERP.t8('Discard duplicate entries in CSV file') ],
+ [ 'check_db', LxERP.t8('Discard entries with duplicates in database or CSV file') ] ] %]
+ [% L.select_tag('settings.duplicates', opts, default = SELF.profile.get('duplicates'), style = 'width: 300px') %]
+ </td>
+ </tr>
+ [% END %]