diff --git a/.liquibase/Data_alias/basic/2021.1.3/Visitplan/alter_VisitplanEntry.xml b/.liquibase/Data_alias/basic/2021.1.3/Visitplan/alter_VisitplanEntry.xml new file mode 100644 index 0000000000000000000000000000000000000000..1412f59c3507c2b770e6ee3f09215e70e5fd3819 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.1.3/Visitplan/alter_VisitplanEntry.xml @@ -0,0 +1,10 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet author="Pierre Suchacek" id="716d7ee8-c84e-401b-bc05-cbbab5e17542"> + <addColumn tableName="VISITPLANENTRY"> + <column name="PREPARATION" type="LONGTEXT"/> + </addColumn> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.1.3/Visitplan/changelog.xml b/.liquibase/Data_alias/basic/2021.1.3/Visitplan/changelog.xml new file mode 100644 index 0000000000000000000000000000000000000000..0e6c626969481e883f16504e95b59c870b8f5bcc --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.1.3/Visitplan/changelog.xml @@ -0,0 +1,6 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <include relativeToChangelogFile="true" file="alter_VisitplanEntry.xml"/> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.1.3/changelog.xml b/.liquibase/Data_alias/basic/2021.1.3/changelog.xml index ef8ebadc8952c74c33a55045c4c76779dd41a35e..985b989b2d949422c14a75d7752a4ab74bdeeda6 100644 --- a/.liquibase/Data_alias/basic/2021.1.3/changelog.xml +++ b/.liquibase/Data_alias/basic/2021.1.3/changelog.xml @@ -4,6 +4,7 @@ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> <include relativeToChangelogFile="true" file="defaultWeblinks/changelog.xml"/> <include relativeToChangelogFile="true" file="Checklist/changelog.xml"/> + <include relativeToChangelogFile="true" file="Visitplan/changelog.xml"/> <include relativeToChangelogFile="true" file="alter_dataTypesToDateTime.xml"/> <include relativeToChangelogFile="true" file="Grouptask/changelog.xml"/> </databaseChangeLog> \ No newline at end of file diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 58c01635d527d7b7722700fa607fee04731c164e..ddd2d828f2905c5456daed5f9346d002fe9a5517 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -14752,7 +14752,7 @@ <dbName></dbName> <primaryKey v="false" /> <columnType v="92" /> - <size v="10" /> + <size v="8" /> <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> @@ -14766,7 +14766,7 @@ <dbName></dbName> <primaryKey v="false" /> <columnType v="92" /> - <size v="10" /> + <size v="8" /> <scale v="0" /> <notNull v="false" /> <isUnique v="false" /> @@ -14887,6 +14887,20 @@ <title></title> <description></description> </entityFieldDb> + <entityFieldDb> + <name>PREPARATION</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="2005" /> + <size v="2147483647" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> </entityFields> </entityDb> <entityDb> diff --git a/entity/Object_entity/Object_entity.aod b/entity/Object_entity/Object_entity.aod index 3aa152675972a2cf7627bba7d76bcd2f3610e9a2..1a530d4eabaa86e93d12a634f2c925de057d4760 100644 --- a/entity/Object_entity/Object_entity.aod +++ b/entity/Object_entity/Object_entity.aod @@ -233,6 +233,19 @@ <fieldName>#PROVIDER</fieldName> </dependency> </entityConsumer> + <entityConsumer> + <name>VisitPlanEntries</name> + <dependency> + <name>dependency</name> + <entityName>VisitPlanEntry_entity</entityName> + <fieldName>#PROVIDER</fieldName> + </dependency> + <children> + <entityParameter> + <name>ContactId_param</name> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod b/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod index 14897c0211e34f9bc450dc6ddc420a9a8b4bcb98..ac03a88fc9981b1c1db9ab26d4d0e250fcd302b2 100644 --- a/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod +++ b/entity/VisitPlanEmployeeWeek_entity/VisitPlanEmployeeWeek_entity.aod @@ -104,6 +104,14 @@ <valueProcess>%aditoprj%/entity/VisitPlanEmployeeWeek_entity/entityfields/entries/children/entries_param/valueProcess.js</valueProcess> <expose v="true" /> </entityParameter> + <entityParameter> + <name>EntryWeek_param</name> + <valueProcess>%aditoprj%/entity/VisitPlanEmployeeWeek_entity/entityfields/entries/children/entryweek_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>CurrentContext_param</name> + <valueProcess>%aditoprj%/entity/VisitPlanEmployeeWeek_entity/entityfields/entries/children/currentcontext_param/valueProcess.js</valueProcess> + </entityParameter> </children> </entityConsumer> <entityProvider> diff --git a/entity/VisitPlanEmployeeWeek_entity/entityfields/entries/children/currentcontext_param/valueProcess.js b/entity/VisitPlanEmployeeWeek_entity/entityfields/entries/children/currentcontext_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7d9b2cb7a69e6a3f6abdf7cdc01c598ba3e8953f --- /dev/null +++ b/entity/VisitPlanEmployeeWeek_entity/entityfields/entries/children/currentcontext_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$sys.currentcontextname")); \ No newline at end of file diff --git a/entity/VisitPlanEmployeeWeek_entity/entityfields/entries/children/entryweek_param/valueProcess.js b/entity/VisitPlanEmployeeWeek_entity/entityfields/entries/children/entryweek_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..19f03c4f102bde295fed129d1dc045d378a92464 --- /dev/null +++ b/entity/VisitPlanEmployeeWeek_entity/entityfields/entries/children/entryweek_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.WEEK")); \ No newline at end of file diff --git a/entity/VisitPlanEmployeeWeek_entity/entityfields/entries_appoint_count/valueProcess.js b/entity/VisitPlanEmployeeWeek_entity/entityfields/entries_appoint_count/valueProcess.js index 3658b62b0ed026756287c596435c61d261a0b362..633257a03f8d04867554c9fc3119f005d1209a1d 100644 --- a/entity/VisitPlanEmployeeWeek_entity/entityfields/entries_appoint_count/valueProcess.js +++ b/entity/VisitPlanEmployeeWeek_entity/entityfields/entries_appoint_count/valueProcess.js @@ -6,5 +6,5 @@ import("Sql_lib"); result.string(newSelect("count(*)") .from("VISITPLANENTRY") .where("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", vars.get("$field.VISITPLANEMPLOYEEWEEKID")) - .and("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$Appointmentarranged()) + .and("VISITPLANENTRY.STATUS_APPOINTMENT", $KeywordRegistry.visitPlanEntryStatusAppointment$confirmed()) .cell()); \ No newline at end of file diff --git a/entity/VisitPlanEmployeeWeek_entity/entityfields/entriesplannedcount/valueProcess.js b/entity/VisitPlanEmployeeWeek_entity/entityfields/entriesplannedcount/valueProcess.js index 2da415daa710e7124099dcb11b9f5c6608b8829a..b0e28c128e8e28b382d84baac87c26193f9e82e3 100644 --- a/entity/VisitPlanEmployeeWeek_entity/entityfields/entriesplannedcount/valueProcess.js +++ b/entity/VisitPlanEmployeeWeek_entity/entityfields/entriesplannedcount/valueProcess.js @@ -6,5 +6,5 @@ import("Sql_lib"); result.string(newSelect("count(*)") .from("VISITPLANENTRY") .where("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", vars.get("$field.VISITPLANEMPLOYEEWEEKID")) - .and("VISITPLANENTRY.STATUS", $KeywordRegistry.visitPlanEntryStatus$planned()) + .and("VISITPLANENTRY.STATUS_APPOINTMENT", $KeywordRegistry.visitPlanEntryStatusAppointment$requested()) .cell()); diff --git a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod index 9f368889fffa44029278bcac66414a50193d3ab1..eb8f3cd9ad4e6ec22ef76b8acad086106ddd74b3 100644 --- a/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod +++ b/entity/VisitPlanEntry_entity/VisitPlanEntry_entity.aod @@ -7,21 +7,31 @@ <grantCreateProcess>%aditoprj%/entity/VisitPlanEntry_entity/grantCreateProcess.js</grantCreateProcess> <grantUpdateProcess>%aditoprj%/entity/VisitPlanEntry_entity/grantUpdateProcess.js</grantUpdateProcess> <grantDeleteProcess>%aditoprj%/entity/VisitPlanEntry_entity/grantDeleteProcess.js</grantDeleteProcess> + <contentTitleProcess>%aditoprj%/entity/VisitPlanEntry_entity/contentTitleProcess.js</contentTitleProcess> <onValidation>%aditoprj%/entity/VisitPlanEntry_entity/onValidation.js</onValidation> <afterSave>%aditoprj%/entity/VisitPlanEntry_entity/afterSave.js</afterSave> <titlePlural></titlePlural> - <recordContainer>jDito</recordContainer> + <recordContainer>db</recordContainer> <entityFields> <entityProvider> <name>#PROVIDER</name> + <recordContainer>db</recordContainer> + <dependencies> + <entityDependency> + <name>9c85f2be-a51e-4306-ae26-6c1e7ffb85b4</name> + <entityName>Object_entity</entityName> + <fieldName>VisitPlanEntries</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> </entityProvider> <entityField> <name>VISITPLANEMPLOYEEWEEK_ID</name> <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/visitplanemployeeweek_id/valueProcess.js</valueProcess> </entityField> <entityField> - <name>UID</name> - <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/uid/valueProcess.js</valueProcess> + <name>VISITPLANENTRYID</name> + <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/visitplanentryid/valueProcess.js</valueProcess> </entityField> <entityField> <name>STATUS</name> @@ -49,6 +59,7 @@ <resolution>DAY</resolution> <outputFormat>dd.MM.yyyy</outputFormat> <inputFormat>dd.MM.yyyy</inputFormat> + <groupable v="true" /> <mandatory v="true" /> <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entrydate/valueProcess.js</valueProcess> <onValueChange>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entrydate/onValueChange.js</onValueChange> @@ -90,44 +101,6 @@ <element>MASK</element> </onValueChangeTypes> </entityField> - <entityActionGroup> - <name>entityActionGroup</name> - <iconId>VAADIN:CALENDAR</iconId> - <children> - <entityActionField> - <name>NewActivity</name> - <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/documentation.adoc</documentation> - <title>Create Visitreport</title> - <onActionProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js</onActionProcess> - <isMenuAction v="true" /> - <iconId>VAADIN:HOURGLASS_END</iconId> - <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/stateProcess.js</stateProcess> - <tooltip>Create Visitreport</tooltip> - <tooltipProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/tooltipProcess.js</tooltipProcess> - </entityActionField> - <entityActionField> - <name>NewAppointment</name> - <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/documentation.adoc</documentation> - <title>New Appointment</title> - <onActionProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js</onActionProcess> - <iconId>VAADIN:CALENDAR</iconId> - <state>EDITABLE</state> - <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/stateProcess.js</stateProcess> - <tooltip>Create new Appointment</tooltip> - <tooltipProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/tooltipProcess.js</tooltipProcess> - </entityActionField> - <entityActionField> - <name>openroute</name> - <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/documentation.adoc</documentation> - <title>Open Route</title> - <onActionProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js</onActionProcess> - <iconId>VAADIN:MAP_MARKER</iconId> - <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/stateProcess.js</stateProcess> - <tooltip>Open route</tooltip> - <tooltipProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/tooltipProcess.js</tooltipProcess> - </entityActionField> - </children> - </entityActionGroup> <entityConsumer> <name>Organisations</name> <dependency> @@ -177,10 +150,12 @@ </entityParameter> <entityField> <name>PARENT_ID</name> + <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/parent_id/valueProcess.js</valueProcess> </entityField> <entityField> <name>PARENTNAME</name> <title>Tag</title> + <displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/parentname/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>ISGROUP</name> @@ -228,6 +203,7 @@ <children> <entityParameter> <name>OrgId_param</name> + <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/persons/children/orgid_param/valueProcess.js</valueProcess> </entityParameter> <entityParameter> <name>OnlyShowContactIds_param</name> @@ -243,10 +219,20 @@ <entityProvider> <name>Entries</name> <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entries/documentation.adoc</documentation> + <recordContainer>db</recordContainer> + <dependencies> + <entityDependency> + <name>22b61edd-c062-4c94-8848-8ac25831c5ba</name> + <entityName>VisitPlanEmployeeWeek_entity</entityName> + <fieldName>Entries</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> </entityProvider> <entityProvider> <name>#PROVIDER_AGGREGATES</name> <useAggregates v="true" /> + <recordContainer>db</recordContainer> </entityProvider> <entityParameter> <name>Entrydate_param</name> @@ -271,6 +257,12 @@ <consumer>KeywordVisitPlanEntryStatusAppointment</consumer> <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/status_appointment/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/status_appointment/displayValueProcess.js</displayValueProcess> + <onValueChange>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/status_appointment/onValueChange.js</onValueChange> + <onValueChangeTypes> + <element>MASK</element> + <element>PROCESS</element> + <element>PROCESS_SETVALUE</element> + </onValueChangeTypes> </entityField> <entityConsumer> <name>KeywordVisitPlanEntryStatusAppointment</name> @@ -312,72 +304,254 @@ <name>PrioritySource_param</name> <expose v="true" /> </entityParameter> + <entityField> + <name>icon</name> + <contentType>IMAGE</contentType> + <displayValueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/icon/displayValueProcess.js</displayValueProcess> + </entityField> + <entityParameter> + <name>EntryWeek_param</name> + <expose v="true" /> + </entityParameter> + <entityField> + <name>PREPARATION</name> + <contentType>HTML</contentType> + </entityField> + <entityParameter> + <name>CurrentContext_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>ObjectId_param</name> + <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/activities/children/objectid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>PresetLinks_param</name> + <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/activities/children/presetlinks_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>RowId_param</name> + <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/activities/children/rowid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>Documents</name> + <selectionMode>MULTI</selectionMode> + <dependency> + <name>dependency</name> + <entityName>Document_entity</entityName> + <fieldName>Documents</fieldName> + </dependency> + <children> + <entityParameter> + <name>AssignmentRowId_param</name> + <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>AssignmentTable_param</name> + <valueProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityActionField> + <name>NewActivity</name> + <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/newactivity/documentation.adoc</documentation> + <title>Create Visitreport</title> + <onActionProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/newactivity/onActionProcess.js</onActionProcess> + <isMenuAction v="true" /> + <iconId>VAADIN:HOURGLASS_END</iconId> + <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/newactivity/stateProcess.js</stateProcess> + <tooltip>Create Visitreport</tooltip> + <tooltipProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/newactivity/tooltipProcess.js</tooltipProcess> + </entityActionField> + <entityActionField> + <name>OpenRoute</name> + <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/openroute/documentation.adoc</documentation> + <title>Open Route</title> + <onActionProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/openroute/onActionProcess.js</onActionProcess> + <isMenuAction v="true" /> + <iconId>VAADIN:MAP_MARKER</iconId> + <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/openroute/stateProcess.js</stateProcess> + </entityActionField> + <entityActionField> + <name>NewAppointment</name> + <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/newappointment/documentation.adoc</documentation> + <title>New Appointment</title> + <onActionProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/newappointment/onActionProcess.js</onActionProcess> + <isMenuAction v="true" /> + <iconId>VAADIN:CALENDAR</iconId> + <state>EDITABLE</state> + <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/newappointment/stateProcess.js</stateProcess> + <tooltip>Create new Appointment</tooltip> + <tooltipProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/newappointment/tooltipProcess.js</tooltipProcess> + </entityActionField> + <entityActionGroup> + <name>entityActionGroup</name> + <iconId>VAADIN:CALENDAR</iconId> + <children> + <entityActionField> + <name>OpenDayRoute</name> + <documentation>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/documentation.adoc</documentation> + <title>Open Route of the day</title> + <onActionProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/onActionProcess.js</onActionProcess> + <isObjectAction v="false" /> + <selectionType>MULTI</selectionType> + <iconId>VAADIN:MAP_MARKER</iconId> + <stateProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/stateProcess.js</stateProcess> + <tooltip>Open route</tooltip> + <tooltipProcess>%aditoprj%/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/tooltipProcess.js</tooltipProcess> + </entityActionField> + </children> + </entityActionGroup> </entityFields> <recordContainers> - <jDitoRecordContainer> - <name>jDito</name> - <jDitoRecordAlias>Data_alias</jDitoRecordAlias> - <contentProcess>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js</contentProcess> - <rowCountProcess>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/jdito/rowCountProcess.js</rowCountProcess> - <onInsert>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js</onInsert> - <onUpdate>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js</onUpdate> - <onDelete>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/jdito/onDelete.js</onDelete> + <dbRecordContainer> + <name>db</name> + <conditionProcess>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/db/conditionProcess.js</conditionProcess> + <orderClauseProcess>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> + <onDBInsert>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/db/onDBInsert.js</onDBInsert> + <onDBUpdate>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/db/onDBUpdate.js</onDBUpdate> + <onDBDelete>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/db/onDBDelete.js</onDBDelete> + <alias>Data_alias</alias> <recordFieldMappings> - <jDitoRecordFieldMapping> - <name>UID.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>ISGROUP.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>PARENT_ID.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> + <dbRecordFieldMapping> + <name>VISITPLANENTRYID.value</name> + <recordfield>VISITPLANENTRY.VISITPLANENTRYID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>STATUS_APPOINTMENT.displayValue</name> + <expression>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/db/recordfieldmappings/status_appointment.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>STATUS_APPOINTMENT.value</name> + <recordfield>VISITPLANENTRY.STATUS_APPOINTMENT</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>STATUS.displayValue</name> + <expression>%aditoprj%/entity/VisitPlanEntry_entity/recordcontainers/db/recordfieldmappings/status.displayvalue/expression.js</expression> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>STATUS.value</name> + <recordfield>VISITPLANENTRY.STATUS</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>VISITPLANEMPLOYEEWEEK_ID.displayValue</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>VISITPLANEMPLOYEEWEEK_ID.value</name> + <recordfield>VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>VISITPLANEMPLOYEEWEEK_INFO.displayValue</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>VISITPLANEMPLOYEEWEEK_INFO.value</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>VISITPLANENTRYID.displayValue</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>VISITRECOMMENDATION_ID.displayValue</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>VISITRECOMMENDATION_ID.value</name> + <recordfield>VISITPLANENTRY.VISITRECOMMENDATION_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> <name>PARENTNAME.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>PARENTNAME.displayValue</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>PARENT_ID.value</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>PARENT_ID.displayValue</name> + </dbRecordFieldMapping> + <consumerMapping> + <name>Organisations</name> + </consumerMapping> + <consumerMapping> + <name>Persons</name> + </consumerMapping> + <dbRecordFieldMapping> + <name>APPOINTMENT_ID.displayValue</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>APPOINTMENT_ID.value</name> + <recordfield>VISITPLANENTRY.APPOINTMENT_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>BEGIN_TIME.displayValue</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> <name>BEGIN_TIME.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>END_TIME.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>ORGANISATION_CONTACT_ID.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>ORGANISATION_CONTACT_ID.displayValue</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>CONTACT_ID.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> + <recordfield>VISITPLANENTRY.BEGIN_TIME</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> <name>CONTACT_ID.displayValue</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>CONTACT_ID.value</name> + <recordfield>VISITPLANENTRY.CONTACT_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>END_TIME.displayValue</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>END_TIME.value</name> + <recordfield>VISITPLANENTRY.END_TIME</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ENTRYDATE.displayValue</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> <name>ENTRYDATE.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>STATUS.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>VISITPLANEMPLOYEEWEEK_ID.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>APPOINTMENT_ID.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>STATUS.displayValue</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>STATUS_APPOINTMENT.value</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>STATUS_APPOINTMENT.displayValue</name> - </jDitoRecordFieldMapping> - <jDitoRecordFieldMapping> - <name>VISITRECOMMENDATION_ID.value</name> - </jDitoRecordFieldMapping> + <recordfield>VISITPLANENTRY.ENTRYDATE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ISGROUP.displayValue</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ISGROUP.value</name> + </dbRecordFieldMapping> + <consumerMapping> + <name>KeywordVisitPlanEntryStatus</name> + </consumerMapping> + <consumerMapping> + <name>KeywordVisitPlanEntryStatusAppointment</name> + </consumerMapping> + <dbRecordFieldMapping> + <name>ORGANISATION_CONTACT_ID.displayValue</name> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>ORGANISATION_CONTACT_ID.value</name> + <recordfield>VISITPLANENTRY.ORGANISATION_CONTACT_ID</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>PREPARATION.value</name> + <recordfield>VISITPLANENTRY.PREPARATION</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> - </jDitoRecordContainer> + <linkInformation> + <linkInformation> + <name>32dd3f07-9a23-4fc0-a703-cdd606754c07</name> + <tableName>VISITPLANENTRY</tableName> + <primaryKey>VISITPLANENTRYID</primaryKey> + <isUIDTable v="true" /> + <readonly v="false" /> + </linkInformation> + </linkInformation> + </dbRecordContainer> </recordContainers> </entity> diff --git a/entity/VisitPlanEntry_entity/afterSave.js b/entity/VisitPlanEntry_entity/afterSave.js index a244a88b306cc25daa82c01c12d5a45982ef2132..efbd0a8d980a3b5182471dc011c26edf04156766 100644 --- a/entity/VisitPlanEntry_entity/afterSave.js +++ b/entity/VisitPlanEntry_entity/afterSave.js @@ -1,54 +1,55 @@ -import("system.translate"); -import("system.eMath"); +import("Calendar_lib"); +import("Communication_lib"); +import("KeywordRegistry_basic"); +import("Sql_lib"); import("system.datetime"); -import("system.logging"); -import("system.result"); +import("system.eMath"); import("system.neon"); -import("system.calendars"); -import("system.util"); +import("system.result"); +import("system.translate"); import("system.vars"); -import("system.db"); -import("Communication_lib"); -import("Calendar_lib"); -import("Sql_lib"); -import("Date_lib"); - -var savedData = vars.get("$local.entitydata"); -if(savedData["VISITRECOMMENDATION_ID"]) +if(vars.get("$param.CurrentContext_param") != null) { - newWhere("VISITRECOMMENDATION.VISITRECOMMENDATIONID", savedData["VISITRECOMMENDATION_ID"]) - .updateData(true, "VISITRECOMMENDATION", ["STATUS"], null, ["PLANNED"]); -} -if(savedData["STATUS_APPOINTMENT"] == "VISITSTATUSAPPOINTMENTCONFIRMED") -{ - var summary = translate.text("Site visit") + " | " + savedData["CONTACT_ID.displayValue"]; - var description = savedData["CONTACT_ID.displayValue"]; - var standardMail = CommUtil.getStandardMail(savedData["CONTACT_ID"]); + var savedData = vars.get("$local.entitydata"); + + if(savedData["VISITRECOMMENDATION_ID"]) + { + newWhere("VISITRECOMMENDATION.VISITRECOMMENDATIONID", savedData["VISITRECOMMENDATION_ID"]) + .updateData(true, "VISITRECOMMENDATION", ["STATUS"], null, ["PLANNED"]); + } + if(savedData["STATUS_APPOINTMENT"] == $KeywordRegistry.visitPlanEntryStatusAppointment$confirmed()) + { + var summary = translate.text("Site visit") + " | " + savedData["CONTACT_ID.displayValue"]; + var description = savedData["CONTACT_ID.displayValue"]; + var standardMail = CommUtil.getStandardMail(savedData["CONTACT_ID"]); - var entryDate = datetime.toLocaleDate(savedData["ENTRYDATE"], "dd-MM-yyyy"); - var startTime = entryDate + " " + datetime.toLocaleDate(savedData["BEGIN_TIME"], "HH:mm:ss.S"); + var entryDate = datetime.toLocaleDate(savedData["ENTRYDATE"], "dd-MM-yyyy"); + var startTime = entryDate + " " + datetime.toLocaleDate(savedData["BEGIN_TIME"], "HH:mm:ss.S"); startTime = datetime.toLong(startTime, "dd-MM-yyyy HH:mm:ss.S", "UTC"); // #1076044 set tz to prevent time gaps. - var endTime = savedData["END_TIME"]; - var duration = eMath.subInt(endTime, startTime); - - var links = [ + var endTime = savedData["END_TIME"]; + var duration = eMath.subInt(endTime, startTime); + + var start = new Date(datetime.clearTime(startTime, vars.get("$sys.timezone")) + Number(savedData["BEGIN_TIME"])); + var end = new Date(datetime.today(vars.get("$sys.timezone")) + Number(savedData["END_TIME"])); + + var links = [ { - "OBJECT_ID":savedData["ORGANISATION_CONTACT_ID"], - "OBJECT_TYPE":"Organisation" + "OBJECT_ID": savedData["ORGANISATION_CONTACT_ID"], + "OBJECT_TYPE": "Organisation" }, { - "OBJECT_ID":savedData["CONTACT_ID"], - "OBJECT_TYPE":"Person" + "OBJECT_ID": savedData["CONTACT_ID"], + "OBJECT_TYPE": "Person" } - ] + ] - var params = { - "Entry_param" : JSON.stringify(CalendarUtil.createEntry(summary, description, links, undefined, undefined, - Date(Date.toExponential(startTime)), Date(Date.toExponential(endTime)), - undefined, undefined, undefined, [standardMail], undefined, undefined, undefined)) - }; + var params = { + "Entry_param" : JSON.stringify(CalendarUtil.createEntry(summary, description, links, undefined, undefined, + start, end, undefined, undefined, undefined, [standardMail], undefined, undefined, undefined)) + }; - neon.openContext("Appointment", "AppointmentEdit_view", [vars.get("$field.UID")], neon.OPERATINGSTATE_NEW, params, null); - result.string(true); -} + neon.openContext("Appointment", "AppointmentEdit_view", [vars.get("$field.VISITPLANENTRYID")], neon.OPERATINGSTATE_NEW, params, null); + result.string(true); + } +} \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/contentTitleProcess.js b/entity/VisitPlanEntry_entity/contentTitleProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..72ce29a56e6856d49aaf5a93b6f566c5e55f13f1 --- /dev/null +++ b/entity/VisitPlanEntry_entity/contentTitleProcess.js @@ -0,0 +1,18 @@ +import("Sql_lib"); +import("system.datetime"); +import("system.result"); +import("system.translate"); +import("system.vars"); + +var parentName = translate.text(datetime.toDate(vars.get("$field.ENTRYDATE"), "EEEE")); + +var entryDate = datetime.toDate(vars.get("$field.ENTRYDATE"), "dd.MM.yyyy"); + +var contactId = vars.get("$field.CONTACT_ID"); +var orgname = newSelect("ORGANISATION.NAME") + .from("ORGANISATION") + .join("CONTACT", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID") + .whereIfSet("CONTACT.CONTACTID", contactId) + .cell(); + +result.string(parentName + " " + entryDate + " - " + orgname); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/activities/children/objectid_param/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/activities/children/objectid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..008915f61deac19ccdd40fff81701de63eb3b6a2 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/activities/children/objectid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/activities/children/presetlinks_param/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/activities/children/presetlinks_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..287a6a09aefe51ff338e5702a0b99e5e65d6fd70 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/activities/children/presetlinks_param/valueProcess.js @@ -0,0 +1,18 @@ +import("system.vars"); +import("system.result"); +import("Contact_lib"); + +var contactId = vars.get("$field.CONTACT_ID"); +var links = []; + +if (contactId) +{ + links.push([ContactUtils.getContextByContactId(contactId), contactId]); +} + +if (vars.get("$field.ORGANISATION_CONTACT_ID")) +{ + links.push(["Organisation", vars.get("$field.ORGANISATION_CONTACT_ID")]); +} + +result.object(links); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/activities/children/rowid_param/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/activities/children/rowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..37386c1308b96a532750439495f6ac134ff2f4ac --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/activities/children/rowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("system.vars"); + +result.string(vars.get("$field.VISITPLANENTRYID")); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/begin_time/dropDownProcess.js b/entity/VisitPlanEntry_entity/entityfields/begin_time/dropDownProcess.js index 12411ad70b3b6d08ee98e1c841e860d8a53256a4..fb3609df1cedef48f68fc33ca2a306d11025aab2 100644 --- a/entity/VisitPlanEntry_entity/entityfields/begin_time/dropDownProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/begin_time/dropDownProcess.js @@ -1,5 +1,4 @@ import("system.datetime"); -import("system.logging"); import("system.util"); import("system.result"); import("system.text"); diff --git a/entity/VisitPlanEntry_entity/entityfields/begin_time/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/begin_time/valueProcess.js index 052b11da3b9bbea6a4ab378f728c67806ea67b71..2c34b61df8a0be25ad884dd4a946abde9ca3eb24 100644 --- a/entity/VisitPlanEntry_entity/entityfields/begin_time/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/begin_time/valueProcess.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.datetime"); import("system.neon"); import("system.result"); diff --git a/entity/VisitPlanEntry_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..37386c1308b96a532750439495f6ac134ff2f4ac --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/documents/children/assignmentrowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("system.vars"); + +result.string(vars.get("$field.VISITPLANENTRYID")); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..b35ea967d46e5f1064f2548c85a4904f69acc5f3 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/documents/children/assignmenttable_param/valueProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string("VISITPLANENTRY"); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/end_time/dropDownProcess.js b/entity/VisitPlanEntry_entity/entityfields/end_time/dropDownProcess.js index fc6e5d4034f088b335e35322609771d3594ce05a..27bebe220320622eb6303acc730c5c1af40e123d 100644 --- a/entity/VisitPlanEntry_entity/entityfields/end_time/dropDownProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/end_time/dropDownProcess.js @@ -1,5 +1,4 @@ import("system.datetime"); -import("system.logging"); import("system.util"); import("system.result"); import("system.text"); diff --git a/entity/VisitPlanEntry_entity/entityfields/end_time/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/end_time/valueProcess.js index 74bbed024fd3b43b1bbbd86ad272efd028439217..5859050ddda8aa897ce4d1158bd475048131aef5 100644 --- a/entity/VisitPlanEntry_entity/entityfields/end_time/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/end_time/valueProcess.js @@ -1,5 +1,4 @@ import("system.eMath"); -import("system.logging"); import("system.datetime"); import("system.neon"); import("system.result"); diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/stateProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/stateProcess.js deleted file mode 100644 index 181e70bbeca24bebbcad6595818e49b2e55484ad..0000000000000000000000000000000000000000 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/stateProcess.js +++ /dev/null @@ -1,15 +0,0 @@ -import("system.logging"); -import("system.result"); -import("system.vars"); -import("system.neon"); -import("Util_lib"); - -if (Utils.toBoolean(vars.get("$field.ISGROUP")) - && (vars.get("$field.STATUS") == "VISITSTATUSAPPPLANED" - || vars.get("$field.STATUS_APPOINTMENT") == "VISITSTATUSAPPOINTMENTCONFIRMED ") - || Utils.isNullOrEmpty(vars.get("$sys.selectionRows")) - || Utils.isNullOrEmpty(vars.get("$field.PARENT_ID"))) -{ - result.string(neon.COMPONENTSTATE_DISABLED); -} - diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/documentation.adoc b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..e594581162806ba973679a0dcc95e794c1a7b8c0 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/documentation.adoc @@ -0,0 +1 @@ +Opens the route to the location via google-maps \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..2a8ed1d91f51ba3208cd82542c6ccc0b10ea88d7 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/onActionProcess.js @@ -0,0 +1,3 @@ +import("VisitPlanning_lib"); + +VisitPlanningUtils.openRoute(true); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/stateProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/stateProcess.js similarity index 53% rename from entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/stateProcess.js rename to entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/stateProcess.js index 903ff9b70c0595a6b3b2fb40404d23b27a0a5525..5a2727774f69cea4ca520a5813e9502a4869de5c 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/stateProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/stateProcess.js @@ -1,9 +1,10 @@ -import("system.logging"); import("system.result"); import("system.vars"); import("system.neon"); var state = neon.COMPONENTSTATE_DISABLED; -if (vars.get("$field.ISGROUP") == "true" && vars.get("$sys.selectionRows") != "" && vars.get("$sys.selectionRows") != undefined) +if (vars.get("$sys.selectionRows") != "" && vars.get("$sys.selectionRows") != undefined) +{ state = neon.COMPONENTSTATE_EDITABLE; +} result.string(state); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/tooltipProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/tooltipProcess.js similarity index 100% rename from entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/tooltipProcess.js rename to entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/opendayroute/tooltipProcess.js diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/documentation.adoc b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/documentation.adoc deleted file mode 100644 index 6fcdffce161a586e2475c42eac36b98a974296fd..0000000000000000000000000000000000000000 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/documentation.adoc +++ /dev/null @@ -1 +0,0 @@ -Opens the route to the location(s) via google-maps \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js deleted file mode 100644 index 5d3c935ea964eefa7f20fdaf93925f7f02b57e5b..0000000000000000000000000000000000000000 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/openroute/onActionProcess.js +++ /dev/null @@ -1,78 +0,0 @@ -import("Sql_lib"); -import("Employee_lib"); -import("system.datetime"); -import("system.db"); -import("system.text"); -import("system.neon"); -import("system.vars"); - -var visitAddresses = []; -var addressIdStart; -var address; -var user = EmployeeUtils.getCurrentContactId(); - -//start homeaddress -addressIdStart = newSelect("ADDRESSID") - .from("ADDRESS") - .where("ADDRESS.ADDR_TYPE", "HOMEADDR") - .and("ADDRESS.CONTACT_ID", user) - .cell(); - -if(!addressIdStart) -{ - //start orgaddress - var orgID = newSelect("ORGANISATION_ID") - .from("CONTACT") - .where("CONTACT.CONTACTID", user) - .cell(); - - addressIdStart = newSelect("ADDRESS_ID") - .from("CONTACT") - .where("CONTACT.ORGANISATION_ID", orgID) - .and("CONTACT.PERSON_ID is null") - .cell(); -} - -var addressStart = ""; -if(addressIdStart) -{ - addressStart = newSelect("ADDRESS, BUILDINGNO, ZIP, CITY, COUNTRY") - .from("ADDRESS") - .where("ADDRESS.ADDRESSID", addressIdStart) - .arrayRow(); - - visitAddresses.push(addressStart.join("+")); -} - -//address to visit -var selectionRowData = vars.get("$sys.selectionRows"); -var UID = selectionRowData[0].UID; -var isGroup = selectionRowData[0].ISGROUP; //not Bool - -var entrydateDB = datetime.toLong(UID.split("#")[1], "dd.MM.yyyy", "UTC"); // UTC, otherwise client-timezone e.g.: "Europe/Berlin" is used. - // (result: time difference of 1 hour) - -if(vars.exists("$param.Entries_param") && vars.get("$param.Entries_param")) -{ - - var entryid = vars.get("$param.Entries_param"); - - var childAddresses = newSelect("ADDRESS, BUILDINGNO, ZIP, CITY, COUNTRY") - .from("ADDRESS") - .leftJoin("VISITPLANENTRY", "ADDRESS.ADDRESSID = (select ADDRESS_ID from CONTACT where CONTACT.CONTACTID \n\ - = VISITPLANENTRY.ORGANISATION_CONTACT_ID)") - .where("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", entryid) - .and("VISITPLANENTRY.ENTRYDATE", entrydateDB) - .table(); - - - for(let i = 0; i < childAddresses.length; i++) - visitAddresses.push(childAddresses[i].join("+")); - - visitAddresses.push(addressStart.join("+")); -} - - -address = "https://www.google.com/maps/dir/" + visitAddresses.join("/"); - -neon.openUrl(address, true); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/entrydate/onValueChange.js b/entity/VisitPlanEntry_entity/entityfields/entrydate/onValueChange.js index 993f36880fe5565faf0b6f7566b416987cababea..4eedf56d0988e96734db88c6b80b63a63d2368fd 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entrydate/onValueChange.js +++ b/entity/VisitPlanEntry_entity/entityfields/entrydate/onValueChange.js @@ -1,5 +1,4 @@ import("system.neon"); -import("system.logging"); import("system.translate"); import("system.result"); import("Sql_lib"); diff --git a/entity/VisitPlanEntry_entity/entityfields/entrydate/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/entrydate/valueProcess.js index 459c622245d9f40641c694f9e11c1f157081cc87..980670eecb3fa306944d315a75740e20e25663f9 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entrydate/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entrydate/valueProcess.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.neon"); import("system.result"); import("system.vars"); diff --git a/entity/VisitPlanEntry_entity/entityfields/icon/displayValueProcess.js b/entity/VisitPlanEntry_entity/entityfields/icon/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7b07825941b5b603de4b9323d2a2efabcaa9725e --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/icon/displayValueProcess.js @@ -0,0 +1,16 @@ +import("system.vars"); +import("system.db"); +import("system.result"); +import("Sql_lib"); + +if(vars.get("$param.EntryWeek_param")) +{ + + var week = vars.get("$param.EntryWeek_param"); + if(week.length == 1) + { + week = "0" + week; + } + + result.string("TEXT:" + week); +} diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/documentation.adoc b/entity/VisitPlanEntry_entity/entityfields/newactivity/documentation.adoc similarity index 100% rename from entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/documentation.adoc rename to entity/VisitPlanEntry_entity/entityfields/newactivity/documentation.adoc diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/newactivity/onActionProcess.js similarity index 96% rename from entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js rename to entity/VisitPlanEntry_entity/entityfields/newactivity/onActionProcess.js index 8701de9c67b619fa9f38c4a025d75e4c27149dc1..511e71f974a9dc3ef2155d8b0a339c6d5769670f 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/newactivity/onActionProcess.js @@ -4,7 +4,6 @@ import("system.db"); import("KeywordRegistry_basic"); import("Contact_lib"); import("Employee_lib"); -import("system.logging"); import("system.vars"); import("ActivityTask_lib"); @@ -27,5 +26,4 @@ else links.push(["Person", vars.get("$field.CONTACT_ID")]); } -ActivityUtils.createNewActivity(null, links, null, null, null, null, $KeywordRegistry.activityDirection$outgoing(), null, $KeywordRegistry.activityCategory$visit(), vars.get("$field.ENTRYDATE"), vars.get("$field.UID")); - +ActivityUtils.createNewActivity(null, links, null, null, null, null, $KeywordRegistry.activityDirection$outgoing(), null, $KeywordRegistry.activityCategory$visit(), vars.get("$field.ENTRYDATE"), vars.get("$field.VISITPLANENTRYID")); diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/stateProcess.js b/entity/VisitPlanEntry_entity/entityfields/newactivity/stateProcess.js similarity index 65% rename from entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/stateProcess.js rename to entity/VisitPlanEntry_entity/entityfields/newactivity/stateProcess.js index 57b2f8280f91c2a73374d503c528b0d6075bbce8..659b85da8ccf7937fac38ae05bc682474a1c9d12 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/stateProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/newactivity/stateProcess.js @@ -6,6 +6,8 @@ import("system.neon"); var state = neon.COMPONENTSTATE_DISABLED; var today = vars.get("$sys.date") -if (vars.get("$field.ISGROUP") == "false" && vars.get("$field.ENTRYDATE") <= today && vars.get("$sys.selectionRows") != "") +if (vars.get("$field.ENTRYDATE") <= today && vars.get("$sys.selectionRows") != "") +{ state = neon.COMPONENTSTATE_EDITABLE; +} result.string(state); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/tooltipProcess.js b/entity/VisitPlanEntry_entity/entityfields/newactivity/tooltipProcess.js similarity index 100% rename from entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/tooltipProcess.js rename to entity/VisitPlanEntry_entity/entityfields/newactivity/tooltipProcess.js diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/documentation.adoc b/entity/VisitPlanEntry_entity/entityfields/newappointment/documentation.adoc similarity index 100% rename from entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/documentation.adoc rename to entity/VisitPlanEntry_entity/entityfields/newappointment/documentation.adoc diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/newappointment/onActionProcess.js similarity index 65% rename from entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js rename to entity/VisitPlanEntry_entity/entityfields/newappointment/onActionProcess.js index 1736c7720e9af0c0afdb57da87cd44bf2d4f24d2..7bf8461c01ec469ee6d667c1211272b8aa4bf7f7 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/newappointment/onActionProcess.js @@ -27,27 +27,26 @@ var standardMail = CommUtil.getStandardMail(selectionRowData[0].CONTACT_ID); //creates an js date object with the current utc time and adds the appointment begin/end time. //necessary for CalendarUtil.createEntry() -var start = new Date(datetime.today(vars.get("$sys.timezone"))+Number(selectionRowData[0].BEGIN_TIME)); -var end = new Date(datetime.today(vars.get("$sys.timezone"))+Number(selectionRowData[0].END_TIME)); +var entryDate = Number(datetime.toLong(datetime.toDate(Number(selectionRowData[0].ENTRYDATE), "dd.MM.yyyy"), "dd.MM.yyyy")); +var start = new Date(entryDate + Number(selectionRowData[0].BEGIN_TIME)); +var end = new Date(entryDate + Number(selectionRowData[0].END_TIME)); var links = [ - { - "OBJECT_ID" : selectionRowData[0]["ORGANISATION_CONTACT_ID"], - "OBJECT_TYPE" : "Organisation" - }, - { - "OBJECT_ID" : selectionRowData[0]["CONTACT_ID"], - "OBJECT_TYPE" : "Person" - } + { + "OBJECT_ID" : selectionRowData[0]["ORGANISATION_CONTACT_ID"], + "OBJECT_TYPE" : "Organisation" + }, + { + "OBJECT_ID" : selectionRowData[0]["CONTACT_ID"], + "OBJECT_TYPE" : "Person" + } ]; var params = { "Entry_param": JSON.stringify(CalendarUtil.createEntry(summary, description, links, undefined, undefined, start, end, undefined, undefined, undefined, [standardMail], undefined, undefined, undefined)) - , "VisitPlanId_param": selectionRowData[0]["#UID"] }; -neon.openContext("Appointment", "AppointmentEdit_view", null, neon.OPERATINGSTATE_NEW, params, null); +neon.openContext("Appointment", "AppointmentEdit_view", [vars.get("$field.VISITPLANENTRYID")], neon.OPERATINGSTATE_NEW, params, null); result.string(true); - diff --git a/entity/VisitPlanEntry_entity/entityfields/newappointment/stateProcess.js b/entity/VisitPlanEntry_entity/entityfields/newappointment/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5a2727774f69cea4ca520a5813e9502a4869de5c --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/newappointment/stateProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.vars"); +import("system.neon"); + +var state = neon.COMPONENTSTATE_DISABLED; +if (vars.get("$sys.selectionRows") != "" && vars.get("$sys.selectionRows") != undefined) +{ + state = neon.COMPONENTSTATE_EDITABLE; +} +result.string(state); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/tooltipProcess.js b/entity/VisitPlanEntry_entity/entityfields/newappointment/tooltipProcess.js similarity index 100% rename from entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newappointment/tooltipProcess.js rename to entity/VisitPlanEntry_entity/entityfields/newappointment/tooltipProcess.js diff --git a/entity/VisitPlanEntry_entity/entityfields/openroute/documentation.adoc b/entity/VisitPlanEntry_entity/entityfields/openroute/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..1faa10952af0de857333e94b922ae747676eaa1d --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/openroute/documentation.adoc @@ -0,0 +1 @@ +Opens the route to the location(s) of the day via google-maps \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/openroute/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/openroute/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..befd5d22f6b5de49980c10b0b7477fedda4cc78c --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/openroute/onActionProcess.js @@ -0,0 +1,3 @@ +import("VisitPlanning_lib"); + +VisitPlanningUtils.openRoute(); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/openroute/stateProcess.js b/entity/VisitPlanEntry_entity/entityfields/openroute/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5a2727774f69cea4ca520a5813e9502a4869de5c --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/openroute/stateProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.vars"); +import("system.neon"); + +var state = neon.COMPONENTSTATE_DISABLED; +if (vars.get("$sys.selectionRows") != "" && vars.get("$sys.selectionRows") != undefined) +{ + state = neon.COMPONENTSTATE_EDITABLE; +} +result.string(state); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/parent_id/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/parent_id/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..95fc66dd29ae23e57bc15186705b787e4cc1b09c --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/parent_id/valueProcess.js @@ -0,0 +1,11 @@ +import("system.result"); +import("system.vars"); +import("system.datetime"); +import("system.translate"); + + +var parentName = translate.text(datetime.toDate(vars.get("$field.ENTRYDATE"), "EEEE")); + +var entryDate = datetime.toDate(vars.get("$field.ENTRYDATE"), "dd.MM.yyyy"); + +result.string(parentName + "#" + entryDate); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/parentname/displayValueProcess.js b/entity/VisitPlanEntry_entity/entityfields/parentname/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d5ffbf8f0791a2aaaa1df431e7705130ae619b28 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/parentname/displayValueProcess.js @@ -0,0 +1,11 @@ +import("system.result"); +import("system.vars"); +import("system.datetime"); +import("system.translate"); + + +var parentName = translate.text(datetime.toDate(vars.get("$field.ENTRYDATE"), "EEEE")); + +var entryDate = datetime.toDate(vars.get("$field.ENTRYDATE"), "dd.MM.yyyy"); + +result.string(parentName + " " + entryDate); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/persons/children/onlyshowcontactids_param/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/persons/children/onlyshowcontactids_param/valueProcess.js index 0dcb7912c8cee051ddf7ffa3e075e89df70c9cbc..04c8be44aea0a3c5f9738b37296f9d657bf6376e 100644 --- a/entity/VisitPlanEntry_entity/entityfields/persons/children/onlyshowcontactids_param/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/persons/children/onlyshowcontactids_param/valueProcess.js @@ -1,4 +1,3 @@ -import("system.logging"); import("KeywordRegistry_basic"); import("Contact_lib"); import("system.result"); diff --git a/entity/VisitPlanEntry_entity/entityfields/persons/children/orgid_param/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/persons/children/orgid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c6e583e8bd66c32b6b8243af36cc6c2264c8ac18 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/persons/children/orgid_param/valueProcess.js @@ -0,0 +1,9 @@ +import("system.logging"); +import("Sql_lib"); +import("system.vars"); +import("system.result"); + +var orgContactId = vars.get("$field.ORGANISATION_CONTACT_ID") +var orgId = newSelect("CONTACT.ORGANISATION_ID").from("CONTACT").where("CONTACT.CONTACTID", orgContactId).cell(); + +result.string(orgId); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/status/displayValueProcess.js b/entity/VisitPlanEntry_entity/entityfields/status/displayValueProcess.js index da9d2bcd966a70656818b970eb8724cf08a847c9..46647e3e381df15c1e8b54b86092e3417e5db4cf 100644 --- a/entity/VisitPlanEntry_entity/entityfields/status/displayValueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/status/displayValueProcess.js @@ -1,5 +1,4 @@ import("system.translate"); -import("system.logging"); import("system.result"); import("system.vars"); import("Keyword_lib"); diff --git a/entity/VisitPlanEntry_entity/entityfields/status_appointment/displayValueProcess.js b/entity/VisitPlanEntry_entity/entityfields/status_appointment/displayValueProcess.js index 6da13f3303b3eb4dd4da2a507f9ea6ba6bdc71a9..5cc2ee94f407aa2b43e42b95dab648537fbfc89f 100644 --- a/entity/VisitPlanEntry_entity/entityfields/status_appointment/displayValueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/status_appointment/displayValueProcess.js @@ -1,5 +1,4 @@ import("system.translate"); -import("system.logging"); import("system.result"); import("system.vars"); import("Keyword_lib"); diff --git a/entity/VisitPlanEntry_entity/entityfields/status_appointment/onValueChange.js b/entity/VisitPlanEntry_entity/entityfields/status_appointment/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..c20b5aa9d22570423cc84009864f96e4ef1b901a --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/status_appointment/onValueChange.js @@ -0,0 +1,7 @@ +import("system.vars"); +import("system.neon"); + +if(!vars.get("$param.CurrentContext_param")) +{ + vars.set("$param.CurrentContext_param", "Status changed"); +} \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/uid/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/uid/valueProcess.js deleted file mode 100644 index 108183b514a537915c0292894b891518c0aab47d..0000000000000000000000000000000000000000 --- a/entity/VisitPlanEntry_entity/entityfields/uid/valueProcess.js +++ /dev/null @@ -1,7 +0,0 @@ -import("system.util"); -import("system.neon"); -import("system.result"); -import("system.vars"); - -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value") && vars.get("$this.value") == null) - result.string(util.getNewUUID()); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/visitplanemployeeweek_id/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/visitplanemployeeweek_id/valueProcess.js index 8488cb5c1b9c9990b40620cd4678ee5dbdbd67e9..5b53ded0af80b13cb2e8e3653a03a5e6fce93564 100644 --- a/entity/VisitPlanEntry_entity/entityfields/visitplanemployeeweek_id/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/visitplanemployeeweek_id/valueProcess.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.neon"); import("system.result"); import("system.vars"); diff --git a/entity/VisitPlanEntry_entity/entityfields/visitplanemployeeweek_info/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/visitplanemployeeweek_info/valueProcess.js index b33b9028b2e8d8f2269e3f89565534a2c26d22c7..6bf0fe6566b61d3b64ffeaf4f614c5c16443dbb9 100644 --- a/entity/VisitPlanEntry_entity/entityfields/visitplanemployeeweek_info/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/visitplanemployeeweek_info/valueProcess.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.translate"); import("system.result"); import("Sql_lib"); diff --git a/entity/VisitPlanEntry_entity/entityfields/visitplanentryid/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/visitplanentryid/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..823247cf893e603a8e2b8d5725d6b94ecd975695 --- /dev/null +++ b/entity/VisitPlanEntry_entity/entityfields/visitplanentryid/valueProcess.js @@ -0,0 +1,9 @@ +import("system.util"); +import("system.vars"); +import("system.result"); +import("system.neon"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) +{ + result.string(util.getNewUUID()); +} \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/entityfields/visitrecommendation_id/valueProcess.js b/entity/VisitPlanEntry_entity/entityfields/visitrecommendation_id/valueProcess.js index dbfee2528ec4bfc6ac624c6e0751f4b2f983bb2a..c6ac0a623bbf5203b795c68369a32e94a43d65cc 100644 --- a/entity/VisitPlanEntry_entity/entityfields/visitrecommendation_id/valueProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/visitrecommendation_id/valueProcess.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.neon"); import("system.result"); import("system.vars"); diff --git a/entity/VisitPlanEntry_entity/grantUpdateProcess.js b/entity/VisitPlanEntry_entity/grantUpdateProcess.js index 9c75adbde300dd0e7e6068c4a07dad9451fec7c8..e8533b964b4d96d4dde9236391793c29673b0e1c 100644 --- a/entity/VisitPlanEntry_entity/grantUpdateProcess.js +++ b/entity/VisitPlanEntry_entity/grantUpdateProcess.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.vars"); import("system.result"); diff --git a/entity/VisitPlanEntry_entity/onValidation.js b/entity/VisitPlanEntry_entity/onValidation.js index f7603c5a13be09d76be49a8f925706c0260462cd..be77ad3335a164be4596f09957bacf54cbe2ceed 100644 --- a/entity/VisitPlanEntry_entity/onValidation.js +++ b/entity/VisitPlanEntry_entity/onValidation.js @@ -1,7 +1,6 @@ import("system.neon"); import("system.eMath"); import("Sql_lib"); -import("system.logging"); import("system.datetime"); import("system.db"); import("system.translate"); diff --git a/entity/VisitPlanEntry_entity/recordcontainers/db/conditionProcess.js b/entity/VisitPlanEntry_entity/recordcontainers/db/conditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1486e70fa27bba4ae09131f01fb1a9a916d09cfa --- /dev/null +++ b/entity/VisitPlanEntry_entity/recordcontainers/db/conditionProcess.js @@ -0,0 +1,30 @@ +import("Util_lib"); +import("system.result"); +import("Employee_lib"); +import("system.datetime"); +import("system.vars"); +import("Sql_lib"); + +var cond = newWhere(); + +if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) +{ + cond.andIfSet("VISITPLANENTRY.VISITPLANENTRYID", vars.get("$local.idvalues")); +} +else if(vars.exists("$param.Entries_param") && vars.get("$param.Entries_param")) +{ + cond.andIfSet("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", vars.get("$param.Entries_param")); +} +else if(vars.exists("$param.EntriesofCurrentWeek_param") && Utils.toBoolean(vars.get("$param.EntriesofCurrentWeek_param"))) +{ + var currentWeek = datetime.toLocaleDate(vars.get("$sys.date"), "w"); + var currentYear = datetime.toLocaleDate(vars.get("$sys.date"), "yyyy"); + var currentUser = EmployeeUtils.getCurrentContactId(); + + cond.join("VISITPLANEMPLOYEEWEEK", "VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID = VISITPLANEMPLOYEEWEEK.VISITPLANEMPLOYEEWEEKID") + .where("VISITPLANEMPLOYEEWEEK.VISITPLAN_WEEK", currentWeek) + .and("VISITPLANEMPLOYEEWEEK.VISITPLAN_YEAR", currentYear) + .and("VISITPLANEMPLOYEEWEEK.CONTACT_ID", currentUser); +} + +result.string(cond.toString()); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onDelete.js b/entity/VisitPlanEntry_entity/recordcontainers/db/onDBDelete.js similarity index 63% rename from entity/VisitPlanEntry_entity/recordcontainers/jdito/onDelete.js rename to entity/VisitPlanEntry_entity/recordcontainers/db/onDBDelete.js index 03ee7d2de39f1b40b71cc77c022c8ef4dd1d9dec..f20952629cfe92f505d956c05a5f81f9bbbda215 100644 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onDelete.js +++ b/entity/VisitPlanEntry_entity/recordcontainers/db/onDBDelete.js @@ -1,4 +1,3 @@ -import("system.calendars"); import("system.vars"); import("Calendar_lib"); import("system.neon"); @@ -11,7 +10,11 @@ var recommendationId = vars.get("$field.VISITRECOMMENDATION_ID"); newWhere("VISITRECOMMENDATION.VISITRECOMMENDATIONID", recommendationId) .updateData(true, "VISITRECOMMENDATION", ["STATUS"], null, [""]); -calendars.removeEntryByUID(calendars.VEVENT, null, id, null) +new SqlBuilder(SqlUtils.getSystemAlias()).whereIfSet("ASYS_CALENDARBACKEND.ELEMENTUID", id) + .deleteData(); + +newWhereIfSet("AB_APPOINTMENTLINK.APPOINTMENT_ID", id) + .deleteData(); -newWhereIfSet("VISITPLANENTRY.VISITPLANENTRYID", "$field.UID") +newWhereIfSet("VISITPLANENTRY.VISITPLANENTRYID", "$field.VISITPLANENTRYID") .deleteData(); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/recordcontainers/db/onDBInsert.js b/entity/VisitPlanEntry_entity/recordcontainers/db/onDBInsert.js new file mode 100644 index 0000000000000000000000000000000000000000..d8f73c57c0fef0051eabac2e39753abf67b548b8 --- /dev/null +++ b/entity/VisitPlanEntry_entity/recordcontainers/db/onDBInsert.js @@ -0,0 +1,79 @@ +import("Sql_lib"); +import("system.neon"); +import("Employee_lib"); +import("system.datetime"); +import("system.db"); +import("system.vars"); +import("system.util"); + +var visitPlanEmployeeWeekID = ""; +var insertData = []; +var user = EmployeeUtils.getCurrentContactId(); +if(vars.get("$param.Entries_param") != null) + visitPlanEmployeeWeekID = vars.get("$param.Entries_param"); +else +{ + var calendarWeek = datetime.toLocaleDate(vars.get("$field.ENTRYDATE"), "w"); + var calendarYear = datetime.toLocaleDate(vars.get("$field.ENTRYDATE"), "yyyy"); + var weekId = newSelect("VISITPLANEMPLOYEEWEEKID") + .from("VISITPLANEMPLOYEEWEEK") + .where("VISITPLANEMPLOYEEWEEK.VISITPLAN_WEEK", calendarWeek) + .and("VISITPLANEMPLOYEEWEEK.VISITPLAN_YEAR", calendarYear) + .and("VISITPLANEMPLOYEEWEEK.CONTACT_ID", user) + .cell(); + + if(weekId) + visitPlanEmployeeWeekID = weekId; + else + { + var newWeekId = util.getNewUUID(); + + var valuesWeek = [ + newWeekId, + calendarWeek, + calendarYear, + user + ]; + + var columnsWeek = [ + "VISITPLANEMPLOYEEWEEKID", + "VISITPLAN_WEEK", + "VISITPLAN_YEAR", + "CONTACT_ID", + ]; + + db.insertData("VISITPLANEMPLOYEEWEEK", columnsWeek, null, valuesWeek); + + visitPlanEmployeeWeekID = newWeekId; + } +} + +if(vars.get("$param.NoVisitPlanEmployeeWeek_param")){ + var valuesEntry = [ + util.getNewUUID(), + vars.get("$field.ENTRYDATE"), + vars.get("$field.BEGIN_TIME"), + vars.get("$field.END_TIME"), + vars.get("$field.ORGANISATION_CONTACT_ID"), + vars.get("$field.CONTACT_ID"), + visitPlanEmployeeWeekID, + vars.get("$field.STATUS"), + vars.get("$field.STATUS_APPOINTMENT"), + vars.get("$field.VISITRECOMMENDATION_ID"), + ]; + + var columnsEntry = [ + "VISITPLANENTRYID", + "ENTRYDATE", + "BEGIN_TIME", + "END_TIME", + "ORGANISATION_CONTACT_ID", + "CONTACT_ID", + "VISITPLANEMPLOYEEWEEK_ID", + "STATUS", + "STATUS_APPOINTMENT", + "VISITRECOMMENDATION_ID" + ]; + + db.insertData("VISITPLANENTRY", columnsEntry, null, valuesEntry); +} \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js b/entity/VisitPlanEntry_entity/recordcontainers/db/onDBUpdate.js similarity index 58% rename from entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js rename to entity/VisitPlanEntry_entity/recordcontainers/db/onDBUpdate.js index 52827d90c75f758c84d2875ff55e888e944b07f8..315dcd70324e08add113fc50b7fa079dc1a51f17 100644 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onUpdate.js +++ b/entity/VisitPlanEntry_entity/recordcontainers/db/onDBUpdate.js @@ -2,15 +2,14 @@ import("Employee_lib"); import("system.util"); import("system.datetime"); import("Sql_lib"); -import("system.logging"); import("system.neon"); import("system.db"); import("system.vars"); var rowData = vars.get("$local.rowdata"); var user = EmployeeUtils.getCurrentContactId() -var calendarWeek = datetime.toLocaleDate(rowData["ENTRYDATE.value"], "w"); -var calendarYear = datetime.toLocaleDate(rowData["ENTRYDATE.value"], "yyyy"); +var calendarWeek = datetime.toLocaleDate(vars.get("$field.ENTRYDATE"), "w"); +var calendarYear = datetime.toLocaleDate(vars.get("$field.ENTRYDATE"), "yyyy"); var weekId = newSelect("VISITPLANEMPLOYEEWEEKID") .from("VISITPLANEMPLOYEEWEEK") .where("VISITPLANEMPLOYEEWEEK.VISITPLAN_WEEK", calendarWeek) @@ -41,28 +40,4 @@ else db.insertData("VISITPLANEMPLOYEEWEEK", columnsWeek, null, valuesWeek); visitPlanEmployeeWeekID = newWeekId; -} - -var values = [ - rowData["ENTRYDATE.value"], - rowData["BEGIN_TIME.value"], - rowData["END_TIME.value"], - rowData["ORGANISATION_CONTACT_ID.value"], - rowData["STATUS.value"], - rowData["STATUS_APPOINTMENT.value"], - visitPlanEmployeeWeekID -]; - -var columns = [ - "ENTRYDATE", - "BEGIN_TIME", - "END_TIME", - "ORGANISATION_CONTACT_ID", - "STATUS", - "STATUS_APPOINTMENT", - "VISITPLANEMPLOYEEWEEK_ID" -]; - -var cond = newWhere("VISITPLANENTRY.VISITPLANENTRYID", vars.get("$field.UID")).toString(); - -db.updateData("VISITPLANENTRY", columns, null, values, cond); +} \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/recordcontainers/db/orderClauseProcess.js b/entity/VisitPlanEntry_entity/recordcontainers/db/orderClauseProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..bd10d975d0694bb7a08d75c004f500e2679b849a --- /dev/null +++ b/entity/VisitPlanEntry_entity/recordcontainers/db/orderClauseProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("system.db"); + +result.object({"VISITPLANENTRY.ENTRYDATE": db.ASCENDING}); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/recordcontainers/db/recordfieldmappings/status.displayvalue/expression.js b/entity/VisitPlanEntry_entity/recordcontainers/db/recordfieldmappings/status.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..d9796db799fae492cf1b6193923c2d988dda24d3 --- /dev/null +++ b/entity/VisitPlanEntry_entity/recordcontainers/db/recordfieldmappings/status.displayvalue/expression.js @@ -0,0 +1,6 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.visitPlanEntryStatus(), "VISITPLANENTRY.STATUS"); +result.string(sql); diff --git a/entity/VisitPlanEntry_entity/recordcontainers/db/recordfieldmappings/status_appointment.displayvalue/expression.js b/entity/VisitPlanEntry_entity/recordcontainers/db/recordfieldmappings/status_appointment.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..e31a8838707a8dd089627ae3803a087d31690acd --- /dev/null +++ b/entity/VisitPlanEntry_entity/recordcontainers/db/recordfieldmappings/status_appointment.displayvalue/expression.js @@ -0,0 +1,6 @@ +import("system.result"); +import("Keyword_lib"); +import("KeywordRegistry_basic"); + +var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.visitPlanEntryStatusAppointment(), "visitplanentry.STATUS_APPOINTMENT"); +result.string(sql); \ No newline at end of file diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js b/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js deleted file mode 100644 index c3eb2cf67d6639429f657516f95f83bfdaaa5d62..0000000000000000000000000000000000000000 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/contentProcess.js +++ /dev/null @@ -1,78 +0,0 @@ -import("Person_lib"); -import("Keyword_lib"); -import("Contact_lib"); -import("Employee_lib"); -import("KeywordRegistry_basic"); -import("system.calendars"); -import("system.datetime"); -import("system.translate"); -import("system.logging"); -import("system.vars"); -import("system.db"); -import("system.result"); -import("Sql_lib"); - -var items = []; -var group = []; -var entryData = ""; - -var entrySQL = newSelect("ENTRYDATE, VISITPLANENTRYID, BEGIN_TIME, END_TIME, ORGANISATION_CONTACT_ID, VISITPLANENTRY.CONTACT_ID, STATUS, VISITPLANEMPLOYEEWEEK_ID" - +", APPOINTMENT_ID, STATUS_APPOINTMENT, VISITRECOMMENDATION_ID") - .from("VISITPLANENTRY"); - -if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) -{ - entrySQL.where("VISITPLANENTRY.VISITPLANENTRYID", vars.get("$local.idvalues")); -} -else if(vars.exists("$param.Entries_param") && vars.get("$param.Entries_param")) -{ - entrySQL.where("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", vars.get("$param.Entries_param")); -} -else if(vars.exists("$param.EntriesofCurrentWeek_param") && vars.get("$param.EntriesofCurrentWeek_param") == "true") -{ - var currentWeek = datetime.toLocaleDate(vars.get("$sys.date"), "w"); - var currentYear = datetime.toLocaleDate(vars.get("$sys.date"), "yyyy"); - var currentUser = EmployeeUtils.getCurrentContactId(); - - entrySQL.join("VISITPLANEMPLOYEEWEEK", "VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID = VISITPLANEMPLOYEEWEEK.VISITPLANEMPLOYEEWEEKID") - .where("VISITPLANEMPLOYEEWEEK.VISITPLAN_WEEK", currentWeek) - .and("VISITPLANEMPLOYEEWEEK.VISITPLAN_YEAR", currentYear) - .and("VISITPLANEMPLOYEEWEEK.CONTACT_ID", currentUser); -} - -entrySQL.orderBy("ENTRYDATE, BEGIN_TIME"); - -entryData = entrySQL.table(); - -if(entryData.length > 0) -{ - for(var i = 0; i < entryData.length; i++) - { - var entryDateRaw, visitPlanEntryId, beginTime, endTime, organisationContactId, contactId, status, visitplanEmployeeWeekId, appointmentid, statusAppointment, visitrecommendation_id; - [entryDateRaw, visitPlanEntryId, beginTime, endTime, organisationContactId, contactId, status, visitplanEmployeeWeekId, appointmentid, statusAppointment, visitrecommendation_id] = entryData[i] - - var contactname = ContactUtils.getTitleByContactId(contactId); - var orgname = OrganisationUtils.getNameByContactId(organisationContactId); - var parentName = translate.text(datetime.toLocaleDate(entryDateRaw, "EEEE")); - entryDate = datetime.toLocaleDate(entryDateRaw, "dd.MM.yyyy"); - - var statusDisplay = KeywordUtils.getViewValue($KeywordRegistry.visitPlanEntryStatus(), status) - var statusAppointmentDisplay = KeywordUtils.getViewValue($KeywordRegistry.visitPlanEntryStatusAppointment(), statusAppointment) - var alias = SqlUtils.getSystemAlias(); - - items.push([visitPlanEntryId, false, parentName + "#" + entryDate, "", beginTime - , endTime, organisationContactId, orgname, contactId, contactname, entryDateRaw, status, visitplanEmployeeWeekId, appointmentid - , statusDisplay, statusAppointment, statusAppointmentDisplay, visitrecommendation_id]); - - if(!vars.get("$local.idvalues")) - { - if(group.indexOf(parentName + "#" + entryDate) == -1) - { - items.push([parentName + "#" + entryDate, true, "", parentName + " " + entryDate, "", "", "", "", "", "", "", "", "", "", "", "", "", ""]); - group.push(parentName + "#" + entryDate); - } - } - } -} - -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 deleted file mode 100644 index 562ff8050fe6c728814d601c5e1a242dedfaac52..0000000000000000000000000000000000000000 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/onInsert.js +++ /dev/null @@ -1,83 +0,0 @@ -import("Sql_lib"); -import("system.neon"); -import("Employee_lib"); -import("system.datetime"); -import("system.logging"); -import("system.db"); -import("system.vars"); -import("system.util"); - -var visitPlanEmployeeWeekID = ""; -var insertData = []; -var user = EmployeeUtils.getCurrentContactId(); -if(vars.get("$param.Entries_param") != null) - visitPlanEmployeeWeekID = vars.get("$param.Entries_param"); -else -{ - var calendarWeek = datetime.toLocaleDate(vars.get("$field.ENTRYDATE"), "w"); - var calendarYear = datetime.toLocaleDate(vars.get("$field.ENTRYDATE"), "yyyy"); - var weekId = newSelect("VISITPLANEMPLOYEEWEEKID") - .from("VISITPLANEMPLOYEEWEEK") - .where("VISITPLANEMPLOYEEWEEK.VISITPLAN_WEEK", calendarWeek) - .and("VISITPLANEMPLOYEEWEEK.VISITPLAN_YEAR", calendarYear) - .and("VISITPLANEMPLOYEEWEEK.CONTACT_ID", user) - .cell(); - - if(weekId) - visitPlanEmployeeWeekID = weekId; - else - { - var newWeekId = util.getNewUUID(); - - var valuesWeek = [ - newWeekId, - calendarWeek, - calendarYear, - user - ]; - - var columnsWeek = [ - "VISITPLANEMPLOYEEWEEKID", - "VISITPLAN_WEEK", - "VISITPLAN_YEAR", - "CONTACT_ID", - ]; - - insertData.push(["VISITPLANEMPLOYEEWEEK", columnsWeek, null, valuesWeek]); - - visitPlanEmployeeWeekID = newWeekId; - } -} - -var rowData = vars.get("$local.rowdata"); -//logging.log("rowData: " + rowData["VISITRECOMMENDATION_ID.value"]); -//logging.log("field: " +vars.get("$field.VISITRECOMMENDATION_ID")); -var valuesEntry = [ - rowData["UID.value"], - rowData["ENTRYDATE.value"], - rowData["BEGIN_TIME.value"], - rowData["END_TIME.value"], - rowData["ORGANISATION_CONTACT_ID.value"], - rowData["CONTACT_ID.value"], - visitPlanEmployeeWeekID, - rowData["STATUS.value"], - rowData["STATUS_APPOINTMENT.value"], - rowData["VISITRECOMMENDATION_ID.value"] || "" -]; - -var columnsEntry = [ - "VISITPLANENTRYID", - "ENTRYDATE", - "BEGIN_TIME", - "END_TIME", - "ORGANISATION_CONTACT_ID", - "CONTACT_ID", - "VISITPLANEMPLOYEEWEEK_ID", - "STATUS", - "STATUS_APPOINTMENT", - "VISITRECOMMENDATION_ID" -]; - -insertData.push(["VISITPLANENTRY", columnsEntry, null, valuesEntry]) - -db.inserts(insertData); diff --git a/entity/VisitPlanEntry_entity/recordcontainers/jdito/rowCountProcess.js b/entity/VisitPlanEntry_entity/recordcontainers/jdito/rowCountProcess.js deleted file mode 100644 index c4d170943e70c3fccc9c9878cd5b5db4128e588f..0000000000000000000000000000000000000000 --- a/entity/VisitPlanEntry_entity/recordcontainers/jdito/rowCountProcess.js +++ /dev/null @@ -1,42 +0,0 @@ -import("Sql_lib"); -import("system.datetime"); -import("system.translate"); -import("system.vars"); -import("system.db"); -import("system.result"); - -var group = []; -var entryData = ""; -var count = 0; - -var entrySQL = newSelect("ENTRYDATE").from("VISITPLANENTRY"); - -if(vars.exists("$param.Entries_param") && vars.get("$param.Entries_param")) -{ - entrySQL = newSelect("ENTRYDATE") - .from("VISITPLANENTRY") - .where("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", vars.get("$param.Entries_param")); -} -if (vars.exists("$local.idvalues") && vars.get("$local.idvalues")) -{ - entrySQL.andIfSet("VISITPLANENTRY.VISITPLANENTRYID", vars.get("$local.idvalues")); -} -entrySQL.orderBy("VISITPLANENTRY.ENTRYDATE, VISITPLANENTRY.BEGIN_TIME"); -entryData = entrySQL.table(); -count += entryData.length; - -if(entryData.length > 0) -{ - for(var i = 0; i < entryData.length; i++) - { - var parentName = translate.text(datetime.toLocaleDate(entryData[i][0], "EEEE")); - if(!vars.exists("$local.idvalues") || !vars.get("$local.idvalues")) - { - if(group.indexOf(parentName) == -1) - group.push(parentName); - - } - } -} -count += group.length; -result.string(count); diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 6c831218bd57770c2bd7784a5c240fa4550140c6..d6a269f2609d2fe323f115932a5b719c6a9d5b1b 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -9307,6 +9307,10 @@ Bitte Datumseingabe prüfen</value> <key>Open route</key> <value>Route öffnen</value> </entry> + <entry> + <key>Open Route of the day</key> + <value>Tagesroute öffnen</value> + </entry> <entry> <key>External Work</key> <value>Aussendienst</value> diff --git a/neonContext/VisitPlanEntry/VisitPlanEntry.aod b/neonContext/VisitPlanEntry/VisitPlanEntry.aod index 93caf6dc86dedfdcdb44b471b655d98610f88eb2..5deb4c833493b2e67b7d898bc411ba5bb081d50d 100644 --- a/neonContext/VisitPlanEntry/VisitPlanEntry.aod +++ b/neonContext/VisitPlanEntry/VisitPlanEntry.aod @@ -1,9 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.1"> <name>VisitPlanEntry</name> + <title>Visitplan Entry</title> <majorModelMode>DISTRIBUTED</majorModelMode> + <mainView>VisitPlanEntryMain_view</mainView> <filterView>VisitPlanEntryFilter_view</filterView> <editView>VisitPlanEntryEdit_view</editView> + <previewView>VisitPlanEntryPreview_view</previewView> <entity>VisitPlanEntry_entity</entity> <references> <neonViewReference> @@ -14,5 +17,17 @@ <name>9f5ad319-7c06-4161-bbec-581ac86b0a0d</name> <view>VisitPlanEntryEdit_view</view> </neonViewReference> + <neonViewReference> + <name>b43d2860-129f-4119-b304-8c8990ff7670</name> + <view>VisitPlanEntryMain_view</view> + </neonViewReference> + <neonViewReference> + <name>47875f73-e1a7-49ba-b356-ff960e63e909</name> + <view>VisitPlanEntryPreview_view</view> + </neonViewReference> + <neonViewReference> + <name>40fdc514-ae39-4c73-971b-0725abb89095</name> + <view>VisitPlanEntryNotice_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonView/VisitPlanEntryFilter_view/VisitPlanEntryFilter_view.aod b/neonView/VisitPlanEntryFilter_view/VisitPlanEntryFilter_view.aod index 3fb2b9ac85512d860ac933badd0c3e9bb364a286..b2d9755026985e22cdd2d98d72430e9654559461 100644 --- a/neonView/VisitPlanEntryFilter_view/VisitPlanEntryFilter_view.aod +++ b/neonView/VisitPlanEntryFilter_view/VisitPlanEntryFilter_view.aod @@ -2,7 +2,7 @@ <neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> <name>VisitPlanEntryFilter_view</name> <majorModelMode>DISTRIBUTED</majorModelMode> - <filterable v="false" /> + <filterable v="true" /> <dashletConfigurations> <neonDashletConfiguration> <name>currentWeek</name> @@ -39,6 +39,9 @@ <parentField>PARENT_ID</parentField> <entityField>#ENTITY</entityField> <favoriteActionGroup1>entityActionGroup</favoriteActionGroup1> + <defaultGroupFields> + <element>ENTRYDATE</element> + </defaultGroupFields> <columns> <neonTreeTableColumn> <name>d728f2d9-c223-47fd-9372-6f49203f68fd</name> diff --git a/neonView/VisitPlanEntryMain_view/VisitPlanEntryMain_view.aod b/neonView/VisitPlanEntryMain_view/VisitPlanEntryMain_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..c75dbf3873796d62e4536a180e13d3a0b9e18ee8 --- /dev/null +++ b/neonView/VisitPlanEntryMain_view/VisitPlanEntryMain_view.aod @@ -0,0 +1,33 @@ +<?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.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> + <name>VisitPlanEntryMain_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <masterSlaveLayout> + <name>layout</name> + <master>1fc1601c-3616-456f-a2f1-952069aeb040</master> + </masterSlaveLayout> + </layout> + <children> + <neonViewReference> + <name>1fc1601c-3616-456f-a2f1-952069aeb040</name> + <entityField>#ENTITY</entityField> + <view>VisitPlanEntryPreview_view</view> + </neonViewReference> + <neonViewReference> + <name>cfed1f51-be83-42ba-8139-61047732fd34</name> + <entityField>#ENTITY</entityField> + <view>VisitPlanEntryNotice_view</view> + </neonViewReference> + <neonViewReference> + <name>2452553a-fa07-4f77-8a2f-815d7fa03a86</name> + <entityField>Activities</entityField> + <view>ActivityFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>0670493a-00f0-4fbb-bc08-bf145f8fece5</name> + <entityField>Documents</entityField> + <view>DocumentFilter_view</view> + </neonViewReference> + </children> +</neonView> diff --git a/neonView/VisitPlanEntryNotice_view/VisitPlanEntryNotice_view.aod b/neonView/VisitPlanEntryNotice_view/VisitPlanEntryNotice_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..d5533d3074bacd5727ded4b120c629c9de1798af --- /dev/null +++ b/neonView/VisitPlanEntryNotice_view/VisitPlanEntryNotice_view.aod @@ -0,0 +1,26 @@ +<?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.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> + <name>VisitPlanEntryNotice_view</name> + <title>Preparation</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <genericViewTemplate> + <name>Notice</name> + <showDrawer v="true" /> + <drawerCaption>Notice</drawerCaption> + <fixedDrawer v="true" /> + <hideEmptyFields v="false" /> + <fields> + <entityFieldLink> + <name>20cc4c04-2a33-4978-9366-a21d6ca75abd</name> + <entityField>PREPARATION</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + </children> +</neonView> diff --git a/neonView/VisitPlanEntryPreview_view/VisitPlanEntryPreview_view.aod b/neonView/VisitPlanEntryPreview_view/VisitPlanEntryPreview_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..e2fd831a5b92ff7d9618b2b301dada6c12056bd9 --- /dev/null +++ b/neonView/VisitPlanEntryPreview_view/VisitPlanEntryPreview_view.aod @@ -0,0 +1,47 @@ +<?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.8" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.8"> + <name>VisitPlanEntryPreview_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <headerFooterLayout> + <name>layout</name> + <header>Header</header> + </headerFooterLayout> + </layout> + <children> + <cardViewTemplate> + <name>Header</name> + <iconField>icon</iconField> + <titleField>PARENTNAME</titleField> + </cardViewTemplate> + <genericViewTemplate> + <name>Info</name> + <fields> + <entityFieldLink> + <name>dd25d1e4-b986-4e28-8a7f-dc603276252a</name> + <entityField>ORGANISATION_CONTACT_ID</entityField> + </entityFieldLink> + <entityFieldLink> + <name>e8950f3a-edbc-4e30-8c01-aa546195317d</name> + <entityField>CONTACT_ID</entityField> + </entityFieldLink> + <entityFieldLink> + <name>535ebb8b-20d5-43c0-84dd-c4494e6edad9</name> + <entityField>ENTRYDATE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>64f6ef56-d78f-424a-ab06-0540699bb728</name> + <entityField>STATUS</entityField> + </entityFieldLink> + <entityFieldLink> + <name>9ab4666a-19eb-4682-9aad-d780da243aae</name> + <entityField>BEGIN_TIME</entityField> + </entityFieldLink> + <entityFieldLink> + <name>f725bfe9-a7e2-47d6-9139-6e81ee7ac25a</name> + <entityField>END_TIME</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> + </children> +</neonView> diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js index 193901a2f9a398312a2bed5def109af3a0ee4273..224b5a77583e0cbc17257477e700a4e99b48ed89 100644 --- a/process/Context_lib/process.js +++ b/process/Context_lib/process.js @@ -173,6 +173,8 @@ ContextUtils.getContextConsumer = function(pContextId) return "SupportTickets"; case ContextUtils.getContextName("Activity"): return "Activities"; + case ContextUtils.getContextName("VisitPlanEntry"): + return "VisitPlanEntries"; default: throw new Error(translate.withArguments("No consumer found for context '%0'", [pContextId])); } @@ -302,20 +304,21 @@ ContextUtils.getContexts = function(pBlacklist, pInvertBlacklist) else { whitelist = new Set() - .add("Organisation") - .add("Person") - .add("PrivatePerson") - .add("Activity") - .add("Salesproject") - .add("Contract") - .add("Offer") - .add("Order") - .add("Product") - .add("Task") - .add("Campaign") - .add("CampaignStep") - .add("SupportTicket") - .add("Leadimport"); + .add("Organisation") + .add("Person") + .add("PrivatePerson") + .add("Activity") + .add("Salesproject") + .add("Contract") + .add("Offer") + .add("Order") + .add("Product") + .add("Task") + .add("Campaign") + .add("CampaignStep") + .add("SupportTicket") + .add("Leadimport") + .add("VisitPlanEntry"); if (pBlacklist) pBlacklist.forEach(whitelist["delete"], whitelist); diff --git a/process/VisitPlanning_lib/VisitPlanning_lib.aod b/process/VisitPlanning_lib/VisitPlanning_lib.aod new file mode 100644 index 0000000000000000000000000000000000000000..1045123646a374122d6c96e454d909f8856716ed --- /dev/null +++ b/process/VisitPlanning_lib/VisitPlanning_lib.aod @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.2.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.2.2"> + <name>VisitPlanning_lib</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/VisitPlanning_lib/process.js</process> + <restrictedRoles /> + <alias>Data_alias</alias> + <variants> + <element>LIBRARY</element> + </variants> +</process> diff --git a/process/VisitPlanning_lib/process.js b/process/VisitPlanning_lib/process.js new file mode 100644 index 0000000000000000000000000000000000000000..80ae9c5f42690d369575fbbc467eb1757f39dc29 --- /dev/null +++ b/process/VisitPlanning_lib/process.js @@ -0,0 +1,102 @@ +import("Sql_lib"); +import("Employee_lib"); +import("system.datetime"); +import("system.db"); +import("system.text"); +import("system.neon"); +import("system.vars"); + +/** + * Methods used for VisitPlannung + * Do not create an instance of this! + * + * @class + */ +function VisitPlanningUtils() {} + +/** + * Used by the OpenRoute and OpenDayRoute actions in VisitplanEntry_entity.<br> + * + * + * @param {String} [pIsDayRoute] Opens the route only for one address, otherwise all of selected week and it's date + * + * @return {void} {content: base64-encoded CSV; + * filename: filename} + * + */ +VisitPlanningUtils.openRoute = function (pIsDayRoute) +{ + + var visitAddresses = []; + var addressIdStart; + var address; + var user = EmployeeUtils.getCurrentContactId(); + + //start homeaddress + addressIdStart = newSelect("ADDRESSID") + .from("ADDRESS") + .where("ADDRESS.ADDR_TYPE", "HOMEADDR") + .and("ADDRESS.CONTACT_ID", user) + .cell(); + + if(!addressIdStart) + { + //start orgaddress + var orgID = newSelect("ORGANISATION_ID") + .from("CONTACT") + .where("CONTACT.CONTACTID", user) + .cell(); + + addressIdStart = newSelect("ADDRESS_ID") + .from("CONTACT") + .where("CONTACT.ORGANISATION_ID", orgID) + .and("CONTACT.PERSON_ID is null") + .cell(); + } + + var addressStart = ""; + if(addressIdStart) + { + addressStart = newSelect("ADDRESS, BUILDINGNO, ZIP, CITY, COUNTRY") + .from("ADDRESS") + .where("ADDRESS.ADDRESSID", addressIdStart) + .arrayRow(); + + visitAddresses.push(addressStart.join("+")); + } + + //address to visit + var selectionRowData = vars.get("$sys.selectionRows"); + var isGroup = selectionRowData[0].ISGROUP; //not Bool + + var entrydate = selectionRowData[0]["ENTRYDATE"] + + var entryid = vars.get("$param.Entries_param"); + + var cond = newWhere("VISITPLANENTRY.VISITPLANEMPLOYEEWEEK_ID", entryid).and("VISITPLANENTRY.ENTRYDATE", entrydate) + + if(!pIsDayRoute) + { + cond = cond.and("VISITPLANENTRY.VISITPLANENTRYID", selectionRowData[0]["VISITPLANENTRYID"]); + } + var childAddresses = newSelect("ADDRESS, BUILDINGNO, ZIP, CITY, COUNTRY") + .from("ADDRESS") + .leftJoin("VISITPLANENTRY", "ADDRESS.ADDRESSID = (select ADDRESS_ID from CONTACT where CONTACT.CONTACTID \n\ + = VISITPLANENTRY.ORGANISATION_CONTACT_ID)") + .where(cond) + .and("VISITPLANENTRY.ENTRYDATE", entrydate) + .table(); + + + for(let i = 0; i < childAddresses.length; i++) + { + visitAddresses.push(childAddresses[i].join("+")); + } + + visitAddresses.push(addressStart.join("+")); + + + address = "https://www.google.com/maps/dir/" + visitAddresses.join("/"); + + neon.openUrl(address, true); +};