Skip to content
Snippets Groups Projects
Commit 71c226c1 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1035771][Kontaktmanagement - Firma /...

[Projekt: Entwicklung - Neon][TicketNr.: 1035771][Kontaktmanagement - Firma / Kontaktperson + Adressen / Kommunikation - Nutzung des kompletten Moduls sicherstellen]
added "new contact action"
parent 4afe97cf
No related branches found
No related tags found
No related merge requests found
Showing
with 265 additions and 0 deletions
...@@ -79,6 +79,12 @@ ...@@ -79,6 +79,12 @@
<fieldName>Addresses</fieldName> <fieldName>Addresses</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency>
<name>f6e4be75-2810-4c39-86c7-710f1b72b172</name>
<entityName>Contact_entity</entityName>
<fieldName>Addresses</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies> </dependencies>
<children> <children>
<entityParameter> <entityParameter>
......
<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.0">
<name>Contact_entity</name>
<title>Contact</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/entity/Contact_entity/documentation.adoc</documentation>
<icon>VAADIN:USERS</icon>
<recordContainer>db</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityField>
<name>CONTACTID</name>
</entityField>
<entityField>
<name>ORGANISATION_ID</name>
<title>Organisation</title>
<consumer>Organisations</consumer>
<mandatory v="true" />
</entityField>
<entityField>
<name>PERSON_ID</name>
<title>Contact</title>
<mandatory v="true" />
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/Contact_entity/entityfields/person_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Contact_entity/entityfields/person_id/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>DEPARTMENT</name>
<title>Deparment</title>
</entityField>
<entityField>
<name>POSITION</name>
<title>Position</title>
</entityField>
<entityField>
<name>CONTACTROLE</name>
<title>Contactrole</title>
</entityField>
<entityConsumer>
<name>Organisations</name>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Organisation_entity</entityName>
<fieldName>#PROVIDER</fieldName>
</dependency>
</entityConsumer>
<entityParameter>
<name>PersonId_param</name>
<expose v="true" />
<description>PARAMETER</description>
</entityParameter>
<entityProvider>
<name>PersonRelated</name>
<fieldType>DEPENDENCY_IN</fieldType>
</entityProvider>
<entityField>
<name>ADDRESS_ID</name>
<title>standard address</title>
<consumer>Addresses</consumer>
</entityField>
<entityConsumer>
<name>Addresses</name>
<fieldType>DEPENDENCY_OUT</fieldType>
<dependency>
<name>dependency</name>
<entityName>Address_entity</entityName>
<fieldName>OrganisationAddresses</fieldName>
</dependency>
<children>
<entityParameter>
<name>ContactId_param</name>
<valueProcess>%aditoprj%/entity/Contact_entity/entityfields/addresses/children/contactid_param/valueProcess.js</valueProcess>
<triggerRecalculation v="true" />
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<dbRecordContainer>
<name>db</name>
<alias>Data_alias</alias>
<linkInformation>
<linkInformation>
<name>d2a29013-e270-4ce1-8f2d-b372206f0aa3</name>
<tableName>CONTACT</tableName>
<primaryKey>CONTACTID</primaryKey>
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
</linkInformation>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>CONTACTID.value</name>
<recordfield>CONTACT.CONTACTID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ORGANISATION_ID.value</name>
<recordfield>CONTACT.ORGANISATION_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>PERSON_ID.value</name>
<recordfield>CONTACT.PERSON_ID</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DEPARTMENT.value</name>
<recordfield>CONTACT.DEPARTMENT</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>POSITION.value</name>
<recordfield>CONTACT.POSTITION</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>CONTACTROLE.value</name>
<recordfield>CONTACT.CONTACTROLE</recordfield>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>ADDRESS_ID.value</name>
<recordfield>CONTACT.ADDRESS_ID</recordfield>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
</entity>
Represents a Contact without detail information to Organisations/Persons
\ No newline at end of file
import("system.logging");
import("system.result");
import("system.db");
import("system.vars");
import("Sql_lib");
var orgId = vars.get("$field.ORGANISATION_ID");
if (orgId)
{
var orgContactId = db.cell(SqlCondition.begin()
.andPrepare("CONTACT.ORGANISATION_ID", orgId)
.and("CONTACT.PERSON_ID is null")
.buildSql("select CONTACT.CONTACTID from CONTACT"));
result.string(orgContactId);
}
\ No newline at end of file
import("system.result");
import("system.vars");
import("Contact_lib");
var persId = vars.get("$field.PERSON_ID");
var res = "";
if (persId)
res = ContactUtils.getTitleByPersonId(persId);
result.string(res);
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
var presetValue = vars.get("$param.PersonId_param");
if (presetValue && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value"))
result.string(presetValue);
\ No newline at end of file
...@@ -259,6 +259,12 @@ ...@@ -259,6 +259,12 @@
<fieldName>Organisations</fieldName> <fieldName>Organisations</fieldName>
<isConsumer v="false" /> <isConsumer v="false" />
</entityDependency> </entityDependency>
<entityDependency>
<name>08439676-9146-427b-9bc6-8d6c6c7548d7</name>
<entityName>Contact_entity</entityName>
<fieldName>Organisations</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies> </dependencies>
</entityProvider> </entityProvider>
<entityConsumer> <entityConsumer>
......
...@@ -694,6 +694,13 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact ...@@ -694,6 +694,13 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
</entityParameter> </entityParameter>
</children> </children>
</entityConsumer> </entityConsumer>
<entityActionField>
<name>newContact</name>
<fieldType>ACTION</fieldType>
<title>new contact</title>
<onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newcontact/onActionProcess.js</onActionProcess>
<iconId>VAADIN:USERS</iconId>
</entityActionField>
</entityFields> </entityFields>
<recordContainers> <recordContainers>
<dbRecordContainer> <dbRecordContainer>
......
import("system.vars");
import("system.neon");
neon.openContext("Contact", null, null, neon.OPERATINGSTATE_NEW, {PersonId_param: vars.get("$field.PERSON_ID")});
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0">
<name>Contact</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<editview>ContactEdit_view</editview>
<entity>Contact_entity</entity>
<references>
<neonViewReference>
<name>c96479fe-4f9c-433d-9de3-c2e1bbb5aac7</name>
<view>ContactEdit_view</view>
</neonViewReference>
</references>
</neonContext>
<?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.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.0">
<name>ContactEdit_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<genericViewTemplate>
<name>data</name>
<editMode v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>b43e201f-b6be-43d7-af03-5cc7defe1a1e</name>
<entityField>PERSON_ID</entityField>
</entityFieldLink>
<entityFieldLink>
<name>40d2367e-c197-424c-8442-9b04c7369e3a</name>
<entityField>ORGANISATION_ID</entityField>
</entityFieldLink>
<entityFieldLink>
<name>e6db316a-cc0b-47b7-9773-1ae72a57ff14</name>
<entityField>ADDRESS_ID</entityField>
</entityFieldLink>
<entityFieldLink>
<name>74e712fb-595f-4f96-9ecb-bd6a99948dce</name>
<entityField>CONTACTROLE</entityField>
</entityFieldLink>
<entityFieldLink>
<name>847e9231-d6df-4ead-903d-b70dbcd69333</name>
<entityField>DEPARTMENT</entityField>
</entityFieldLink>
<entityFieldLink>
<name>e7c57e62-ff21-4ccd-8458-55d2fcca7b97</name>
<entityField>POSITION</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
</children>
</neonView>
...@@ -213,6 +213,32 @@ ContactUtils.getFullTitleByContactId = function(pContactId) ...@@ -213,6 +213,32 @@ ContactUtils.getFullTitleByContactId = function(pContactId)
return ""; return "";
} }
/**
* get the name of the person
*
* @param {String} pPersonId the id of the person where the data shall be loaded
*
* @return {String} the name or ""
*/
ContactUtils.getTitleByPersonId = function(pPersonId)
{
if (pPersonId)
{
var data = db.array(db.ROW, SqlCondition.begin()
.andPrepare("PERSON.PERSONID", pPersonId)
.buildSql("select PERSON.SALUTATION, PERSON.TITLE, PERSON.FIRSTNAME, PERSON.MIDDLENAME, PERSON.LASTNAME "
+ "from PERSON", "1 = 2"));
if (data.length == 0)
return "";
var contact = new Contact();
[contact.salutation, contact.title, contact.firstname, contact.middlename, contact.lastname] = data;
var renderer = new ContactTitleRenderer(contact);
return renderer.asString();
}
return "";
}
/** /**
* returns the from string for the contact joined with org, person, address * returns the from string for the contact joined with org, person, address
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment