Skip to content
Snippets Groups Projects
Commit 5c18b293 authored by Sebastian Pongratz's avatar Sebastian Pongratz :ping_pong:
Browse files

Merge branch '#1063579-BeobachtungenAnpassungen' into '2021.0.0'

#1063579-BeobachtungenAnpassungen Anpassungen notifikation und übersetzungen

See merge request xrm/basic!603
parents 5d8cb7d5 906e8f0d
No related branches found
No related tags found
No related merge requests found
......@@ -355,7 +355,7 @@
<entityDependency>
<name>c83ebe7a-5a3b-49ed-b40c-d667bb72f268</name>
<entityName>Observation_entity</entityName>
<fieldName>Ussers</fieldName>
<fieldName>Users</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
......
......@@ -79,7 +79,9 @@
</entityField>
<entityField>
<name>LINKCONTEXT</name>
<groupable v="true" />
<valueProcess>%aditoprj%/entity/Notification_entity/entityfields/linkcontext/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Notification_entity/entityfields/linkcontext/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>LINKID</name>
......
import("Context_lib");
import("system.vars");
import("system.translate");
import("system.result");
let type = vars.get("$this.value");
if (type)
result.string(translate.text(ContextUtils.getContextName(type)));
\ No newline at end of file
......@@ -4,7 +4,6 @@
<title>Observation</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/Observation_entity/documentation.adoc</documentation>
<title>Observation</title>
<titlePlural>Observations</titlePlural>
<recordContainer>db</recordContainer>
<entityFields>
......@@ -41,7 +40,7 @@
<entityField>
<name>OBSERVER</name>
<title>Observer</title>
<consumer>Ussers</consumer>
<consumer>Users</consumer>
<groupable v="true" />
<mandatory v="true" />
<stateProcess>%aditoprj%/entity/Observation_entity/entityfields/observer/stateProcess.js</stateProcess>
......@@ -64,7 +63,7 @@
</entityField>
<entityField>
<name>OBJECT_ID</name>
<title>Object Id</title>
<title>Dataset</title>
<consumer>ObjectProxyConsumer</consumer>
<linkedContextProcess>%aditoprj%/entity/Observation_entity/entityfields/object_id/linkedContextProcess.js</linkedContextProcess>
<stateProcess>%aditoprj%/entity/Observation_entity/entityfields/object_id/stateProcess.js</stateProcess>
......@@ -85,14 +84,9 @@
<valueProcess>%aditoprj%/entity/Observation_entity/entityfields/priokeywords/children/containername_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
<dependency>
<name>dependency</name>
<entityName>KeywordEntry_entity</entityName>
<fieldName>#PROVIDER</fieldName>
</dependency>
</entityConsumer>
<entityConsumer>
<name>Ussers</name>
<name>Users</name>
<dependency>
<name>dependency</name>
<entityName>Employee_entity</entityName>
......@@ -112,11 +106,6 @@
<valueProcess>%aditoprj%/entity/Observation_entity/entityfields/objectproxyconsumer/children/entity_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
<dependency>
<name>dependency</name>
<entityName>ObjectProxy_entity</entityName>
<fieldName>FilteredObjects</fieldName>
</dependency>
</entityConsumer>
<entityField>
<name>TRIGGEREVENTUPDATE</name>
......@@ -145,7 +134,7 @@
</entityField>
<entityField>
<name>OBJECT_FILTER</name>
<title>Object Filter</title>
<title>Filter</title>
<contentType>FILTER_TREE</contentType>
<stateProcess>%aditoprj%/entity/Observation_entity/entityfields/object_filter/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/Observation_entity/entityfields/object_filter/valueProcess.js</valueProcess>
......@@ -206,11 +195,6 @@
<valueProcess>%aditoprj%/entity/Observation_entity/entityfields/contexts/children/invertblacklist_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
<dependency>
<name>dependency</name>
<entityName>Context_entity</entityName>
<fieldName>Exclusive</fieldName>
</dependency>
</entityConsumer>
<entityField>
<name>OBSERVATION_ID</name>
......@@ -244,7 +228,6 @@
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<isPageable v="false" />
<hasDependentRecords v="true" />
<conditionProcess>%aditoprj%/entity/Observation_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
......
......@@ -14,7 +14,7 @@ else
"Campaign",
"Contract",
"Employee",
"Favorite",
// "Favorite", TODO: Fix errors in favorites dependencies and then remove the comment
"Leadimport",
"Offer",
"Order",
......
......@@ -6327,7 +6327,7 @@
</entry>
<entry>
<key>Update</key>
<value>Update</value>
<value>Bearbeiten</value>
</entry>
<entry>
<key>Blog</key>
......@@ -10152,9 +10152,7 @@ Bitte Datumseingabe prüfen</value>
</entry>
<entry>
<key>Insert</key>
</entry>
<entry>
<key>INSERT</key>
<value>Neuanlage</value>
</entry>
<entry>
<key>Observation Type</key>
......@@ -10385,6 +10383,9 @@ Bitte Datumseingabe prüfen</value>
<entry>
<key>Adviser status</key>
</entry>
<entry>
<key>INSERT</key>
</entry>
</keyValueMap>
<font name="Dialog" style="0" size="11" />
</language>
......@@ -29,6 +29,9 @@ Observation.OBJECT_IDs = function () {
Observation.PRIO = function () {
return "PRIORITY";
}
Observation.CONTENTTITLE = function () {
return "OBJECT_CONTENTTITLE";
}
/**
* If the variables have not yet been parsed to an Object, they will now.
......@@ -208,18 +211,18 @@ Observation._notifiyUsers = function (pVariables, pObservers)
// If there is a OBJECT_TYPE, this is a dependency observation
if (pObservers[pObserver][Observation.OBJECT_TYPE()])
{
filteredVariables.notificationSubcategory = pObservers[pObserver][Observation.OBJECT_TYPE()]
filteredVariables.notificationCaption = pVariables[WorkflowVariables.TRIGGER()];
var context = pObservers[pObserver][Observation.OBJECT_TYPE()];
for (var targetId in pObservers[pObserver][Observation.OBJECT_IDs()])
{
filteredVariables.notificationSubcategory = pObservers[pObserver][Observation.OBJECT_IDs()][targetId]
Observation._notification(
pVariables,
filteredVariables,
pObservers,
pObserver,
context,
pObservers[pObserver][Observation.OBJECT_IDs()][targetId],
context,
targetId);
}
}
......@@ -232,7 +235,6 @@ Observation._notifiyUsers = function (pVariables, pObservers)
pObservers,
pObserver,
pVariables[WorkflowVariables.TARGET_CONTEXT()],
pVariables[WorkflowVariables.CONTENTTITLE()],
pVariables[WorkflowVariables.TARGET_ID()]);
}
......@@ -250,14 +252,12 @@ Observation._notifiyUsers = function (pVariables, pObservers)
* @param {Object} [pObservers] the Observers with the observed fields.
* @param {Object} [pObserver] the current observer in the loop.
* @param {Object} [pContext] the context from which the change is based.
* @param {Object} [pContenttitle] the Contenttitle of the changed context or dependency.
* @param {Object} [pTargetId] the id of the record from which the change is based.
*/
Observation._notification = function (pVariables, pFilteredVariables, pObservers, pObserver, pContext, pContenttitle, pTargetId)
Observation._notification = function (pVariables, pFilteredVariables, pObservers, pObserver, pContext, pTargetId)
{
pFilteredVariables.notificationPriority = pObservers[pObserver][Observation.PRIO()];
pFilteredVariables.notificationCaption = translate.text(pVariables[WorkflowVariables.TRIGGER()].slice(12));
pFilteredVariables.notificationDescription += translate.text(pContext) + " \"" + pContenttitle + "\" ";
pFilteredVariables.notificationCaption = pVariables[WorkflowVariables.CONTENTTITLE()];
pFilteredVariables.notificationAffectedUID = pTargetId;
pFilteredVariables.notificationAffectedContext = pContext;
var isfirstField = true;
......@@ -268,7 +268,6 @@ Observation._notification = function (pVariables, pFilteredVariables, pObservers
break;
case WorkflowSignalSender.EVENT_UPDATE():
pFilteredVariables.notificationDescription += translate.text("changed") + ":";
let subcategories = []
if (pFilteredVariables.notificationSubcategory)
subcategories.push(pFilteredVariables.notificationSubcategory);
......@@ -276,7 +275,8 @@ Observation._notification = function (pVariables, pFilteredVariables, pObservers
notification.getUserNotifications(pObserver, [notification.STATE_SEEN, notification.STATE_UNSEEN], subcategories).forEach(function (pNotification) {
if (pNotification.caption == pFilteredVariables.notificationCaption &&
pNotification.linkinfo == text.encodeMS([pContext, pTargetId]) &&
pNotification.type == pFilteredVariables.notificationType)
pNotification.type == pFilteredVariables.notificationType &&
!pNotification.description.endsWith("....there is more data available"))
{
isfirstField = false;
pFilteredVariables.notificationContentId = pNotification.contentid;
......@@ -285,8 +285,8 @@ Observation._notification = function (pVariables, pFilteredVariables, pObservers
});
break;
case WorkflowSignalSender.EVENT_DELETE():
pFilteredVariables.notificationDescription += translate.text(pVariables[WorkflowVariables.TARGET_CONTEXT()]) + " \"" + pVariables[WorkflowVariables.CONTENTTITLE()] + "\" ";
pFilteredVariables.notificationDescription += translate.text("deleted") + ".";
pFilteredVariables.notificationDescription = pFilteredVariables.notificationDescription.toString();
Observation._createNotification(pFilteredVariables);
return;
}
......@@ -301,6 +301,14 @@ Observation._notification = function (pVariables, pFilteredVariables, pObservers
var formatedFieldValue = Observation.formatFieldValue(rowData,pVariables[WorkflowVariables.CHANGED_ROWS_TYPES()], field);
pFilteredVariables.notificationDescription += " " +(isfirstField ? "" : translate.text("and"))+ " " +
pObservers[pObserver][field] + " " + translate.text("was set to") + " \"" + formatedFieldValue + "\"";
if (pFilteredVariables.notificationDescription.length > 980)
{
pFilteredVariables.notificationDescription.slice(0, 980)
pFilteredVariables.notificationDescription += "....there is more data available";
return;
}
isfirstField = false;
isNewDescription = true;
}
......@@ -309,7 +317,6 @@ Observation._notification = function (pVariables, pFilteredVariables, pObservers
if (isNewDescription)
{
pFilteredVariables.notificationDescription = pFilteredVariables.notificationDescription.toString();
Observation._createNotification(pFilteredVariables);
}
......@@ -323,6 +330,7 @@ Observation._notification = function (pVariables, pFilteredVariables, pObservers
*/
Observation._createNotification = function (variables)
{
variables.notificationDescription = variables.notificationDescription.toString();
if (false) // WorkflowUtils.engineIsEnabled()
{
checkObservation.signalEventReceived("Observation", variables);
......@@ -566,11 +574,10 @@ Observation.getEntityFilter = function (pEntity, pFilter)
"childs":[]
}
var res = {
"filter":pFilter,
"entity":pEntity
};
return JSON.stringify(res);
return JSON.stringify({
"filter":pFilter,
"entity":pEntity
});
}
/**
......
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