Skip to content
Snippets Groups Projects
Commit e9224448 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

Merge branch '2021.2' into '2021.2.2'

[Projekt: Entwicklung - Neon][TicketNr.: 1076531][Löschen eines Users muss...

See merge request xrm/basic!1521
parents dfbc843a b674370a
No related branches found
No related tags found
No related merge requests found
Showing with 112 additions and 15 deletions
......@@ -13,4 +13,4 @@
<include relativeToChangelogFile="true" file="EwsContactSync/changelog.xml"/>
<include relativeToChangelogFile="true" file="Export/changelog.xml"/>
<include relativeToChangelogFile="true" file="insert_ProductGroupcode.xml"/>
</databaseChangeLog>
</databaseChangeLog>
\ No newline at end of file
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<include relativeToChangelogFile="true" file="insertBulkMailSenderAddressKeyword.xml"/>
</databaseChangeLog>
\ No newline at end of file
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="m.groppe" id="50badea9-da46-4aa0-94ed-a2c3db2874ac">
<insert tableName="AB_KEYWORD_CATEGORY">
<column name="AB_KEYWORD_CATEGORYID" value="3f31d08d-bf59-4bb7-9e96-7f026571cb79"/>
<column name="NAME" value="BulkmailSenderAddress"/>
<column name="SORTINGBY" valueNumeric="0"/>
<column name="SORTINGDIRECTION" value="ASC"/>
</insert>
<insert tableName="AB_KEYWORD_ENTRY">
<column name="AB_KEYWORD_ENTRYID" value="c4773a13-314d-4f00-a7d3-ab65947586ba"/>
<column name="KEYID" value="news@adito.de"/>
<column name="TITLE" value="news@adito.de"/>
<column name="CONTAINER"/>
<column name="SORTING" valueNumeric="1"/>
<column name="ISACTIVE" valueNumeric="1"/>
<column name="ISESSENTIAL" valueNumeric="0"/>
<column name="AB_KEYWORD_CATEGORY_ID" value="3f31d08d-bf59-4bb7-9e96-7f026571cb79"/>
</insert>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -13,4 +13,5 @@
<include relativeToChangelogFile="true" file="Mosaico/insert_mosaico_color_keyword.xml"/>
<include relativeToChangelogFile="true" file="Mailbridge/changelog.xml"/>
<include relativeToChangelogFile="true" file="OfferOrder/changelog.xml"/>
<include relativeToChangelogFile="true" file="BulkMail/changelog.xml"/>
</databaseChangeLog>
\ No newline at end of file
......@@ -93,8 +93,9 @@
<entityField>
<name>SENDER</name>
<title>Sender address</title>
<consumer>SenderAddressKeyword</consumer>
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/sender/valueProcess.js</valueProcess>
<textInputAllowed v="true" />
<onValidation>%aditoprj%/entity/BulkMail_entity/entityfields/sender/onValidation.js</onValidation>
</entityField>
<entityField>
......@@ -641,6 +642,20 @@
<fieldName>ISO3Name</fieldName>
</dependency>
</entityConsumer>
<entityConsumer>
<name>SenderAddressKeyword</name>
<dependency>
<name>dependency</name>
<entityName>KeywordEntry_entity</entityName>
<fieldName>SpecificContainerKeywords</fieldName>
</dependency>
<children>
<entityParameter>
<name>ContainerName_param</name>
<valueProcess>%aditoprj%/entity/BulkMail_entity/entityfields/senderaddresskeyword/children/containername_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.neon");
import("system.vars");
import("Communication_lib");
import("system.result");
import("Employee_lib");
if(vars.get("$this.value") == null && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
result.string(CommUtil.getStandardMail(EmployeeUtils.getCurrentContactId()));
\ No newline at end of file
import("KeywordRegistry_basic");
import("system.result");
result.string($KeywordRegistry.bulkMailSenderAddress());
\ No newline at end of file
......@@ -5,14 +5,60 @@ import("system.neon");
import("system.vars");
import("system.tools");
import("Employee_lib");
import("system.tag");
//the current user should not delete himself
if (EmployeeUtils.getCurrentUserName() != vars.get("$field.TITLE") && !EmployeeUtils.hasRelations(vars.get("$field.CONTACT_ID")))
{
tools.deleteUser(vars.get("$field.TITLE"));
new AttributeRelationQuery(EmployeeUtils.sliceUserId(vars.get("$field.UID")), null, ContextUtils.getCurrentContextId())
.deleteAllAttributes();
var targetUserTitle = vars.get("$field.TITLE");
if (targetUserTitle)
{
untagAllPrivateTaggedObjects(targetUserTitle);
tools.deleteUser(targetUserTitle);
new AttributeRelationQuery(EmployeeUtils.sliceUserId(vars.get("$field.UID")), null, ContextUtils.getCurrentContextId())
.deleteAllAttributes();
WorkflowSignalSender.deleted();
WorkflowSignalSender.deleted();
}
}
/*
* Untags all private tagged objects (default favorites and favorite groups) of the provided user.
*/
function untagAllPrivateTaggedObjects(pTargetUserTitle)
{
var privateTags = [];
var targetUser = tools.getUser([pTargetUserTitle], tools.PROFILE_DEFAULT);
var config = tag.createGetTaggedObjectsConfig();
config.setUserId(targetUser.name);
// get all objects tagged as default favorite
config.setTagType(tag.DEFAULT_FAVORITE_GROUP);
privateTags = privateTags.concat(getAllTaggedObjectIds(config));
// get all objects tagged as favorite group
config.setTagType(tag.FAVORITE_GROUP);
privateTags = privateTags.concat(getAllTaggedObjectIds(config));
// untag all private tags
config = tag.createUntagMultipleByIdConfig();
config.setTaggedObjectsRecordIds(privateTags);
tag.untag(config);
}
/*
* Returns an array containing all ids of private tagged objects (ID of ASYS_RECORD).
*/
function getAllTaggedObjectIds(pConfig)
{
var allTaggedObjectIds = [];
tag.getTaggedObjects(pConfig).forEach(function(taggedObject) {
if (taggedObject.id)
allTaggedObjectIds.push(taggedObject.id);
});
return allTaggedObjectIds;
}
\ No newline at end of file
......@@ -521,6 +521,8 @@ $KeywordRegistry.linkEvaluationType$default = function(){return "LINKEVALUATION_
$KeywordRegistry.linkEvaluationType$ignore = function(){return "LINKEVALUATION_IGNORE";};
$KeywordRegistry.linkEvaluationType$unsubscribe = function(){return "LINKEVALUATION_UNSUBSCRIBE";};
$KeywordRegistry.bulkMailSenderAddress = function() {return "BulkmailSenderAddress";};
$KeywordRegistry.mosaicoBaseTemplate = function(){return "MosaicoBaseTemplate";};
$KeywordRegistry.mosaicoColor = function(){return "MosaicoColor";};
$KeywordRegistry.mosaicoTemplateCategory = function(){return "MosaicoTemplateCategory";};
\ No newline at end of file
......@@ -1075,6 +1075,13 @@ function PermissionUtil () {}
};
}
}
else
{
res = {
status: null, // if pRecordState == NEW -> status is not relevant for display
title: ContextUtils.getTitleByContext(pObjectType, pObjectRowId)
};
}
return res;
}
......
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