diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 49f121e1a5c32f3a0b06a4ac0d950cf8e2d8f2ed..33a2f4dc7d5b3ad349cc08bdbcd825c91a150092 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -49,12 +49,13 @@ <name>SALUTATION</name> <title>Salutation</title> <consumer>Salutations</consumer> - <possibleItemsProcess>%aditoprj%/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js</possibleItemsProcess> + <displayValueProcess>%aditoprj%/entity/Person_entity/entityfields/salutation/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>TITLE</name> <title>Title</title> <consumer>SalutationTitles</consumer> + <displayValueProcess>%aditoprj%/entity/Person_entity/entityfields/title/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>TITLESUFFIX</name> @@ -551,6 +552,7 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <entityParameter> <name>Language_param</name> <code>%aditoprj%/entity/Person_entity/entityfields/salutations/children/language_param/code.js</code> + <triggerRecalculation v="true" /> </entityParameter> <entityParameter> <name>uIdDefinition_param</name> @@ -594,6 +596,14 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact <name>uIdDefinition_param</name> <code>%aditoprj%/entity/Person_entity/entityfields/salutationtitles/children/uiddefinition_param/code.js</code> </entityParameter> + <entityParameter> + <name>Salutation_param</name> + <code>%aditoprj%/entity/Person_entity/entityfields/salutationtitles/children/salutation_param/code.js</code> + </entityParameter> + <entityParameter> + <name>Language_param</name> + <code>%aditoprj%/entity/Person_entity/entityfields/salutationtitles/children/language_param/code.js</code> + </entityParameter> </children> </entityConsumer> </entityFields> diff --git a/entity/Person_entity/entityfields/language/onValueChange.js b/entity/Person_entity/entityfields/language/onValueChange.js index 03065f02fb7b396fe16137da6fbcdbf881996b54..e34861072b2bcb283233fbb07671e3c6efbb5633 100644 --- a/entity/Person_entity/entityfields/language/onValueChange.js +++ b/entity/Person_entity/entityfields/language/onValueChange.js @@ -1,3 +1,10 @@ +import("system.db"); +import("system.vars"); import("system.neon"); +var language = vars.get("$field.LANGUAGE"); +var salutation = vars.get("$field.SALUTATION") +var salLanguage = db.cell("select LANGUAGE from SALUTATION where SALUTATION = '" + salutation + "'") + +if((vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) && salLanguage != language) neon.setFieldValue("$field.SALUTATION", ""); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/language/valueProcess.js b/entity/Person_entity/entityfields/language/valueProcess.js index 741d521c5f2dd49c3239a4d53642517107f50241..ebaf1bb63bcccaaac9729d5fe437bdb43d360b97 100644 --- a/entity/Person_entity/entityfields/language/valueProcess.js +++ b/entity/Person_entity/entityfields/language/valueProcess.js @@ -1,7 +1,10 @@ +import("system.logging"); import("system.neon"); import("system.vars"); import("system.db"); import("system.result"); -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + +logging.log("kljkk " + vars.get("$field.SALUTATION")) +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$field.LANGUAGE") == "") result.string("deu"); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/salutation/displayValueProcess.js b/entity/Person_entity/entityfields/salutation/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..927bb4fb7ea161586866850e85e971e74c11b746 --- /dev/null +++ b/entity/Person_entity/entityfields/salutation/displayValueProcess.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.db"); +import("system.result"); + +result.string(db.cell("select SALUTATION from PERSON where PERSONID = '" + vars.get("$field.PERSONID") + "'")); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js b/entity/Person_entity/entityfields/salutation/possibleItemsProcess.js deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/entity/Person_entity/entityfields/salutations/children/language_param/code.js b/entity/Person_entity/entityfields/salutations/children/language_param/code.js index 2cb0f4295d8276abc980683fdc3945bcfd965aee..6c3df16a4ffb295fe537c8755c9ccca6bd228637 100644 --- a/entity/Person_entity/entityfields/salutations/children/language_param/code.js +++ b/entity/Person_entity/entityfields/salutations/children/language_param/code.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.vars"); import("system.result"); diff --git a/entity/Person_entity/entityfields/salutationtitles/children/language_param/code.js b/entity/Person_entity/entityfields/salutationtitles/children/language_param/code.js new file mode 100644 index 0000000000000000000000000000000000000000..c3083144b9f1a385d088606337e6e80af6f27ed3 --- /dev/null +++ b/entity/Person_entity/entityfields/salutationtitles/children/language_param/code.js @@ -0,0 +1,5 @@ +import("system.logging"); +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.LANGUAGE")) \ No newline at end of file diff --git a/entity/Person_entity/entityfields/salutationtitles/children/salutation_param/code.js b/entity/Person_entity/entityfields/salutationtitles/children/salutation_param/code.js new file mode 100644 index 0000000000000000000000000000000000000000..cada0795b3ef47e81ab39d537c57c8a8bdbdbe5a --- /dev/null +++ b/entity/Person_entity/entityfields/salutationtitles/children/salutation_param/code.js @@ -0,0 +1,8 @@ +import("system.vars"); +import("system.result"); +import("system.logging") + +logging.log("dsfksdjnfksj" + vars.get("$field.ORGANISATION_ID")); +logging.log("ff" + vars.get("$field.SALUTATION")); + +result.string(vars.get("$field.SALUTATION")); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/title/displayValueProcess.js b/entity/Person_entity/entityfields/title/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7a4911a0e3d7f70a8406c0d6e1cf1473b9de1705 --- /dev/null +++ b/entity/Person_entity/entityfields/title/displayValueProcess.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.db"); +import("system.result"); + +result.string(db.cell("select TITLE from PERSON where PERSONID = '" + vars.get("$field.PERSONID") + "'")); \ No newline at end of file diff --git a/entity/Salutation_entity/Salutation_entity.aod b/entity/Salutation_entity/Salutation_entity.aod index ef6897d9082bf85f284b8984d7031ac2f08a2bcd..1acb5474ce888a162e419c1937d3b0bf35c3f0df 100644 --- a/entity/Salutation_entity/Salutation_entity.aod +++ b/entity/Salutation_entity/Salutation_entity.aod @@ -4,7 +4,7 @@ <title>Anrede</title> <majorModelMode>DISTRIBUTED</majorModelMode> <titleProcess>%aditoprj%/entity/Salutation_entity/titleProcess.js</titleProcess> - <recordContainer>db</recordContainer> + <recordContainer>distinctSalutation_jdito</recordContainer> <entityFields> <entityProvider> <name>#PROVIDER</name> @@ -86,6 +86,7 @@ <entityParameter> <name>Language_param</name> <expose v="true" /> + <triggerRecalculation v="true" /> </entityParameter> </children> </entityProvider> @@ -108,6 +109,7 @@ <name>Language_param</name> <expose v="true" /> <triggerRecalculation v="true" /> + <mandatory v="false" /> <description>PARAMETER</description> </entityParameter> <entityField> @@ -122,6 +124,13 @@ <mandatory v="false" /> <description>PARAMETER</description> </entityParameter> + <entityParameter> + <name>Salutation_param</name> + <expose v="true" /> + <triggerRecalculation v="true" /> + <mandatory v="false" /> + <description>PARAMETER</description> + </entityParameter> </entityFields> <recordContainers> <dbRecordContainer> @@ -192,7 +201,14 @@ </jDitoRecordContainer> <jDitoRecordContainer> <name>title_jdito</name> + <title>55</title> <jDitoRecordAlias>Data_alias</jDitoRecordAlias> + <contentProcess>%aditoprj%/entity/Salutation_entity/recordcontainers/title_jdito/contentProcess.js</contentProcess> + <isPageable v="false" /> + <recordFields> + <element>UID.value</element> + <element>UID.displayValue</element> + </recordFields> </jDitoRecordContainer> </recordContainers> </entity> diff --git a/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js b/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js index 577b640acd616a8638c4d811aaf2bad0508fdf5b..e22730569cac6fc4d8637c49407c1c9ff759f265 100644 --- a/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js +++ b/entity/Salutation_entity/recordcontainers/distinctsalutation_jdito/contentProcess.js @@ -1,18 +1,14 @@ -import("system.logging"); import("system.vars"); import("system.result"); import("system.db"); import("Sql_lib"); -logging.log("kkkdjdkdjdf") var cond = SqlCondition.begin() .and("SALUTATION is not NULL") + .andPrepareVars("SALUTATION.LANGUAGE", "$param.Language_param") .buildSql("select distinct SALUTATION, SALUTATION from SALUTATION", "1=2"); var salutation = db.table(cond); -logging.log(salutation) -logging.log(cond) - result.object(salutation); \ No newline at end of file diff --git a/entity/Salutation_entity/recordcontainers/title_jdito/contentProcess.js b/entity/Salutation_entity/recordcontainers/title_jdito/contentProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f083f9a4454248daef2ceb4a6d0bb9de986b8e77 --- /dev/null +++ b/entity/Salutation_entity/recordcontainers/title_jdito/contentProcess.js @@ -0,0 +1,15 @@ +import("system.vars"); +import("system.result"); +import("system.db"); +import("Sql_lib"); + + + +var cond = SqlCondition.begin() + .and("TITLE is not NULL") + .andPrepareVars("SALUTATION.SALUTATION", "$param.Salutation_param") + .buildSql("select TITLE, TITLE from SALUTATION", "1=2"); + +var salutation = db.table(cond); + +result.object(salutation); \ No newline at end of file diff --git a/neonView/PersonFilter_view/PersonFilter_view.aod b/neonView/PersonFilter_view/PersonFilter_view.aod index b465bc58f7ee67e677f524661e986bb58962d30f..5aaf1f8ecc20c5a5b5ddd0b60e60ca0bf219b6ae 100644 --- a/neonView/PersonFilter_view/PersonFilter_view.aod +++ b/neonView/PersonFilter_view/PersonFilter_view.aod @@ -42,6 +42,7 @@ <neonTableColumn> <name>125d04cc-5c7a-4c38-bd0f-b5d02d21067d</name> <entityField>SALUTATION</entityField> + <collapse v="false" /> </neonTableColumn> <neonTableColumn> <name>2cdfaf73-d3ee-4ad8-83ea-f50acba0335a</name>