diff --git a/entity/Activity_entity/entityfields/responsible/valueProcess.js b/entity/Activity_entity/entityfields/responsible/valueProcess.js index a95c59aa0b3b800aa722f4da67d502dd69d18ae9..fc2ffa0007b4a023a449394d06f5fb002edd00a7 100644 --- a/entity/Activity_entity/entityfields/responsible/valueProcess.js +++ b/entity/Activity_entity/entityfields/responsible/valueProcess.js @@ -3,5 +3,5 @@ import("system.vars"); import("system.result"); import("Employee_lib"); -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) result.string(EmployeeUtils.getCurrentContactId()); \ No newline at end of file diff --git a/entity/Attribute_entity/Attribute_entity.aod b/entity/Attribute_entity/Attribute_entity.aod index cc99164ec880429153f2d3fda1eaf2140fb7c9c6..e016d3d0870069ccef713ba523c35f38bea1d17e 100644 --- a/entity/Attribute_entity/Attribute_entity.aod +++ b/entity/Attribute_entity/Attribute_entity.aod @@ -355,6 +355,7 @@ <name>DROPDOWNFILTER</name> <title>Filter</title> <contentType>FILTER_TREE</contentType> + <valueProcess>%aditoprj%/entity/Attribute_entity/entityfields/dropdownfilter/valueProcess.js</valueProcess> </entityField> <entityParameter> <name>AttributeTypes_param</name> diff --git a/entity/Attribute_entity/entityfields/dropdownfilter/valueProcess.js b/entity/Attribute_entity/entityfields/dropdownfilter/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..83bdb17d2622ba877e06fa3ecca9d7d80cd57dc1 --- /dev/null +++ b/entity/Attribute_entity/entityfields/dropdownfilter/valueProcess.js @@ -0,0 +1,14 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); +import("Attribute_lib"); + +var thisValueNotValid = "{\"entity\":\"\",\"filter\":{\"type\":\"group\",\"operator\":\"AND\",\"childs\":[]}}"; + +if (vars.get("$field.DROPDOWNDEFINITION") == $AttributeTypes.OBJECTSELECTION + && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && (vars.get("$this.value") == null || vars.get("$this.value") == thisValueNotValid)) +{ + var entity = vars.getString("$field.DROPDOWNDEFINITION"); + var condJson = JSON.stringify({entity: entity, filter: {type: "group", operator: "AND", childs: []}}); + result.string(condJson); +} \ No newline at end of file diff --git a/entity/Language_entity/Language_entity.aod b/entity/Language_entity/Language_entity.aod index b9b83b6e231e6c962d6fdc28f601b7f52a442715..f009d4b2ed37bf0377d5028aca60d0620a2cb589 100644 --- a/entity/Language_entity/Language_entity.aod +++ b/entity/Language_entity/Language_entity.aod @@ -2,6 +2,7 @@ <entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.11" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.11"> <name>Language_entity</name> <majorModelMode>DISTRIBUTED</majorModelMode> + <title>Language</title> <contentTitleProcess>%aditoprj%/entity/Language_entity/contentTitleProcess.js</contentTitleProcess> <recordContainer>db</recordContainer> <entityFields> diff --git a/entity/Person_entity/entityfields/appointmentsnextweek/valueProcess.js b/entity/Person_entity/entityfields/appointmentsnextweek/valueProcess.js index 224a4f60165fa7e05157eee1e9085b721955cf32..ba33991456031e9bce5872e2629407dfeda9770b 100644 --- a/entity/Person_entity/entityfields/appointmentsnextweek/valueProcess.js +++ b/entity/Person_entity/entityfields/appointmentsnextweek/valueProcess.js @@ -1,8 +1,8 @@ -import("system.result"); -import("system.entities"); - -var loadConfig = entities.createConfigForLoadingConsumerRows() - .consumer("Appointments"); -var rowCount = entities.getRowCount(loadConfig); -result.string(rowCount); - +//import("system.result"); +//import("system.entities"); +// +//var loadConfig = entities.createConfigForLoadingConsumerRows() +// .consumer("Appointments"); +//var rowCount = entities.getRowCount(loadConfig); +//result.string(rowCount); +// diff --git a/neonContext/Attribute/Attribute.aod b/neonContext/Attribute/Attribute.aod index b5df2588451587bfb01da4465a6211ce5bdd4988..41c89314536548dde56af8bad6207bdf8b893c5b 100644 --- a/neonContext/Attribute/Attribute.aod +++ b/neonContext/Attribute/Attribute.aod @@ -7,6 +7,7 @@ <filterview>AttributeFilter_view</filterview> <editview>AttributeEdit_view</editview> <preview>AttributePreview_view</preview> + <lookupview>AttributeLookup_view</lookupview> <entity>Attribute_entity</entity> <references> <neonViewReference> @@ -25,5 +26,9 @@ <name>6ab8d733-544c-4e48-ade9-b5210a5e5355</name> <view>AttributeTree_view</view> </neonViewReference> + <neonViewReference> + <name>a380915a-6946-4923-9b13-7a981606ce60</name> + <view>AttributeLookup_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonView/AttributeEdit_view/AttributeEdit_view.aod b/neonView/AttributeEdit_view/AttributeEdit_view.aod index 9d807129bbbf0feb38f702de894a2e51565901a8..c037a3098ad126f0c0250fff6e8931999f205a47 100644 --- a/neonView/AttributeEdit_view/AttributeEdit_view.aod +++ b/neonView/AttributeEdit_view/AttributeEdit_view.aod @@ -38,6 +38,10 @@ <name>c8a5f45e-8092-45f4-ac22-681700447235</name> <entityField>ATTRIBUTE_LEVEL</entityField> </entityFieldLink> + <entityFieldLink> + <name>7f7616c5-d633-4ffd-b05e-51f9fed982c2</name> + <entityField>DROPDOWNFILTER</entityField> + </entityFieldLink> </fields> </genericViewTemplate> <neonViewReference> @@ -45,11 +49,5 @@ <entityField>AttributeUsages</entityField> <view>AttributeUsageMultiEdit_view</view> </neonViewReference> - <filterTreeViewTemplate> - <name>FilterTree</name> - <entityNameField>DROPDOWNDEFINITION</entityNameField> - <filterField>DROPDOWNFILTER</filterField> - <entityField>#ENTITY</entityField> - </filterTreeViewTemplate> </children> </neonView> diff --git a/neonView/AttributeLookup_view/AttributeLookup_view.aod b/neonView/AttributeLookup_view/AttributeLookup_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..95ca44e075940a7a14bab32b3a270774707c59f5 --- /dev/null +++ b/neonView/AttributeLookup_view/AttributeLookup_view.aod @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.2"> + <name>AttributeLookup_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <tableViewTemplate> + <name>Table</name> + <entityField>#ENTITY</entityField> + <columns> + <neonTableColumn> + <name>9a69a2af-3186-4180-a665-016c30f1fbdc</name> + <entityField>FULL_ATTRIBUTE_NAME</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> +</neonView> diff --git a/neonView/PersonPreview_view/PersonPreview_view.aod b/neonView/PersonPreview_view/PersonPreview_view.aod index 2fd441219ae3b310898be33f9168c6ac9c5213ef..776d85c31bf065509ce01627a7e5fe2f2fd51015 100644 --- a/neonView/PersonPreview_view/PersonPreview_view.aod +++ b/neonView/PersonPreview_view/PersonPreview_view.aod @@ -79,10 +79,6 @@ <name>929d76b2-4f91-4a02-9b2e-b3f42b49294a</name> <entityField>OpenTasks</entityField> </entityFieldLink> - <entityFieldLink> - <name>4ca4ea6e-ef39-4040-a515-757f7049df48</name> - <entityField>AppointmentsNextWeek</entityField> - </entityFieldLink> </fields> </scoreCardViewTemplate> </children> diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js index 0a3b7af1fccdeaca0ea0a10463317ac6c9ce7b80..a2a93c3da05cdb4a4aaef1e10c164f51e0f1ffc8 100644 --- a/process/Attribute_lib/process.js +++ b/process/Attribute_lib/process.js @@ -1,3 +1,4 @@ +import("system.logging"); import("KeywordData_lib"); import("Context_lib"); import("system.util"); @@ -141,8 +142,8 @@ AttributeUtil.getPossibleListValues = function (pAttributeId, pAttributeType, pI var config = entities.createConfigForLoadingRows() .entity(module) .fields([uid, title]); - if (filter) - config.filter(filter); + if (filter && filter.filter) + config.filter(filter.filter); var rows = entities.getRows(config); for (let i = 0, l = rows.length; i < l; i++) objects.push([rows[i][uid], rows[i][title]]) @@ -774,16 +775,40 @@ $AttributeTypes.OBJECTSELECTION = { getDropDownDefinitions : function () { var dropDownList = []; - //TODO filter entities project.getDataModels(project.DATAMODEL_KIND_ENTITY).forEach( function (entity) { - if (entity[1]) + if (entity[1] && this._selectableEntities[entity[0]]) dropDownList.push([entity[0], translate.text(entity[1])]); } ); return dropDownList; - } + }, + /** @private */ + _selectableEntities : { + "ObjectRelationType_entity" : true, + "DocumentTemplate_entity" : true, + "SupportTicket_entity" : true, + "Organisation_entity" : true, + "Salesproject_entity" : true, + "Productprice_entity" : true, + "SerialLetter_entity" : true, + "AnyContact_entity" : true, + "Salutation_entity" : true, + "Attribute_entity" : true, + "Activity_entity" : true, + "Contract_entity" : true, + "Campaign_entity" : true, + "BulkMail_entity" : true, + "Employee_entity" : true, + "Language_entity" : true, + "Product_entity" : true, + "Person_entity" : true, + "Offer_entity" : true, + "Order_entity" : true, + "Task_entity" : true, + "Role_entity" : true + } }; $AttributeTypes.THEME = { toString : function () {return "THEME";},