From dafd3d02da148c28b964b7904bf64fc6313843a0 Mon Sep 17 00:00:00 2001 From: "j.luginger" <j.luginger@JLuginger.aditosoftware.local> Date: Thu, 28 Feb 2019 15:36:06 +0100 Subject: [PATCH] [Projekt: Entwicklung - Neon][TicketNr.: 1035026][[Person]: Anrede und Titel] --- entity/Person_entity/Person_entity.aod | 12 +++++++++++- .../entityfields/language/onValueChange.js | 7 +++++++ .../entityfields/language/valueProcess.js | 5 ++++- .../salutation/displayValueProcess.js | 5 +++++ .../salutation/possibleItemsProcess.js | 0 .../children/language_param/code.js | 1 + .../children/language_param/code.js | 5 +++++ .../children/salutation_param/code.js | 8 ++++++++ .../entityfields/title/displayValueProcess.js | 5 +++++ entity/Salutation_entity/Salutation_entity.aod | 18 +++++++++++++++++- .../distinctsalutation_jdito/contentProcess.js | 6 +----- .../title_jdito/contentProcess.js | 15 +++++++++++++++ .../PersonFilter_view/PersonFilter_view.aod | 1 + 13 files changed, 80 insertions(+), 8 deletions(-) create mode 100644 entity/Person_entity/entityfields/salutation/displayValueProcess.js delete mode 100644 entity/Person_entity/entityfields/salutation/possibleItemsProcess.js create mode 100644 entity/Person_entity/entityfields/salutationtitles/children/language_param/code.js create mode 100644 entity/Person_entity/entityfields/salutationtitles/children/salutation_param/code.js create mode 100644 entity/Person_entity/entityfields/title/displayValueProcess.js create mode 100644 entity/Salutation_entity/recordcontainers/title_jdito/contentProcess.js diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index 49f121e1a5c..33a2f4dc7d5 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 03065f02fb7..e34861072b2 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 741d521c5f2..ebaf1bb63bc 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 00000000000..927bb4fb7ea --- /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 e69de29bb2d..00000000000 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 2cb0f4295d8..6c3df16a4ff 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 00000000000..c3083144b9f --- /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 00000000000..cada0795b3e --- /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 00000000000..7a4911a0e3d --- /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 ef6897d9082..1acb5474ce8 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 577b640acd6..e22730569ca 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 00000000000..f083f9a4454 --- /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 b465bc58f7e..5aaf1f8ecc2 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> -- GitLab