mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
import: skip search for duplicates
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user