Skip to content
Snippets Groups Projects
Commit 2e953c79 authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon: Committed by Sebastian Pongratz
Browse files

[Projekt: xRM-Sales][TicketNr.: 1083524][Gebiet: Änderung von Rolle wird nicht...

[Projekt: xRM-Sales][TicketNr.: 1083524][Gebiet: Änderung von Rolle wird nicht in die Zuordnung überführt]
parent 7cb76638
No related branches found
No related tags found
No related merge requests found
Showing
with 319 additions and 31 deletions
<?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="b.ulrich" id="cfa405a8-4588-4dab-9e5b-6532e6e6f97f">
<addColumn tableName="DISTRICTCONTACT">
<column name="DISTRICTRESPONSIBLE_ID" type="CHAR(36)"/>
</addColumn>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<include relativeToChangelogFile="true" file="alter_DistrictContact.xml"/>
</databaseChangeLog>
\ No newline at end of file
......@@ -12,4 +12,5 @@
<include relativeToChangelogFile="true" file="Campaign/changelog.xml"/>
<include relativeToChangelogFile="true" file="Visitplan/changelog.xml"/>
<include relativeToChangelogFile="true" file="UpdateAddrFormats.xml"/>
<include relativeToChangelogFile="true" file="District/changelog.xml"/>
</databaseChangeLog>
\ No newline at end of file
......@@ -9,14 +9,18 @@
<column name="ADVISER_ROLE" value="ADVISERROLE_AreaManager"/>
<column name="ADVISER_CONTACT_ID" value="d5a2dc64-e503-4aed-a0c6-d54f49b8db87"/>
<column name="STATUS" value="CONTACTSTATACTIVE "/>
<column name="DISTRICT_ID" value="08026817-e05f-469f-9a55-00fee0ec0fac"/>
<column name="DISTRICTRESPONSIBLE_ID" value="79423e23-9079-4d60-98ae-efb08c082f32"/>
</insert>
<insert tableName="districtcontact">
<column name="DISTRICTCONTACTID" value="a2b36387-7d03-4d18-8c10-db2c2193ce47"/>
<column name="ORIGIN" value="DistrictOrigin_manual"/>
<column name="CONTACT_ID" value="2a45eaab-3638-42fa-82ec-1b6893cb6a30"/>
<column name="CONTACT_ID" value="ef345d11-a40d-59e0-a24c-afcb6095d2cb"/>
<column name="ADVISER_ROLE" value="ADVISERROLE_OfficeDuty"/>
<column name="ADVISER_CONTACT_ID" value="ef345d11-a40d-59e0-a24c-afcb6095d2cb"/>
<column name="STATUS" value="CONTACTSTATACTIVE "/>
<column name="DISTRICT_ID" value="eef5f9a1-c849-4530-8068-1927d2b0e4d7"/>
<column name="DISTRICTRESPONSIBLE_ID" value="83117f7a-b0b2-4cc9-b654-3d4833e9bd34"/>
</insert>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -7,28 +7,52 @@
<column name="DISTRICT_ID" value="08026817-e05f-469f-9a55-00fee0ec0fac"/>
<column name="USER_NEW" value="Admin"/>
<column name="EMPLOYEE_CONTACT_ID" value="d5a2dc64-e503-4aed-a0c6-d54f49b8db87"/>
<column name="ADVISER_STATUS" value="CONTACTSTATACTIVE"/>
<column name="ADVISER_ROLE" value="ADVISERROLE_AccountManager"/>
<column name="VISITFREQUENCY" value="VISITFREQUENCYSEMIANNUALLY"/>
<column name="DATE_NEW" valueDate="2020-09-16T08:31:52"/>
<column name="USER_NEW" value="Admin"/>
<column name="VALID_FROM" valueDate="2020-09-16T08:31:52"/>
<column name="VALID_UNTIL" valueDate="2022-09-16T08:31:52"/>
</insert>
<insert tableName="districtresponsible">
<column name="DISTRICTRESPONSIBLEID" value="83117f7a-b0b2-4cc9-b654-3d4833e9bd34"/>
<column name="DISTRICT_ID" value="eef5f9a1-c849-4530-8068-1927d2b0e4d7"/>
<column name="USER_NEW" value="Admin"/>
<column name="EMPLOYEE_CONTACT_ID" value="ef345d11-a40d-59e0-a24c-afcb6095d2cb"/>
<column name="ADVISER_STATUS" value="CONTACTSTATACTIVE"/>
<column name="ADVISER_ROLE" value="ADVISERROLE_AccountManager"/>
<column name="VISITFREQUENCY" value="VISITFREQUENCYSEMIANNUALLY"/>
<column name="DATE_NEW" valueDate="2020-09-16T08:28:58"/>
<column name="USER_NEW" value="Admin"/>
<column name="VALID_FROM" valueDate="2020-09-16T08:31:52"/>
<column name="VALID_UNTIL" valueDate="2022-09-16T08:31:52"/>
</insert>
<insert tableName="districtresponsible">
<column name="DISTRICTRESPONSIBLEID" value="ddeb50e7-b838-45a7-99ed-75053a0201c9"/>
<column name="DISTRICT_ID" value="7fc6c55e-f4af-4f77-8c09-b6cc2d95862f"/>
<column name="USER_NEW" value="Admin"/>
<column name="EMPLOYEE_CONTACT_ID" value="c7ddf982-0e58-4152-b82b-8f5673b0b729"/>
<column name="ADVISER_STATUS" value="CONTACTSTATACTIVE"/>
<column name="ADVISER_ROLE" value="ADVISERROLE_AccountManager"/>
<column name="VISITFREQUENCY" value="VISITFREQUENCYSEMIANNUALLY"/>
<column name="DATE_NEW" valueDate="2020-09-16T08:21:13"/>
<column name="USER_NEW" value="Admin"/>
<column name="VALID_FROM" valueDate="2020-09-16T08:31:52"/>
<column name="VALID_UNTIL" valueDate="2022-09-16T08:31:52"/>
</insert>
<insert tableName="districtresponsible">
<column name="DISTRICTRESPONSIBLEID" value="e4a51357-23dd-4904-b62e-7cccaaa6eb2c"/>
<column name="DISTRICT_ID" value="502d71dd-a26a-41b9-a762-8c5bde80ca4e"/>
<column name="USER_NEW" value="Admin"/>
<column name="EMPLOYEE_CONTACT_ID" value="d105f7f4-afd1-4a98-adc2-13fd6934b7e9"/>
<column name="ADVISER_STATUS" value="CONTACTSTATACTIVE"/>
<column name="ADVISER_ROLE" value="ADVISERROLE_AccountManager"/>
<column name="VISITFREQUENCY" value="VISITFREQUENCYSEMIANNUALLY"/>
<column name="DATE_NEW" valueDate="2020-09-16T08:30:33"/>
<column name="USER_NEW" value="Admin"/>
<column name="VALID_FROM" valueDate="2020-09-16T08:31:52"/>
<column name="VALID_UNTIL" valueDate="2022-09-16T08:31:52"/>
</insert>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -15966,8 +15966,8 @@
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="19" />
<scale v="0" />
<size v="29" />
<scale v="9" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
......@@ -15980,8 +15980,8 @@
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="19" />
<scale v="0" />
<size v="29" />
<scale v="9" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
......@@ -15994,8 +15994,8 @@
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="19" />
<scale v="0" />
<size v="29" />
<scale v="9" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
......@@ -16022,8 +16022,8 @@
<dbName></dbName>
<primaryKey v="false" />
<columnType v="93" />
<size v="19" />
<scale v="0" />
<size v="29" />
<scale v="9" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
......@@ -16058,6 +16058,20 @@
<documentation></documentation>
<description></description>
</entityFieldDb>
<entityFieldDb>
<name>DISTRICTRESPONSIBLE_ID</name>
<dbName></dbName>
<primaryKey v="false" />
<columnType v="1" />
<size v="36" />
<scale v="0" />
<notNull v="false" />
<isUnique v="false" />
<index v="false" />
<documentation></documentation>
<title></title>
<description></description>
</entityFieldDb>
</entityFields>
</entityDb>
<entityDb>
......
<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.21" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.21">
<name>DistrictChangeValidityDates_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<recordContainer>jdito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityProvider>
<name>#PROVIDER_AGGREGATES</name>
<useAggregates v="true" />
</entityProvider>
<entityField>
<name>VALID_FROM</name>
<title>Valid from</title>
<contentType>DATE</contentType>
<state>EDITABLE</state>
<stateProcess>%aditoprj%/entity/DistrictChangeValidityDates_entity/entityfields/valid_from/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/DistrictChangeValidityDates_entity/entityfields/valid_from/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>VALID_UNTIL</name>
<title>Valid to</title>
<contentType>DATE</contentType>
<state>EDITABLE</state>
<stateProcess>%aditoprj%/entity/DistrictChangeValidityDates_entity/entityfields/valid_until/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/DistrictChangeValidityDates_entity/entityfields/valid_until/valueProcess.js</valueProcess>
</entityField>
<entityParameter>
<name>DistrictContactIds_param</name>
<expose v="true" />
</entityParameter>
<entityActionField>
<name>safeAndUpdate</name>
<onActionProcess>%aditoprj%/entity/DistrictChangeValidityDates_entity/entityfields/safeandupdate/onActionProcess.js</onActionProcess>
<iconId>VAADIN:CHECK</iconId>
</entityActionField>
<entityField>
<name>count</name>
<title>Contacts selected</title>
<valueProcess>%aditoprj%/entity/DistrictChangeValidityDates_entity/entityfields/count/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>setValid_from</name>
<title>change valid from</title>
<contentType>BOOLEAN</contentType>
<state>EDITABLE</state>
<valueProcess>%aditoprj%/entity/DistrictChangeValidityDates_entity/entityfields/setvalid_from/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>setValid_until</name>
<title>change valid to</title>
<contentType>BOOLEAN</contentType>
<state>EDITABLE</state>
<valueProcess>%aditoprj%/entity/DistrictChangeValidityDates_entity/entityfields/setvalid_until/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>UID</name>
</entityField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
<name>jdito</name>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<contentProcess>%aditoprj%/entity/DistrictChangeValidityDates_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
<onInsert>%aditoprj%/entity/DistrictChangeValidityDates_entity/recordcontainers/jdito/onInsert.js</onInsert>
<recordFieldMappings>
<jDitoRecordFieldMapping>
<name>UID.value</name>
</jDitoRecordFieldMapping>
</recordFieldMappings>
</jDitoRecordContainer>
</recordContainers>
</entity>
import("system.vars");
import("system.result");
var districtContactIds = vars.get("$param.DistrictContactIds_param");
if(districtContactIds && Array.isArray(districtContactIds))
{
result.string(JSON.parse(districtContactIds).length);
}
else
{
result.string(0);
}
import("system.result");
import("system.neon");
import("Util_lib");
import("system.vars");
var state = neon.COMPONENTSTATE_INVISIBLE;
if(Utils.toBoolean(vars.get("$field.setValid_from")))
{
state = neon.COMPONENTSTATE_EDITABLE;
}
result.string(state);
\ No newline at end of file
import("system.vars");
import("system.neon");
import("system.result");
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value"))
{
result.string(vars.get("$sys.date"));
}
\ No newline at end of file
import("system.result");
import("system.neon");
import("Util_lib");
import("system.vars");
var state = neon.COMPONENTSTATE_INVISIBLE;
if(Utils.toBoolean(vars.get("$field.setValid_until")))
{
state = neon.COMPONENTSTATE_EDITABLE;
}
result.string(state);
\ No newline at end of file
import("system.vars");
import("system.neon");
import("system.result");
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value"))
{
result.string(vars.get("$sys.date"));
}
\ No newline at end of file
import("system.result");
import("system.vars");
if(vars.get("$local.idvalues"))
{
result.object([vars.get("$local.idvalues")]);
}
\ No newline at end of file
import("system.entities");
import("Util_lib");
import("Sql_lib");
import("system.vars");
var districtContactIds = vars.get("$param.DistrictContactIds_param");
if(districtContactIds)
{
districtContactIds = JSON.parse(districtContactIds);
var validFrom = vars.get("$field.VALID_FROM");
var validUntil = vars.get("$field.VALID_UNTIL");
var setValidFrom = Utils.toBoolean(vars.get("$field.setValid_from"));
var setValidUntil = Utils.toBoolean(vars.get("$field.setValid_until"));
//it is possible to
//- change one or both of the date values to another date
//- and "clear" one or both of them by clearing said field
//--> to make it possible to enable the user to change one of the dates without setting/clearing the other date we have to use the helper fields "setValidFrom" and "setValiduntil"
//to know when to update said value.
if(setValidFrom || setValiduntil)
{
var fieldValues = {};
if(setValidFrom)
{
if(validFrom)
{
fieldValues["VALID_FROM"] = validFrom;
}
else
{
fieldValues["VALID_FROM"] = "";
}
}
if(setValidUntil)
{
if(validUntil)
{
fieldValues["VALID_UNTIL"] = validUntil;
}
else
{
fieldValues["VALID_UNTIL"] = "";
}
}
var config = entities.createConfigForUpdatingRows();
config.entity("DistrictContact_entity");
config.fieldValues(fieldValues);
for each(let idToUpdate in districtContactIds) {
config.uid(idToUpdate);
entities.updateRow(config);
}
}
}
\ No newline at end of file
......@@ -66,6 +66,7 @@
<contentType>DATE</contentType>
<resolution>DAY</resolution>
<groupable v="true" />
<valueProcess>%aditoprj%/entity/DistrictContact_entity/entityfields/valid_from/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>VALID_UNTIL</name>
......@@ -181,27 +182,6 @@
<name>RowId_param</name>
<expose v="true" />
</entityParameter>
<entityActionGroup>
<name>setStatus</name>
<children>
<entityActionField>
<name>setActive</name>
<title>Set active</title>
<onActionProcess>%aditoprj%/entity/DistrictContact_entity/entityfields/setstatus/children/setactive/onActionProcess.js</onActionProcess>
<selectionType>MULTI</selectionType>
<iconId>VAADIN:THUMBS_UP</iconId>
<tooltip>Set status to active</tooltip>
</entityActionField>
<entityActionField>
<name>setInactive</name>
<title>Set inactive</title>
<onActionProcess>%aditoprj%/entity/DistrictContact_entity/entityfields/setstatus/children/setinactive/onActionProcess.js</onActionProcess>
<selectionType>MULTI</selectionType>
<iconId>VAADIN:THUMBS_DOWN</iconId>
<tooltip>Set status to inactive</tooltip>
</entityActionField>
</children>
</entityActionGroup>
<entityParameter>
<name>isDashletView_param</name>
<expose v="true" />
......@@ -234,6 +214,33 @@
<name>ContactId_param</name>
<expose v="true" />
</entityParameter>
<entityActionGroup>
<name>filterViewActionGroup</name>
<children>
<entityActionField>
<name>setActive</name>
<title>Set active</title>
<onActionProcess>%aditoprj%/entity/DistrictContact_entity/entityfields/filterviewactiongroup/children/setactive/onActionProcess.js</onActionProcess>
<selectionType>MULTI</selectionType>
<iconId>VAADIN:THUMBS_UP</iconId>
<tooltip>Set status to active</tooltip>
</entityActionField>
<entityActionField>
<name>setInactive</name>
<title>Set inactive</title>
<onActionProcess>%aditoprj%/entity/DistrictContact_entity/entityfields/filterviewactiongroup/children/setinactive/onActionProcess.js</onActionProcess>
<selectionType>MULTI</selectionType>
<iconId>VAADIN:THUMBS_DOWN</iconId>
<tooltip>Set status to inactive</tooltip>
</entityActionField>
<entityActionField>
<name>changeValidity</name>
<title>Change Validity Dates</title>
<onActionProcess>%aditoprj%/entity/DistrictContact_entity/entityfields/filterviewactiongroup/children/changevalidity/onActionProcess.js</onActionProcess>
<iconId>VAADIN:CALENDAR</iconId>
</entityActionField>
</children>
</entityActionGroup>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.translate");
import("system.neon");
import("Context_lib");
import("FilterViewAction_lib");
import("system.vars");
var districtContactIds;
var currentContext = ContextUtils.getCurrentContextId();
if (vars.get("$sys.selection").length > 0)
{
districtContactIds = vars.get("$sys.selection");
}
else
{
districtContactIds = FilterViewActionUtils.getUidsByEntityFilter(
currentContext
, vars.get("$sys.filter")
, {"currentOrganisationId_param": vars.get("$param.currentOrganisationId_param")
, "DistrictId_param": vars.get("$param.DistrictId_param")});
}
var params = {
"DistrictContactIds_param": JSON.stringify(districtContactIds)
}
neon.openContext("DistrictChangeValidityDates", "DistrictChangeValidityDatesEdit_view", null, neon.OPERATINGSTATE_NEW, params, null);
\ No newline at end of file
import("system.vars");
import("system.neon");
import("system.result");
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value"))
{
result.string(vars.get("$sys.date"));
}
\ No newline at end of file
......@@ -158,7 +158,6 @@
<children>
<entityParameter>
<name>ExcludedContactIds_param</name>
<valueProcess>%aditoprj%/entity/DistrictResponsible_entity/entityfields/persons/children/excludedcontactids_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
......@@ -205,6 +204,7 @@
<contentType>DATE</contentType>
<resolution>DAY</resolution>
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/DistrictResponsible_entity/entityfields/valid_from/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>VALID_UNTIL</name>
......@@ -262,6 +262,7 @@
<contentType>DATE</contentType>
<resolution>DAY</resolution>
<stateProcess>%aditoprj%/entity/DistrictResponsible_entity/entityfields/valid_untilselectionfield/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/DistrictResponsible_entity/entityfields/valid_untilselectionfield/valueProcess.js</valueProcess>
<onValueChange>%aditoprj%/entity/DistrictResponsible_entity/entityfields/valid_untilselectionfield/onValueChange.js</onValueChange>
</entityField>
</entityFields>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment