Skip to content
Snippets Groups Projects
Commit bfb60323 authored by David Büchler's avatar David Büchler
Browse files

New keyword has been added for activity direct interal

If a merge has been successful, a new acitivity gets created on the target record of the merge
This has been implemented on Person and Organisation
parent 62ae27b7
No related branches found
No related tags found
No related merge requests found
Showing with 47 additions and 8 deletions
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
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
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
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
......@@ -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>
......
......@@ -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>
......@@ -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>
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);
}
......
......@@ -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");};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment