{{-- Column mapping of an import (#2957 slice 4d, card #3018). Included by import/edit only. Posts the same fields as the old form to imports.update (PUT): receiverList or newReceiverList, overwrite, email, phone (column index, -1 for none), receiverProp[templateId] and newReceiverProp[header]. resources/assets/js/nuhet/import-edit.js is the old jQuery behaviour in plain JS: a column can be picked for one field only, typing a new list name disables the list select, and typing the name of an existing list selects that list instead. The receiver limit check is the old one, unchanged (Import has no "count" attribute). --}} @php $json = json_decode($import->json, true); $headers = (array) ($json['headers'] ?? []); $company = Auth::user()->company; $limitReached = ($company->package->max_receivers - $company->receivers()->countsTowardLimit()->count()) < $import->count; $selected = fn (string $key, $value) => (string) old($key, '-1') === (string) $value; $tagChoices = ! empty($receiverLists) ? $company->receiverLists()->whereIn('id', array_keys((array) $receiverLists))->orderBy('name')->get() : collect(); @endphp
@csrf @method('PUT')

{{ __('taggingImport.nh.stepList') }}

@if (! empty($receiverLists)) @else

{{ __('taggingImport.nh.noLists') }}

@endif

{{ __('import.nh.stepColumns') }}

{{ __('import.infoText') }}

@foreach (['email' => __('import.pickColumnEmail'), 'phone' => __('import.pickColumnPhone')] as $field => $placeholder) @foreach ($headers as $index => $header) @endforeach @endforeach @foreach ((array) $receiverPropTemplates as $templateId => $propTemplate) @foreach ($headers as $index => $header) @endforeach @endforeach
@if (count($headers) > 2)
{{ __('import.showExtraHeaders') }}

{{ __('import.nh.extraHint') }}

@foreach ($headers as $property) @foreach ($headers as $index => $header) @endforeach @endforeach
@endif

{{ __('import.nh.stepStart') }}

@if ($limitReached) {{ __('import.edit.receiverLimit') }} {{ __('global.upgradePackage') }} @endif

{{ __('import.nh.startHint') }}

{{ __('import.importBtn') }} {{ __('import.nh.cancel') }}
@push('scripts') @endpush