diff --git a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js index 8f77a056440c8c7647f7085b0140873cc3f145c6..ad79e4da1a4442679263baee900df37040397eac 100644 --- a/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Appointment_entity/recordcontainers/jdito/contentProcess.js @@ -9,8 +9,6 @@ import("system.datetime"); import("system.eMath"); import("system.util"); import("system.neon"); -import("system.entities") - var cond = SqlCondition.begin(); var appointmentUids; diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index bc2cdf9d11cd5e39cddb87dadc7b1007f7727a15..8a2491b00ccd367162cc0236d829a0ca3a39e6e9 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -39,6 +39,7 @@ <title>Language</title> <consumer>Languages</consumer> <selectionMode>SINGLE</selectionMode> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/language/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/Organisation_entity/entityfields/language/displayValueProcess.js</displayValueProcess> </entityField> <entityField> diff --git a/entity/Organisation_entity/entityfields/language/displayValueProcess.js b/entity/Organisation_entity/entityfields/language/displayValueProcess.js index c90f80c5a0134c388f357d51b11eef1095b6eb47..fbcdba886ae05f415758c8c9bb4eb8c57600d541 100644 --- a/entity/Organisation_entity/entityfields/language/displayValueProcess.js +++ b/entity/Organisation_entity/entityfields/language/displayValueProcess.js @@ -1,17 +1,5 @@ -import("system.result"); import("system.vars"); -import("system.entities"); +import("system.result"); +import("Context_lib"); -if (vars.get("$field.LANGUAGE")) -{ - var conf = entities.createConfigForLoadingRows() - conf.entity("Language_entity") - .uid(vars.get("$field.LANGUAGE")) - .fields(["NAME_LATIN"]) - - result.string(entities.getRow(conf).NAME_LATIN) -} -else -{ - result.string("") -} \ No newline at end of file +result.string(ContextUtils.loadContentTitle("Language_entity", vars.get("$field.LANGUAGE"))); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/language/valueProcess.js b/entity/Organisation_entity/entityfields/language/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..2bb039c219ee635fbd789a66704d4f5dd483dbfb --- /dev/null +++ b/entity/Organisation_entity/entityfields/language/valueProcess.js @@ -0,0 +1,6 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.getString("$this.value") == null) + result.string("deu"); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/language/displayValueProcess.js b/entity/Person_entity/entityfields/language/displayValueProcess.js index dae44e029af40ecdf3c360a4e80a24d6a5f74540..fbcdba886ae05f415758c8c9bb4eb8c57600d541 100644 --- a/entity/Person_entity/entityfields/language/displayValueProcess.js +++ b/entity/Person_entity/entityfields/language/displayValueProcess.js @@ -1,10 +1,5 @@ -import("system.result"); import("system.vars"); -import("Keyword_lib"); +import("system.result"); +import("Context_lib"); -var key = vars.get("$field.LANGUAGE"); -if (key) -{ - var res = LanguageKeywordUtils.getViewValue(key); - result.string(res); -} +result.string(ContextUtils.loadContentTitle("Language_entity", vars.get("$field.LANGUAGE"))); \ 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 8be4c28401d63e681cbff0a6929e7d472ebf9042..2bb039c219ee635fbd789a66704d4f5dd483dbfb 100644 --- a/entity/Person_entity/entityfields/language/valueProcess.js +++ b/entity/Person_entity/entityfields/language/valueProcess.js @@ -1,7 +1,6 @@ +import("system.result"); import("system.neon"); import("system.vars"); -import("system.db"); -import("system.result"); if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.getString("$this.value") == null) result.string("deu"); \ No newline at end of file diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js index aa417543da872a6c3d85b72ee1d9c57b8dd4ddad..f2d989230a88aba460367753c6eb8aca6492a32b 100644 --- a/process/Context_lib/process.js +++ b/process/Context_lib/process.js @@ -1,3 +1,5 @@ +import("system.logging"); +import("system.entities"); import("system.tools"); import("system.neon"); import("system.db"); @@ -85,6 +87,33 @@ ContextUtils.getContextConsumer = function(pContextId) } } +/** + * loads the contenttitle by using entities.getRow + * @param {String} pEntity The entity name you want to load the title for + * @param {String} pUid the uid for which to load the title + * + * @return the #CONTENTTITLE or "" + */ +ContextUtils.loadContentTitle = function(pEntity, pUid) +{ + if (!pUid) + { + return ""; + } + + var conf = entities.createConfigForLoadingRows() + .entity(pEntity) + .uid(pUid) + .fields(["#CONTENTTITLE"]); + + if (entities.getRowCount(conf) > 0) + { + return entities.getRow(conf)["#CONTENTTITLE"]; + } + + return ""; +} + /** * * @param {Boolean} [pFilter=false] filter only for contexts which have a mapping in ContextUtils.getSelectMap