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

Merge branch '1072297_AttributSerienaktion' into '2021.1'

[Projekt: Entwicklung - Neon][TicketNr.: 1072297][Attribut anlegen als Serienaktion]

See merge request xrm/basic!940
parents 3ba7cb3c 7f0888b8
No related branches found
No related tags found
No related merge requests found
Showing
with 318 additions and 0 deletions
......@@ -627,6 +627,14 @@
<stateProcess>%aditoprj%/entity/Activity_entity/entityfields/filteractions/children/observe/stateProcess.js</stateProcess>
<titleProcess>%aditoprj%/entity/Activity_entity/entityfields/filteractions/children/observe/titleProcess.js</titleProcess>
</entityActionField>
<entityActionField>
<name>addAttributeToSelection</name>
<title>Set attribute (use filter result)</title>
<onActionProcess>%aditoprj%/entity/Activity_entity/entityfields/filteractions/children/addattributetoselection/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
<iconId>VAADIN:TAGS</iconId>
<titleProcess>%aditoprj%/entity/Activity_entity/entityfields/filteractions/children/addattributetoselection/titleProcess.js</titleProcess>
</entityActionField>
</children>
</entityActionGroup>
<entityActionField>
......
import("system.translate");
import("system.neon");
import("Context_lib");
import("FilterViewAction_lib");
import("system.vars");
var ids;
var currentContext = ContextUtils.getCurrentContextId();
if (vars.get("$sys.selection").length > 0)
{
ids = vars.get("$sys.selection");
}
else
{
ids = FilterViewActionUtils.getUidsByEntityFilter(currentContext, vars.get("$sys.filter"));
}
var params = {
"DataUIDs_param": JSON.stringify(ids),
"ContextId_param": currentContext,
"Datalength_param": ids.length,
"ContextTitlePlural_param": translate.text("Activities")
}
neon.openContext("AddAttributesToSelection", "AddAttributesToSelectionEdit_view", null, neon.OPERATINGSTATE_NEW, params, null);
\ No newline at end of file
import("system.translate");
import("system.result");
import("system.vars");
if (vars.get("$sys.selection").length > 0)
{
result.string(translate.text("set attribute (selected data)"))
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.21" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.21">
<name>AddAttributesToSelectionMulti_entity</name>
<title>Add Attributes </title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/documentation.adoc</documentation>
<recordContainer>jDito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityProvider>
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
<entityConsumer>
<name>SpecificAttributes</name>
<dependency>
<name>dependency</name>
<entityName>Attribute_entity</entityName>
<fieldName>SpecificAttribute</fieldName>
</dependency>
<children>
<entityParameter>
<name>ObjectType_param</name>
<valueProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/specificattributes/children/objecttype_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityField>
<name>AB_ATTRIBUTE_ID</name>
<title>Attribute</title>
<consumer>SpecificAttributes</consumer>
<state>EDITABLE</state>
<displayValueProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/ab_attribute_id/displayValueProcess.js</displayValueProcess>
<onValueChange>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/ab_attribute_id/onValueChange.js</onValueChange>
<onValueChangeTypes>
<element>MASK</element>
</onValueChangeTypes>
<onValidation>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/ab_attribute_id/onValidation.js</onValidation>
</entityField>
<entityField>
<name>VALUE</name>
<title>Value</title>
<contentTypeProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/value/contentTypeProcess.js</contentTypeProcess>
<mandatory v="true" />
<mandatoryProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/value/mandatoryProcess.js</mandatoryProcess>
<dropDownProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/value/dropDownProcess.js</dropDownProcess>
<state>EDITABLE</state>
<stateProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/value/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/value/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/value/displayValueProcess.js</displayValueProcess>
<onValidation>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/value/onValidation.js</onValidation>
</entityField>
<entityField>
<name>VALUE_LOOKUP</name>
<title>Value</title>
<consumer>Objects</consumer>
<contentTypeProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/value_lookup/contentTypeProcess.js</contentTypeProcess>
<state>EDITABLE</state>
<stateProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/value_lookup/stateProcess.js</stateProcess>
<displayValueProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/value_lookup/displayValueProcess.js</displayValueProcess>
<onValidation>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/value_lookup/onValidation.js</onValidation>
</entityField>
<entityField>
<name>UID</name>
</entityField>
<entityProvider>
<name>AddAttributeToSelectionMulti</name>
</entityProvider>
<entityParameter>
<name>ContextId_param</name>
<expose v="true" />
</entityParameter>
<entityField>
<name>DROPDOWNDEFINITION</name>
<valueProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/dropdowndefinition/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>VALIDATIONPARAMETERS</name>
<valueProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/validationparameters/valueProcess.js</valueProcess>
</entityField>
<entityConsumer>
<name>Objects</name>
<dependency>
<name>dependency</name>
<entityName>ObjectProxy_entity</entityName>
<fieldName>FilteredObjects</fieldName>
</dependency>
<children>
<entityParameter>
<name>Entity_param</name>
<valueProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/objects/children/entity_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>Filter_param</name>
<valueProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/objects/children/filter_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityField>
<name>DROPDOWNFILTER</name>
<valueProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/entityfields/dropdownfilter/valueProcess.js</valueProcess>
</entityField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
<name>jDito</name>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<contentProcess>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
<onInsert>%aditoprj%/entity/AddAttributesToSelectionMulti_entity/recordcontainers/jdito/onInsert.js</onInsert>
<recordFieldMappings>
<jDitoRecordFieldMapping>
<name>UID.value</name>
</jDitoRecordFieldMapping>
</recordFieldMappings>
</jDitoRecordContainer>
</recordContainers>
</entity>
= AddAttributesToSelectionMulti_entity
this entity is for the MultiEdit in the small editview when the action "addAttributeToSelection" is run, e. g. in the Organisation_entity
\ No newline at end of file
import("system.vars");
import("system.result");
import("Attribute_lib");
result.string(AttributeUtil.getFullAttributeName(vars.get("$field.AB_ATTRIBUTE_ID"), false));
import("system.translate");
import("Attribute_lib");
import("system.result");
import("system.vars");
var attributeId = vars.get("$field.AB_ATTRIBUTE_ID");
if (AttributeUtil.getAttributeType(attributeId) == AttributeTypes.GROUP())
{
result.string(translate.text("Attribute groups can't be selected"));
}
\ No newline at end of file
import("system.vars");
import("system.neon");
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT ||
vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW)
{
neon.setFieldValue("$field.VALUE", "");
}
\ No newline at end of file
import("Sql_lib");
import("system.result");
var definition = newSelect("DROPDOWNDEFINITION")
.from("AB_ATTRIBUTE")
.where("AB_ATTRIBUTE.AB_ATTRIBUTEID", "$field.AB_ATTRIBUTE_ID")
.cell();
result.string(definition);
\ No newline at end of file
import("system.result");
import("Sql_lib");
result.string(newSelect("DROPDOWNFILTER")
.from("AB_ATTRIBUTE")
.where("AB_ATTRIBUTE.AB_ATTRIBUTEID", "$field.AB_ATTRIBUTE_ID")
.cell());
\ No newline at end of file
import("Attribute_lib");
import("system.vars");
import("system.result");
var attrType = AttributeTypes.get(AttributeUtil.getAttributeType(vars.get("$field.AB_ATTRIBUTE_ID")));
if (AttributeTypeUtil.useLookup(attrType))
{
result.string(vars.get("$field.DROPDOWNDEFINITION"));
}
else
{
result.string("");
}
\ No newline at end of file
import("system.vars");
import("system.result");
var filter = vars.get("$field.DROPDOWNFILTER");
if (filter)
{
filter = JSON.parse(filter);
result.string(JSON.stringify(filter.filter));
}
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$param.ContextId_param"));
\ No newline at end of file
import("system.result");
import("Sql_lib");
var validationparameters = newSelect("VALIDATIONPARAMETERS")
.from("AB_ATTRIBUTE")
.where("AB_ATTRIBUTE.AB_ATTRIBUTEID", "$field.AB_ATTRIBUTE_ID")
.cell();
result.string(validationparameters);
\ No newline at end of file
import("system.vars");
import("system.result");
import("Attribute_lib");
var attributeType = AttributeUtil.getAttributeType(vars.get("$field.AB_ATTRIBUTE_ID"));
result.string(AttributeTypeUtil.getContentType(attributeType));
\ No newline at end of file
import("system.translate");
import("system.result");
import("system.vars");
import("Attribute_lib");
var attrType = AttributeTypes.get(AttributeUtil.getAttributeType(vars.get("$field.AB_ATTRIBUTE_ID")));
var viewValue = AttributeTypeUtil.getAttributeViewValue(attrType, vars.get("$field.VALUE"), vars.get("$field.DROPDOWNDEFINITION"));
if (viewValue == null)
{
viewValue = translate.text("Object not found");
}
result.string(viewValue);
\ No newline at end of file
import("Context_lib");
import("system.translate");
import("system.db");
import("system.result");
import("system.vars");
import("Attribute_lib");
import("Sql_lib");
var attributeId = vars.get("$field.AB_ATTRIBUTE_ID");
var attrType = AttributeUtil.getAttributeType(vars.get("$field.AB_ATTRIBUTE_ID"));
var res = null;
if (!AttributeTypeUtil.useLookup(attrType))
{
res = AttributeUtil.getPossibleListValues(attributeId, attrType);
}
result.object(res);
\ No newline at end of file
import("system.vars");
import("system.result");
import("Attribute_lib");
var attributeType = AttributeUtil.getAttributeType(vars.get("$field.AB_ATTRIBUTE_ID"));
var contentType = AttributeTypeUtil.getContentType(attributeType);
result.string(!AttributeTypeUtil.useLookup(attributeType) && contentType != null && contentType != "BOOLEAN");
\ No newline at end of file
import("Util_lib");
import("system.result");
import("system.vars");
import("Attribute_lib");
var attributeType = AttributeTypes.get(AttributeUtil.getAttributeType(vars.get("$field.AB_ATTRIBUTE_ID")));
if (attributeType && !attributeType.useLookup)
{
var validationResult = attributeType.validateValue(vars.get("$local.value"), Utils.parseJSON(vars.get("$field.VALIDATIONPARAMETERS")));
if (validationResult && validationResult !== true)
{
result.string(validationResult);
}
}
\ No newline at end of file
import("system.neon");
import("system.vars");
import("system.result");
import("Attribute_lib");
var attributeType = AttributeUtil.getAttributeType(vars.get("$field.AB_ATTRIBUTE_ID"));
var fieldState;
if (AttributeTypeUtil.useLookup(attributeType) && vars.get("$sys.recordstate") != neon.OPERATINGSTATE_VIEW)
{
fieldState = neon.COMPONENTSTATE_INVISIBLE;
}
else if(AttributeTypeUtil.getContentType(attributeType) != null)
{
fieldState = neon.COMPONENTSTATE_EDITABLE;
}
else
{
fieldState = neon.COMPONENTSTATE_READONLY;
}
result.string(fieldState);
\ No newline at end of file
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