diff --git a/.liquibase/Data_alias/basic/2020.1.0/VisitPlan/create_VisitPlanTables.xml b/.liquibase/Data_alias/basic/2020.1.0/VisitPlan/create_VisitPlanTables.xml index 04e0fa9f3cd843cf4f487e60519ba7d99c1b331c..09bf3da3c4fa88c254ecf1ccc54d584e51fd13ed 100644 --- a/.liquibase/Data_alias/basic/2020.1.0/VisitPlan/create_VisitPlanTables.xml +++ b/.liquibase/Data_alias/basic/2020.1.0/VisitPlan/create_VisitPlanTables.xml @@ -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)"/> diff --git a/.liquibase/Data_alias/basic/2020.1.0/VisitPlan/init_VisitFrequency.xml b/.liquibase/Data_alias/basic/2020.1.0/VisitPlan/init_VisitFrequency.xml index 7111e45c969bc2417371c4febcd0453980956d50..4583f7760a9cc5e48b2827196d43ae7da1f04801 100644 --- a/.liquibase/Data_alias/basic/2020.1.0/VisitPlan/init_VisitFrequency.xml +++ b/.liquibase/Data_alias/basic/2020.1.0/VisitPlan/init_VisitFrequency.xml @@ -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> diff --git a/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml b/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml index 533d677a544e1912c5b0b7ba19a15e036f9cbfc3..af7e5d06f6b435f4ed23b000313f51c786bc0dfc 100644 --- a/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml +++ b/.liquibase/Data_alias/basic/_demoData/generatedData/visitplan.xml @@ -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> diff --git a/.netbeans.xml b/.netbeans.xml index e2ee35210e237af7f5e6f08cef71730811bdc14b..29cf857bdd8df354fe69e1f12d2e7fae986bc663 100644 --- a/.netbeans.xml +++ b/.netbeans.xml @@ -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> diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 3a18b7fe0b62e44310da843bce598819d93dc7f6..3cf0386dfd91a32515217928491ca53e6044b766 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -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> diff --git a/entity/360Degree_entity/360Degree_entity.aod b/entity/360Degree_entity/360Degree_entity.aod index 3c9139943a40ae07963b30b9dcb582a6766c4700..7069d6c38e61b4bf3909502e67902cd1f7ecff6b 100644 --- a/entity/360Degree_entity/360Degree_entity.aod +++ b/entity/360Degree_entity/360Degree_entity.aod @@ -106,6 +106,7 @@ <name>newModule</name> <title>New module</title> <iconId>VAADIN:PLUS_CIRCLE</iconId> + <stateProcess>%aditoprj%/entity/360Degree_entity/entityfields/newmodule/stateProcess.js</stateProcess> <children> <entityActionField> <name>newOffer</name> @@ -168,6 +169,10 @@ <name>BaseContextId_param</name> <expose v="true" /> </entityParameter> + <entityParameter> + <name>ObjectStatus_param</name> + <expose v="true" /> + </entityParameter> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/360Degree_entity/entityfields/newmodule/stateProcess.js b/entity/360Degree_entity/entityfields/newmodule/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..0b02ed053a7ba32d8f740031e0c5ceb72f1c3716 --- /dev/null +++ b/entity/360Degree_entity/entityfields/newmodule/stateProcess.js @@ -0,0 +1,9 @@ +import("system.vars"); +import("system.neon"); +import("system.result"); +import("KeywordRegistry_basic"); + +var objectStatusParam = vars.get("$param.ObjectStatus_param"); + +if (objectStatusParam == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Activity_entity/Activity_entity.aod b/entity/Activity_entity/Activity_entity.aod index 8258e93b0561e3c6d1d473dfee6392cb88520325..bb17b9fa7f2471bd1c69064d7f84a049d033be65 100644 --- a/entity/Activity_entity/Activity_entity.aod +++ b/entity/Activity_entity/Activity_entity.aod @@ -264,6 +264,12 @@ <fieldName>Activities</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>943c36a2-d378-44a1-b214-25e92244c8cb</name> + <entityName>UniversalFileProcessor_entity</entityName> + <fieldName>Activities</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> @@ -595,6 +601,15 @@ <name>VisitPlanEntryId_param</name> <expose v="true" /> </entityParameter> + <entityParameter> + <name>ActivityIDs_param</name> + <expose v="true" /> + </entityParameter> + <entityField> + <name>countLinks</name> + <title> number of connections</title> + <valueProcess>%aditoprj%/entity/Activity_entity/entityfields/countlinks/valueProcess.js</valueProcess> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Activity_entity/entityfields/countlinks/valueProcess.js b/entity/Activity_entity/entityfields/countlinks/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..fbf4e2585e7c20e4127683dc4f7586025615e682 --- /dev/null +++ b/entity/Activity_entity/entityfields/countlinks/valueProcess.js @@ -0,0 +1,5 @@ +import("system.result"); +import("system.vars"); +import("Sql_lib"); + +result.string(newSelect("count(*)").from("ACTIVITYLINK").where("ACTIVITYLINK.ACTIVITY_ID", vars.get("$field.ACTIVITYID")).arrayColumn()[0]); \ No newline at end of file diff --git a/entity/Activity_entity/recordcontainers/db/conditionProcess.js b/entity/Activity_entity/recordcontainers/db/conditionProcess.js index a90c77ea69bef0ebc370e9842321a1ffe006c56c..fe77ebfa1d1ce7e8056d1505bcbda07e318f163e 100644 --- a/entity/Activity_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Activity_entity/recordcontainers/db/conditionProcess.js @@ -1,3 +1,4 @@ +import("system.logging"); import("Employee_lib"); import("system.vars"); import("system.db"); @@ -40,6 +41,11 @@ if(vars.getString("$param.OnlyInnate_param") == "true") loadNothing = true; } +if (vars.exists("$param.ActivityIDs_param") && vars.get("$param.ActivityIDs_param")) { + var acticityIDs = JSON.parse(vars.get("$param.ActivityIDs_param")); + cond.and("ACTIVITY.ACTIVITYID",acticityIDs , SqlBuilder.IN()); +} + if (loadNothing) { resCond = "1 = 2"; diff --git a/entity/Activity_entity/recordcontainers/db/onDBInsert.js b/entity/Activity_entity/recordcontainers/db/onDBInsert.js index 54e631277f5bbf233587f5b5c74b6625d7b11480..ce851e0d4489f20cf098f2573e0b08dab9cc7665 100644 --- a/entity/Activity_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Activity_entity/recordcontainers/db/onDBInsert.js @@ -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"]; diff --git a/entity/AnyContact_entity/AnyContact_entity.aod b/entity/AnyContact_entity/AnyContact_entity.aod index ebeba91e961ff738a0b7c700280d670308265101..8db94a88d290b6ae25d9b37180d3c350627e4344 100644 --- a/entity/AnyContact_entity/AnyContact_entity.aod +++ b/entity/AnyContact_entity/AnyContact_entity.aod @@ -4,6 +4,7 @@ <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/AnyContact_entity/documentation.adoc</documentation> <contentTitleProcess>%aditoprj%/entity/AnyContact_entity/contentTitleProcess.js</contentTitleProcess> + <afterUiInit>%aditoprj%/entity/AnyContact_entity/afterUiInit.js</afterUiInit> <imageProcess>%aditoprj%/entity/AnyContact_entity/imageProcess.js</imageProcess> <recordContainer>db</recordContainer> <entityFields> @@ -159,12 +160,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> diff --git a/entity/AnyContact_entity/afterUiInit.js b/entity/AnyContact_entity/afterUiInit.js new file mode 100644 index 0000000000000000000000000000000000000000..ad4324c7682881b8e9ca470e334269ae822ec522 --- /dev/null +++ b/entity/AnyContact_entity/afterUiInit.js @@ -0,0 +1,23 @@ +import("system.neon"); +import("Keyword_lib"); +import("system.vars"); +import("KeywordRegistry_basic"); + +var statusFilterElement = { + "type":"row", + "name":"STATUS", + "operator":"NOT_EQUAL", + "key":$KeywordRegistry.contactStatus$inactive(), + "contenttype": vars.get("$property.STATUS.contentType") +}; + +statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); + +var filter = { + "type":"group", + "operator":"AND", + "childs": [statusFilterElement] +}; + +filter = JSON.stringify(filter); +neon.setFilter("#ENTITY", filter); \ No newline at end of file diff --git a/entity/Appointment_entity/Appointment_entity.aod b/entity/Appointment_entity/Appointment_entity.aod index f6632a173eb5a0efa60679c5cf0cf5dce380f372..8b3f481d0a44dc3b9a9130dd77113eacbafb79e0 100644 --- a/entity/Appointment_entity/Appointment_entity.aod +++ b/entity/Appointment_entity/Appointment_entity.aod @@ -5,6 +5,8 @@ <documentation>%aditoprj%/entity/Appointment_entity/documentation.adoc</documentation> <title>Appointment</title> <siblings /> + <grantUpdateProcess>%aditoprj%/entity/Appointment_entity/grantUpdateProcess.js</grantUpdateProcess> + <grantDeleteProcess>%aditoprj%/entity/Appointment_entity/grantDeleteProcess.js</grantDeleteProcess> <afterUiInit>%aditoprj%/entity/Appointment_entity/afterUiInit.js</afterUiInit> <titlePlural>Appointments</titlePlural> <recordContainer>jdito</recordContainer> diff --git a/entity/Appointment_entity/grantDeleteProcess.js b/entity/Appointment_entity/grantDeleteProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..4caa2d99cfdda2637190ab5c76a15565666b79b5 --- /dev/null +++ b/entity/Appointment_entity/grantDeleteProcess.js @@ -0,0 +1,7 @@ +import("system.vars"); +import("system.result"); +import("system.calendars"); +import("system.text"); + +var owner = text.decodeMS(JSON.parse(vars.get("$param.Entry_param"))["h"])[1].split(":")[1]; +result.string(calendars.hasPermission([owner], calendars.VEVENT, "WRITE")); \ No newline at end of file diff --git a/entity/Appointment_entity/grantUpdateProcess.js b/entity/Appointment_entity/grantUpdateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3562ea4a6c4ba8fda784eb7ea85abd591e022f87 --- /dev/null +++ b/entity/Appointment_entity/grantUpdateProcess.js @@ -0,0 +1,8 @@ +import("system.vars"); +import("system.result"); +import("system.calendars"); +import("system.text"); + +var owner = text.decodeMS(JSON.parse(vars.get("$param.Entry_param"))["h"])[1].split(":")[1]; +result.string(calendars.hasPermission([owner], calendars.VEVENT, "WRITE")); + diff --git a/entity/Contact_entity/Contact_entity.aod b/entity/Contact_entity/Contact_entity.aod index fde844bfab9f6ad4b50d0c00821b7052553ddde7..6a95fa2e17f2edbf5014e8e7c0e81640cdb999a7 100644 --- a/entity/Contact_entity/Contact_entity.aod +++ b/entity/Contact_entity/Contact_entity.aod @@ -8,6 +8,7 @@ <grantUpdateProcess>%aditoprj%/entity/Contact_entity/grantUpdateProcess.js</grantUpdateProcess> <grantDeleteProcess>%aditoprj%/entity/Contact_entity/grantDeleteProcess.js</grantDeleteProcess> <contentTitleProcess>%aditoprj%/entity/Contact_entity/contentTitleProcess.js</contentTitleProcess> + <afterUiInit>%aditoprj%/entity/Contact_entity/afterUiInit.js</afterUiInit> <onValidation>%aditoprj%/entity/Contact_entity/onValidation.js</onValidation> <iconId>VAADIN:USERS</iconId> <titlePlural>Contacts</titlePlural> @@ -346,6 +347,18 @@ <name>CONTACTID.displayValue</name> <expression>%aditoprj%/entity/Contact_entity/recordcontainers/db/recordfieldmappings/contactid.displayvalue/expression.js</expression> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>CONTACTROLE.displayValue</name> + <expression>%aditoprj%/entity/Contact_entity/recordcontainers/db/recordfieldmappings/contactrole.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>POSITION.displayValue</name> + <expression>%aditoprj%/entity/Contact_entity/recordcontainers/db/recordfieldmappings/position.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DEPARTMENT.displayValue</name> + <expression>%aditoprj%/entity/Contact_entity/recordcontainers/db/recordfieldmappings/department.displayvalue/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Contact_entity/afterUiInit.js b/entity/Contact_entity/afterUiInit.js new file mode 100644 index 0000000000000000000000000000000000000000..ad4324c7682881b8e9ca470e334269ae822ec522 --- /dev/null +++ b/entity/Contact_entity/afterUiInit.js @@ -0,0 +1,23 @@ +import("system.neon"); +import("Keyword_lib"); +import("system.vars"); +import("KeywordRegistry_basic"); + +var statusFilterElement = { + "type":"row", + "name":"STATUS", + "operator":"NOT_EQUAL", + "key":$KeywordRegistry.contactStatus$inactive(), + "contenttype": vars.get("$property.STATUS.contentType") +}; + +statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); + +var filter = { + "type":"group", + "operator":"AND", + "childs": [statusFilterElement] +}; + +filter = JSON.stringify(filter); +neon.setFilter("#ENTITY", filter); \ No newline at end of file diff --git a/entity/Contact_entity/recordcontainers/db/recordfieldmappings/contactrole.displayvalue/expression.js b/entity/Contact_entity/recordcontainers/db/recordfieldmappings/contactrole.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..588a1897cf0518ecf2236c8062133e304ea161a9 --- /dev/null +++ b/entity/Contact_entity/recordcontainers/db/recordfieldmappings/contactrole.displayvalue/expression.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("CONTACTROLE"); \ No newline at end of file diff --git a/entity/Contact_entity/recordcontainers/db/recordfieldmappings/department.displayvalue/expression.js b/entity/Contact_entity/recordcontainers/db/recordfieldmappings/department.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..40d0a559971c0e89f5f8db9321212c9d81fc231e --- /dev/null +++ b/entity/Contact_entity/recordcontainers/db/recordfieldmappings/department.displayvalue/expression.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("DEPARTMENT"); \ No newline at end of file diff --git a/entity/Contact_entity/recordcontainers/db/recordfieldmappings/position.displayvalue/expression.js b/entity/Contact_entity/recordcontainers/db/recordfieldmappings/position.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..33b955e1e7dbe1773b32cbf4d43d0e3ec6bb1e68 --- /dev/null +++ b/entity/Contact_entity/recordcontainers/db/recordfieldmappings/position.displayvalue/expression.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("CONTACTPOSITION"); \ No newline at end of file diff --git a/entity/Document_entity/entityfields/downloadsinglefileaction/onActionProcess.js b/entity/Document_entity/entityfields/downloadsinglefileaction/onActionProcess.js index cb680339a304a772903d66b521a97809f90288f2..6fb7d7cd93ae311e233e542bc38778dc559e7882 100644 --- a/entity/Document_entity/entityfields/downloadsinglefileaction/onActionProcess.js +++ b/entity/Document_entity/entityfields/downloadsinglefileaction/onActionProcess.js @@ -1,2 +1,4 @@ +import("system.vars"); import("Document_lib"); -DocumentUtil.downloadSelectedDocuments(); + +DocumentUtil.downloadSelectedDocuments(vars.get("$param.AssignmentName_param")); diff --git a/entity/Leadimport_entity/recordcontainers/db/onDBInsert.js b/entity/Leadimport_entity/recordcontainers/db/onDBInsert.js index 1a9be3005379dd4286a0b861ed91c1ba374f189b..1f82f62e8044dcf276f7546ee8c3eb4c78dd4725 100644 --- a/entity/Leadimport_entity/recordcontainers/db/onDBInsert.js +++ b/entity/Leadimport_entity/recordcontainers/db/onDBInsert.js @@ -19,7 +19,8 @@ var recordSep = ExportTemplateUtils.getSentenceSeparator(vars.get("$field.SENTEN if(bindata != '' && filename != '') { var mimeType = DocumentUtil.getMimeTypeFromUpload(vars.get("$field.bindata")); - if (mimeType == "application/vnd.ms-excel" || mimeType == "text/csv") + if (mimeType == "application/vnd.ms-excel" || mimeType == "text/csv" + || mimeType == "text/plain") //ToDo: remove this one, as soon as csv's get their correct mimetype #1057287 { var documentId = SingleBinaryUtils.insertMainDocument("LEADIMPORT", "IMPORTFILE", assignmentRowId, bindata, filename, "", SqlUtils.getBinariesAlias()); LeadImportUtils.loadImportFile(documentId, fieldSep, fieldLimit, recordSep, assignmentRowId, false, true); diff --git a/entity/Order_entity/entityfields/isolanguage/valueProcess.js b/entity/Order_entity/entityfields/isolanguage/valueProcess.js index 77df925266af97e5fbb03d8519355dd73c5b8d53..9ce0bbebd61d58530b880b1a513baa32edd4c963 100644 --- a/entity/Order_entity/entityfields/isolanguage/valueProcess.js +++ b/entity/Order_entity/entityfields/isolanguage/valueProcess.js @@ -1,9 +1,8 @@ -import("system.neon"); import("system.result"); import("system.vars"); -import("KeywordRegistry_basic"); -if (vars.exists("$param.OrderLanguage_param") && vars.get("$param.OrderLanguage_param")) +if ((vars.get("$this.value") == null || vars.get("$this.value") == undefined) + && vars.exists("$param.OrderLanguage_param") && vars.get("$param.OrderLanguage_param")) { result.string(vars.get("$param.OrderLanguage_param")); } diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index 8ccbb9a42d1654e4e8fe1ded35ba808c4bdddf84..55f954b6501a729d5579a4b2e1f797422f88c8bc 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -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> @@ -548,6 +548,10 @@ <name>ObjectRowId_param</name> <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/360degreeobjects/children/objectrowid_param/valueProcess.js</valueProcess> </entityParameter> + <entityParameter> + <name>ObjectStatus_param</name> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js</valueProcess> + </entityParameter> </children> </entityConsumer> <entityParameter> @@ -822,6 +826,7 @@ <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/openeditdefaultsview/onActionProcess.js</onActionProcess> <actionOrder v="1" /> <iconId>NEON:WRENCH</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/openeditdefaultsview/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newOffer</name> @@ -830,6 +835,7 @@ <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newoffer/onActionProcess.js</onActionProcess> <actionOrder v="2" /> <iconId>VAADIN:CART</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/newoffer/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newActivity</name> @@ -853,12 +859,14 @@ <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newtask/onActionProcess.js</onActionProcess> <actionOrder v="3" /> <iconId>VAADIN:TASKS</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/newtask/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newAppointment</name> <title>New appointment</title> <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newappointment/onActionProcess.js</onActionProcess> <iconId>VAADIN:CALENDAR</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/newappointment/stateProcess.js</stateProcess> <tooltip>New Appointment</tooltip> </entityActionField> <entityActionGroup> @@ -885,6 +893,7 @@ <isObjectAction v="false" /> <isSelectionAction v="true" /> <iconId>VAADIN:AT</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js</stateProcess> <tooltipProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/tooltipProcess.js</tooltipProcess> </entityActionField> <entityActionField> @@ -894,6 +903,7 @@ <isObjectAction v="false" /> <isSelectionAction v="true" /> <iconId>VAADIN:ENVELOPES</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js</stateProcess> <tooltipProcess>%aditoprj%/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/tooltipProcess.js</tooltipProcess> </entityActionField> <entityActionField> @@ -913,6 +923,7 @@ <title>Add to Campaign</title> <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/addtocampaign/onActionProcess.js</onActionProcess> <iconId>NEON:GROUP_APPOINTMENT</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/addtocampaign/stateProcess.js</stateProcess> <tooltip>Choose a campaign and a step to add the contact to a campaign</tooltip> </entityActionField> <entityActionField> @@ -920,12 +931,14 @@ <title>Write email</title> <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newemail/onActionProcess.js</onActionProcess> <iconId>VAADIN:AT</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/newemail/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newLetter</name> <title>New letter</title> <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/newletter/onActionProcess.js</onActionProcess> <iconId>VAADIN:ENVELOPE</iconId> + <stateProcess>%aditoprj%/entity/Organisation_entity/entityfields/newletter/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>openAdminView</name> @@ -1074,6 +1087,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> diff --git a/entity/Organisation_entity/afterUiInit.js b/entity/Organisation_entity/afterUiInit.js index 40048a413712450e39dc819e7142ed9b2a48d820..669f54dbb747c656a7723b9795e3e10875eade5c 100644 --- a/entity/Organisation_entity/afterUiInit.js +++ b/entity/Organisation_entity/afterUiInit.js @@ -1,8 +1,29 @@ +import("Keyword_lib"); +import("KeywordRegistry_basic"); import("system.neon"); import("system.vars"); import("Context_lib"); import("Attribute_lib"); +var statusFilterElement = { + "type":"row", + "name":"STATUS", + "operator":"NOT_EQUAL", + "key":$KeywordRegistry.contactStatus$inactive(), + "contenttype": vars.get("$property.STATUS.contentType") +}; + +statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); + +var filter = { + "type":"group", + "operator":"AND", + "childs": [statusFilterElement] +}; + +filter = JSON.stringify(filter); +neon.setFilter("#ENTITY", filter); + if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) { AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); diff --git a/entity/Organisation_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js b/entity/Organisation_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..047f2af7d720d3fb0c19529dc9d8dadae5342256 --- /dev/null +++ b/entity/Organisation_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.STATUS")); diff --git a/entity/Organisation_entity/entityfields/addtocampaign/stateProcess.js b/entity/Organisation_entity/entityfields/addtocampaign/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/addtocampaign/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1a24bf4924a99876b3bec1f9bec24fe7bed7743d --- /dev/null +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js @@ -0,0 +1,9 @@ +import("system.neon"); +import("system.neon"); +import("system.result"); +import("KeywordRegistry_basic"); +import("system.vars"); + + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js index 35dcb1420a14ba006cfc657b2ac1208bc2b46d2e..a4f62ede0a6fc0d8c841610e69fcace9a4213f30 100644 --- a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js @@ -1,3 +1,4 @@ +import("KeywordRegistry_basic"); import("system.db"); import("system.vars"); import("system.neon"); @@ -12,4 +13,7 @@ if(contactCount > 0) else { result.string(neon.COMPONENTSTATE_DISABLED); -} \ No newline at end of file +} + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..daa09139c5a6115f0f8dea868089b1293977fe97 --- /dev/null +++ b/entity/Organisation_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js @@ -0,0 +1,8 @@ +import("system.neon"); +import("system.result"); +import("KeywordRegistry_basic"); +import("system.vars"); + + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/newappointment/stateProcess.js b/entity/Organisation_entity/entityfields/newappointment/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/newappointment/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/newemail/stateProcess.js b/entity/Organisation_entity/entityfields/newemail/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/newemail/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/newletter/stateProcess.js b/entity/Organisation_entity/entityfields/newletter/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/newletter/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/newoffer/stateProcess.js b/entity/Organisation_entity/entityfields/newoffer/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/newoffer/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/newtask/stateProcess.js b/entity/Organisation_entity/entityfields/newtask/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/newtask/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/openeditdefaultsview/stateProcess.js b/entity/Organisation_entity/entityfields/openeditdefaultsview/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Organisation_entity/entityfields/openeditdefaultsview/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/openlocation/onActionProcess.js b/entity/Organisation_entity/entityfields/openlocation/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..764513935758151ec5cf988b86e9f304be4d296f --- /dev/null +++ b/entity/Organisation_entity/entityfields/openlocation/onActionProcess.js @@ -0,0 +1,18 @@ +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 diff --git a/entity/Organisation_entity/entityfields/picture/displayValueProcess.js b/entity/Organisation_entity/entityfields/picture/displayValueProcess.js index 2ad6742677b7f0a685be75783483833b35bebfc0..fd846d87707177ddf7438dfb66f956da2bd57f76 100644 --- a/entity/Organisation_entity/entityfields/picture/displayValueProcess.js +++ b/entity/Organisation_entity/entityfields/picture/displayValueProcess.js @@ -1,10 +1,18 @@ import("system.vars"); import("system.result"); import("system.neon"); +import("KeywordRegistry_basic"); + if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW) { - if (vars.get("$field.PICTURE")) - result.string(vars.get("$field.PICTURE")); + + if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string("VAADIN:CLOSE_BIG") else - result.string(vars.get("$param.AvatarText_param")); -} + { + if (vars.get("$field.PICTURE")) + result.string(vars.get("$field.PICTURE")); + else + result.string(vars.get("$param.AvatarText_param")); + } +} \ No newline at end of file diff --git a/entity/Person_entity/Person_entity.aod b/entity/Person_entity/Person_entity.aod index ad01eb35313e6f2fc9f39b5224f8348d0c4f4dec..b50490a5992a498f3e2aa87967892a3f2c4e820d 100644 --- a/entity/Person_entity/Person_entity.aod +++ b/entity/Person_entity/Person_entity.aod @@ -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> @@ -725,6 +731,10 @@ <name>ObjectRowId_param</name> <valueProcess>%aditoprj%/entity/Person_entity/entityfields/360degreeobjects/children/objectrowid_param/valueProcess.js</valueProcess> </entityParameter> + <entityParameter> + <name>ObjectStatus_param</name> + <valueProcess>%aditoprj%/entity/Person_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js</valueProcess> + </entityParameter> </children> </entityConsumer> <entityConsumer> @@ -954,12 +964,14 @@ <title>Edit defaults</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/openeditdefaultsview/onActionProcess.js</onActionProcess> <iconId>VAADIN:WRENCH</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/openeditdefaultsview/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newOffer</name> <title>New offer</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newoffer/onActionProcess.js</onActionProcess> <iconId>VAADIN:CART</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/newoffer/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newActivity</name> @@ -974,6 +986,7 @@ <title>New task</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newtask/onActionProcess.js</onActionProcess> <iconId>VAADIN:TASKS</iconId> + <iconIdProcess>%aditoprj%/entity/Person_entity/entityfields/newtask/iconIdProcess.js</iconIdProcess> </entityActionField> <entityActionField> <name>addToCampaign</name> @@ -981,6 +994,7 @@ <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/addtocampaign/onActionProcess.js</onActionProcess> <actionOrder v="1" /> <iconId>NEON:GROUP_APPOINTMENT</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/addtocampaign/stateProcess.js</stateProcess> <tooltip>Choose a campaign and a step to add the contact to a campaign</tooltip> </entityActionField> <entityActionGroup> @@ -1018,6 +1032,7 @@ <isObjectAction v="false" /> <isSelectionAction v="true" /> <iconId>VAADIN:ENVELOPES</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js</stateProcess> <tooltipProcess>%aditoprj%/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/tooltipProcess.js</tooltipProcess> </entityActionField> <entityActionField> @@ -1083,12 +1098,14 @@ <title>Write email</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newemail/onActionProcess.js</onActionProcess> <iconId>VAADIN:AT</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/newemail/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>newAppointment</name> <title>New appointment</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newappointment/onActionProcess.js</onActionProcess> <iconId>VAADIN:CALENDAR</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/newappointment/stateProcess.js</stateProcess> <tooltip>New Appointment</tooltip> </entityActionField> <entityActionField> @@ -1096,11 +1113,13 @@ <title>New letter</title> <onActionProcess>%aditoprj%/entity/Person_entity/entityfields/newletter/onActionProcess.js</onActionProcess> <iconId>VAADIN:ENVELOPE</iconId> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/newletter/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>openTaskView</name> <isMenuAction v="false" /> <isObjectAction v="false" /> + <stateProcess>%aditoprj%/entity/Person_entity/entityfields/opentaskview/stateProcess.js</stateProcess> </entityActionField> <entityActionField> <name>startWorkflow</name> @@ -1231,6 +1250,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> @@ -1508,6 +1533,18 @@ <name>ORGANISATION_CONTACTID.displayValue</name> <expression>%aditoprj%/entity/Person_entity/recordcontainers/db/recordfieldmappings/organisation_contactid.displayvalue/expression.js</expression> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DEPARTMENT.displayValue</name> + <expression>%aditoprj%/entity/Person_entity/recordcontainers/db/recordfieldmappings/department.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>POSITION.displayValue</name> + <expression>%aditoprj%/entity/Person_entity/recordcontainers/db/recordfieldmappings/position.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>CONTACTROLE.displayValue</name> + <expression>%aditoprj%/entity/Person_entity/recordcontainers/db/recordfieldmappings/contactrole.displayvalue/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> <filterExtensions> <filterExtensionSet> diff --git a/entity/Person_entity/afterUiInit.js b/entity/Person_entity/afterUiInit.js index 40048a413712450e39dc819e7142ed9b2a48d820..e756cf590afbc22dfff0537787df1a139a3d47ff 100644 --- a/entity/Person_entity/afterUiInit.js +++ b/entity/Person_entity/afterUiInit.js @@ -1,8 +1,29 @@ +import("Keyword_lib"); +import("KeywordRegistry_basic"); import("system.neon"); import("system.vars"); import("Context_lib"); import("Attribute_lib"); +var statusFilterElement = { + "type":"row", + "name":"STATUS", + "operator":"NOT_EQUAL", + "key":$KeywordRegistry.contactStatus$inactive(), + "contenttype": vars.get("$property.STATUS.contentType") +}; + +statusFilterElement.value = KeywordUtils.getViewValue($KeywordRegistry.contactStatus(), statusFilterElement.key); + +var filter = { + "type":"group", + "operator":"AND", + "childs": [statusFilterElement] +}; + +filter = JSON.stringify(filter); +neon.setFilter("#ENTITY", filter); + if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) { AttributeRelationUtils.presetMandatoryAttributes(ContextUtils.getCurrentContextId(), "Attributes"); diff --git a/entity/Person_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js b/entity/Person_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c077bf5964a863059f2629603660d7d7eda02492 --- /dev/null +++ b/entity/Person_entity/entityfields/360degreeobjects/children/objectstatus_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.STATUS")); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/addtocampaign/onActionProcess.js b/entity/Person_entity/entityfields/addtocampaign/onActionProcess.js index f04c2eb6b26677e381d239f513a25ee02b5fff03..66a7a45263219f9c17b4775aaadf04a8fe344b3c 100644 --- a/entity/Person_entity/entityfields/addtocampaign/onActionProcess.js +++ b/entity/Person_entity/entityfields/addtocampaign/onActionProcess.js @@ -1,5 +1,5 @@ -import("system.vars"); -import("Campaign_lib"); - -var contactIdRay = [vars.getString("$field.CONTACTID")]; +import("system.vars"); +import("Campaign_lib"); + +var contactIdRay = [vars.getString("$field.CONTACTID")]; CampaignUtils.addParticipantsByRowIds(JSON.stringify(contactIdRay), "PERSON"); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/addtocampaign/stateProcess.js b/entity/Person_entity/entityfields/addtocampaign/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/addtocampaign/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/campaignactiongroup/children/addtobulkmailfromtable/stateProcess.js b/entity/Person_entity/entityfields/campaignactiongroup/children/addtobulkmailfromtable/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..97f11bcc36325116cb384cd7ffd6e3fc8b537061 --- /dev/null +++ b/entity/Person_entity/entityfields/campaignactiongroup/children/addtobulkmailfromtable/stateProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +var isInactive = vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive() ? true : false; + +if (isInactive) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/stateProcess.js b/entity/Person_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..de48bf8c672f09224d17ea648e12c3c8c656ca70 --- /dev/null +++ b/entity/Person_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/stateProcess.js @@ -0,0 +1,14 @@ +import("system.db"); +import("system.vars"); +import("system.neon"); +import("system.result"); +import("KeywordRegistry_basic"); + + +var contactCount = vars.get("$sys.datarowcount") +var isInactive = vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive() ? true : false; + +if (contactCount <= 0 || isInactive) + result.string(neon.COMPONENTSTATE_DISABLED); +else + result.string(neon.COMPONENTSTATE_EDITABLE); diff --git a/entity/Person_entity/entityfields/campaignactiongroup/children/addtoserialletter/stateProcess.js b/entity/Person_entity/entityfields/campaignactiongroup/children/addtoserialletter/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..97f11bcc36325116cb384cd7ffd6e3fc8b537061 --- /dev/null +++ b/entity/Person_entity/entityfields/campaignactiongroup/children/addtoserialletter/stateProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +var isInactive = vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive() ? true : false; + +if (isInactive) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..92f584818ad1fcff6775adf3c9ef1acd2e807151 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtobulkmailfromtable/stateProcess.js @@ -0,0 +1,8 @@ +import("system.vars"); +import("system.neon"); +import("system.result"); +import("system.result"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js index d7025bdf30d79dd2530c526aa2cdefe27514de17..1692669f6caf7db43e9f24decb3fcbfeb3c62993 100644 --- a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtocampaignfromtable/stateProcess.js @@ -1,3 +1,4 @@ +import("KeywordRegistry_basic"); import("system.db"); import("system.vars"); import("system.neon"); @@ -12,4 +13,7 @@ if(contactCount > 0) else { result.string(neon.COMPONENTSTATE_DISABLED); -} \ No newline at end of file +} + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..0712af69970fdab78181f33195515067e0003949 --- /dev/null +++ b/entity/Person_entity/entityfields/filterviewactiongroup/children/addtoserialletter/stateProcess.js @@ -0,0 +1,7 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/newappointment/stateProcess.js b/entity/Person_entity/entityfields/newappointment/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/newappointment/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/newemail/stateProcess.js b/entity/Person_entity/entityfields/newemail/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/newemail/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/newletter/stateProcess.js b/entity/Person_entity/entityfields/newletter/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/newletter/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/newoffer/stateProcess.js b/entity/Person_entity/entityfields/newoffer/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/newoffer/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/newtask/iconIdProcess.js b/entity/Person_entity/entityfields/newtask/iconIdProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Person_entity/entityfields/newtask/stateProcess.js b/entity/Person_entity/entityfields/newtask/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/newtask/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/newvisitplanentry/onActionProcess.js b/entity/Person_entity/entityfields/newvisitplanentry/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f32b45bbbf4dcad4715cdee536fa1326f7bb3ae3 --- /dev/null +++ b/entity/Person_entity/entityfields/newvisitplanentry/onActionProcess.js @@ -0,0 +1,9 @@ +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 diff --git a/entity/Person_entity/entityfields/openeditdefaultsview/stateProcess.js b/entity/Person_entity/entityfields/openeditdefaultsview/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..aefbc6e8f76f99c4281890f3461553c49562d5b9 --- /dev/null +++ b/entity/Person_entity/entityfields/openeditdefaultsview/stateProcess.js @@ -0,0 +1,7 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("KeywordRegistry_basic"); + +if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string(neon.COMPONENTSTATE_DISABLED); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/opentaskview/stateProcess.js b/entity/Person_entity/entityfields/opentaskview/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/entity/Person_entity/entityfields/picture/displayValueProcess.js b/entity/Person_entity/entityfields/picture/displayValueProcess.js index 2ad6742677b7f0a685be75783483833b35bebfc0..fd846d87707177ddf7438dfb66f956da2bd57f76 100644 --- a/entity/Person_entity/entityfields/picture/displayValueProcess.js +++ b/entity/Person_entity/entityfields/picture/displayValueProcess.js @@ -1,10 +1,18 @@ import("system.vars"); import("system.result"); import("system.neon"); +import("KeywordRegistry_basic"); + if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW) { - if (vars.get("$field.PICTURE")) - result.string(vars.get("$field.PICTURE")); + + if (vars.get("$field.STATUS") == $KeywordRegistry.contactStatus$inactive()) + result.string("VAADIN:CLOSE_BIG") else - result.string(vars.get("$param.AvatarText_param")); -} + { + if (vars.get("$field.PICTURE")) + result.string(vars.get("$field.PICTURE")); + else + result.string(vars.get("$param.AvatarText_param")); + } +} \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/recordfieldmappings/contactrole.displayvalue/expression.js b/entity/Person_entity/recordcontainers/db/recordfieldmappings/contactrole.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..588a1897cf0518ecf2236c8062133e304ea161a9 --- /dev/null +++ b/entity/Person_entity/recordcontainers/db/recordfieldmappings/contactrole.displayvalue/expression.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("CONTACTROLE"); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/recordfieldmappings/department.displayvalue/expression.js b/entity/Person_entity/recordcontainers/db/recordfieldmappings/department.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..40d0a559971c0e89f5f8db9321212c9d81fc231e --- /dev/null +++ b/entity/Person_entity/recordcontainers/db/recordfieldmappings/department.displayvalue/expression.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("DEPARTMENT"); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/recordfieldmappings/position.displayvalue/expression.js b/entity/Person_entity/recordcontainers/db/recordfieldmappings/position.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..33b955e1e7dbe1773b32cbf4d43d0e3ec6bb1e68 --- /dev/null +++ b/entity/Person_entity/recordcontainers/db/recordfieldmappings/position.displayvalue/expression.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("CONTACTPOSITION"); \ No newline at end of file diff --git a/entity/UniversalFileProcessor_entity/UniversalFileProcessor_entity.aod b/entity/UniversalFileProcessor_entity/UniversalFileProcessor_entity.aod index 85dbe914eb0f95de9a431073e247d335c4136bbf..b46af9a58f2764af6f2b9ba85d9baf6c2f419cda 100644 --- a/entity/UniversalFileProcessor_entity/UniversalFileProcessor_entity.aod +++ b/entity/UniversalFileProcessor_entity/UniversalFileProcessor_entity.aod @@ -22,5 +22,19 @@ <name>category_param</name> <expose v="true" /> </entityParameter> + <entityConsumer> + <name>Activities</name> + <dependency> + <name>dependency</name> + <entityName>Activity_entity</entityName> + <fieldName>LinkedObjects</fieldName> + </dependency> + <children> + <entityParameter> + <name>ActivityIDs_param</name> + <valueProcess>%aditoprj%/entity/UniversalFileProcessor_entity/entityfields/activities/children/activityids_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> </entity> diff --git a/entity/UniversalFileProcessor_entity/entityfields/activities/children/activityids_param/valueProcess.js b/entity/UniversalFileProcessor_entity/entityfields/activities/children/activityids_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..826d12e6b5386f0ca1808c840e61d740ac726b3d --- /dev/null +++ b/entity/UniversalFileProcessor_entity/entityfields/activities/children/activityids_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.exists("$global.ACTIVITY_IDS")? vars.get("$global.ACTIVITY_IDS"):"[]"); \ No newline at end of file diff --git a/entity/UniversalFileProcessor_entity/entityfields/drop_action/onActionProcess.js b/entity/UniversalFileProcessor_entity/entityfields/drop_action/onActionProcess.js index b538d551ae7e04936883c49898ae489fad2f7ce3..f72044a7c9312c6e04b4e3649629c884e82dc082 100644 --- a/entity/UniversalFileProcessor_entity/entityfields/drop_action/onActionProcess.js +++ b/entity/UniversalFileProcessor_entity/entityfields/drop_action/onActionProcess.js @@ -17,6 +17,7 @@ var status = { otherImportedFiles: 0, skippedFiles: 0 }; +var activityIDs = []; for (var i = 0, l = files.length; i < l; i++) { @@ -34,12 +35,16 @@ for (var i = 0, l = files.length; i < l; i++) var incomingMailExec = new IncomingEmailExecutor(mailObj); incomingMailExec.setAlias(dbAlias); var mailImportResult = incomingMailExec.autoProcess() - if (mailImportResult.activityId) + if ((!mailImportResult.unlinkedMailId) && mailImportResult.activityId) status.activitiesCreated++; - else if (mailImportResult.unlinkedMailId) + else if (mailImportResult.unlinkedMailId && mailImportResult.activityId) status.unlinkedMailsCreated++; else status.skippedFiles++; + + if (mailImportResult.activityId){ + activityIDs.push(mailImportResult.activityId); + } } else status.skippedFiles++; @@ -50,6 +55,8 @@ for (var i = 0, l = files.length; i < l; i++) } } +vars.set("$global.ACTIVITY_IDS", JSON.stringify(activityIDs)); //TODO: Änderung auf andere Variable #1057014 + if (status.activitiesCreated > 0 || status.unlinkedMailsCreated > 0 || status.otherImportedFiles > 0) neon.refreshAll();//this is needed for the dashboard: other elements are refreshed and display for example unlinkedMails diff --git a/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod b/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod index 0867671a3805c26c002b6fb881f88097809dbd5e..531c1918d2452b84b8a0548b723dc849f0906793 100644 --- a/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod +++ b/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod @@ -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> diff --git a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod index cb8b237c253d5a21e68730fa3d62ea3296cad6bc..449150050accbbfd17b3ac473b85c6532b497ec1 100644 --- a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod +++ b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod @@ -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> diff --git a/entity/VisitPlanEntry_entity/documentation.adoc b/entity/VisitPlanEntry_entity/documentation.adoc index 202b31e2f8f9aa493f717d896932c99aecfcaed1..fe840f04ecae1b740eca60633420ce2d1f362c95 100644 --- a/entity/VisitPlanEntry_entity/documentation.adoc +++ b/entity/VisitPlanEntry_entity/documentation.adoc @@ -1,4 +1,8 @@ = 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 diff --git a/entity/VisitPlanEntry_entity/entityfields/anycontacts/children/contactid_param/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/anycontacts/children/contactid_param/valueProcess.js deleted file mode 100644 index 6d0e1cf3f92832cd370bd8b960ddcbcf0ab74d82..0000000000000000000000000000000000000000 --- a/entity/VisitPlanEntry_entity/entityfields/anycontacts/children/contactid_param/valueProcess.js +++ /dev/null @@ -1,5 +0,0 @@ -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 diff --git a/entity/VisitPlanEntry_entity/entityfields/appointment_id/documentation.adoc b/entity/VisitPlanEntry_entity/entityfields/appointment_id/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..36604c1523c6d4c386d09ac97d809ccc5ea714b3 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/appointment_id/documentation.adoc @@ -0,0 +1,2 @@ +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 diff --git a/entity/VisitPlanEntry_entity/entityfields/contact_id/displayValueProcess.js b/entity/VisitPlanEntry_entity/entityfields/contact_id/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5384d5effe7fa9821b498472979d30014d7104bd --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/contact_id/displayValueProcess.js @@ -0,0 +1,10 @@ +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 diff --git a/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js b/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..03f6b8014252f4c2405882dda74d4955d797c27f --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/contact_id/onValidation.js @@ -0,0 +1,11 @@ +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 diff --git a/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..fe203ca7a71f6d00e5a41fc9b1d2447822c43177 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/contact_id/valueProcess.js @@ -0,0 +1,17 @@ +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 diff --git a/entity/VisitPlanEntry_entity/entityfields/contactcontext/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/contactcontext/valueProcess.js deleted file mode 100644 index 80c6814e0f702b58103b38e5c9d0f4d22d3033a6..0000000000000000000000000000000000000000 --- a/entity/VisitPlanEntry_entity/entityfields/contactcontext/valueProcess.js +++ /dev/null @@ -1,7 +0,0 @@ -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 diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js index ca537a336ac04404c3bdf82bbad7af873c9d06d3..0af8e295e63255fb7540147e6904e87cc65eb4fa 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js @@ -42,4 +42,4 @@ else links.push([context, contactId]); } -ActivityUtils.createNewActivity(null, links, null, null, null, null, $KeywordRegistry.activityDirection$outgoing(), null, $KeywordRegistry.activityCategory$visit(), vars.get("$field.ENTRYDATE"), vars.get("$field.UID")); \ No newline at end of file +ActivityUtils.createNewActivity(null, links, null, null, null, null, $KeywordRegistry.activityDirection$outgoing(), null, $KeywordRegistry.activityCategory$visit(), vars.get("$field.ENTRYDATE"), vars.get("$field.UID")); diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js index 29a02cbf84117b94c950075d7c09853e9c8c36e0..e9a7e5846d28fb6ffb8fcd6d7878ff3ea199d5f9 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js @@ -1,3 +1,7 @@ +import("Keyword_lib"); +import("Address_lib"); +import("Person_lib"); +import("Contact_lib"); import("KeywordRegistry_basic"); import("system.translate"); import("Sql_lib"); @@ -26,6 +30,7 @@ var values; var columns; var columnTypes; var update; +var i; var selectionRowData = vars.get("$sys.selectionRows"); @@ -35,43 +40,86 @@ var entryDateAsLong = selectionRowData[0].ENTRYDATE; var entryDate = datetime.toDate(entryDateAsLong, "dd-MM-yyyy"); var startTime = selectionRowData[0].BEGIN_TIME; var endTime = selectionRowData[0].END_TIME; -var organisation_id = selectionRowData[0].ORGANISATION_ID - -if(isGroup == "false") //No Group was selected +var organisation_id = selectionRowData[0].ORGANISATION_ID; +var organisationName = OrganisationUtils.getNameByOrganisationId(organisation_id); +var contact_id = selectionRowData[0].CONTACT_ID; +var contactName = ContactUtils.getFullTitleByContactId(contact_id); +var contactMail = CommUtil.getStandardSubSqlMail(contact_id) +var contactData = newSelect("CONTACT.DEPARTMENT, CONTACT.CONTACTROLE") + .from("CONTACT") + .where("CONTACT.CONTACTID", contact_id) + .arrayRow() +var department = contactData[0]; +var contactRole = contactData[1]; +var addressId = newSelect("CONTACT.ADDRESS_ID") + .from("CONTACT") + .where("CONTACT.CONTACTID", organisation_id) + .cell(); +var organisationAddress = new AddrObject(organisation_id); +var organisationAddressFormatted = organisationAddress.getFormattedAddress(false, "{salutation_name}\n {street} {buildingno}\n {country_short} - {zip} {city}"); +var contactCommunication = newSelect("COMMUNICATION.MEDIUM_ID, COMMUNICATION.ADDR") + .from("COMMUNICATION") + .where("COMMUNICATION.CONTACT_ID", contact_id) + .table(); +if(contactCommunication.length > 0) { - pointOfContact = newSelect(["CONTACT.CONTACTID", "(" + CommUtil.getStandardSubSqlMail() + ")"]) - .from("CONTACT") - .leftJoin("AB_ATTRIBUTERELATION", "CONTACT.CONTACTID = AB_ATTRIBUTERELATION.OBJECT_ROWID") - .leftJoin("AB_ATTRIBUTE", "AB_ATTRIBUTE.AB_ATTRIBUTEID = AB_ATTRIBUTERELATION.AB_ATTRIBUTE_ID") - .leftJoin("ORGANISATION", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID") - .where("AB_ATTRIBUTE.AB_ATTRIBUTEID", $AttributeRegistry.visitPlanPointOfContact()) - .and("ORGANISATION.ORGANISATIONID", organisation_id) - .table(); - - userMailto = []; - - for(var i = 0; i < pointOfContact.length; i++) + var communicationString; + for (i = 0; i < contactCommunication.length; i++) { - userMailto.push("mailto:" + pointOfContact[i][1], "CN:" + pointOfContact[i][1]); - mailAffectedUser.push(text.encodeMS(userMailto)); + communicationString += KeywordUtils.getViewValue($KeywordRegistry.communicationMedium(), contactCommunication[i][0]) + ": " + + contactCommunication[i][1] + "</br>" } + communicationString = communicationString.substring(9); +} +var summary = translate.text("Visit") + " " + contactName + " | "+ organisationName; +var description = contactName + "</br>" + + department + "</br>" + + contactRole + "</br>" + + communicationString + "</br>" + "</br>" + + organisationName + "</br>" + + organisationAddressFormatted; + +userMailto = []; +userMailto.push("mailto:" + contactMail, "CN:" + contactMail); +mailAffectedUser.push(text.encodeMS(userMailto)); - var startdate = entryDate + " " + datetime.toDate(startTime, "HH:mm:ss.S"); - startdate = datetime.toLong(startdate, "dd-MM-yyyy HH:mm:ss.S"); - var duration = eMath.subInt(endTime, startTime); - entry = CalendarUtil.createEntry("", calendars.VEVENT, translate.text("Visit"), "", false, false, false, vars.get("$sys.user"), [vars.get("$sys.user")], startdate, duration, null, calendars.STATUS_TENTATIVE, null, null, mailAffectedUser); +var startdate = entryDate + " " + datetime.toDate(startTime, "HH:mm:ss.S"); +startdate = datetime.toLong(startdate, "dd-MM-yyyy HH:mm:ss.S"); - params["Entry_param"] = JSON.stringify(entry); - uidAppointment = calendars.insert([entry]); +var duration = eMath.subInt(endTime, startTime); + +entry = CalendarUtil.createEntry("", calendars.VEVENT, summary, description, false, false, false, + vars.get("$sys.user"), [vars.get("$sys.user")], startdate, duration, null, calendars.STATUS_TENTATIVE, null, null); + +params["Entry_param"] = JSON.stringify(entry); +uidAppointment = calendars.insert([entry]); + +columns = ["AB_APPOINTMENTLINK_ID", + "APPOINTMENT_ID", + "OBJECT_TYPE", + "OBJECT_ROWID"] + +columnTypes = db.getColumnTypes("AB_APPOINTMENTLINK", columns, db.getCurrentAlias()); + +values = [util.getNewUUID(), + uidAppointment[0], + "Organisation", + organisation_id] +insert = db.insertData("AB_APPOINTMENTLINK", columns, columnTypes, values) + +values = [util.getNewUUID(), + uidAppointment[0], + "Person", + contact_id] +insert = db.insertData("AB_APPOINTMENTLINK", columns, columnTypes, values) - values = [$KeywordRegistry.visitPlanEntryStatus$Appointmentarranged(), uidAppointment[0]]; - columns = ["STATUS", "APPOINTMENT_ID"]; - columnTypes = db.getColumnTypes("VISITPLANENTRY", columns, db.getCurrentAlias()); +values = [$KeywordRegistry.visitPlanEntryStatus$Appointmentarranged(), uidAppointment[0]]; +columns = ["STATUS", "APPOINTMENT_ID"]; +columnTypes = db.getColumnTypes("VISITPLANENTRY", columns, db.getCurrentAlias()); - update = newWhere("VISITPLANENTRY.VISITPLANENTRYID", uid) +update = newWhere("VISITPLANENTRY.VISITPLANENTRYID", uid) .updateData(true, "VISITPLANENTRY", columns, columnTypes, values); - neon.setFieldValue("$field.STATUS", $KeywordRegistry.visitPlanEntryStatus$Appointmentarranged()); - neon.refreshAll(); -} \ No newline at end of file +neon.setFieldValue("$field.STATUS", $KeywordRegistry.visitPlanEntryStatus$Appointmentarranged()); +neon.refreshAll(); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_id/linkedContextProcess.js b/entity/VisitPlanEntry_entity/entityfields/organisation_id/linkedContextProcess.js deleted file mode 100644 index 666b1349748541127d2977a28e6a140ccbf800b1..0000000000000000000000000000000000000000 --- a/entity/VisitPlanEntry_entity/entityfields/organisation_id/linkedContextProcess.js +++ /dev/null @@ -1,5 +0,0 @@ -import("system.vars"); -import("system.result"); -import("Contact_lib"); - -result.string(ContactUtils.getContextByPersOrg(vars.get("$field.CONTACT_PERSON_ID"), vars.get("$field.CONTACT_ORG_ID"))); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_id/stateProcess.js b/entity/VisitPlanEntry_entity/entityfields/organisation_id/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..832f94c08cd6b525fa8a549e6332eea384362f65 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/organisation_id/stateProcess.js @@ -0,0 +1,10 @@ +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")) +{ + result.string(neon.COMPONENTSTATE_INVISIBLE); +} \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/organisation_id/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/organisation_id/valueProcess.js index 1e2ae6fb1b0bf9ab65352f918d3cdb1bd467de63..f641a6b32d121c19d65e3ad57e6b7fc5ca7e3953 100644 --- a/entity/VisitPlanEntry_entity/entityfields/organisation_id/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/organisation_id/valueProcess.js @@ -3,7 +3,8 @@ import("system.neon"); import("system.result"); import("system.vars"); -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null + && vars.exists("$param.OrganisationId_param") && vars.get("$param.OrganisationId_param")) { result.string(vars.get("$param.OrganisationId_param")); } \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..ec94b86401b566ada90ac2bd3f2d2c43bf78c950 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.vars"); +import("Sql_lib"); + +var contactIdArray = newSelect("CONTACT.CONTACTID") + .from("CONTACT") + .where("CONTACT.ORGANISATION_ID", vars.get("$field.ORGANISATION_ID"), SqlBuilder.NOT_EQUAL()) + .arrayColumn() +result.object(contactIdArray) \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js b/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js index dd23121f3e4c85f9b0a4b49d18a0c73913be022c..9711f6208cf7dff928ac21b7b0a8cfc89f4b57e1 100644 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js @@ -1,3 +1,4 @@ +import("Person_lib"); import("Keyword_lib"); import("Contact_lib"); import("Employee_lib"); @@ -15,7 +16,7 @@ var items = []; var group = []; var entryData = ""; -var entrySQL = newSelect("ENTRYDATE, VISITPLANENTRYID, BEGIN_TIME, END_TIME, ORGANISATION_ID, STATUS, VISITPLANEMPLOYEEWEEK_ID") +var entrySQL = newSelect("ENTRYDATE, VISITPLANENTRYID, BEGIN_TIME, END_TIME, ORGANISATION_ID, CONTACT_ID,STATUS, VISITPLANEMPLOYEEWEEK_ID, APPOINTMENT_ID") .from("VISITPLANENTRY"); if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) @@ -45,38 +46,29 @@ if(entryData.length > 0) { for(var i = 0; i < entryData.length; i++) { - var entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisation_id, status, visitplanemployeeweek_id; - [entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisation_id, status, visitplanemployeeweek_id] = entryData[i] + var entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisation_id, contact_id, status, visitplanemployeeweek_id, appointmentid; + [entryDateRaw, visitPlanEntryId, beginn_time, end_time, organisation_id, contact_id, status, visitplanemployeeweek_id, appointmentid] = entryData[i] - var contactData = newSelect("CONTACT.ORGANISATION_ID, CONTACT.PERSON_ID") - .from("CONTACT") - .where("CONTACT.CONTACTID", organisation_id) - .arrayRow(); - - - var orgname = OrganisationUtils.getNameByOrganisationId(contactData[0]); + var contactname = db.cell(PersUtils.getResolvingDisplaySubSql("'" + contact_id + "'")); + var orgname = OrganisationUtils.getNameByOrganisationId(organisation_id); var parentName = translate.text(datetime.toDate(entryDateRaw, "EEEE")); entryDate = datetime.toDate(entryDateRaw, "dd.MM.yyyy"); - + + var statusDisplay = KeywordUtils.getViewValue($KeywordRegistry.visitPlanEntryStatus(), status) + var alias = SqlUtils.getSystemAlias(); items.push([visitPlanEntryId, false, parentName + "#" + entryDate, "", beginn_time - , end_time, organisation_id, orgname, entryDateRaw, status, visitplanemployeeweek_id]); + , end_time, organisation_id, orgname, contact_id, contactname, entryDateRaw, status, visitplanemployeeweek_id, appointmentid, statusDisplay]); if(!vars.get("$local.idvalues")) { if(group.indexOf(parentName + "#" + entryDate) == -1) { - items.push([parentName + "#" + entryDate, true, "", parentName + " " + entryDate, "", "", "", "", "", "", ""]); + items.push([parentName + "#" + entryDate, true, "", parentName + " " + entryDate, "", "", "", "", "", "", "", "", "", "", ""]); group.push(parentName + "#" + entryDate); } } } } -//add Display Value for Status -for (let i = 0; i < items.length; i++) -{ - items[i][11] = KeywordUtils.getViewValue($KeywordRegistry.visitPlanEntryStatus(), items[i][9]) -} - result.object(items); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js index 398d44122293a9ba9d757d651896896aa4273a36..c0f1048f2920e1035145fc0c8ac1dfb49f915cc3 100644 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js +++ b/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js @@ -59,6 +59,7 @@ var valuesEntry = [ rowData["BEGIN_TIME.value"], rowData["END_TIME.value"], rowData["ORGANISATION_ID.value"], + rowData["CONTACT_ID.value"], visitPlanEmployeeWeekID, rowData["STATUS.value"] ]; @@ -69,6 +70,7 @@ var columnsEntry = [ "BEGIN_TIME", "END_TIME", "ORGANISATION_ID", + "CONTACT_ID", "VISITPLANEMPLOYEEWEEK_ID", "STATUS" ]; diff --git a/entity/VisitRecommendation_entity/VisitRecommendation_entity.aod b/entity/VisitRecommendation_entity/VisitRecommendation_entity.aod index 24c14af1835318b0a97cac0cdd85cb41c575fb56..12ff61c90d3335d882c896970ab01667a7961c5e 100644 --- a/entity/VisitRecommendation_entity/VisitRecommendation_entity.aod +++ b/entity/VisitRecommendation_entity/VisitRecommendation_entity.aod @@ -27,7 +27,9 @@ <entityField> <name>CONTACT_ID</name> <documentation>%aditoprj%/entity/VisitRecommendation_entity/entityfields/contact_id/documentation.adoc</documentation> - <title>Contactperson</title> + <title>Customer</title> + <consumer>OrganisationConsumer</consumer> + <stateProcess>%aditoprj%/entity/VisitRecommendation_entity/entityfields/contact_id/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/VisitRecommendation_entity/entityfields/contact_id/valueProcess.js</valueProcess> </entityField> <entityField> @@ -101,7 +103,7 @@ <dependency> <name>dependency</name> <entityName>Organisation_entity</entityName> - <fieldName>#PROVIDER</fieldName> + <fieldName>Organisations</fieldName> </dependency> </entityConsumer> <entityConsumer> diff --git a/entity/VisitRecommendation_entity/documentation.adoc b/entity/VisitRecommendation_entity/documentation.adoc index 9dc7ddd44659123d50ccd0f2ed6f75c4a49a4b05..791224a2b9c17df8b884ac9b3cdd3739768eab8f 100644 --- a/entity/VisitRecommendation_entity/documentation.adoc +++ b/entity/VisitRecommendation_entity/documentation.adoc @@ -1,4 +1,4 @@ = VisitRecommendation_entity For the recommended visits with their information(customer, address, priority, priority-source, duedate and Info. -Linked to VisitPlanEmployeeWeek_entity so you only see the entries in the chosen week. \ No newline at end of file +Keep in mind, that only the organization of visitplanEntries is important for the visitRecommendations and not the Point of Contact. \ No newline at end of file diff --git a/entity/VisitRecommendation_entity/entityfields/contact_id/stateProcess.js b/entity/VisitRecommendation_entity/entityfields/contact_id/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5cc1152733bc77ebadb70d7da6bec021692745a0 --- /dev/null +++ b/entity/VisitRecommendation_entity/entityfields/contact_id/stateProcess.js @@ -0,0 +1,7 @@ +import("system.logging"); +import("system.neon"); +import("system.result"); +import("system.vars"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$param.ContactId_param") && vars.exists("$param.ContactId_param")) +result.string(neon.COMPONENTSTATE_INVISIBLE) \ No newline at end of file diff --git a/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js b/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js index 5045250e03171debf64617cf93a996892a825237..f40acbba7672272556e64ce01b90ed8fd93e5b6b 100644 --- a/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/VisitRecommendation_entity/recordcontainers/jdito/contentProcess.js @@ -16,8 +16,6 @@ import("KeywordRegistry_basic"); import("Util_lib"); import("Address_lib"); -var sqlHelper = new SqlMaskingUtils(db.getCurrentAlias()); - var recommendationData = []; var activitySubQuery = ""; @@ -85,7 +83,7 @@ var recommendationSQLData = newSelect(["VISITRECOMMENDATIONID", "VISITRECOMMENDA .and("VISITPLANENTRY.entrydate", datetime.today(), SqlBuilder.GREATER()) .cell(), - newSelect("contact_id") + newSelect("VISITRECOMMENDATION.CONTACT_ID") .from("VISITPLANEMPLOYEEWEEK, VISITPLANENTRY") .where("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", "VISITPLANEMPLOYEEWEEKID") .and("VISITRECOMMENDATION.CONTACT_ID", "VISITPLANENTRY.ORGANISATION_ID") diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index fc6870e2c140885397fd2504d758e24b82198e41..fe27631e36b764b8516909749aedd5041d1e8eb3 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -6653,6 +6653,9 @@ <entry> <key>Leadimport Reset</key> </entry> + <entry> + <key>Offer status changed!</key> + </entry> <entry> <key>Möchten Sie den Import abbrechen?</key> </entry> @@ -6693,7 +6696,13 @@ <key>Linked In</key> </entry> <entry> - <key>Invalid file type; only .html, .eml and .txt are allowed</key> + <key>Contact has to be employee in the chosen Organisation</key> + </entry> + <entry> + <key>Appointment Status</key> + </entry> + <entry> + <key>Not created yet</key> </entry> <entry> <key>ankle of</key> @@ -6710,6 +6719,18 @@ <entry> <key>New Visit Recommendation</key> </entry> + <entry> + <key>Set salesproject phase</key> + </entry> + <entry> + <key>Create salesproject</key> + </entry> + <entry> + <key> number of connections</key> + </entry> + <entry> + <key>Create salesproject touchpoint</key> + </entry> <entry> <key>Limited details</key> </entry> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 8fb1843084c01789e1932ec846d629fd0da4ff4d..a06d484d4b27c139da8d845b89f4f19bf1994a48 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -28,7 +28,6 @@ </entry> <entry> <key>Finished</key> - <value>Abgeschlossen</value> </entry> <entry> <key>Show my organisations</key> @@ -1436,7 +1435,7 @@ </entry> <entry> <key>Location</key> - <value>Ort</value> + <value>Standort</value> </entry> <entry> <key>75 %</key> @@ -8492,9 +8491,6 @@ Bitte Datumseingabe prüfen</value> <key>Serial Letter</key> <value>Serienbrief</value> </entry> - <entry> - <key>Abgesagt</key> - </entry> <entry> <key>Point of Contact</key> </entry> @@ -8592,6 +8588,19 @@ Bitte Datumseingabe prüfen</value> <entry> <key>Abomodel</key> </entry> + <entry> + <key>Set salesproject phase</key> + </entry> + <entry> + <key>Create salesproject</key> + </entry> + <entry> + <key> number of connections</key> + <value>Anzahl Verknüpfungen</value> + </entry> + <entry> + <key>Create salesproject touchpoint</key> + </entry> <entry> <key>Limited details</key> <value>Eingeschränkte Details</value> @@ -8632,6 +8641,18 @@ Bitte Datumseingabe prüfen</value> <key>Full details</key> <value>Alle Details</value> </entry> + <entry> + <key>Contact has to be employee in the chosen Organisation</key> + <value>Kontakt muss Mitarbeiter in der ausgewähltne Firma sein</value> + </entry> + <entry> + <key>Appointment Status</key> + <value>Terminstatus</value> + </entry> + <entry> + <key>Not created yet</key> + <value>Noch nicht erstellt</value> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 73a7ba3dbee552a181da34db47c07421212c9fc3..fd3c8a7f0d2df9506a9fa0331a6c036f52eedb88 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -6706,6 +6706,9 @@ <entry> <key>Leadimport Reset</key> </entry> + <entry> + <key>Offer status changed!</key> + </entry> <entry> <key>Möchten Sie den Import abbrechen?</key> </entry> @@ -6758,7 +6761,13 @@ <key>Week</key> </entry> <entry> - <key>Invalid file type; only .html, .eml and .txt are allowed</key> + <key>Contact has to be employee in the chosen Organisation</key> + </entry> + <entry> + <key>Appointment Status</key> + </entry> + <entry> + <key>Not created yet</key> </entry> <entry> <key>Visit Planning</key> @@ -6766,6 +6775,18 @@ <entry> <key>ankle of</key> </entry> + <entry> + <key>Set salesproject phase</key> + </entry> + <entry> + <key>Create salesproject</key> + </entry> + <entry> + <key> number of connections</key> + </entry> + <entry> + <key>Create salesproject touchpoint</key> + </entry> <entry> <key>Visit Planning</key> </entry> diff --git a/neonContext/Activity/Activity.aod b/neonContext/Activity/Activity.aod index ab6c6588469b634a18567c187ee0094c9bcd4571..a1422e41f51f12e1f51d461ec428b16219209e31 100644 --- a/neonContext/Activity/Activity.aod +++ b/neonContext/Activity/Activity.aod @@ -37,5 +37,9 @@ <name>3884f349-be09-47bd-8930-47e0697d658f</name> <view>ActivityMultiEdit_view</view> </neonViewReference> + <neonViewReference> + <name>01feb10a-34d2-4ef3-b87b-a1e35a4b12e0</name> + <view>ActivityUniversalFileProcessorFilter_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonView/ActivityUniversalFileProcessorFilter_view/ActivityUniversalFileProcessorFilter_view.aod b/neonView/ActivityUniversalFileProcessorFilter_view/ActivityUniversalFileProcessorFilter_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..a40577f24e623131aba304a68873f02eb1055f0f --- /dev/null +++ b/neonView/ActivityUniversalFileProcessorFilter_view/ActivityUniversalFileProcessorFilter_view.aod @@ -0,0 +1,45 @@ +<?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.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.6"> + <name>ActivityUniversalFileProcessorFilter_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <groupLayout> + <name>layout</name> + </groupLayout> + </layout> + <children> + <tableViewTemplate> + <name>ActivityUniversalFileProcessorFilterTable</name> + <iconField>#IMAGE</iconField> + <titleField>SUBJECT</titleField> + <subtitleField>ENTRYDAY</subtitleField> + <descriptionField>DIRECTION</descriptionField> + <entityField>#ENTITY</entityField> + <linkedColumns> + <element>SUBJECT</element> + </linkedColumns> + <columns> + <neonTableColumn> + <name>d97147cc-cbdc-4eab-99b3-8c6fd092329d</name> + <entityField>entryDateDateFormat</entityField> + </neonTableColumn> + <neonTableColumn> + <name>030dcd56-6f13-4f93-b37e-7ebb4eaa4b70</name> + <entityField>countLinks</entityField> + </neonTableColumn> + <neonTableColumn> + <name>fa2cad56-c55d-48c9-b77c-5741b7299131</name> + <entityField>RESPONSIBLE</entityField> + </neonTableColumn> + <neonTableColumn> + <name>4505af54-c491-4f59-a5b7-ae93718baa70</name> + <entityField>SUBJECT</entityField> + </neonTableColumn> + <neonTableColumn> + <name>a32a87b0-79ed-4774-9331-a814298c4ee8</name> + <entityField>INFO</entityField> + </neonTableColumn> + </columns> + </tableViewTemplate> + </children> +</neonView> diff --git a/neonView/LogHistoryFilter_view/LogHistoryFilter_view.aod b/neonView/LogHistoryFilter_view/LogHistoryFilter_view.aod index df8e17c739fe2659db9ee8242894f89caf772cad..fad28a618b1f1e86b397f291a859d8c90841b345 100644 --- a/neonView/LogHistoryFilter_view/LogHistoryFilter_view.aod +++ b/neonView/LogHistoryFilter_view/LogHistoryFilter_view.aod @@ -3,7 +3,7 @@ <name>LogHistoryFilter_view</name> <title>Log</title> <majorModelMode>DISTRIBUTED</majorModelMode> - <filterable v="true" /> + <filterable v="false" /> <layout> <groupLayout> <name>layout</name> diff --git a/neonView/OrganisationFilter_view/OrganisationFilter_view.aod b/neonView/OrganisationFilter_view/OrganisationFilter_view.aod index 90abf63f4003d63aaad0590a57405845f10329a6..f8c447378a26d517bb9521f3913d82b9ac037d79 100644 --- a/neonView/OrganisationFilter_view/OrganisationFilter_view.aod +++ b/neonView/OrganisationFilter_view/OrganisationFilter_view.aod @@ -60,7 +60,7 @@ <columns> <neonTableColumn> <name>2008e7ac-9e6a-4104-9d5b-da60a10a1c02</name> - <entityField>#IMAGE</entityField> + <entityField>PICTURE</entityField> </neonTableColumn> <neonTableColumn> <name>a290a2ca-3236-4eb0-bf51-99f99d8414d6</name> diff --git a/neonView/UniversalFileProcessorDropzone_view/UniversalFileProcessorDropzone_view.aod b/neonView/UniversalFileProcessorDropzone_view/UniversalFileProcessorDropzone_view.aod index 15a8687076458278599c09ab2b52e4e07541c089..8072435ed1e7c2dd82d0177d949b9d1fea218418 100644 --- a/neonView/UniversalFileProcessorDropzone_view/UniversalFileProcessorDropzone_view.aod +++ b/neonView/UniversalFileProcessorDropzone_view/UniversalFileProcessorDropzone_view.aod @@ -37,5 +37,10 @@ <descriptionField>INFO</descriptionField> <entityField>#ENTITY</entityField> </dragAndDropViewTemplate> + <neonViewReference> + <name>9cddaca9-6c6a-426c-90f1-54f6d21305d4</name> + <entityField>Activities</entityField> + <view>ActivityUniversalFileProcessorFilter_view</view> + </neonViewReference> </children> </neonView> diff --git a/neonView/VisitPlanEntryEdit_view/VisitPlanEntryEdit_view.aod b/neonView/VisitPlanEntryEdit_view/VisitPlanEntryEdit_view.aod index 28604879e7108ad50dd857e98fea28e94e177984..69433069c2a760ea96f1919145fc9ac450b2ea29 100644 --- a/neonView/VisitPlanEntryEdit_view/VisitPlanEntryEdit_view.aod +++ b/neonView/VisitPlanEntryEdit_view/VisitPlanEntryEdit_view.aod @@ -19,6 +19,10 @@ <name>6cb39117-71cf-432b-afe7-b3446921d89e</name> <entityField>ORGANISATION_ID</entityField> </entityFieldLink> + <entityFieldLink> + <name>7584baf6-340c-419b-ad16-03c75b96aa39</name> + <entityField>CONTACT_ID</entityField> + </entityFieldLink> <entityFieldLink> <name>8347bc87-30f2-4335-b824-23e107b949b5</name> <entityField>ENTRYDATE</entityField> diff --git a/neonView/VisitPlanEntryFilter_view/VisitPlanEntryFilter_view.aod b/neonView/VisitPlanEntryFilter_view/VisitPlanEntryFilter_view.aod index 8db62ce75af057e94f32bbb8eba63f4c70819676..d7dcd500c7cd98ba11fb59219587d07c538a05fc 100644 --- a/neonView/VisitPlanEntryFilter_view/VisitPlanEntryFilter_view.aod +++ b/neonView/VisitPlanEntryFilter_view/VisitPlanEntryFilter_view.aod @@ -56,6 +56,10 @@ <name>646193df-c713-4b40-85cc-0fbe6f8cb316</name> <entityField>ORGANISATION_ID</entityField> </neonTreeTableColumn> + <neonTreeTableColumn> + <name>bcaf81b5-0e84-47e0-91aa-b62cec49ed17</name> + <entityField>CONTACT_ID</entityField> + </neonTreeTableColumn> <neonTreeTableColumn> <name>ca75adc7-5405-40af-bda0-52ae38e61f76</name> <entityField>STATUS</entityField> diff --git a/neonView/VisitRecommendationEdit_view/VisitRecommendationEdit_view.aod b/neonView/VisitRecommendationEdit_view/VisitRecommendationEdit_view.aod index e23697e9b2c4a7c34be6387a84308d922cb82600..3f6a787f4a8bf4bc1faad535b28ccce8aef50778 100644 --- a/neonView/VisitRecommendationEdit_view/VisitRecommendationEdit_view.aod +++ b/neonView/VisitRecommendationEdit_view/VisitRecommendationEdit_view.aod @@ -15,6 +15,10 @@ <entityField>#ENTITY</entityField> <isEditable v="true" /> <fields> + <entityFieldLink> + <name>1356cbc2-646b-4277-8671-cf004b2dffd8</name> + <entityField>CONTACT_ID</entityField> + </entityFieldLink> <entityFieldLink> <name>f4c34f77-c8cd-4eeb-a172-2f22a6de4029</name> <entityField>DUE_DATE</entityField> diff --git a/process/ActivityTask_lib/process.js b/process/ActivityTask_lib/process.js index 8b47036ae72278c5eee854102ea827dbebe8fc0f..0e23cd7b6c2028c7812508707862273ad150795b 100644 --- a/process/ActivityTask_lib/process.js +++ b/process/ActivityTask_lib/process.js @@ -201,6 +201,12 @@ ActivityUtils.insertDocuments = function (pActivityId, pDocuments) * For example: * <pre>[["number.txt", * "MDExOCA5OTkgODgxIDk5OSAxMTkgNzI1IDM", true]]</pre> + * @param {String} pCategory (optional) <p> + * category (e.g visit)<br> + * @param {String} pEntryDate (optional) <p> + * entryDate of an Visit<br> + * @param {String} pVisitPlanEntryId (optional) <p> + * visitPlanEntryId (needed to set the status of visits in visitPlanning)<br> * @static * @example * var content; @@ -222,7 +228,7 @@ ActivityUtils.insertDocuments = function (pActivityId, pDocuments) * $KeywordRegistry.activityDirection$outgoing(), * [["Letter.docx", content, false]]); */ -ActivityUtils.createNewActivity = function(pRowId, pAdditionalLinks, pParentContext, pParentId, pSubject, pInfo, pDirection, pDocuments) +ActivityUtils.createNewActivity = function(pRowId, pAdditionalLinks, pParentContext, pParentId, pSubject, pInfo, pDirection, pDocuments, pCategory, pEntryDate, pVisitPlanEntryId) { var params = {}; if (pDocuments) @@ -233,6 +239,12 @@ ActivityUtils.createNewActivity = function(pRowId, pAdditionalLinks, pParentCont params["Info_param"] = text.text2html(pInfo.trim(), false); if (pDirection) params["Direction_param"] = pDirection; + if (pCategory) + params["Category_param"] = pCategory; + if (pEntryDate) + params["Entrydate_param"] = pEntryDate; + if (pVisitPlanEntryId) + params["VisitPlanEntryId_param"] = pVisitPlanEntryId; _ActivityTaskUtils._createNew("Activity", pRowId, pAdditionalLinks, pParentContext, pParentId, params) }; diff --git a/process/Appointment_lib/process.js b/process/Appointment_lib/process.js index 66eabd04b1983a22cb7c2b1b477f3b7ae9bb8218..c40c2d134dfd8ea6d7cc2d5b24d964bf80cbefc2 100644 --- a/process/Appointment_lib/process.js +++ b/process/Appointment_lib/process.js @@ -157,8 +157,9 @@ AppointmentUtils.setAppointmentLinkComponentState = function(pSysRecordstate, pA { var currentUserId = CalendarUtil.getEffectiveCalendarIdFromUser(tools.getCurrentUser()); var organzierId = CalendarUtil.getEffectiveCalendarIdFromUser(tools.getUser(entry[calendars.ORGANIZER2]["cn"], tools.PROFILE_DEFAULT)); + var owner = text.decodeMS(entry["h"])[1].split(":")[1] - if(currentUserId && currentUserId == organzierId) + if(currentUserId && currentUserId == organzierId || calendars.hasPermission([owner], calendars.VEVENT, "WRITE")) return neon.COMPONENTSTATE_EDITABLE; else return neon.COMPONENTSTATE_DISABLED; diff --git a/process/Document_lib/process.js b/process/Document_lib/process.js index 1fc5466aa2751bc671c6fdc20da3b1e025ec807a..6085c3f5eec1ff9f9c1954bfd29b490188c27751 100644 --- a/process/Document_lib/process.js +++ b/process/Document_lib/process.js @@ -19,23 +19,27 @@ function DocumentUtil(){ * Utility function to download all selected documents. * Selected documents will be checked with $sys.selectionRows * Documents will be downloaded with neon.download + * @param {String} pAssignmentName (optional) the name of the assignment, used to modify the filename + * */ -DocumentUtil.downloadSelectedDocuments = function() { +DocumentUtil.downloadSelectedDocuments = function(pAssignmentName) { var alias = SqlUtils.getBinariesAlias(); if(vars.exists("$sys.selectionRows") && vars.getString("$sys.selectionRows")) { var rows = vars.get("$sys.selectionRows"); var uids = vars.get("$sys.selection"); var binaryContents = db.getBinaryContents(uids, alias); - + // check if multiplie Files are selected. // files get packed into a zip archive before downloading if(binaryContents.length > 1) { var fileNames = rows.map(function(value) { return value["NAME"]; }); neon.downloadToZip(translate.text("Files") + ".zip", binaryContents, fileNames); - } else { - neon.download(binaryContents[0], rows[0]["NAME"]); } + else if(pAssignmentName == "ERRORLOG") + neon.download(binaryContents[0], rows[0]["NAME"] + ".txt"); + else + neon.download(binaryContents[0], rows[0]["NAME"]); } } diff --git a/process/IncomingEmailExecutor_lib/process.js b/process/IncomingEmailExecutor_lib/process.js index ce4cbed2796ab576a163b3f4fa6d092ff11081a1..6841b19deb7a2398849d77c40c770dd190e9e7a9 100644 --- a/process/IncomingEmailExecutor_lib/process.js +++ b/process/IncomingEmailExecutor_lib/process.js @@ -71,6 +71,7 @@ IncomingEmailExecutor.prototype.setActivityEmployeeContact = function (pContactI else { this.activityData.employeeContactId = pContactId; + this.activityData.links.push(["Person", pContactId]); this.activityData.employeeContactLanguage = pLanguageIso3; } } @@ -198,7 +199,7 @@ IncomingEmailExecutor.prototype.createActivity = function(pAdditionalLinks) activityLinks = ArrayUtils.distinct2d(activityLinks);//TODO: better check before adding the elements into the array if it already exists there var activityDocs = [["mail.eml", util.encodeBase64String(mail.toRFC(this.rawMail)), true]]; - var activityRes = ActivityUtils.insertNewActivity(activityDataForInsert, activityLinks, activityDocs, this._alias); + var activityRes = ActivityUtils.insertNewActivity(activityDataForInsert, activityLinks, activityDocs, this._alias, this.mailSentDate); return activityRes; } @@ -210,6 +211,7 @@ IncomingEmailExecutor.prototype.deleteUnlinkedMail = function (pUnlinkedMailId) IncomingEmailExecutor.prototype.autoProcess = function(pUnlinkedMailId) { + let tempResult = {}; if (this.isUnlinkable()) { if (pUnlinkedMailId) @@ -217,12 +219,12 @@ IncomingEmailExecutor.prototype.autoProcess = function(pUnlinkedMailId) unlinkedMailId: pUnlinkedMailId }; else - return this.insertUnlinkedMail(); + tempResult.unlinkedMailId = this.insertUnlinkedMail(); } - var activityRes = this.createActivity(); + tempResult.activityId = this.createActivity().activityId; this.deleteUnlinkedMail(pUnlinkedMailId); - return activityRes; + return tempResult; } IncomingEmailExecutor.prototype._getProcessingFunction = function (pIsSender, pTargetArray) diff --git a/process/KeywordRegistry_basic/process.js b/process/KeywordRegistry_basic/process.js index e8e257f78ff1f409e4ba075a1b1388877d0b6fae..b53349181660fe4f0829d5fa6f8b7e03e755f735 100644 --- a/process/KeywordRegistry_basic/process.js +++ b/process/KeywordRegistry_basic/process.js @@ -251,7 +251,6 @@ $KeywordRegistry.workflowSignalTrigger$delete = function(){return "TRIGGEREVENTD $KeywordRegistry.permissionCalendarType = function(){return "PermissionCalendarType";}; $KeywordRegistry.permissionCalendarType$user = function(){return "USER";}; $KeywordRegistry.permissionCalendarType$department = function(){return "DEPARTMENT";}; - $KeywordRegistry.workflowActivityType = function(){return "WorkflowActivityType";}; $KeywordRegistry.workflowActivityType$sequenceFlow = function(){return "sequenceFlow";}; $KeywordRegistry.workflowActivityType$startEvent = function(){return "startEvent";}; diff --git a/process/Leadimport_lib/process.js b/process/Leadimport_lib/process.js index 282dfc8408152e9c99969a0b300e215229ef5dc3..12ee0883e8b9d49b2556cbf740a459580afaf2b3 100644 --- a/process/Leadimport_lib/process.js +++ b/process/Leadimport_lib/process.js @@ -1,3 +1,4 @@ +import("ExportTemplate_lib"); import("system.workflow"); import("system.project"); import("Util_lib"); @@ -93,6 +94,10 @@ LeadImportUtils.loadImportFile = function(pBinId, pFieldSep, pFieldLimit, pRecor var insertCols = ["IMPORTFIELDID", "FIELDNAME", "LEADIMPORT_ID", "DATE_NEW", "USER_NEW", "FIELDNUMBER"]; var insertTypes = db.getColumnTypes(insertTable, insertCols); var insertVals = []; + var sentenceSeparator = ExportTemplateUtils.getSentenceSeparator(pRecordSep); + var fieldSeparator = ExportTemplateUtils.getFieldSeparator(pFieldSep); + var fieldDeLimiter = ExportTemplateUtils.getFieldDeLimiter(pFieldLimit); + if (pUpdate == undefined) pUpdate = false; @@ -102,7 +107,7 @@ LeadImportUtils.loadImportFile = function(pBinId, pFieldSep, pFieldLimit, pRecor { var data = db.getBinaryContent(pBinId, SqlUtils.getBinariesAlias()); data = util.decodeBase64String(data, "UTF-8"); - var table = text.parseCSV(data.replace(/(^\s+)|(\s+$)/g,""), pRecordSep, pFieldSep, pFieldLimit.charAt(0)); + var table = text.parseCSV(data.replace(/(^\s+)|(\s+$)/g,""), sentenceSeparator, fieldSeparator, fieldDeLimiter); if (pNewFile) { if (pUpdate) { diff --git a/process/Person_lib/process.js b/process/Person_lib/process.js index 1963013e3e25e981546cf3852b7dc242c71a7b39..4537b57af5ccffb4642c96eac520d723ba780558 100644 --- a/process/Person_lib/process.js +++ b/process/Person_lib/process.js @@ -58,7 +58,7 @@ PersUtils.getResolvingDisplaySubSql = function(pRelationIdField) { var selectExpression = PersUtils.getDisplaySqlExpression(); - //TODO: verify if there is a better solution for the usage of this as a displayValueExpression --> automatic use of #TITLE | waiting vor implementation + //TODO: verify if there is a better solution for the usage of this as a displayValueExpression --> automatic use of #TITLE | waiting for implementation return "select " + selectExpression + "from PERSON \n\ join CONTACT on (PERSON.PERSONID = CONTACT.PERSON_ID) \n\ where CONTACT.CONTACTID = " + pRelationIdField;