diff --git a/entity/Person_entity/entityfields/selfduplicates/children/onlyshowcontactids_param/valueProcess.js b/entity/Person_entity/entityfields/selfduplicates/children/onlyshowcontactids_param/valueProcess.js index 0d12ba78972752c64fb3be7f6a02e448b38fcf65..0338fbaa15f15cae671a530ae93424401c990c6d 100644 --- a/entity/Person_entity/entityfields/selfduplicates/children/onlyshowcontactids_param/valueProcess.js +++ b/entity/Person_entity/entityfields/selfduplicates/children/onlyshowcontactids_param/valueProcess.js @@ -9,12 +9,9 @@ let duplicateIds = DuplicateScannerUtils.GetCachedDuplicatesForContactId(contact /* * To achieve that if there are no duplicates, no contacts should be shown and therefore returned by the - * recordcontainer, a "nonsense" id gets returned. It then is used in the conditionProcess. + * recordcontainer, an invalid id gets returned. It then is used in the conditionProcess to load the duplicates. * Because of its invalidity, no records are shown. */ -logging.log("duplicateIds -> " + duplicateIds); -logging.log("duplicateIds -> " + duplicateIds.length); - if(duplicateIds.length == 0) result.string(JSON.stringify(["nodata"])); else diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index c2aad558ee94eaf9b87a44c71d50985a257f9de9..b78b681876f4078d50e7f11a6d033ba6dcb79685 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -4977,6 +4977,15 @@ <entry> <key>Ignore Duplicate</key> </entry> + <entry> + <key>Integrate current into selected contact</key> + </entry> + <entry> + <key>Integrate selected into current contact</key> + </entry> + <entry> + <key>Duplicate actions</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 26fe06dafb0fb074f20ca828837c9c5d654312c5..ae4377a01ae18f929fe98b4ea017edafc47202bf 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -6268,6 +6268,18 @@ <key>Ignore Duplicate</key> <value>Dublette ignorieren</value> </entry> + <entry> + <key>Integrate current into selected contact</key> + <value>Aktuellen Datensatz in selektierten integrieren</value> + </entry> + <entry> + <key>Integrate selected into current contact</key> + <value>Selektierten Datensatz in aktuellen integrieren</value> + </entry> + <entry> + <key>Duplicate actions</key> + <value>Dubletten Aktionen</value> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 5a622924ea164d6948e79496641c0957e02730c7..259ad7e781a02e4114c2e8f9dfeaa5b65ea92f21 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -5026,6 +5026,15 @@ <entry> <key>Ignore Duplicate</key> </entry> + <entry> + <key>Integrate current into selected contact</key> + </entry> + <entry> + <key>Integrate selected into current contact</key> + </entry> + <entry> + <key>Duplicate actions</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/process/DuplicateScanner_lib/process.js b/process/DuplicateScanner_lib/process.js index 4af56b3a0549bf8c323e8329bd977ab47dc9eb7e..30b78bc43f85686500e5b520377480fe01e1d35b 100644 --- a/process/DuplicateScanner_lib/process.js +++ b/process/DuplicateScanner_lib/process.js @@ -51,11 +51,43 @@ DuplicateScannerUtils.ScanForDuplicates = function(pFilterName, pTargetEntity, p // } //} -DuplicateScannerUtils.RemoveFromDuplicatesCache = function(pContactId) +DuplicateScannerUtils.DeleteCachedDuplicate = function(pContactId) { + let query = "select count(ID), CLUSTERID from DUPLICATECLUSTERS" + + " where CLUSTERID = (select CLUSTERID from DUPLICATECLUSTERS where DUPLICATEID = '"+ pContactId +"')" + + " and DUPLICATEID != '"+ pContactId +"'" + + " group by CLUSTERID"; + + let coundAndClusterId = db.array(db.ROW, query); + let countDuplicatesInClusterWithoutParameterId = coundAndClusterId[0]; + let clusterId = coundAndClusterId[1]; + //If only one duplicate would be remaining, + //the whole cluster has to be deleted because there are no more duplicates. + //Otherwise delete just the single duplicate. + if(countDuplicatesInClusterWithoutParameterId <= 1) + { + let deleteClusterCondition = "DUPLICATECLUSTERS.CLUSTERID = '"+ clusterId +"'"; + db.deleteData("DUPLICATECLUSTERS", pCondition); + } + else + { + db.deleteData("DUPLICATECLUSTERS", "DUPLICATECLUSTERS.DUPLICATEID = '"+ pContactId +"'"); + } + //todo delete from ignore table, too } +DuplicateScannerUtils.IgnoreDuplicateRelation = function(pContactId1, pContactId2) +{ + +} + +DuplicateScannerUtils.UnIgnoreDuplicateRelation = function(pContactId1, pContactId2) +{ + +} + + DuplicateScannerUtils.GetCachedDuplicatesForContactId = function(pDuplicateId) { let querySelectDuplicateContactIds = "select DUPLICATEID from DUPLICATECLUSTERS"