From 1f0ac3c9f00e26f85da92cc9667980856e020af5 Mon Sep 17 00:00:00 2001 From: "m.escher" <m.escher@mescher-nb.aditosoftware.local> Date: Tue, 4 Sep 2018 13:08:52 +0200 Subject: [PATCH] add default Caption for new Contacts --- .../entityfields/previewtitle/valueProcess.js | 18 ++++++++++++------ neonView/PersEdit_view/PersEdit_view.aod | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/entity/Pers_entity/entityfields/previewtitle/valueProcess.js b/entity/Pers_entity/entityfields/previewtitle/valueProcess.js index e245c7950b..25b8c0094c 100644 --- a/entity/Pers_entity/entityfields/previewtitle/valueProcess.js +++ b/entity/Pers_entity/entityfields/previewtitle/valueProcess.js @@ -1,9 +1,15 @@ import("system.vars"); import("system.result"); -result.string(vars.get("$field.SALUTATION") - + " " + vars.get("$field.TITLE") - + " " + vars.get("$field.FIRSTNAME") - + " " + vars.get("$field.MIDDLENAME") - + " " + vars.get("$field.LASTNAME") - + " " + vars.get("$field.TITLESUFFIX")); \ No newline at end of file +var salutation = vars.get("$field.SALUTATION"); +var title = vars.get("$field.TITLE"); +var firstname = vars.get("$field.FIRSTNAME"); +var middlename = vars.get("$field.MIDDLENAME"); +var lastname = vars.get("$field.LASTNAME"); +var titlesuffix = vars.get("$field.TITLESUFFIX"); +var resultString = [salutation, title, firstname, middlename, lastname, titlesuffix].filter(Boolean).join(" "); + +if(resultString) + result.string(resultString); +else + result.string("Neuer Kontakt"); diff --git a/neonView/PersEdit_view/PersEdit_view.aod b/neonView/PersEdit_view/PersEdit_view.aod index 6d1e277a95..95b00ae973 100644 --- a/neonView/PersEdit_view/PersEdit_view.aod +++ b/neonView/PersEdit_view/PersEdit_view.aod @@ -1,7 +1,7 @@ <?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.0.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.0.0"> <name>PersEdit_view</name> - <title>Kontakte</title> + <title>Kontakt</title> <majorModelMode>DISTRIBUTED</majorModelMode> <quickAdd v="true" /> <layout> -- GitLab