Skip to content
Snippets Groups Projects
Commit bae069b4 authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon: Committed by Johannes Goderbauer
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1052660][Übernahme der "Besuch vor...

[Projekt: Entwicklung - Neon][TicketNr.: 1052660][Übernahme der "Besuch vor Ort"-Implentierung aus dem Vorwerk system]
parent 3e0f8c52
No related branches found
No related tags found
No related merge requests found
Showing
with 175 additions and 114 deletions
......@@ -19,6 +19,7 @@
<column name="BEGIN_TIME" type="TIME"/>
<column name="END_TIME" type="TIME"/>
<column name="ORGANISATION_ID" type="CHAR(36)"/>
<column name="CONTACT_ID" type="CHAR(36)"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" type="CHAR(36)"/>
<column name="STATUS" type="CHAR(36)"/>
<column name="VISITRECOMMENDATION_ID" type="CHAR(36)"/>
......
......@@ -8,19 +8,5 @@
<column name="ATTRIBUTE_NAME" value="Visit Planning"/>
<column name="ATTRIBUTE_TYPE" value="VOID "/>
</insert>
<insert tableName="AB_ATTRIBUTE">
<column name="AB_ATTRIBUTEID" value="7d78320a-31c6-4c24-992a-a583f47caeb5"/>
<column name="ATTRIBUTE_ACTIVE" valueNumeric="1"/>
<column name="ATTRIBUTE_NAME" value="Point of Contact"/>
<column name="ATTRIBUTE_PARENT_ID" value="59377864-0745-4a18-8d7b-57a0491a8116"/>
<column name="ATTRIBUTE_TYPE" value="BOOLEAN "/>
</insert>
<insert tableName="AB_ATTRIBUTEUSAGE">
<column name="AB_ATTRIBUTEUSAGEID" value="24df9727-85ef-4344-a33d-7ac30218b481"/>
<column name="AB_ATTRIBUTE_ID" value="7d78320a-31c6-4c24-992a-a583f47caeb5"/>
<column name="MAX_COUNT" valueNumeric="1"/>
<column name="OBJECT_TYPE" value="Person"/>
</insert>
</changeSet>
</databaseChangeLog>
......@@ -16,6 +16,7 @@
<column name="BEGIN_TIME" value="10:00"/>
<column name="END_TIME" value="11:00"/>
<column name="ORGANISATION_ID" value="fc465f2f-803b-4a1f-b79d-7b466d7ecff4"/>
<column name ="CONTACT_ID" value="6c612f91-0160-4f09-9103-dccee7f7a6b7"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/>
<column name="STATUS" value="VISITSTATUSPLANNED "/>
</insert>
......@@ -25,6 +26,7 @@
<column name="BEGIN_TIME" value="14:00"/>
<column name="END_TIME" value="17:00"/>
<column name="ORGANISATION_ID" value="dec94545-2487-46d5-978d-26ee0fcf0f5f"/>
<column name ="CONTACT_ID" value="45635aca-7971-43df-a683-c80c86cb58cc"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/>
<column name="STATUS" value="VISITSTATUSPLANNED "/>
</insert>
......@@ -33,7 +35,8 @@
<column name="ENTRYDATE" valueDate="2020-05-19"/>
<column name="BEGIN_TIME" value="10:00"/>
<column name="END_TIME" value="11:00"/>
<column name="ORGANISATION_ID" value="e83c45e0-c30b-436e-b445-00a8b58383b0"/>
<column name="ORGANISATION_ID" value="b219b58a-f120-42d8-9a64-0b176501eac7"/>
<column name ="CONTACT_ID" value="ef345d11-a40d-59e0-a24c-afcb6095d2cb"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/>
<column name="STATUS" value="VISITSTATUSPLANNED "/>
</insert>
......@@ -43,6 +46,7 @@
<column name="BEGIN_TIME" value="10:00"/>
<column name="END_TIME" value="11:00"/>
<column name="ORGANISATION_ID" value="8707accf-b1fd-4bde-97b1-ab44b75f66f9"/>
<column name ="CONTACT_ID" value="79ce56fc-0022-4d5c-91b1-080c0f1e2191"/>
<column name="VISITPLANEMPLOYEEWEEK_ID" value="821b3424-b6d2-41f8-b0b2-6a7c2c050214"/>
<column name="STATUS" value="VISITSTATUSPLANNED "/>
</insert>
......
......@@ -2,5 +2,6 @@
<auxiliary-configuration xmlns="http://www.netbeans.org/ns/auxiliary-configuration/1">
<spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1">
<word>organisation</word>
<word>visitRecommendations</word>
</spellchecker-wordlist>
</auxiliary-configuration>
......@@ -14897,20 +14897,6 @@
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>CONTACT_ID</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="1" />
<size v="36" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>APPOINTMENT_ID</name>
<dbName></dbName>
......
......@@ -23,8 +23,8 @@ else
}
if (documents)
ActivityUtils.insertDocuments(vars.get("$local.uid"), documents);
if(vars.get("$param.VisitPlanEntryId_param"))
if(vars.exists("$param.VisitPlanEntryId_param") && vars.get("$param.VisitPlanEntryId_param"))
{
var values = [$KeywordRegistry.visitPlanEntryStatus$Visitreportcreated()];
var columns = ["STATUS"];
......
......@@ -159,12 +159,6 @@ See ContactUtils.getRelationTypeByPersOrg for possible values</description>
<fieldName>AnyContacts</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>91db53ad-3748-4a24-8dba-11dc707c2d6b</name>
<entityName>VisitPlanEntry_entity</entityName>
<fieldName>AnyContacts</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
......
......@@ -135,6 +135,12 @@
<fieldName>Organisations</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>cbb5b03c-8c47-4aff-8f95-172216d2eff6</name>
<entityName>VisitRecommendation_entity</entityName>
<fieldName>OrganisationConsumer</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
......@@ -265,12 +271,6 @@
<fieldName>Organisations</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>e395c4fd-a885-4f73-899f-6899cd3aa294</name>
<entityName>VisitRecommendation_entity</entityName>
<fieldName>OrganisationConsumer</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
</entityProvider>
<entityConsumer>
......@@ -1074,6 +1074,12 @@
<onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newvisitplanentry/onActionProcess.js</onActionProcess>
<iconId>VAADIN:CAR</iconId>
</entityActionField>
<entityActionField>
<name>openLocation</name>
<title>Location</title>
<onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/openlocation/onActionProcess.js</onActionProcess>
<iconId>NEON:TACKED</iconId>
</entityActionField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.neon");
import("Sql_lib");
import("system.vars");
var addressId = vars.get("$field.ADDRESS_ID")
var address = []
addressData = newSelect("ADDRESS, BUILDINGNO, ZIP, CITY, COUNTRY")
.from("ADDRESS")
.where("ADDRESS.ADDRESSID", addressId)
.arrayRow();
address.push(addressData.join("+"));
addressUrl = "https://www.google.com/maps/dir/" + address.join("/");
neon.openUrl(addressUrl, true);
\ No newline at end of file
......@@ -693,6 +693,12 @@
<fieldName>Persons</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>f56b1378-138d-4f88-b9df-274adce9f90c</name>
<entityName>VisitPlanEntry_entity</entityName>
<fieldName>Persons</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
......@@ -1231,6 +1237,12 @@
<name>IndexPhoneticFirstname</name>
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/indexphoneticfirstname/valueProcess.js</valueProcess>
</entityField>
<entityActionField>
<name>newVisitPlanEntry</name>
<title>New Weekplanentry</title>
<onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newvisitplanentry/onActionProcess.js</onActionProcess>
<iconId>VAADIN:CAR</iconId>
</entityActionField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.neon");
import("system.vars");
var params = {};
params["NoVisitPlanEmployeeWeek_param"] = true;
params["ContactId_param"] = vars.get("$field.CONTACTID");
neon.openContext("VisitPlanEntry", "VisitPlanEntryEdit_view", null, neon.OPERATINGSTATE_NEW, params);
\ No newline at end of file
......@@ -64,21 +64,6 @@
<title>Visitreport created</title>
<valueProcess>%aditoprj%/entity/VisitPlanEmployeeWeek_entity/entityfields/entries_activity_count/valueProcess.js</valueProcess>
</entityField>
<entityConsumer>
<name>Entries</name>
<dependency>
<name>dependency</name>
<entityName>VisitPlanEntry_entity</entityName>
<fieldName>Entries</fieldName>
</dependency>
<children>
<entityParameter>
<name>Entries_param</name>
<valueProcess>%aditoprj%/entity/VisitPlanEmployeeWeek_entity/entityfields/entries/children/entries_param/valueProcess.js</valueProcess>
<expose v="true" />
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
<name>recommendations</name>
<dependency>
......@@ -95,6 +80,21 @@
<fieldName>Contacts</fieldName>
</dependency>
</entityConsumer>
<entityConsumer>
<name>Entries</name>
<dependency>
<name>dependency</name>
<entityName>VisitPlanEntry_entity</entityName>
<fieldName>Entries</fieldName>
</dependency>
<children>
<entityParameter>
<name>Entries_param</name>
<valueProcess>%aditoprj%/entity/VisitPlanEmployeeWeek_entity/entityfields/entries/children/entries_param/valueProcess.js</valueProcess>
<expose v="true" />
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
......@@ -32,10 +32,10 @@
<entityField>
<name>ORGANISATION_ID</name>
<documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/documentation.adoc</documentation>
<title>Contact</title>
<consumer>AnyContacts</consumer>
<linkedContextProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/linkedContextProcess.js</linkedContextProcess>
<title>Organisation</title>
<consumer>Organisations</consumer>
<mandatory v="true" />
<stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/organisation_id/displayValueProcess.js</displayValueProcess>
</entityField>
......@@ -70,10 +70,6 @@
<dropDownProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/begin_time/dropDownProcess.js</dropDownProcess>
<valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/begin_time/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>contactcontext</name>
<valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/contactcontext/valueProcess.js</valueProcess>
</entityField>
<entityActionGroup>
<name>entityActionGroup</name>
<iconId>VAADIN:CALENDAR</iconId>
......@@ -112,20 +108,6 @@
</entityActionField>
</children>
</entityActionGroup>
<entityProvider>
<name>Entries</name>
<targetContextField>contactcontext</targetContextField>
<targetIdField>ORGANISATION_ID</targetIdField>
<documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entries/documentation.adoc</documentation>
<dependencies>
<entityDependency>
<name>ed458b30-e642-4c89-925b-20938e3abfc6</name>
<entityName>VisitPlanEmployeeWeek_entity</entityName>
<fieldName>Entries</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
</entityProvider>
<entityConsumer>
<name>Organisations</name>
<dependency>
......@@ -150,20 +132,6 @@
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
<name>AnyContacts</name>
<dependency>
<name>dependency</name>
<entityName>AnyContact_entity</entityName>
<fieldName>OnlySameCompany</fieldName>
</dependency>
<children>
<entityParameter>
<name>ContactId_param</name>
<valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/anycontacts/children/contactid_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityParameter>
<name>Entries_param</name>
<expose v="true" />
......@@ -197,13 +165,8 @@
</entityField>
<entityField>
<name>APPOINTMENT_ID</name>
<title></title>
</entityField>
<entityField>
<name>CONTACT_ORG_ID</name>
</entityField>
<entityField>
<name>CONTACT_PERSON_ID</name>
<documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/appointment_id/documentation.adoc</documentation>
<linkedContext>Appointment</linkedContext>
</entityField>
<entityParameter>
<name>VisitPlanEmployeeWeek_param</name>
......@@ -220,6 +183,46 @@
<name>ComingFromRecommendation_param</name>
<expose v="true" />
</entityParameter>
<entityField>
<name>CONTACT_ID</name>
<title>Contact</title>
<consumer>Persons</consumer>
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/contact_id/displayValueProcess.js</displayValueProcess>
<onValidation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js</onValidation>
</entityField>
<entityConsumer>
<name>Persons</name>
<dependency>
<name>dependency</name>
<entityName>Person_entity</entityName>
<fieldName>Contacts</fieldName>
</dependency>
<children>
<entityParameter>
<name>ExcludedContactIds_param</name>
<valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js</valueProcess>
<expose v="true" />
</entityParameter>
</children>
</entityConsumer>
<entityParameter>
<name>ContactId_param</name>
<expose v="true" />
</entityParameter>
<entityProvider>
<name>Entries</name>
<documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entries/documentation.adoc</documentation>
<dependencies>
<entityDependency>
<name>22b61edd-c062-4c94-8848-8ac25831c5ba</name>
<entityName>VisitPlanEmployeeWeek_entity</entityName>
<fieldName>Entries</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
</entityProvider>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......@@ -253,7 +256,13 @@
<name>ORGANISATION_ID.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>CONTACT_ORG_ID.displayValue</name>
<name>ORGANISATION_ID.displayValue</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>CONTACT_ID.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>CONTACT_ID.displayValue</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>ENTRYDATE.value</name>
......@@ -264,6 +273,9 @@
<jDitoRecordFieldMapping>
<name>VISITPLANEMPLOYEEWEEK_ID.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>APPOINTMENT_ID.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>STATUS.displayValue</name>
</jDitoRecordFieldMapping>
......
= VisitPlanEntry_entity
For storing Visitentries with their information(date, time, contact, and most importantly: it's Status).
Linked to VisitPlanEmployeeWeek_entity so you only see the entries in the chosen week.
\ No newline at end of file
Linked to VisitPlanEmployeeWeek_entity so you only see the entries in the chosen week.
ORGANISATION_ID is used to store the company that's being visited, CONTACT_ID to Store the Point-of-Contact,
since you are normally visiting one specific person.
Keep in mind, that only the organization is important for the visitRecommendations and not the Point of Contact.
\ No newline at end of file
import("system.vars");
import("system.result");
if(vars.exists("$param.ComingFromRecommendation_param") && vars.get("$param.ComingFromRecommendation_param"))
result.string(vars.get("$field.ORGANISATION_ID"));
\ No newline at end of file
ToDo: display the status of the appointment in the filterview,
as soon as an method to easily get the Status of an appointment exists.
\ No newline at end of file
import("Person_lib");
import("system.db");
import("system.result");
import("system.vars");
var contactId = vars.get("$field.CONTACT_ID");
var res = db.cell(PersUtils.getResolvingDisplaySubSql("'" + contactId + "'"));
result.string(res);
\ No newline at end of file
import("system.translate");
import("system.result");
import("Contact_lib");
import("system.vars");
var orgId = vars.get("$field.ORGANISATION_ID");
var contactId = vars.get("$field.CONTACT_ID");
var orgContactId = ContactUtils.getPersOrgIds(contactId)[2];
if(orgId != orgContactId)
result.string(translate.text("Contact has to be employee in the chosen Organisation"))
\ No newline at end of file
import("Sql_lib");
import("system.logging");
import("system.neon");
import("system.result");
import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null
&& vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param"))
{
var contactId = vars.get("$param.ContactId_param");
var orgId = newSelect("CONTACT.ORGANISATION_ID")
.from("CONTACT")
.where("CONTACT.CONTACTID", contactId)
.cell();
neon.setFieldValue("$field.ORGANISATION_ID", orgId);
result.string(vars.get("$param.ContactId_param"));
}
\ No newline at end of file
import("system.vars");
import("system.result");
import("Contact_lib");
//gets either ORGANISATION or CONTACT depending on which kind of ID got saved in the ORGANISATION_ID field
//(visiting contacts might be needed in the future, but not yet implemented)
result.string(ContactUtils.getContextByContactId(vars.getString("$field.ORGANISATION_ID")));
\ No newline at end of file
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