import: skip search for duplicates

This commit is contained in:
yuri
2016-11-07 12:54:14 +02:00
parent 8f4917eb24
commit f4a88df067
5 changed files with 18 additions and 2 deletions

View File

@@ -138,6 +138,7 @@ class Import extends \Espo\Core\Controllers\Record
'currency' => $data['currency'],
'defaultValues' => $data['defaultValues'],
'action' => $data['action'],
'skipDuplicateChecking' => $data['skipDuplicateChecking']
);
if (array_key_exists('updateBy', $data)) {

View File

@@ -49,7 +49,8 @@
"Single Quote": "Single Quote",
"Imported": "Imported",
"Duplicates": "Duplicates",
"Updated": "Updated"
"Updated": "Updated",
"Skip searching for duplicates": "Skip searching for duplicates"
},
"messages": {
"utf8": "Should be UTF-8 encoded",

View File

@@ -527,7 +527,10 @@ class Import extends \Espo\Services\Record
try {
if ($isNew) {
$isDuplicate = $recordService->checkEntityForDuplicate($entity);
$isDuplicate = false;
if (empty($params['skipDuplicateChecking'])) {
$isDuplicate = $recordService->checkEntityForDuplicate($entity);
}
}
if ($entity->id) {
$sql = $this->getEntityManager()->getRepository($entity->getEntityType())->deleteFromDb($entity->id, true);

View File

@@ -110,6 +110,14 @@
</select>
</div>
</div>
<div class="row">
<div class="col-sm-4 form-group">
<label class="control-label">{{translate 'Skip searching for duplicates' scope='Import'}}</label>
<div>
<input type="checkbox" id="skip-duplicate-checking">
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -109,6 +109,7 @@ Espo.define('views/import/step1', 'view', function (Dep) {
this.formData.decimalMark = $('#import-decimal-mark').val();
this.formData.currency = $('#import-currency').val();
this.formData.personNameFormat = $('#import-person-name-format').val();
this.formData.skipDuplicateChecking = $('#skip-duplicate-checking').get(0).checked;
this.getParentView().formData = this.formData;
this.getParentView().changeStep(2);
@@ -117,6 +118,8 @@ Espo.define('views/import/step1', 'view', function (Dep) {
setupFormData: function () {
$('#import-header-row').get(0).checked = this.formData.headerRow || false;
$('#skip-duplicate-checking').get(0).checked = this.formData.skipDuplicateChecking || false;
if (this.formData.entityType) {
$('#import-entity-type').val(this.formData.entityType);
}