diff --git a/entity/Organisation_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js b/entity/Organisation_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js index 65462384c264d3a5ea28736501d66e5c2ab21d1a..597cd13795bb8284b220d743517bfede1d7cdfe6 100644 --- a/entity/Organisation_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js +++ b/entity/Organisation_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js @@ -1,3 +1,4 @@ +import("Employee_lib"); import("system.vars"); import("system.neon"); import("DuplicateScanner_lib"); @@ -10,5 +11,7 @@ let mergeSuccess = DuplicateScannerUtils.MergeOrganisation(sourceContactId, targ if(mergeSuccess) { + let currentContactId = EmployeeUtils.getCurrentContactId(); + DuplicateScannerUtils.CreateMergeSuccessActivity(sourceContactId, targetContactId, currentContactId, "Organisation"); neon.openContext("Organisation", "OrganisationMain_view", [targetContactId], neon.OPERATINGSTATE_VIEW, null) } \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js b/entity/Organisation_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js index 85447cf5568a641ed169eaf7239bcaf7648a3ff8..519f845eb20c37ed76d498ac659859dac9b344ef 100644 --- a/entity/Organisation_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js +++ b/entity/Organisation_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js @@ -1,3 +1,4 @@ +import("Employee_lib"); import("system.logging"); import("system.vars"); import("system.neon"); @@ -5,12 +6,13 @@ import("DuplicateScanner_lib"); let targetContactId = vars.get("$param.DuplicateCurrentContactId_param"); let sourceContactId = vars.get("$sys.selection"); -logging.log("targetContactId -> " + targetContactId); -logging.log("sourceContactId -> "+ sourceContactId); + //todo the actual merge ought to happen in a separate view where the contact infos can be merged manually by the user. let mergeSuccess = DuplicateScannerUtils.MergeOrganisation(sourceContactId, targetContactId); if(mergeSuccess) { + let currentContactId = EmployeeUtils.getCurrentContactId(); + DuplicateScannerUtils.CreateMergeSuccessActivity(sourceContactId, targetContactId, currentContactId, "Organisation"); neon.refreshAll(); } \ No newline at end of file diff --git a/entity/Person_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js b/entity/Person_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js index b752040252bd1274bf9866436c23256667c6b808..bf7678e3b0f63c9ad0eebb6904132b9cde2a308c 100644 --- a/entity/Person_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js +++ b/entity/Person_entity/entityfields/duplicateactions/children/integratecurrentintoselectedaction/onActionProcess.js @@ -1,3 +1,4 @@ +import("Employee_lib"); import("system.vars"); import("system.neon"); import("DuplicateScanner_lib"); @@ -10,5 +11,8 @@ let mergeSuccess = DuplicateScannerUtils.MergePerson(sourceContactId, targetCont if(mergeSuccess) { + let currentContactId = EmployeeUtils.getCurrentContactId(); + DuplicateScannerUtils.CreateMergeSuccessActivity(sourceContactId, targetContactId, currentContactId, "Person"); + neon.openContext("Person", "PersonMain_view", [targetContactId], neon.OPERATINGSTATE_VIEW, null) } \ No newline at end of file diff --git a/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js b/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js index ea59a8ed2970a3bfe268a4ca47e8fad6d0adc0ff..69765d3ca542f6e779d7c872d3d6bc48aa1ac1e8 100644 --- a/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js +++ b/entity/Person_entity/entityfields/duplicateactions/children/integrateselectedintocurrentaction/onActionProcess.js @@ -1,3 +1,7 @@ +import("system.db"); +import("Employee_lib"); +import("KeywordRegistry_basic"); +import("ActivityTask_lib"); import("system.logging"); import("system.vars"); import("system.neon"); @@ -12,5 +16,8 @@ let mergeSuccess = DuplicateScannerUtils.MergePerson(sourceContactId, targetCont if(mergeSuccess) { + let currentContactId = EmployeeUtils.getCurrentContactId(); + DuplicateScannerUtils.CreateMergeSuccessActivity(sourceContactId, targetContactId, currentContactId, "Person"); + neon.refreshAll(); } \ No newline at end of file diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index f610601e6596c281f5af3bdbeb80ab660a45424d..6a76f469275b7ceabcf0c2d09fb202f8d81ee577 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -5196,6 +5196,12 @@ <entry> <key>Field configuration</key> </entry> + <entry> + <key>%0 with ID \"%1\" has been integrated into the %0 with the ID \"%2\"</key> + </entry> + <entry> + <key>A %0 record has been merged</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 52bbbd711bf0c3fd3afd33239320b02d70598f8a..53cf55f14e6b16f9350d635ebb091d96bd189dc3 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -6553,6 +6553,14 @@ <key>Field configuration</key> <value>Feldkonfiguration</value> </entry> + <entry> + <key>%0 with ID \"%1\" has been integrated into the %0 with the ID \"%2\"</key> + <value>%0 mit der ID \"%1\" wurde in %0 mit der ID \"%2\" integriert</value> + </entry> + <entry> + <key>A %0 record has been merged</key> + <value>Zwei Datensätze vom Typ %0 wurden zusammengeführt</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 147496b33d9abd0c0c8d0455fa89d90714847b9f..c0b3cccc55025fc4c5d6738a8952d0bba333979d 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -5246,6 +5246,12 @@ <entry> <key>Field configuration</key> </entry> + <entry> + <key>A %0 record has been merged</key> + </entry> + <entry> + <key>%0 with ID \"%1\" has been integrated into the %0 with the ID \"%2\"</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 5b76a06e6defe25ae8439e2cb1e2402e1e9ea74b..02512e08de22dfba3106b780533ea54c8a3cb3f2 100644 --- a/process/DuplicateScanner_lib/process.js +++ b/process/DuplicateScanner_lib/process.js @@ -1,3 +1,4 @@ +import("KeywordRegistry_basic"); import("system.translate"); import("ActivityTask_lib"); import("Contact_lib"); @@ -761,14 +762,14 @@ DuplicateScannerUtils.MergePerson = function(pSourceContactId, pTargetContactId) DuplicateScannerUtils.CreateMergeSuccessActivity = function(pSourceContactId, pTargetContactId, pCurrentContactId, pContext) { var activityDataForInsert = { - subject: translate.withArguments("A %0 record has been merged", [pContext]),//"Es wurde ein Personendatensatz in diesen integriert", + subject: translate.withArguments("A %0 record has been merged", [pContext]), content: translate.withArguments("%0 with ID \"%1\" has been integrated into the %0 with the ID \"%2\"", [pContext, pSourceContactId, pTargetContactId]), //categoryKeywordId: $KeywordRegistry.ac - directionKeywordId: "x", + directionKeywordId: $KeywordRegistry.activityDirection$internal(), responsibleContactId: pCurrentContactId }; var activityLinks = [[pContext, pTargetContactId]]; - + return ActivityUtils.insertNewActivity(activityDataForInsert, activityLinks, null, db.getCurrentAlias()); } @@ -1118,9 +1119,10 @@ _DuplicateScannerUtils._callIndexSearch = function(pTargetEntity, pPreFilterJson if(filterPattern != null) indexQuery = indexQuery.addFilter(filterPattern); - logging.log("indexQuery.getPattern -> " + indexQuery.getPattern()); - logging.log("indexQuery.getFilters -> " + indexQuery.getFilters()); - //logging.log("Starte Indexsuche -> "); + + logging.log("indexQuery.getPattern -> " + indexQuery.getPattern()); + logging.log("indexQuery.getFilters -> " + indexQuery.getFilters()); + return indexsearch.searchIndex(indexQuery); } diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index f3db5255815df2c575c3419e6267213f8181bdac..c1a2df5bdafd53bf971dccee2614c81904ac51e7 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -33,6 +33,7 @@ $KeywordRegistry.contractType = function(){return "ContractType";}; $KeywordRegistry.activityDirection = function(){return "ActivityDirection";}; $KeywordRegistry.activityDirection$incoming = function(){return $KeywordRegistry._autoPad("i");}; $KeywordRegistry.activityDirection$outgoing = function(){return $KeywordRegistry._autoPad("o");}; +$KeywordRegistry.activityDirection$internal = function(){return $KeywordRegistry._autoPad("x");}; $KeywordRegistry.contactStatus = function(){return "ContactStatus";}; $KeywordRegistry.contactStatus$active = function(){return $KeywordRegistry._autoPad("CONTACTSTATACTIVE");};