Take the values from the importer form to configure the used importer

This commit is contained in:
Ivan Nieto Vivanco 2022-03-29 17:31:43 -06:00
parent f7cd21a007
commit 1a448cc4b6
2 changed files with 7 additions and 5 deletions

View file

@ -60,8 +60,8 @@ class ItemImportRequest extends FormRequest
} }
$importer->setCallbacks([$this, 'log'], [$this, 'progress'], [$this, 'errorCallback']) $importer->setCallbacks([$this, 'log'], [$this, 'progress'], [$this, 'errorCallback'])
->setUserId(Auth::id()) ->setUserId(Auth::id())
->setUpdating($this->has('import-update')) ->setUpdating($this->get('import-update'))
->setShouldNotify($this->has('send-welcome')) ->setShouldNotify($this->get('send-welcome'))
->setUsernameFormat('firstname.lastname') ->setUsernameFormat('firstname.lastname')
->setFieldMappings($fieldMappings); ->setFieldMappings($fieldMappings);
$importer->import(); $importer->import();

View file

@ -21,7 +21,7 @@
<label for="import-update">Update Existing Values?:</label> <label for="import-update">Update Existing Values?:</label>
</div> </div>
<div class="col-md-7 col-xs-12"> <div class="col-md-7 col-xs-12">
<input type="checkbox" class="iCheck minimal" name="import-update" v-model="options.update"> <input type="checkbox" class="icheckbox_minimal" name="import-update" v-model="options.update">
</div> </div>
</div><!-- /dynamic-form-row --> </div><!-- /dynamic-form-row -->
@ -30,7 +30,7 @@
<label for="send-welcome">Send Welcome Email for new Users?</label> <label for="send-welcome">Send Welcome Email for new Users?</label>
</div> </div>
<div class="col-md-7 col-xs-12"> <div class="col-md-7 col-xs-12">
<input type="checkbox" class="minimal" name="send-welcome" v-model="options.send_welcome"> <input type="checkbox" class="icheckbox_minimal" name="send-welcome" v-model="options.send_welcome">
</div> </div>
</div><!-- /dynamic-form-row --> </div><!-- /dynamic-form-row -->
@ -39,7 +39,7 @@
<label for="run-backup">Backup before importing?</label> <label for="run-backup">Backup before importing?</label>
</div> </div>
<div class="col-md-7 col-xs-12"> <div class="col-md-7 col-xs-12">
<input type="checkbox" class="minimal" name="run-backup" v-model="options.run_backup"> <input type="checkbox" class="icheckbox_minimal" name="run-backup" v-model="options.run_backup">
</div> </div>
</div><!-- /dynamic-form-row --> </div><!-- /dynamic-form-row -->
@ -111,6 +111,8 @@
options: { options: {
importType: this.file.import_type, importType: this.file.import_type,
update: false, update: false,
send_welcome: false,
run_backup: false,
importTypes: [ importTypes: [
{ id: 'asset', text: 'Assets' }, { id: 'asset', text: 'Assets' },
{ id: 'accessory', text: 'Accessories' }, { id: 'accessory', text: 'Accessories' },