diff --git a/.liquibase/Data_alias/basic/2021.1.3/Checklist/alter_Checklist.xml b/.liquibase/Data_alias/basic/2021.1.3/Checklist/alter_Checklist.xml new file mode 100644 index 0000000000000000000000000000000000000000..4b18e3285d422e2fd602ef7e24862628ec721f14 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.1.3/Checklist/alter_Checklist.xml @@ -0,0 +1,14 @@ +<?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="j.luginger" id="8886003f-e80a-4430-9d8b-759854dac6ba"> + <addColumn tableName="CHECKLIST"> + <column name="DESCRIPTION" type="VARCHAR(500)"/> + <column name="TITLE" type="VARCHAR(100)"/> + <column name="AUTOPROBABILITY" type="DECIMAL(6, 2)"/> + <column name="CONTEXT" type="VARCHAR(50)"/> + <column name="COND" type="CLOB"/> + </addColumn> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.1.3/Checklist/alter_ChecklistEntry.xml b/.liquibase/Data_alias/basic/2021.1.3/Checklist/alter_ChecklistEntry.xml new file mode 100644 index 0000000000000000000000000000000000000000..fb84856c03e2ae6904897d8d05f8e803713cffc0 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.1.3/Checklist/alter_ChecklistEntry.xml @@ -0,0 +1,11 @@ +<?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="j.luginger" id="26131e0c-07bf-4bbd-8f2d-a821230e058f"> + <addColumn tableName="CHECKLISTENTRY"> + <column name="COND" type="CLOB"/> + <column name="FILTER_USED" type="TINYINT" defaultValueNumeric="0"/> + </addColumn> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.1.3/Checklist/changelog.xml b/.liquibase/Data_alias/basic/2021.1.3/Checklist/changelog.xml index b5ff1d8f229551c4d551acdf1274285d7f30df16..143e76fb76bd5e61e08fddd9ad0803ac4e3d08e4 100644 --- a/.liquibase/Data_alias/basic/2021.1.3/Checklist/changelog.xml +++ b/.liquibase/Data_alias/basic/2021.1.3/Checklist/changelog.xml @@ -1,6 +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"> +<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_Checklist.xml"/> + <include relativeToChangelogFile="true" file="alter_ChecklistEntry.xml"/> <include relativeToChangelogFile="true" file="alter_ChecklistDateDatatypes.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 95973cf3548510a035ef920b440cdc8ffb93c8fb..f50bcf9df66007ae9b05bdde074386e8d5eb891a 100644 --- a/.liquibase/Data_alias/basic/2021.1.3/changelog.xml +++ b/.liquibase/Data_alias/basic/2021.1.3/changelog.xml @@ -5,3 +5,4 @@ <include relativeToChangelogFile="true" file="Checklist/changelog.xml"/> <include relativeToChangelogFile="true" file="alter_dataTypesToDateTime.xml"/> </databaseChangeLog> +</databaseChangeLog> diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index ab314e0fcb39da55f3e34558c89ad90b636e2841..50495ae21d2e6ed48f4bf060c35606f9c6e676e4 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -17577,6 +17577,34 @@ <title></title> <description></description> </entityFieldDb> + <entityFieldDb> + <name>COND</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="-1" /> + <size v="2147483647" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>FILTER_USED</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="-6" /> + <size v="3" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> </entityFields> </entityDb> <entityDb> @@ -17661,6 +17689,76 @@ <documentation></documentation> <description></description> </entityFieldDb> + <entityFieldDb> + <name>DESCRIPTION</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="500" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>AUTOPROBABILITY</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="3" /> + <size v="6" /> + <scale v="2" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>TITLE</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="100" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>COND</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="-1" /> + <size v="2147483647" /> + <scale v="0" /> + <notNull v="false" /> + <isUnique v="false" /> + <index v="false" /> + <documentation></documentation> + <title></title> + <description></description> + </entityFieldDb> + <entityFieldDb> + <name>CONTEXT</name> + <dbName></dbName> + <primaryKey v="false" /> + <columnType v="12" /> + <size v="50" /> + <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/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod index ee0a5b93039f68e19d4786c596e783eb21d5a6d6..049eeb525e6c6ffbe044dea92d433afade2a879d 100644 --- a/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod +++ b/application/_____SYSTEM_APPLICATION_NEON/_____SYSTEM_APPLICATION_NEON.aod @@ -374,7 +374,7 @@ <kind v="10077" /> </entityNode> <entityNode> - <name>SalesprojectPhaseDefinition</name> + <name>Checklist</name> <kind v="10077" /> </entityNode> </childNodes> diff --git a/entity/ChecklistEntryValue_entity/ChecklistEntryValue_entity.aod b/entity/ChecklistEntryValue_entity/ChecklistEntryValue_entity.aod index d338522fd916a7f3cdba56ca7c02c4dcebd5b9e5..eef2c59e835ff9ca78164bcea1492a500511974c 100644 --- a/entity/ChecklistEntryValue_entity/ChecklistEntryValue_entity.aod +++ b/entity/ChecklistEntryValue_entity/ChecklistEntryValue_entity.aod @@ -1,10 +1,11 @@ <?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>ChecklistEntryValue_entity</name> - <title>Checklist entries</title> + <title>Checklist</title> <majorModelMode>DISTRIBUTED</majorModelMode> <icon>NEON:MQL</icon> <imageProcess>%aditoprj%/entity/ChecklistEntryValue_entity/imageProcess.js</imageProcess> + <titlePlural>Checklist</titlePlural> <recordContainer>jDito</recordContainer> <entityFields> <entityProvider> @@ -92,6 +93,16 @@ <name>DONEUSER</name> <title>Done by</title> </entityField> + <entityParameter> + <name>ChecklistIds_param</name> + <expose v="true" /> + </entityParameter> + <entityField> + <name>COND</name> + </entityField> + <entityField> + <name>FILTER_USED</name> + </entityField> </entityFields> <recordContainers> <jDitoRecordContainer> @@ -111,6 +122,12 @@ <jDitoRecordFieldMapping> <name>CHECKLISTENTRY_ID.displayValue</name> </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>FILTER_USED.value</name> + </jDitoRecordFieldMapping> + <jDitoRecordFieldMapping> + <name>COND.value</name> + </jDitoRecordFieldMapping> <jDitoRecordFieldMapping> <name>DONEUSER.value</name> </jDitoRecordFieldMapping> diff --git a/entity/ChecklistEntryValue_entity/entityfields/setchecklistentrycompleted/children/setcompleted/onActionProcess.js b/entity/ChecklistEntryValue_entity/entityfields/setchecklistentrycompleted/children/setcompleted/onActionProcess.js index 9ac4b995eb7e8f87127e037ef37566db7633c185..02e277286510a0a551dc95497ec69c505d31bfcc 100644 --- a/entity/ChecklistEntryValue_entity/entityfields/setchecklistentrycompleted/children/setcompleted/onActionProcess.js +++ b/entity/ChecklistEntryValue_entity/entityfields/setchecklistentrycompleted/children/setcompleted/onActionProcess.js @@ -19,17 +19,17 @@ if(Utils.toBoolean(newSelect("count(*)").from("CHECKLISTENTRYVALUE").where(cond) }, "CHECKLISTENTRYVALUE"); } else -{ +{ new SqlBuilder().insertFields({ CHECKLISTENTRYVALUEID: vars.get("$field.UID"), CHECKLISTENTRY_ID: vars.get("$field.CHECKLISTENTRY_ID"), DONEUSER: fulfilledUser, DONEDATE: fulfilledDate, IS_FULFILLED: fulfilledValue, - OBJECT_TYPE: vars.get("$field.OBJECT_TYPE"), - OBJECT_ROWID: vars.get("$field.OBJECT_ROWID"), - DATE_EDIT: vars.get("$field.DATE_EDIT"), - DATE_NEW: vars.get("$field.DATE_NEW"), + OBJECT_TYPE: vars.get("$param.ObjectType_param"), + OBJECT_ROWID: vars.get("$param.ObjectRowId_param"), + DATE_EDIT: fulfilledDate, + DATE_NEW: fulfilledDate, USER_EDIT: vars.get("$field.USER_EDIT"), USER_NEW: vars.get("$field.USER_NEW") }, "CHECKLISTENTRYVALUE"); diff --git a/entity/ChecklistEntryValue_entity/recordcontainers/jdito/contentProcess.js b/entity/ChecklistEntryValue_entity/recordcontainers/jdito/contentProcess.js index e1e1e87749e51d75a7b8090cd0df45d187441724..847ce5f1042ac939138867f6699f28a9179c6cc0 100644 --- a/entity/ChecklistEntryValue_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/ChecklistEntryValue_entity/recordcontainers/jdito/contentProcess.js @@ -5,11 +5,15 @@ import("system.datetime"); import("Sql_lib"); import("ChecklistEntryRegistry_basic"); +var checklistIds = JSON.parse(vars.get("$param.ChecklistIds_param")); + var data = newSelect([ "CHECKLISTENTRYVALUE.CHECKLISTENTRYVALUEID", "CHECKLISTENTRY.AUTO", "CHECKLISTENTRY.CHECKLISTENTRYID", "CHECKLISTENTRY.TITLE", + "CHECKLISTENTRY.FILTER_USED", + "CHECKLISTENTRY.COND", "CHECKLISTENTRYVALUE.DONEUSER", "CHECKLISTENTRYVALUE.DONEDATE", "CHECKLISTENTRYVALUE.IS_FULFILLED", @@ -25,23 +29,33 @@ var data = newSelect([ newWhere("CHECKLISTENTRYVALUE.CHECKLISTENTRY_ID = CHECKLISTENTRY.CHECKLISTENTRYID") .and("CHECKLISTENTRYVALUE.OBJECT_ROWID", vars.get("$param.ObjectRowId_param")) .andIfSet("CHECKLISTENTRYVALUE.OBJECT_TYPE", vars.get("$param.ObjectType_param")) -).whereIfSet("CHECKLISTENTRY.CHECKLIST_ID", vars.get("$param.ChecklistId_param")) +).whereIfSet("CHECKLISTENTRY.CHECKLIST_ID", checklistIds, SqlBuilder.IN()) .table(); for(let i = 0; i < data.length; i++) { data[i][0] = data[i][0] || util.getNewUUID(); - data[i][6] = data[i][6] || "0"; - data[i][7] = data[i][7] || vars.get("$param.ObjectRowId_param"); - data[i][8] = data[i][8] || vars.get("$param.ObjectType_param"); - data[i][10] = data[i][10] || datetime.date(); - data[i][12] = data[i][12] || vars.get("$sys.user"); + data[i][8] = data[i][8] || "0"; + data[i][9] = data[i][9] || vars.get("$param.ObjectRowId_param"); + data[i][10] = data[i][10] || vars.get("$param.ObjectType_param"); + data[i][12] = data[i][12] || datetime.date(); + data[i][14] = data[i][14] || vars.get("$sys.user"); if(parseInt(data[i][1])) { - var checklistEntry = $ChecklistEntryRegistry[data[i][3]](); - data[i][3] = checklistEntry.title; - data[i][6] = checklistEntry.verifierFn(vars.get("$param.ObjectRowId_param")) ? "1" : "0"; + var checklistEntry; + if (data[i][4] == 1){ // FILTER_USED + checklistEntry = $ChecklistEntryRegistry["filter"](); + data[i][8] = checklistEntry.verifierFn(vars.get("$param.ObjectRowId_param"), vars.get("$param.ObjectType_param"), data[i][5]) ? "1" : "0"; + } + else { + checklistEntry = $ChecklistEntryRegistry[data[i][3]](); + data[i][8] = checklistEntry.verifierFn(vars.get("$param.ObjectRowId_param")) ? "1" : "0"; + data[i][3] = checklistEntry.title; + } + + + } } diff --git a/entity/ChecklistEntry_entity/ChecklistEntry_entity.aod b/entity/ChecklistEntry_entity/ChecklistEntry_entity.aod index bbc1bc5a7bf7a97678f2639a3d5b8788c2842f34..f59dc1d71b6ab5177249ea9bd4679d4423265a4f 100644 --- a/entity/ChecklistEntry_entity/ChecklistEntry_entity.aod +++ b/entity/ChecklistEntry_entity/ChecklistEntry_entity.aod @@ -69,6 +69,29 @@ <fieldName>ChecklistEntryValues</fieldName> </dependency> </entityConsumer> + <entityField> + <name>COND</name> + <title>Condition</title> + <contentType>FILTER_TREE</contentType> + <state>INVISIBLE</state> + <stateProcess>%aditoprj%/entity/ChecklistEntry_entity/entityfields/cond/stateProcess.js</stateProcess> + </entityField> + <entityParameter> + <name>ObjectType_param</name> + <expose v="true" /> + </entityParameter> + <entityField> + <name>FILTER_USED</name> + <title>Filter</title> + <contentType>BOOLEAN</contentType> + <placeholder>Filter</placeholder> + <state>INVISIBLE</state> + <stateProcess>%aditoprj%/entity/ChecklistEntry_entity/entityfields/filter_used/stateProcess.js</stateProcess> + <onValueChange>%aditoprj%/entity/ChecklistEntry_entity/entityfields/filter_used/onValueChange.js</onValueChange> + <onValueChangeTypes> + <element>MASK</element> + </onValueChangeTypes> + </entityField> </entityFields> <recordContainers> <dbRecordContainer> @@ -108,6 +131,14 @@ <name>AUTO.value</name> <recordfield>CHECKLISTENTRY.AUTO</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>COND.value</name> + <recordfield>CHECKLISTENTRY.COND</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>FILTER_USED.value</name> + <recordfield>CHECKLISTENTRY.FILTER_USED</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> <linkInformation> <linkInformation> diff --git a/entity/ChecklistEntry_entity/entityfields/auto/onValueChange.js b/entity/ChecklistEntry_entity/entityfields/auto/onValueChange.js index e44082d115bf9429cced900ee2f038ee81cd0ecd..5cbbac2619be84f3a622966d3cb8838770006919 100644 --- a/entity/ChecklistEntry_entity/entityfields/auto/onValueChange.js +++ b/entity/ChecklistEntry_entity/entityfields/auto/onValueChange.js @@ -1,3 +1,8 @@ +import("system.vars"); import("system.neon"); -neon.setFieldValue("$field.TITLE", null); \ No newline at end of file +neon.setFieldValue("$field.TITLE", null); + +if(vars.get("$local.value") == 0){ + neon.setFieldValue("$field.FILTER_USED", 0); +} diff --git a/entity/ChecklistEntry_entity/entityfields/cond/stateProcess.js b/entity/ChecklistEntry_entity/entityfields/cond/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1d1ff3befe301a880b6518307b5129c6a78eeaea --- /dev/null +++ b/entity/ChecklistEntry_entity/entityfields/cond/stateProcess.js @@ -0,0 +1,7 @@ +import("system.neon"); +import("system.result"); +import("system.vars"); + +if(vars.get("$field.AUTO") == 1 && vars.get("$field.FILTER_USED") == 1 ){ + result.string(neon.COMPONENTSTATE_EDITABLE); +} \ No newline at end of file diff --git a/entity/ChecklistEntry_entity/entityfields/filter_used/onValueChange.js b/entity/ChecklistEntry_entity/entityfields/filter_used/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..2f7da203ca8396db6359ebc1f6ed76525398aaca --- /dev/null +++ b/entity/ChecklistEntry_entity/entityfields/filter_used/onValueChange.js @@ -0,0 +1,21 @@ +import("JditoFilter_lib"); +import("Context_lib"); +import("system.vars"); +import("system.neon"); + +var filterUsed = vars.get("$local.value"); + +if(filterUsed == 0){ + neon.setFieldValue("$field.COND", null); +} + +if(filterUsed == 1){ + + var thisValueNotValid = "{\"entity\":\"\",\"filter\":{\"type\":\"group\",\"operator\":\"AND\",\"childs\":[]}}"; + var context = vars.get("$param.ObjectType_param"); + var cond = vars.get("$field.COND") + + if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && (!cond || cond == thisValueNotValid) && context) { + neon.setFieldValue("$field.COND", JditoFilterUtils.getEmptyFilter(ContextUtils.getEntity(context))); + } +} \ No newline at end of file diff --git a/entity/ChecklistEntry_entity/entityfields/filter_used/stateProcess.js b/entity/ChecklistEntry_entity/entityfields/filter_used/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..02e2241611fce498209373ed31145f28fd7469dc --- /dev/null +++ b/entity/ChecklistEntry_entity/entityfields/filter_used/stateProcess.js @@ -0,0 +1,7 @@ +import("system.neon"); +import("system.vars"); +import("system.result"); + +if(vars.get("$field.AUTO") == 1 && vars.get("$sys.recordstate") != neon.OPERATINGSTATE_VIEW ){ + result.string(neon.COMPONENTSTATE_EDITABLE) +} \ No newline at end of file diff --git a/entity/ChecklistEntry_entity/entityfields/title/displayValueProcess.js b/entity/ChecklistEntry_entity/entityfields/title/displayValueProcess.js index b3faf49a58ac77eacc78015a3054bcf2fcef9ae6..85f4f3ed96e462c74fbf5ffb83cd2427564c2ec5 100644 --- a/entity/ChecklistEntry_entity/entityfields/title/displayValueProcess.js +++ b/entity/ChecklistEntry_entity/entityfields/title/displayValueProcess.js @@ -7,7 +7,7 @@ import("ChecklistEntryRegistry_basic"); var title = vars.get("$field.TITLE"); -if (Utils.toBoolean(vars.get("$field.AUTO"))) +if (Utils.toBoolean(vars.get("$field.AUTO")) && title && vars.get("$field.FILTER_USED") == 0) { result.string($ChecklistEntryRegistry[title]().title); } diff --git a/entity/ChecklistEntry_entity/entityfields/title/dropDownProcess.js b/entity/ChecklistEntry_entity/entityfields/title/dropDownProcess.js index b8fce1068b75efc84d99d5df068d56cef1dad792..ee204176cdb58bf82d585856658f8ec1c9267a11 100644 --- a/entity/ChecklistEntry_entity/entityfields/title/dropDownProcess.js +++ b/entity/ChecklistEntry_entity/entityfields/title/dropDownProcess.js @@ -3,8 +3,8 @@ import("system.vars"); import("KeywordRegistry_basic"); import("ChecklistEntryRegistry_basic"); - -if (vars.get("$field.AUTO") == 1) +var context = vars.get("$param.ObjectType_param"); +if (vars.get("$field.AUTO") == 1 && context && vars.get("$field.FILTER_USED") != 1) { - result.object($ChecklistEntryRegistry.getEntryList()); + result.object($ChecklistEntryRegistry.getEntryList(context)); } \ No newline at end of file diff --git a/entity/Checklist_entity/Checklist_entity.aod b/entity/Checklist_entity/Checklist_entity.aod index fab6c2cd44a9a57f68bb543ed3e3e9f1989d13ec..72a890da95e776fcd2f147ce5da2e62fe6184f1f 100644 --- a/entity/Checklist_entity/Checklist_entity.aod +++ b/entity/Checklist_entity/Checklist_entity.aod @@ -1,9 +1,11 @@ <?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>Checklist_entity</name> + <title>Checklist</title> <majorModelMode>DISTRIBUTED</majorModelMode> <icon>NEON:MQC</icon> <siblings /> + <titlePlural>Checklists</titlePlural> <recordContainer>db</recordContainer> <entityFields> <entityProvider> @@ -42,6 +44,77 @@ <entityName>ChecklistEntry_entity</entityName> <fieldName>ChecklistEntries</fieldName> </dependency> + <children> + <entityParameter> + <name>ChecklistUid_param</name> + <valueProcess>%aditoprj%/entity/Checklist_entity/entityfields/checklistentries/children/checklistuid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Checklist_entity/entityfields/checklistentries/children/objecttype_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityField> + <name>COND</name> + <title>Condition</title> + <contentType>FILTER_TREE</contentType> + <valueProcess>%aditoprj%/entity/Checklist_entity/entityfields/cond/valueProcess.js</valueProcess> + </entityField> + <entityField> + <name>CHECKLIST_CONTEXT</name> + <title>Context</title> + <consumer>Contexts</consumer> + <groupable v="true" /> + <displayValueProcess>%aditoprj%/entity/Checklist_entity/entityfields/checklist_context/displayValueProcess.js</displayValueProcess> + </entityField> + <entityField> + <name>TITLE</name> + <title>Title</title> + </entityField> + <entityField> + <name>DESCRIPTION</name> + <title>Description</title> + <contentType>LONG_TEXT</contentType> + </entityField> + <entityField> + <name>AUTOPROBABILITY</name> + <title>Auto probability</title> + <consumer>KeywordAutoprobability</consumer> + <state>INVISIBLE</state> + <stateProcess>%aditoprj%/entity/Checklist_entity/entityfields/autoprobability/stateProcess.js</stateProcess> + </entityField> + <entityConsumer> + <name>KeywordAutoprobability</name> + <dependency> + <name>dependency</name> + <entityName>KeywordEntry_entity</entityName> + <fieldName>SpecificContainerKeywords</fieldName> + </dependency> + <children> + <entityParameter> + <name>ContainerName_param</name> + <valueProcess>%aditoprj%/entity/Checklist_entity/entityfields/keywordautoprobability/children/containername_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>Contexts</name> + <dependency> + <name>dependency</name> + <entityName>Context_entity</entityName> + <fieldName>Context</fieldName> + </dependency> + <children> + <entityParameter> + <name>InvertBlacklist_param</name> + <valueProcess>%aditoprj%/entity/Checklist_entity/entityfields/contexts/children/invertblacklist_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>Blacklist_param</name> + <valueProcess>%aditoprj%/entity/Checklist_entity/entityfields/contexts/children/blacklist_param/valueProcess.js</valueProcess> + </entityParameter> + </children> </entityConsumer> </entityFields> <recordContainers> @@ -69,6 +142,26 @@ <name>USER_NEW.value</name> <recordfield>CHECKLIST.USER_NEW</recordfield> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>AUTOPROBABILITY.value</name> + <recordfield>CHECKLIST.AUTOPROBABILITY</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>CHECKLIST_CONTEXT.value</name> + <recordfield>CHECKLIST.CONTEXT</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>COND.value</name> + <recordfield>CHECKLIST.COND</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>TITLE.value</name> + <recordfield>CHECKLIST.TITLE</recordfield> + </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>DESCRIPTION.value</name> + <recordfield>CHECKLIST.DESCRIPTION</recordfield> + </dbRecordFieldMapping> </recordFieldMappings> <linkInformation> <linkInformation> diff --git a/entity/Checklist_entity/entityfields/autoprobability/stateProcess.js b/entity/Checklist_entity/entityfields/autoprobability/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..51fdd65d27b18d4c78ac3c9c60003b53ea80a396 --- /dev/null +++ b/entity/Checklist_entity/entityfields/autoprobability/stateProcess.js @@ -0,0 +1,8 @@ +import("system.vars"); +import("system.neon"); +import("system.result"); + +if(vars.get("$field.CHECKLIST_CONTEXT") == "Salesproject") +{ + result.string(neon.COMPONENTSTATE_EDITABLE); +} \ No newline at end of file diff --git a/entity/Checklist_entity/entityfields/checklist_context/displayValueProcess.js b/entity/Checklist_entity/entityfields/checklist_context/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..cc1b74324173b7f49f7d6025b89359e3d89f0d7d --- /dev/null +++ b/entity/Checklist_entity/entityfields/checklist_context/displayValueProcess.js @@ -0,0 +1,6 @@ +import("system.translate"); +import("system.result"); +import("system.vars"); +import("Context_lib"); + +result.string(translate.text(ContextUtils.getContextName(vars.get("$field.CHECKLIST_CONTEXT")))); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/checklistentries/children/checklistuid_param/valueProcess.js b/entity/Checklist_entity/entityfields/checklistentries/children/checklistuid_param/valueProcess.js similarity index 50% rename from entity/SalesprojectPhaseDefinition_entity/entityfields/checklistentries/children/checklistuid_param/valueProcess.js rename to entity/Checklist_entity/entityfields/checklistentries/children/checklistuid_param/valueProcess.js index 91d7fc39bc8d5ad5a55eb72f53dff893886aac9e..064af58e2fb10d5c0b69e116c62db41bbe777092 100644 --- a/entity/SalesprojectPhaseDefinition_entity/entityfields/checklistentries/children/checklistuid_param/valueProcess.js +++ b/entity/Checklist_entity/entityfields/checklistentries/children/checklistuid_param/valueProcess.js @@ -1,5 +1,4 @@ -import("system.result"); import("system.vars"); +import("system.result"); - -result.string(vars.get("$field.CHECKLIST_ID")); \ No newline at end of file +result.string(vars.get("$field.CHECKLISTID")); \ No newline at end of file diff --git a/entity/Checklist_entity/entityfields/checklistentries/children/objecttype_param/valueProcess.js b/entity/Checklist_entity/entityfields/checklistentries/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..06f56774a66c3376d681e78eefe6f0ed413ca8c5 --- /dev/null +++ b/entity/Checklist_entity/entityfields/checklistentries/children/objecttype_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.CHECKLIST_CONTEXT")); \ No newline at end of file diff --git a/entity/Checklist_entity/entityfields/cond/valueProcess.js b/entity/Checklist_entity/entityfields/cond/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8025a68fe4633f93e02c8660570b28a54b200c89 --- /dev/null +++ b/entity/Checklist_entity/entityfields/cond/valueProcess.js @@ -0,0 +1,14 @@ +import("JditoFilter_lib"); +import("Context_lib"); +import("system.neon"); +import("system.vars"); +import("system.result"); + +var thisValueNotValid = "{\"entity\":\"\",\"filter\":{\"type\":\"group\",\"operator\":\"AND\",\"childs\":[]}}"; +var context = vars.get("$field.CHECKLIST_CONTEXT"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && (vars.get("$this.value") == null || vars.get("$this.value") == thisValueNotValid) && context) { + + var condJson = JditoFilterUtils.getEmptyFilter(ContextUtils.getEntity(context)); + result.string(condJson); +} \ No newline at end of file diff --git a/entity/Checklist_entity/entityfields/contexts/children/blacklist_param/valueProcess.js b/entity/Checklist_entity/entityfields/contexts/children/blacklist_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..1a2ad49c012703d3d4f93f02c187cd1ba85a69a5 --- /dev/null +++ b/entity/Checklist_entity/entityfields/contexts/children/blacklist_param/valueProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.object(["Organisation", "Salesproject", "SupportTicket"]); \ No newline at end of file diff --git a/entity/Checklist_entity/entityfields/contexts/children/invertblacklist_param/valueProcess.js b/entity/Checklist_entity/entityfields/contexts/children/invertblacklist_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..40effa0178464da0c7850912345f19c7fa95975a --- /dev/null +++ b/entity/Checklist_entity/entityfields/contexts/children/invertblacklist_param/valueProcess.js @@ -0,0 +1,3 @@ +import("system.result"); + +result.string(true); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js b/entity/Checklist_entity/entityfields/keywordautoprobability/children/containername_param/valueProcess.js similarity index 100% rename from entity/SalesprojectPhaseDefinition_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js rename to entity/Checklist_entity/entityfields/keywordautoprobability/children/containername_param/valueProcess.js diff --git a/entity/Context_entity/Context_entity.aod b/entity/Context_entity/Context_entity.aod index 48924a76732f7a118fd3a6533ea521b7289aae30..0ea225608c0d468d4b0c390d1ec07c6a7f1d6f48 100644 --- a/entity/Context_entity/Context_entity.aod +++ b/entity/Context_entity/Context_entity.aod @@ -25,11 +25,11 @@ <children> <entityParameter> <name>InvertBlacklist_param</name> - <expose v="false" /> + <expose v="true" /> </entityParameter> <entityParameter> <name>Blacklist_param</name> - <expose v="false" /> + <expose v="true" /> </entityParameter> </children> </entityProvider> diff --git a/entity/DistrictContact_entity/DistrictContact_entity.aod b/entity/DistrictContact_entity/DistrictContact_entity.aod index 7b0a005e07e02d7a3d33d7be793b3119119ef0ce..2f45b2002f4ce2881bf43adf481d2d825cb9d648 100644 --- a/entity/DistrictContact_entity/DistrictContact_entity.aod +++ b/entity/DistrictContact_entity/DistrictContact_entity.aod @@ -226,6 +226,14 @@ </entityParameter> </children> </entityConsumer> + <entityParameter> + <name>OnlyValids_param</name> + <expose v="true" /> + </entityParameter> + <entityParameter> + <name>ContactId_param</name> + <expose v="true" /> + </entityParameter> </entityFields> <recordContainers> <dbRecordContainer> @@ -315,6 +323,15 @@ <readonly v="true" /> </linkInformation> </linkInformation> + <filterExtensions> + <filterExtension> + <name>ValidDistrictContacts_filter</name> + <title>Valid district contacts</title> + <contentType>BOOLEAN</contentType> + <filterConditionProcess>%aditoprj%/entity/DistrictContact_entity/recordcontainers/db/filterextensions/validdistrictcontacts_filter/filterConditionProcess.js</filterConditionProcess> + <filtertype>BASIC</filtertype> + </filterExtension> + </filterExtensions> </dbRecordContainer> </recordContainers> </entity> diff --git a/entity/DistrictContact_entity/recordcontainers/db/conditionProcess.js b/entity/DistrictContact_entity/recordcontainers/db/conditionProcess.js index b8195ebfa8f2f08258f2c8dc98449b6ec7cc292c..6cfe3fe681d4c2f213624d9e5c638e2ddf5ffdeb 100644 --- a/entity/DistrictContact_entity/recordcontainers/db/conditionProcess.js +++ b/entity/DistrictContact_entity/recordcontainers/db/conditionProcess.js @@ -8,7 +8,8 @@ import("Sql_lib"); var isDashletView = vars.get("$param.isDashletView_param"); var organisationID = vars.get("$param.currentOrganisationId_param"); var districtID = vars.get("$param.DistrictId_param"); -var cond = newWhere(); +var cond = newWhere() + .andIfSet("DISTRICTCONTACT.CONTACT_ID", "$param.ContactId_param"); if (vars.exists("$param.RowId_param") && vars.get("$param.RowId_param") && vars.exists("$param.ObjectId_param") && vars.get("$param.ObjectId_param")) { @@ -38,4 +39,16 @@ if(districtID){ cond.and("DISTRICTCONTACT.DISTRICT_ID", districtID); } +if(vars.get("$param.OnlyValids_param") == "true"){ + var dateToday = vars.get("$sys.date"); + cond.and("DISTRICTCONTACT.STATUS", $KeywordRegistry.contactStatus$active()); + cond.and(newWhere("DISTRICTCONTACT.VALID_FROM", dateToday, SqlBuilder.LESS_OR_EQUAL()) + .and("DISTRICTCONTACT.VALID_UNTIL", dateToday, SqlBuilder.GREATER_OR_EQUAL()) + .or("DISTRICTCONTACT.VALID_FROM", dateToday, SqlBuilder.LESS_OR_EQUAL()) + .and("DISTRICTCONTACT.VALID_UNTIL is null") + .or("DISTRICTCONTACT.VALID_FROM is null") + .and("DISTRICTCONTACT.VALID_UNTIL", dateToday, SqlBuilder.GREATER_OR_EQUAL()) + .or("DISTRICTCONTACT.VALID_FROM is null") + .and("DISTRICTCONTACT.VALID_UNTIL is null")); +} result.string(cond.toString()); \ No newline at end of file diff --git a/entity/DistrictContact_entity/recordcontainers/db/filterextensions/validdistrictcontacts_filter/filterConditionProcess.js b/entity/DistrictContact_entity/recordcontainers/db/filterextensions/validdistrictcontacts_filter/filterConditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..eef2d0706422ba56622958e82fd425326dd60ef5 --- /dev/null +++ b/entity/DistrictContact_entity/recordcontainers/db/filterextensions/validdistrictcontacts_filter/filterConditionProcess.js @@ -0,0 +1,34 @@ +import("system.result"); +import("system.vars"); +import("Sql_lib"); +import("KeywordRegistry_basic"); + +var operator = vars.get("$local.comparison"); +var value = vars.get("$local.rawvalue"); +var dateToday = vars.get("$sys.date"); +var cond = newWhere(); + +if ((operator == "EQUAL" && value == 1) || (operator == "NOT_EQUAL" && value == 0)) +{ + cond.and("DISTRICTCONTACT.STATUS", $KeywordRegistry.contactStatus$active()); + cond.and(newWhere("DISTRICTCONTACT.VALID_FROM", dateToday, SqlBuilder.LESS_OR_EQUAL()) + .and("DISTRICTCONTACT.VALID_UNTIL", dateToday, SqlBuilder.GREATER_OR_EQUAL()) + .or("DISTRICTCONTACT.VALID_FROM", dateToday, SqlBuilder.LESS_OR_EQUAL()) + .and("DISTRICTCONTACT.VALID_UNTIL is null") + .or("DISTRICTCONTACT.VALID_FROM is null") + .and("DISTRICTCONTACT.VALID_UNTIL", dateToday, SqlBuilder.GREATER_OR_EQUAL()) + .or("DISTRICTCONTACT.VALID_FROM is null") + .and("DISTRICTCONTACT.VALID_UNTIL is null")); +} +else if ((operator == "EQUAL" && value == 0) || (operator == "NOT_EQUAL" && value == 1)) +{ + cond.and("DISTRICTCONTACT.STATUS", $KeywordRegistry.contactStatus$active(), SqlBuilder.NOT_EQUAL()); + cond.or(newWhere("DISTRICTCONTACT.VALID_FROM", dateToday, SqlBuilder.GREATER_OR_EQUAL()) + .and("DISTRICTCONTACT.VALID_UNTIL", dateToday, SqlBuilder.LESS_OR_EQUAL()) + .or("DISTRICTCONTACT.VALID_FROM", dateToday, SqlBuilder.GREATER_OR_EQUAL()) + .and("DISTRICTCONTACT.VALID_UNTIL is null") + .or("DISTRICTCONTACT.VALID_FROM is null") + .and("DISTRICTCONTACT.VALID_UNTIL", dateToday, SqlBuilder.LESS_OR_EQUAL())); +} + +result.string(cond.toString()); \ No newline at end of file diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index 63909e433d6ea5a766153e2a2e184dd8645764c9..cd75186ab8946daf5c8d04e6432be0ccbaca3979 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -1378,6 +1378,28 @@ <onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/openclassificationoverview/onActionProcess.js</onActionProcess> <iconId>VAADIN:LIST_OL</iconId> </entityActionField> + <entityConsumer> + <name>ChecklistEntryValues</name> + <dependency> + <name>dependency</name> + <entityName>ChecklistEntryValue_entity</entityName> + <fieldName>ChecklistEntryValues</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectRowId_param</name> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/checklistentryvalues/children/objectrowid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/checklistentryvalues/children/objecttype_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>ChecklistIds_param</name> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> @@ -1580,6 +1602,25 @@ <name>STANDARD_LON.value</name> <recordfield>ADDRESS.LON</recordfield> </dbRecordFieldMapping> + <consumerMapping> + <name>Plannings</name> + <filterConditionProcess>%aditoprj%/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/plannings/filterConditionProcess.js</filterConditionProcess> + <isFilterable v="true" /> + <filtertype>EXTENDED</filtertype> + </consumerMapping> + <consumerMapping> + <name>ContactCommunicationSettings</name> + <filterConditionProcess>%aditoprj%/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/contactcommunicationsettings/filterConditionProcess.js</filterConditionProcess> + <isFilterable v="true" /> + <filtertype>EXTENDED</filtertype> + </consumerMapping> + <consumerMapping> + <name>DistrictContacts</name> + <filterConditionProcess>%aditoprj%/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/districtcontacts/filterConditionProcess.js</filterConditionProcess> + <isFilterable v="true" /> + <isLookupFilter v="false" /> + <filtertype>EXTENDED</filtertype> + </consumerMapping> </recordFieldMappings> <linkInformation> <linkInformation> diff --git a/entity/Organisation_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js b/entity/Organisation_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e18350afb4831c1abed664fc5be1df068a79b5f8 --- /dev/null +++ b/entity/Organisation_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js @@ -0,0 +1,25 @@ +import("Checklist_lib"); +import("system.result"); +import("system.vars"); +import("Context_lib"); +import("Sql_lib"); + +var context = ContextUtils.getCurrentContextId(); +var checklistIds = ['']; +var select = ChecklistUtils.getCaseWhenSqlSelectWithConditions(context); + +if(select){ + checklistIds = newSelect(select) + .from("ORGANISATION") + .join("CONTACT", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID and CONTACT.PERSON_ID is null") + .leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID") + .leftJoin("CLASSIFICATIONSTORAGE", "CLASSIFICATIONSTORAGE.OBJECT_ROWID = CONTACT.CONTACTID") + .where("CONTACT.CONTACTID", vars.get("$field.CONTACTID")) + .arrayRow(); + + checklistIds.filter(function(checklistId){ + return checklistId != ""; // if a checklist entry does not apply it is empty and will be excluded + }); +} + +result.string(JSON.stringify(checklistIds)); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/checklistentryvalues/children/objectrowid_param/valueProcess.js b/entity/Organisation_entity/entityfields/checklistentryvalues/children/objectrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..7b6137b4d105e9ba592cf8ef6e796fb838a32b09 --- /dev/null +++ b/entity/Organisation_entity/entityfields/checklistentryvalues/children/objectrowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.CONTACTID")); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/checklistentryvalues/children/objecttype_param/valueProcess.js b/entity/Organisation_entity/entityfields/checklistentryvalues/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..008915f61deac19ccdd40fff81701de63eb3b6a2 --- /dev/null +++ b/entity/Organisation_entity/entityfields/checklistentryvalues/children/objecttype_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/Organisation_entity/recordcontainers/db/recordfieldmappings/contactcommunicationsettings/filterConditionProcess.js b/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/contactcommunicationsettings/filterConditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e261145492b032a4fcd95f5b86bf5f41684826e3 --- /dev/null +++ b/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/contactcommunicationsettings/filterConditionProcess.js @@ -0,0 +1,15 @@ +import("Sql_lib"); +import("system.vars"); +import("system.result"); + +result.string(newWhere("CONTACT.CONTACTID", newSelect("CONTACT_ID") + .from("COMMUNICATIONSETTINGS") + .join("COMMUNICATIONLEGALBASE", new SqlBuilder() + .where("COMMUNICATIONSETTINGS.COMMUNICATIONSETTINGSID = COMMUNICATIONLEGALBASE.COMMUNICATIONSETTINGS_ID") + .and(null, new SqlBuilder() + .select("fresher.COMMUNICATIONLEGALBASEID") + .from("COMMUNICATIONLEGALBASE", "fresher") + .where("fresher.COMMUNICATIONSETTINGS_ID = COMMUNICATIONSETTINGS.COMMUNICATIONSETTINGSID") + .and("fresher.DATE_NEW > COMMUNICATIONLEGALBASE.DATE_NEW"), + SqlBuilder.NOT_EXISTS())) + .where(vars.get("$local.condition")), SqlBuilder.IN()).toString()); \ No newline at end of file diff --git a/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/districtcontacts/filterConditionProcess.js b/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/districtcontacts/filterConditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..46161d21dd3ae4ba3b238e8c0fa884242183d49d --- /dev/null +++ b/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/districtcontacts/filterConditionProcess.js @@ -0,0 +1,5 @@ +import("Sql_lib"); +import("system.vars"); +import("system.result"); + +result.string(newWhere("CONTACT.CONTACTID", newSelect("CONTACT_ID").from("DISTRICTCONTACT").where(vars.get("$local.condition")), SqlBuilder.IN()).toString()); \ No newline at end of file diff --git a/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/plannings/filterConditionProcess.js b/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/plannings/filterConditionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..da33d77132449fe8003e149fde93d35603f14e2c --- /dev/null +++ b/entity/Organisation_entity/recordcontainers/db/recordfieldmappings/plannings/filterConditionProcess.js @@ -0,0 +1,5 @@ +import("Sql_lib"); +import("system.vars"); +import("system.result"); + +result.string(newWhere("CONTACT.CONTACTID", newSelect("CONTACT_ID").from("FORECAST").where(vars.get("$local.condition")), SqlBuilder.IN()).toString()); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/SalesprojectPhaseDefinition_entity.aod b/entity/SalesprojectPhaseDefinition_entity/SalesprojectPhaseDefinition_entity.aod deleted file mode 100644 index b311e3e64182e03aa4ec8b3acbc326a98f72d381..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/SalesprojectPhaseDefinition_entity.aod +++ /dev/null @@ -1,171 +0,0 @@ -<?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>SalesprojectPhaseDefinition_entity</name> - <title>Salesproject phases</title> - <majorModelMode>DISTRIBUTED</majorModelMode> - <icon>VAADIN:LIST_UL</icon> - <siblings /> - <iconIdProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/iconIdProcess.js</iconIdProcess> - <recordContainer>db</recordContainer> - <entityFields> - <entityProvider> - <name>#PROVIDER</name> - </entityProvider> - <entityProvider> - <name>#PROVIDER_AGGREGATES</name> - <useAggregates v="true" /> - </entityProvider> - <entityField> - <name>SALESPROJECTPHASETRAITDEFINITIONID</name> - </entityField> - <entityField> - <name>USER_NEW</name> - <valueProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/user_new/valueProcess.js</valueProcess> - </entityField> - <entityField> - <name>USER_EDIT</name> - <valueProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/user_edit/valueProcess.js</valueProcess> - </entityField> - <entityField> - <name>DATE_NEW</name> - <valueProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/date_new/valueProcess.js</valueProcess> - </entityField> - <entityField> - <name>DATE_EDIT</name> - <valueProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/date_edit/valueProcess.js</valueProcess> - </entityField> - <entityField> - <name>PHASE</name> - <title>Phase</title> - <mandatory v="true" /> - <dropDownProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/dropDownProcess.js</dropDownProcess> - <displayValueProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/displayValueProcess.js</displayValueProcess> - <onValidation>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/onValidation.js</onValidation> - </entityField> - <entityParameter> - <name>SalesprojectUid_param</name> - <expose v="false" /> - </entityParameter> - <entityParameter> - <name>SalesprojectPhaseId_param</name> - <expose v="true" /> - </entityParameter> - <entityProvider> - <name>SalesprojectPhaseDefinitions</name> - <lookupIdfield>SALESPROJECTPHASETRAITDEFINITIONID</lookupIdfield> - </entityProvider> - <entityConsumer> - <name>ChecklistEntries</name> - <refreshParent v="true" /> - <dependency> - <name>dependency</name> - <entityName>ChecklistEntry_entity</entityName> - <fieldName>ChecklistEntries</fieldName> - </dependency> - <children> - <entityParameter> - <name>ChecklistUid_param</name> - <valueProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/checklistentries/children/checklistuid_param/valueProcess.js</valueProcess> - </entityParameter> - </children> - </entityConsumer> - <entityField> - <name>CHECKLIST_ID</name> - <valueProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/checklist_id/valueProcess.js</valueProcess> - </entityField> - <entityField> - <name>traitCount</name> - <title>Traits</title> - <valueProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/traitcount/valueProcess.js</valueProcess> - </entityField> - <entityField> - <name>DESCRIPTION</name> - <title>Description</title> - <contentType>LONG_TEXT</contentType> - </entityField> - <entityField> - <name>AUTOPROBABILITY</name> - <title>Auto probability</title> - <consumer>KeywordProbabilitySalesproject</consumer> - <contentType>NUMBER</contentType> - <maxValue v="100" /> - <minValue v="0" /> - <outputFormat>0'%'</outputFormat> - </entityField> - <entityConsumer> - <name>KeywordProbabilitySalesproject</name> - <dependency> - <name>dependency</name> - <entityName>KeywordEntry_entity</entityName> - <fieldName>SpecificContainerKeywords</fieldName> - </dependency> - <children> - <entityParameter> - <name>ContainerName_param</name> - <valueProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/entityfields/keywordprobabilitysalesproject/children/containername_param/valueProcess.js</valueProcess> - </entityParameter> - </children> - </entityConsumer> - </entityFields> - <recordContainers> - <dbRecordContainer> - <name>db</name> - <fromClauseProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/fromClauseProcess.js</fromClauseProcess> - <orderClauseProcess>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> - <onDBInsert>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/onDBInsert.js</onDBInsert> - <alias>Data_alias</alias> - <recordFieldMappings> - <dbRecordFieldMapping> - <name>CHECKLIST_ID.value</name> - <recordfield>SALESPROJECTPHASEDEFINITION.CHECKLIST_ID</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>DATE_EDIT.value</name> - <recordfield>SALESPROJECTPHASEDEFINITION.DATE_EDIT</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>DATE_NEW.value</name> - <recordfield>SALESPROJECTPHASEDEFINITION.DATE_EDIT</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>DESCRIPTION.value</name> - <recordfield>SALESPROJECTPHASEDEFINITION.DESCRIPTION</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>PHASE.value</name> - <recordfield>SALESPROJECTPHASEDEFINITION.PHASE</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>PHASE.displayValue</name> - <recordfield>SALESPROJECTPHASEDEFINITION.PHASE</recordfield> - <expression>%aditoprj%/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/recordfieldmappings/phase.displayvalue/expression.js</expression> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>SALESPROJECTPHASETRAITDEFINITIONID.value</name> - <recordfield>SALESPROJECTPHASEDEFINITION.SALESPROJECTPHASEDEFINITIONID</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>USER_EDIT.value</name> - <recordfield>SALESPROJECTPHASEDEFINITION.USER_EDIT</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>USER_NEW.value</name> - <recordfield>SALESPROJECTPHASEDEFINITION.USER_NEW</recordfield> - </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>AUTOPROBABILITY.value</name> - <recordfield>SALESPROJECTPHASEDEFINITION.AUTOPROBABILITY</recordfield> - </dbRecordFieldMapping> - </recordFieldMappings> - <linkInformation> - <linkInformation> - <name>6b48c807-5948-41ff-a5b5-b1556db01c3e</name> - <tableName>SALESPROJECTPHASEDEFINITION</tableName> - <primaryKey>SALESPROJECTPHASEDEFINITIONID</primaryKey> - <isUIDTable v="true" /> - <readonly v="false" /> - </linkInformation> - </linkInformation> - </dbRecordContainer> - </recordContainers> -</entity> diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/checklist_id/valueProcess.js b/entity/SalesprojectPhaseDefinition_entity/entityfields/checklist_id/valueProcess.js deleted file mode 100644 index 4d1a3077043fd3b0444e1f1a87839cc1d5844519..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/entityfields/checklist_id/valueProcess.js +++ /dev/null @@ -1,9 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.util"); - - -if (!vars.get("$field.CHECKLIST_ID")) -{ - result.string(util.getNewUUID()); -} \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/date_edit/valueProcess.js b/entity/SalesprojectPhaseDefinition_entity/entityfields/date_edit/valueProcess.js deleted file mode 100644 index e22054c04fb16601530ec2cb75af55dc24732889..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/entityfields/date_edit/valueProcess.js +++ /dev/null @@ -1,13 +0,0 @@ -import("system.vars"); -import("system.neon"); -import("system.result"); - - -var currentDate = null; - -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) -{ - currentUser = vars.get("$sys.date"); -} - -result.string(currentDate); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/date_new/valueProcess.js b/entity/SalesprojectPhaseDefinition_entity/entityfields/date_new/valueProcess.js deleted file mode 100644 index e1f0aceaa6c3a35ca0626bb855c090612748b7a0..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/entityfields/date_new/valueProcess.js +++ /dev/null @@ -1,13 +0,0 @@ -import("system.vars"); -import("system.neon"); -import("system.result"); - - -var currentDate = null; - -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) -{ - currentUser = vars.get("$sys.date"); -} - -result.string(currentDate); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/displayValueProcess.js b/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/displayValueProcess.js deleted file mode 100644 index 909b87ff774205c98165542547d1286c455092f8..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/displayValueProcess.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.result"); -import("system.vars"); -import("KeywordRegistry_basic"); -import("Keyword_lib"); - -result.string(KeywordUtils.getViewValue($KeywordRegistry.salesprojectPhase(), vars.get("$field.PHASE"))); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/dropDownProcess.js b/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/dropDownProcess.js deleted file mode 100644 index 0e5726bdf8ee99c3b6a8eabed16219c908f83725..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/dropDownProcess.js +++ /dev/null @@ -1,27 +0,0 @@ -import("system.result"); -import("system.vars"); -import("KeywordRegistry_basic"); -import("Keyword_lib"); -import("Sql_lib"); - -var salesprojectPhases = KeywordUtils.getEntryArray($KeywordRegistry.salesprojectPhase()); -var dropDownEntries = []; -var counter = 0; - -var exisitingPhases = newSelect("PHASE") - .from("SALESPROJECTPHASEDEFINITION") - .arrayColumn(); - -salesprojectPhases.forEach(function(pSalesprojectPhase) -{ - var doesExist = exisitingPhases.includes(pSalesprojectPhase[0]); - - if (!doesExist) - { - dropDownEntries[counter] = [pSalesprojectPhase[0], pSalesprojectPhase[1]]; - } - - counter++; -}); - -result.object(dropDownEntries); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/onValidation.js b/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/onValidation.js deleted file mode 100644 index 447fe3e410ed852c9276460e2e30a394d526ca4a..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/entityfields/phase/onValidation.js +++ /dev/null @@ -1,24 +0,0 @@ -import("system.vars"); -import("system.result"); -import("system.translate"); -import("system.neon"); -import("Sql_lib"); - - -var thisValue = vars.get("$this.value"); - -if(thisValue != null && thisValue != "" && - vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && - thisValue != vars.get("$field.PHASE")) -{ - var doesExist = newSelect("COUNT(*)") - .from("SALESPROJECTPHASEDEFINITION") - .where("SALESPROJECTPHASEDEFINITION.SALESPROJECTPHASE", localValue) - .cell(); - - if (doesExist > 0) - { - result.string(translate.text("Traits have already been defined for this salesproject phase.")); - } -} - diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/traitcount/valueProcess.js b/entity/SalesprojectPhaseDefinition_entity/entityfields/traitcount/valueProcess.js deleted file mode 100644 index b2430c974f84383660f14bef9d6b4a6d943eae10..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/entityfields/traitcount/valueProcess.js +++ /dev/null @@ -1,11 +0,0 @@ -import("system.result"); -import("system.vars"); -import("Sql_lib"); - - -var traitCounting = newSelect("COUNT(*)") - .from("CHECKLISTENTRY") - .where("CHECKLISTENTRY.CHECKLIST_ID", vars.get("$field.CHECKLIST_ID")) - .cell(); - -result.string(traitCounting); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/user_edit/valueProcess.js b/entity/SalesprojectPhaseDefinition_entity/entityfields/user_edit/valueProcess.js deleted file mode 100644 index 4ce39f0d7bbd26f93005bef325050028972e5d91..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/entityfields/user_edit/valueProcess.js +++ /dev/null @@ -1,13 +0,0 @@ -import("system.vars"); -import("system.neon"); -import("system.result"); - - -var currentUser = null; - -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT) -{ - currentUser = vars.get("$sys.user"); -} - -result.string(currentUser); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/entityfields/user_new/valueProcess.js b/entity/SalesprojectPhaseDefinition_entity/entityfields/user_new/valueProcess.js deleted file mode 100644 index 9257fbfc206646ed188497bdcc2392fa740955a8..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/entityfields/user_new/valueProcess.js +++ /dev/null @@ -1,13 +0,0 @@ -import("system.vars"); -import("system.neon"); -import("system.result"); - - -var currentUser = null; - -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null) -{ - currentUser = vars.get("$sys.user"); -} - -result.string(currentUser); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/iconIdProcess.js b/entity/SalesprojectPhaseDefinition_entity/iconIdProcess.js deleted file mode 100644 index 87857762669d119f86eb6578f89c3d6b84251a4b..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/iconIdProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string("TEXT:" + vars.getString("$field.PHASE.displayValue")); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/fromClauseProcess.js b/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/fromClauseProcess.js deleted file mode 100644 index 471acd05d196a2ef60258b94794dd2e047fd7869..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/fromClauseProcess.js +++ /dev/null @@ -1,5 +0,0 @@ -import("system.result"); - -//join AB_KEYWORD_ENTRY so we can order the records the correct way -result.string("SALESPROJECTPHASEDEFINITION \n\ - join AB_KEYWORD_ENTRY on (SALESPROJECTPHASEDEFINITION.PHASE = AB_KEYWORD_ENTRY.KEYID)"); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/onDBInsert.js b/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/onDBInsert.js deleted file mode 100644 index c2501480abe5308c33ececdd86eb5f91ab7c59ed..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/onDBInsert.js +++ /dev/null @@ -1,12 +0,0 @@ -import("system.vars"); -import("system.entities"); - -var rowData = vars.get("$local.rowdata"); -var creatingConf = entities.createConfigForAddingRows() - .entity("Checklist_entity") - .fieldValues({ - "CHECKLISTID" : rowData["SALESPROJECTPHASEDEFINITION.CHECKLIST_ID"], - "USER_NEW" : vars.get("$sys.user"), - "DATE_NEW" : vars.get("$sys.date") - }); -entities.createRow(creatingConf); diff --git a/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/orderClauseProcess.js b/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/orderClauseProcess.js deleted file mode 100644 index 0e59750c1b14198cb25148b2ab98928b9282e1f4..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/orderClauseProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.result"); -import("system.db"); - -result.object({"AB_KEYWORD_ENTRY.SORTING": db.ASCENDING}); \ No newline at end of file diff --git a/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/recordfieldmappings/phase.displayvalue/expression.js b/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/recordfieldmappings/phase.displayvalue/expression.js deleted file mode 100644 index d86536b1bdaa18fa89d6ab0959ad001b73a83efa..0000000000000000000000000000000000000000 --- a/entity/SalesprojectPhaseDefinition_entity/recordcontainers/db/recordfieldmappings/phase.displayvalue/expression.js +++ /dev/null @@ -1,8 +0,0 @@ -import("system.result"); -import("Keyword_lib"); -import("KeywordRegistry_basic"); -import("Sql_lib"); - -var resolvingSql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.salesprojectPhase(), "SALESPROJECTPHASEDEFINITION.SALESPROJECTPHASE"); - -result.string(resolvingSql); diff --git a/entity/Salesproject_entity/Salesproject_entity.aod b/entity/Salesproject_entity/Salesproject_entity.aod index 38a6f11c638da48605b85367bf5f58b9be77b0d5..69eec0a06a6194198189a225637f0ec74c2bb2e3 100644 --- a/entity/Salesproject_entity/Salesproject_entity.aod +++ b/entity/Salesproject_entity/Salesproject_entity.aod @@ -719,8 +719,12 @@ <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/checklistentryvalues/children/objectrowid_param/valueProcess.js</valueProcess> </entityParameter> <entityParameter> - <name>ChecklistId_param</name> - <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/checklistentryvalues/children/checklistid_param/valueProcess.js</valueProcess> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/checklistentryvalues/children/objecttype_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>ChecklistIds_param</name> + <valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js</valueProcess> </entityParameter> </children> </entityConsumer> diff --git a/entity/Salesproject_entity/entityfields/checklistentryvalues/children/checklistid_param/valueProcess.js b/entity/Salesproject_entity/entityfields/checklistentryvalues/children/checklistid_param/valueProcess.js deleted file mode 100644 index 2a921546e3472fda60a57aaf2f6a5a5fdcc718d4..0000000000000000000000000000000000000000 --- a/entity/Salesproject_entity/entityfields/checklistentryvalues/children/checklistid_param/valueProcess.js +++ /dev/null @@ -1,12 +0,0 @@ -import("system.result"); -import("system.vars"); -import("KeywordRegistry_basic"); -import("Sql_lib"); - - -var checklistId = newSelect("SALESPROJECTPHASEDEFINITION.CHECKLIST_ID") - .from("SALESPROJECTPHASEDEFINITION") - .where("SALESPROJECTPHASEDEFINITION.PHASE", vars.get("$field.PHASE")) - .cell(); - -result.string(checklistId); \ No newline at end of file diff --git a/entity/Salesproject_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js b/entity/Salesproject_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..19ac32389a050be943aa0c0c272713fbdbd5f687 --- /dev/null +++ b/entity/Salesproject_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js @@ -0,0 +1,27 @@ +import("Checklist_lib"); +import("system.result"); +import("system.vars"); +import("Context_lib"); +import("Sql_lib"); + +var context = ContextUtils.getCurrentContextId(); +var checklistIds = ['']; +var select = ChecklistUtils.getCaseWhenSqlSelectWithConditions(context); + +if(select){ + checklistIds = newSelect(select) + .from("SALESPROJECT") + .leftJoin("CONTACT", "SALESPROJECT.CONTACT_ID = CONTACT.CONTACTID") + .leftJoin("ORGANISATION", "CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID") + .leftJoin("CLASSIFICATIONSTORAGE", "CLASSIFICATIONSTORAGE.OBJECT_ROWID = SALESPROJECT.SALESPROJECTID") + .leftJoin("MST_TEAMLINK", "SALESPROJECT.SALESPROJECTID = MST_TEAMLINK.OBJECT_ROWID and MST_TEAMLINK.OBJECT_TYPE = '" + context + "'") + .leftJoin("MST_TEAM", "MST_TEAM.MST_TEAMID = MST_TEAMLINK.MST_TEAM_ID") + .where("SALESPROJECT.SALESPROJECTID", vars.get("$field.SALESPROJECTID")) + .arrayRow(); + + checklistIds.filter(function(checklistId){ + return checklistId != ""; + }); +} + +result.string(JSON.stringify(checklistIds)); \ No newline at end of file diff --git a/entity/Salesproject_entity/entityfields/checklistentryvalues/children/objecttype_param/valueProcess.js b/entity/Salesproject_entity/entityfields/checklistentryvalues/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..008915f61deac19ccdd40fff81701de63eb3b6a2 --- /dev/null +++ b/entity/Salesproject_entity/entityfields/checklistentryvalues/children/objecttype_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/Salesproject_entity/entityfields/phase/onValueChange.js b/entity/Salesproject_entity/entityfields/phase/onValueChange.js index 0406f7bfe870ce6bc5cee88b9bd3eeb1b55a1c1b..99c913d4e86205429ce7c82471aa042922320e93 100644 --- a/entity/Salesproject_entity/entityfields/phase/onValueChange.js +++ b/entity/Salesproject_entity/entityfields/phase/onValueChange.js @@ -4,25 +4,29 @@ import("system.vars"); var currPobab = parseInt(vars.get("$field.PROBABILITY")); -var autoProbab = parseInt( - newSelect("SALESPROJECTPHASEDEFINITION.AUTOPROBABILITY") - .from("SALESPROJECTPHASEDEFINITION") - .where("SALESPROJECTPHASEDEFINITION.PHASE", vars.get("$this.value")) - .cell() -); +var autoProbabs = + newSelect("CHECKLIST.AUTOPROBABILITY") + .from("CHECKLIST") + .where("CHECKLIST.COND", "%\"name\":\"PHASE\"%", SqlBuilder.LIKE()) + .and("CHECKLIST.COND", "%\"key\":\"" + vars.get("$local.value") + "\"%", SqlBuilder.LIKE()) + .arrayColumn(); + +autoProbabs.forEach(function(probability){ + + var value; + probability = parseInt(probability); + if(isNaN(probability) && isNaN(currPobab)) + { + value = ""; + } + else if(isNaN(probability) || probability < currPobab) + { + value = currPobab; + } + else + { + value = probability; + } -var value; -if(isNaN(autoProbab) && isNaN(currPobab)) -{ - value = ""; -} -else if(isNaN(autoProbab) || autoProbab < currPobab) -{ - value = currPobab; -} -else -{ - value = autoProbab; -} - -neon.setFieldValue("$field.PROBABILITY", value); \ No newline at end of file + neon.setFieldValue("$field.PROBABILITY", value); +}); diff --git a/entity/SupportTicket_entity/SupportTicket_entity.aod b/entity/SupportTicket_entity/SupportTicket_entity.aod index 642c7b3f71299b97cc301237872980e5286aa9e6..af6e8030f6e0ff2a0b7184b873c17a7e29f8c676 100644 --- a/entity/SupportTicket_entity/SupportTicket_entity.aod +++ b/entity/SupportTicket_entity/SupportTicket_entity.aod @@ -474,6 +474,29 @@ <entityField> <name>ACTIVE</name> </entityField> + <entityConsumer> + <name>ChecklistEntryValues</name> + <dependency> + <name>dependency</name> + <entityName>ChecklistEntryValue_entity</entityName> + <fieldName>ChecklistEntryValues</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectRowId_param</name> + <valueProcess>%aditoprj%/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/objectrowid_param/valueProcess.js</valueProcess> + <expose v="true" /> + </entityParameter> + <entityParameter> + <name>ObjectType_param</name> + <valueProcess>%aditoprj%/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/objecttype_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>ChecklistIds_param</name> + <valueProcess>%aditoprj%/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> @@ -520,6 +543,7 @@ <dbRecordFieldMapping> <name>TASK_REQUESTOR_CONTACT_ID.value</name> <recordfield>TASK.REQUESTOR_CONTACT_ID</recordfield> + <isFilterable v="true" /> </dbRecordFieldMapping> <dbRecordFieldMapping> <name>TASK_START_DATE.value</name> diff --git a/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js b/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..9c78ff4ee528f6ca69f2c0df807910c7a117deb1 --- /dev/null +++ b/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/checklistids_param/valueProcess.js @@ -0,0 +1,23 @@ +import("Checklist_lib"); +import("system.result"); +import("system.vars"); +import("Context_lib"); +import("Sql_lib"); + +var context = ContextUtils.getCurrentContextId(); +var checklistIds = ['']; +var select = ChecklistUtils.getCaseWhenSqlSelectWithConditions(context); + +if(select){ + checklistIds = newSelect(select) + .from("TICKET") + .leftJoin("TASK", "TASK_ID = TASKID") + .where("TICKET.TICKETID", vars.get("$field.TICKETID")) + .arrayRow(); + + checklistIds.filter(function(checklistId){ + return checklistId != ""; + }); +} + +result.string(JSON.stringify(checklistIds)); \ No newline at end of file diff --git a/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/objectrowid_param/valueProcess.js b/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/objectrowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5ab951a157ba044be2a4b28176af385742641cea --- /dev/null +++ b/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/objectrowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.TICKETID")); \ No newline at end of file diff --git a/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/objecttype_param/valueProcess.js b/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/objecttype_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..008915f61deac19ccdd40fff81701de63eb3b6a2 --- /dev/null +++ b/entity/SupportTicket_entity/entityfields/checklistentryvalues/children/objecttype_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/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index be0cf329416fe04732c8c6d16cf473c8844ed7b2..ad0a74378d886a4d0dd7bdfc8fee6899ec3356ce 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -9260,13 +9260,22 @@ <key>increase Priority</key> </entry> <entry> - <key>Integrate opened dataset into selected dataset</key> + <key>Default phone</key> </entry> <entry> - <key>Integrate selected dataset into opened dataset</key> + <key>increase priority</key> </entry> <entry> - <key>increase priority</key> + <key>Default address</key> + </entry> + <entry> + <key>Default mail</key> + </entry> + <entry> + <key>Integrate opened dataset into selected dataset</key> + </entry> + <entry> + <key>Integrate selected dataset into opened dataset</key> </entry> <entry> <key>Weekly</key> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 61533a2b4708db398e6ee32df4129487b6494363..f69643cf430f4b92ac55f5511ead8a9872730f16 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -30,10 +30,22 @@ <key>Openers</key> <value>Geöffnet</value> </entry> + <entry> + <key>District contact assigned</key> + <value>Betreuer zugeordnet</value> + </entry> + <entry> + <key>Default phone</key> + <value>Standard Telefon</value> + </entry> <entry> <key>Number of clicks</key> <value>Anzahl Klicks</value> </entry> + <entry> + <key>Default address</key> + <value>Standard Adresse</value> + </entry> <entry> <key>decrease priority</key> <value>Priorität verringern</value> @@ -42,6 +54,10 @@ <key>Move selection up</key> <value>Auswahl nach oben verschieben</value> </entry> + <entry> + <key>Default mail</key> + <value>Standard E-Mail</value> + </entry> <entry> <key>Attributes of attribute group \"%0\" have to be used at least %1.</key> <value>Eigenschaften der Eigenschaftsgruppe \"%0\" müssen mindestens %1 verwendet werden.</value> @@ -12156,6 +12172,16 @@ Bitte Datumseingabe prüfen</value> </entry> <entry> <key>increase Priority</key> + <value>Priorität erhöhen</value> + </entry> + <entry> + <key>DSGVO-Anonymisierung</key> + </entry> + <entry> + <key>privat</key> + </entry> + <entry> + <key>During processing the e-mail an error has occurred.\n Please contact an administrator</key> </entry> <entry> <key>DSGVO-Anonymisierung</key> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 037a5cfb28f75510bc1c6155e846ec3986e2cd2d..8a2742e2cafbb9135183299ab27956f79c274ce3 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -9348,13 +9348,22 @@ <key>increase Priority</key> </entry> <entry> - <key>Integrate opened dataset into selected dataset</key> + <key>Default phone</key> </entry> <entry> - <key>Integrate selected dataset into opened dataset</key> + <key>increase priority</key> </entry> <entry> - <key>increase priority</key> + <key>Default address</key> + </entry> + <entry> + <key>Default mail</key> + </entry> + <entry> + <key>Integrate opened dataset into selected dataset</key> + </entry> + <entry> + <key>Integrate selected dataset into opened dataset</key> </entry> <entry> <key>Weekly</key> diff --git a/neonContext/Checklist/Checklist.aod b/neonContext/Checklist/Checklist.aod index d30de3d0d0b4d5fe7e35cf47b845d88b8034d68d..3a56d59b7c295282ca42a693d8ee43cd0aae74c8 100644 --- a/neonContext/Checklist/Checklist.aod +++ b/neonContext/Checklist/Checklist.aod @@ -4,15 +4,26 @@ <title>Checklist</title> <majorModelMode>DISTRIBUTED</majorModelMode> <icon>NEON:MQL</icon> + <filterView>ChecklistFilter_view</filterView> + <editView>ChecklistEdit_view</editView> + <previewView>ChecklistPreview_view</previewView> <entity>Checklist_entity</entity> <references> <neonViewReference> <name>bec4bdfb-d61d-418e-ac97-6905b00a0393</name> - <view>ChecklistEdit_view</view> + <view>ChecklistEditMulti_view</view> </neonViewReference> <neonViewReference> <name>2a7eb3a8-1ef9-4ecd-a302-42bd676ed24f</name> <view>ChecklistFilter_view</view> </neonViewReference> + <neonViewReference> + <name>433be238-b01e-4c48-ab80-fd457761dc0c</name> + <view>ChecklistEdit_view</view> + </neonViewReference> + <neonViewReference> + <name>ece73c77-3218-45e6-ac64-8f0c473a7f30</name> + <view>ChecklistPreview_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonContext/ChecklistEntryValue/ChecklistEntryValue.aod b/neonContext/ChecklistEntryValue/ChecklistEntryValue.aod index 842a8f0eed5a50064ca7e6a3b6e3e849b5599c00..de48e98da66ad4e275dfde21f03c9e700b646d86 100644 --- a/neonContext/ChecklistEntryValue/ChecklistEntryValue.aod +++ b/neonContext/ChecklistEntryValue/ChecklistEntryValue.aod @@ -1,7 +1,7 @@ <?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>ChecklistEntryValue</name> - <title>ChecklistEntryValue</title> + <title>Checklist</title> <majorModelMode>DISTRIBUTED</majorModelMode> <icon>NEON:MQL</icon> <entity>ChecklistEntryValue_entity</entity> diff --git a/neonContext/SalesprojectPhaseDefinition/SalesprojectPhaseDefinition.aod b/neonContext/SalesprojectPhaseDefinition/SalesprojectPhaseDefinition.aod deleted file mode 100644 index abfe2caf79a2a03d4170a7b98c04d168ea55d936..0000000000000000000000000000000000000000 --- a/neonContext/SalesprojectPhaseDefinition/SalesprojectPhaseDefinition.aod +++ /dev/null @@ -1,30 +0,0 @@ -<?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>SalesprojectPhaseDefinition</name> - <title>Salesproject phases</title> - <majorModelMode>DISTRIBUTED</majorModelMode> - <icon>VAADIN:LIST_UL</icon> - <filterView>SalesprojectPhaseDefinitionFilter_view</filterView> - <editView>SalesprojectPhaseDefinitionEdit_view</editView> - <previewView>SalesprojectPhaseDefinitionPreview_view</previewView> - <devices> - <element>MOBILE</element> - <element>TABLET</element> - <element>DESKTOP</element> - </devices> - <entity>SalesprojectPhaseDefinition_entity</entity> - <references> - <neonViewReference> - <name>41bee035-a20a-4eb1-95ba-190dbacf1c7d</name> - <view>SalesprojectPhaseDefinitionFilter_view</view> - </neonViewReference> - <neonViewReference> - <name>a1eac585-06e1-4a5f-bb7b-4cbacb0710ae</name> - <view>SalesprojectPhaseDefinitionEdit_view</view> - </neonViewReference> - <neonViewReference> - <name>14fcb49f-fd8c-43e4-a3e9-6e6ccd42743c</name> - <view>SalesprojectPhaseDefinitionPreview_view</view> - </neonViewReference> - </references> -</neonContext> diff --git a/neonView/ChecklistEditMulti_view/ChecklistEditMulti_view.aod b/neonView/ChecklistEditMulti_view/ChecklistEditMulti_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..0c1c7c5e835aaae96989ff4bda9d68aa6ddc62da --- /dev/null +++ b/neonView/ChecklistEditMulti_view/ChecklistEditMulti_view.aod @@ -0,0 +1,16 @@ +<?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>ChecklistEditMulti_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <noneLayout> + <name>layout</name> + </noneLayout> + </layout> + <children> + <neonViewReference> + <name>8499691f-153d-43ee-829e-d586255d9344</name> + <view>ChecklistEntryMultiEdit_view</view> + </neonViewReference> + </children> +</neonView> diff --git a/neonView/ChecklistEdit_view/ChecklistEdit_view.aod b/neonView/ChecklistEdit_view/ChecklistEdit_view.aod index 30049e3d38f17bc7eb5145ee1b0ad04c40f5bf4c..6747f637d5d083cf562a4f7068320bcb293c0c4e 100644 --- a/neonView/ChecklistEdit_view/ChecklistEdit_view.aod +++ b/neonView/ChecklistEdit_view/ChecklistEdit_view.aod @@ -8,8 +8,35 @@ </noneLayout> </layout> <children> + <genericViewTemplate> + <name>Generic</name> + <editMode v="true" /> + <fields> + <entityFieldLink> + <name>4f16559d-9198-4167-8761-2ad8a0c53914</name> + <entityField>TITLE</entityField> + </entityFieldLink> + <entityFieldLink> + <name>013277d7-4d49-4f41-8277-4eadad855037</name> + <entityField>CHECKLIST_CONTEXT</entityField> + </entityFieldLink> + <entityFieldLink> + <name>584c5be1-c46c-4d22-ac1a-1fd1bebbc648</name> + <entityField>COND</entityField> + </entityFieldLink> + <entityFieldLink> + <name>38038da2-02f7-4c09-a72e-9f1919e4f476</name> + <entityField>AUTOPROBABILITY</entityField> + </entityFieldLink> + <entityFieldLink> + <name>efc5afce-4a9c-4d8a-b4c3-735254bc4bb7</name> + <entityField>DESCRIPTION</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> <neonViewReference> - <name>8499691f-153d-43ee-829e-d586255d9344</name> + <name>5ff87dde-b4d7-449c-941e-842617bf8388</name> + <entityField>ChecklistEntries</entityField> <view>ChecklistEntryMultiEdit_view</view> </neonViewReference> </children> diff --git a/neonView/ChecklistEntryList_view/ChecklistEntryList_view.aod b/neonView/ChecklistEntryList_view/ChecklistEntryList_view.aod index 73632c6d2d8b4ad54a29ac6c390e24538aafd6a2..4828808811d369a48051e0dbbc5f4d45f1886563 100644 --- a/neonView/ChecklistEntryList_view/ChecklistEntryList_view.aod +++ b/neonView/ChecklistEntryList_view/ChecklistEntryList_view.aod @@ -12,11 +12,19 @@ <name>titledListViewTemplate</name> <titleField>AUTO</titleField> <columns> + <neonTitledListTableColumn> + <name>f388cf1b-d512-41ea-852c-5db92e207b9b</name> + <entityField>FILTER_USED</entityField> + </neonTitledListTableColumn> <neonTitledListTableColumn> <name>49ad66e3-645d-489a-8bf8-d56645cf5465</name> <entityField>TITLE</entityField> <fullWidth v="true" /> </neonTitledListTableColumn> + <neonTitledListTableColumn> + <name>fca6d957-f96b-4911-a7d3-158c0505f6e3</name> + <entityField>COND</entityField> + </neonTitledListTableColumn> </columns> </titledListViewTemplate> </children> diff --git a/neonView/ChecklistEntryMultiEdit_view/ChecklistEntryMultiEdit_view.aod b/neonView/ChecklistEntryMultiEdit_view/ChecklistEntryMultiEdit_view.aod index 97fdc36b6fc77c2338f16f0c1efe397dd42947f3..fbf5918c15506cb2cf3c6a8a6c25eefb142f3766 100644 --- a/neonView/ChecklistEntryMultiEdit_view/ChecklistEntryMultiEdit_view.aod +++ b/neonView/ChecklistEntryMultiEdit_view/ChecklistEntryMultiEdit_view.aod @@ -16,10 +16,18 @@ <name>f139b472-471b-45ef-8406-f11fe052e246</name> <entityField>AUTO</entityField> </neonGenericMultipleTableColumn> + <neonGenericMultipleTableColumn> + <name>cc04e5ea-910f-4330-b98b-e46d305b7342</name> + <entityField>FILTER_USED</entityField> + </neonGenericMultipleTableColumn> <neonGenericMultipleTableColumn> <name>ed1eb021-aad1-4228-bcdf-eef2d44f53f8</name> <entityField>TITLE</entityField> </neonGenericMultipleTableColumn> + <neonGenericMultipleTableColumn> + <name>8d9fb6c6-48ac-4044-bbf5-90cbe33fd831</name> + <entityField>COND</entityField> + </neonGenericMultipleTableColumn> </columns> </genericMultipleViewTemplate> </children> diff --git a/neonView/ChecklistFilter_view/ChecklistFilter_view.aod b/neonView/ChecklistFilter_view/ChecklistFilter_view.aod index 81105b42d24250da3b0b6217efea767043b97454..226111df217fc44b77cdda54d42366371ca12560 100644 --- a/neonView/ChecklistFilter_view/ChecklistFilter_view.aod +++ b/neonView/ChecklistFilter_view/ChecklistFilter_view.aod @@ -3,8 +3,34 @@ <name>ChecklistFilter_view</name> <majorModelMode>DISTRIBUTED</majorModelMode> <layout> - <noneLayout> + <groupLayout> <name>layout</name> - </noneLayout> + </groupLayout> </layout> + <children> + <treeTableViewTemplate> + <name>TreeTable</name> + <defaultGroupFields> + <element>CHECKLIST_CONTEXT</element> + </defaultGroupFields> + <columns> + <neonTreeTableColumn> + <name>69fd2342-d41d-4a65-9a32-5569e56acdd4</name> + <entityField>CHECKLIST_CONTEXT</entityField> + </neonTreeTableColumn> + <neonTreeTableColumn> + <name>b762714d-c6bd-4fe0-9ebd-9de69366e447</name> + <entityField>TITLE</entityField> + </neonTreeTableColumn> + <neonTreeTableColumn> + <name>11754805-e36b-4d84-8d56-349f83562937</name> + <entityField>DESCRIPTION</entityField> + </neonTreeTableColumn> + <neonTreeTableColumn> + <name>0542e59d-8ea5-4f38-8032-cec2aa14f7ad</name> + <entityField>AUTOPROBABILITY</entityField> + </neonTreeTableColumn> + </columns> + </treeTableViewTemplate> + </children> </neonView> diff --git a/neonView/SalesprojectPhaseDefinitionEdit_view/SalesprojectPhaseDefinitionEdit_view.aod b/neonView/ChecklistPreview_view/ChecklistPreview_view.aod similarity index 52% rename from neonView/SalesprojectPhaseDefinitionEdit_view/SalesprojectPhaseDefinitionEdit_view.aod rename to neonView/ChecklistPreview_view/ChecklistPreview_view.aod index b51922e319bb2f0901196ed947958d46772b43d1..93aac3dbc5f5829f3115d1120b9668fb9ec8fa10 100644 --- a/neonView/SalesprojectPhaseDefinitionEdit_view/SalesprojectPhaseDefinitionEdit_view.aod +++ b/neonView/ChecklistPreview_view/ChecklistPreview_view.aod @@ -1,6 +1,6 @@ <?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>SalesprojectPhaseDefinitionEdit_view</name> + <name>ChecklistPreview_view</name> <majorModelMode>DISTRIBUTED</majorModelMode> <layout> <noneLayout> @@ -9,28 +9,36 @@ </layout> <children> <genericViewTemplate> - <name>genericViewTemplate</name> - <editMode v="true" /> - <entityField>#ENTITY</entityField> + <name>Generic</name> + <showDrawer v="true" /> + <drawerCaption>Details</drawerCaption> <fields> <entityFieldLink> - <name>db76830d-c140-4205-bc32-57ad6cb8fb7b</name> - <entityField>PHASE</entityField> + <name>07de01b8-9fe5-4d60-85b6-764420c6c2d9</name> + <entityField>TITLE</entityField> </entityFieldLink> <entityFieldLink> - <name>f0aa8dd0-2cc1-4634-9509-db8b511e602d</name> - <entityField>DESCRIPTION</entityField> + <name>2e42da3c-1e40-4bba-b6bb-8ea8cf0aec56</name> + <entityField>CHECKLIST_CONTEXT</entityField> + </entityFieldLink> + <entityFieldLink> + <name>267eff1e-1410-471c-97fb-174032c2a1db</name> + <entityField>COND</entityField> </entityFieldLink> <entityFieldLink> - <name>b5e973f9-854e-4ddc-b980-2fac447cb292</name> + <name>a2837822-7631-46e8-b05d-3bd5801034ae</name> <entityField>AUTOPROBABILITY</entityField> </entityFieldLink> + <entityFieldLink> + <name>2c44240d-2e2e-4d92-8bee-4607ed19373f</name> + <entityField>DESCRIPTION</entityField> + </entityFieldLink> </fields> </genericViewTemplate> <neonViewReference> - <name>def21f47-1a93-4865-a92c-5015243955e8</name> + <name>3b548c83-7724-45b0-bd54-c4d4ae26597a</name> <entityField>ChecklistEntries</entityField> - <view>ChecklistEntryMultiEdit_view</view> + <view>ChecklistEntryList_view</view> </neonViewReference> </children> </neonView> diff --git a/neonView/OrganisationMain_view/OrganisationMain_view.aod b/neonView/OrganisationMain_view/OrganisationMain_view.aod index bcfdf5234b69f859073d04a1aa625b7db205bd2c..627d41b1da3df3afa19149e9c89efb08a5a0cf38 100644 --- a/neonView/OrganisationMain_view/OrganisationMain_view.aod +++ b/neonView/OrganisationMain_view/OrganisationMain_view.aod @@ -25,6 +25,11 @@ <entityField>360DegreeObjects</entityField> <view>360DegreeFilter_view</view> </neonViewReference> + <neonViewReference> + <name>d63b5190-e85e-4a34-a937-3be8a3bd5d40</name> + <entityField>ChecklistEntryValues</entityField> + <view>ChecklistEntryValueList_view</view> + </neonViewReference> <neonViewReference> <name>c10533a6-d185-4b13-84ee-53a468544c03</name> <entityField>Contact</entityField> diff --git a/neonView/SalesprojectPhaseDefinitionFilter_view/SalesprojectPhaseDefinitionFilter_view.aod b/neonView/SalesprojectPhaseDefinitionFilter_view/SalesprojectPhaseDefinitionFilter_view.aod deleted file mode 100644 index d7e3bd3cc976e7fb9fa401ffd7984140773daa5d..0000000000000000000000000000000000000000 --- a/neonView/SalesprojectPhaseDefinitionFilter_view/SalesprojectPhaseDefinitionFilter_view.aod +++ /dev/null @@ -1,38 +0,0 @@ -<?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>SalesprojectPhaseDefinitionFilter_view</name> - <title>Traits</title> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <noneLayout> - <name>layout</name> - </noneLayout> - </layout> - <children> - <tableViewTemplate> - <name>tableViewTemplate</name> - <iconField>#ICON</iconField> - <entityField>#ENTITY</entityField> - <linkedColumns /> - <title>Traits</title> - <columns> - <neonTableColumn> - <name>64a213a9-5429-4e6b-9f7e-e23beb9f15b9</name> - <entityField>#ICON</entityField> - </neonTableColumn> - <neonTableColumn> - <name>7cd4dd99-ffc7-4207-9e81-874a5c71c2c2</name> - <entityField>PHASE</entityField> - </neonTableColumn> - <neonTableColumn> - <name>80ea1a84-c6a1-4a12-b2fb-18c78d526119</name> - <entityField>traitCount</entityField> - </neonTableColumn> - <neonTableColumn> - <name>b44c14af-9a2a-405f-8e6a-e02fd9403c20</name> - <entityField>DESCRIPTION</entityField> - </neonTableColumn> - </columns> - </tableViewTemplate> - </children> -</neonView> diff --git a/neonView/SalesprojectPhaseDefinitionPreview_view/SalesprojectPhaseDefinitionPreview_view.aod b/neonView/SalesprojectPhaseDefinitionPreview_view/SalesprojectPhaseDefinitionPreview_view.aod deleted file mode 100644 index d25d74cf44d19ccc4ae7db5988db9bcb0ea9b5e8..0000000000000000000000000000000000000000 --- a/neonView/SalesprojectPhaseDefinitionPreview_view/SalesprojectPhaseDefinitionPreview_view.aod +++ /dev/null @@ -1,36 +0,0 @@ -<?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>SalesprojectPhaseDefinitionPreview_view</name> - <title>Traits</title> - <majorModelMode>DISTRIBUTED</majorModelMode> - <layout> - <headerFooterLayout> - <name>layout</name> - <header>cardViewTemplate</header> - </headerFooterLayout> - </layout> - <children> - <cardViewTemplate> - <name>cardViewTemplate</name> - <iconField>#ICON</iconField> - <titleField>PHASE</titleField> - <entityField>#ENTITY</entityField> - </cardViewTemplate> - <genericViewTemplate> - <name>Generic</name> - <showDrawer v="true" /> - <drawerCaption>Info</drawerCaption> - <fields> - <entityFieldLink> - <name>d12a93ac-5c83-4b79-8cb9-4a2852bb3082</name> - <entityField>AUTOPROBABILITY</entityField> - </entityFieldLink> - </fields> - </genericViewTemplate> - <neonViewReference> - <name>786e8ccd-b846-4968-8b6c-9e8cf13ba63c</name> - <entityField>ChecklistEntries</entityField> - <view>ChecklistEntryList_view</view> - </neonViewReference> - </children> -</neonView> diff --git a/neonView/SupportTicketMain_view/SupportTicketMain_view.aod b/neonView/SupportTicketMain_view/SupportTicketMain_view.aod index 8831172e97de1cfd83232e5dafcd545297d1fa68..e611840d07710413c603481a510031af220028b2 100644 --- a/neonView/SupportTicketMain_view/SupportTicketMain_view.aod +++ b/neonView/SupportTicketMain_view/SupportTicketMain_view.aod @@ -29,6 +29,11 @@ <entityField>ModuleTrees</entityField> <view>ModuleTree_view</view> </neonViewReference> + <neonViewReference> + <name>af00a5c6-f79b-4673-b1cf-945734702ebd</name> + <entityField>ChecklistEntryValues</entityField> + <view>ChecklistEntryValueList_view</view> + </neonViewReference> <neonViewReference> <name>6846f680-84ef-46da-a0ea-6797044cf693</name> <entityField>Documents</entityField> diff --git a/process/ChecklistEntryRegistry_basic/process.js b/process/ChecklistEntryRegistry_basic/process.js index 53e11df9ba9dcffa0cd8c09539a158ec71f5c090..90bf55caef470e92cf655ffbb9c4a4916826359c 100644 --- a/process/ChecklistEntryRegistry_basic/process.js +++ b/process/ChecklistEntryRegistry_basic/process.js @@ -1,3 +1,7 @@ +import("Context_lib"); +import("Communication_lib"); +import("Contact_lib"); +import("AttributeRegistry_basic"); import("Attribute_lib"); import("Keyword_lib"); import("system.eMath"); @@ -7,6 +11,7 @@ import("system.entities"); import("system.project"); import("KeywordRegistry_basic"); import("Sql_lib"); +import("Util_lib"); @@ -38,8 +43,10 @@ function $ChecklistEntryRegistry(){} * The parameters which are necessary to loading the rows. * @param {String} pProvider <p> * An provider for loading the rows. + * @param {String} pFilter <p> + * An filter object for loading the rows. */ -$ChecklistEntryRegistry._getRows = function(pUid, pEntity, pFields, pParameters, pProvider) +$ChecklistEntryRegistry._getRows = function(pUid, pEntity, pFields, pParameters, pProvider, pFilter) { var config = entities.createConfigForLoadingRows() @@ -66,6 +73,10 @@ $ChecklistEntryRegistry._getRows = function(pUid, pEntity, pFields, pParameters, } } } + + if(pFilter){ + config.filter(JSON.stringify(pFilter)); + } return entities.getRows(config); } @@ -77,12 +88,13 @@ $ChecklistEntryRegistry._getRows = function(pUid, pEntity, pFields, pParameters, * selection of all possible entries.<br> * */ -$ChecklistEntryRegistry.getEntryList = function(){ +$ChecklistEntryRegistry.getEntryList = function(pObjectType){ var rawList = Object.keys($ChecklistEntryRegistry); var returnableList = {}; rawList.forEach(function(pEntry){ - if (pEntry != 'getEntryList' && pEntry != '_getRows')//ignore the functions (main reason being performance) + + if (pEntry != 'getEntryList' && pEntry != '_getRows' && ($ChecklistEntryRegistry[pEntry]().context != undefined && $ChecklistEntryRegistry[pEntry]().context.includes(pObjectType)))//ignore the functions (main reason being performance) { returnableList[pEntry] = $ChecklistEntryRegistry[pEntry]().title; } @@ -98,6 +110,7 @@ $ChecklistEntryRegistry.getEntryList = function(){ */ $ChecklistEntryRegistry.salesprojectRoleProjManager = function(){ return{ + context: ["Salesproject"], title: translate.text("Project team: \"Project manager\""), verifierFn: function(pSalesprojectId){ @@ -124,6 +137,7 @@ $ChecklistEntryRegistry.salesprojectRoleProjManager = function(){ */ $ChecklistEntryRegistry.salesprojectTouchpoint = function(){ return{ + context: ["Salesproject"], title: translate.text("Touchpoint"), verifierFn: function(pSalesprojectId){ @@ -145,6 +159,7 @@ $ChecklistEntryRegistry.salesprojectTouchpoint = function(){ */ $ChecklistEntryRegistry.salesprojectVolume = function(){ return{ + context: ["Salesproject"], title: translate.text("Volume"), verifierFn: function(pSalesprojectId){ @@ -165,6 +180,7 @@ $ChecklistEntryRegistry.salesprojectVolume = function(){ */ $ChecklistEntryRegistry.salesprojectProjStart = function(){ return{ + context: ["Salesproject"], title: translate.text("Project start"), verifierFn: function(pSalesprojectId){ @@ -185,6 +201,7 @@ $ChecklistEntryRegistry.salesprojectProjStart = function(){ */ $ChecklistEntryRegistry.salesprojectClassificationFields = function(){ return{ + context: ["Salesproject"], title: translate.text("Classification fields"), verifierFn: function(pSalesprojectId){ var res = false; @@ -212,6 +229,7 @@ $ChecklistEntryRegistry.salesprojectClassificationFields = function(){ */ $ChecklistEntryRegistry.salesprojectRoleIntDist = function(){ return{ + context: ["Salesproject"], title: translate.text("Project team: \"Internal distribution\""), verifierFn: function(pSalesprojectId){ var spRows = $ChecklistEntryRegistry._getRows(pSalesprojectId, "Salesproject_entity", ["SALESPROJECTID", "MST_TEAM_ID", "PROJECTCODE"], null, "NoPhaseRequirementLoading"); @@ -240,6 +258,7 @@ $ChecklistEntryRegistry.salesprojectRoleIntDist = function(){ */ $ChecklistEntryRegistry.salesprojectTeamRoles = function(){ return{ + context: ["Salesproject"], title: translate.text("Project team roles"), verifierFn: function(pSalesprojectId){ @@ -277,6 +296,7 @@ $ChecklistEntryRegistry.salesprojectTeamRoles = function(){ */ $ChecklistEntryRegistry.salesprojectOfferExists = function(){ return{ + context: ["Salesproject"], title: translate.text("Offer exists"), verifierFn: function(pSalesprojectId){ @@ -297,6 +317,7 @@ $ChecklistEntryRegistry.salesprojectOfferExists = function(){ */ $ChecklistEntryRegistry.salesprojectProjStart12 = function(){ return{ + context: ["Salesproject"], title: translate.text("Project start within next 12 months"), verifierFn: function(pSalesprojectId){ @@ -328,6 +349,7 @@ $ChecklistEntryRegistry.salesprojectProjStart12 = function(){ */ $ChecklistEntryRegistry.salesprojectOfferSent = function(){ return{ + context: ["Salesproject"], title: translate.text("Offer sent"), verifierFn: function(pSalesprojectId){ @@ -354,6 +376,7 @@ $ChecklistEntryRegistry.salesprojectOfferSent = function(){ */ $ChecklistEntryRegistry.salesprojectProb100 = function(){ return{ + context: ["Salesproject"], title: translate.text("Probablity: 100%"), verifierFn: function(pSalesprojectId){ @@ -374,6 +397,7 @@ $ChecklistEntryRegistry.salesprojectProb100 = function(){ */ $ChecklistEntryRegistry.salesprojectStatusWon = function(){ return{ + context: ["Salesproject"], title: translate.text("Status: \"won\""), verifierFn: function(pSalesprojectId){ @@ -395,6 +419,7 @@ $ChecklistEntryRegistry.salesprojectStatusWon = function(){ */ $ChecklistEntryRegistry.salesprojectContractExists = function(){ return{ + context: ["Salesproject"], title: translate.text("Contract"), verifierFn: function(pSalesprojectId){ @@ -419,6 +444,7 @@ $ChecklistEntryRegistry.salesprojectContractExists = function(){ */ $ChecklistEntryRegistry.salesprojectRoleProjectteam = function(){ return{ + context: ["Salesproject"], title: translate.text("Project team"), verifierFn: function(pSalesprojectId){ var spRows = $ChecklistEntryRegistry._getRows(pSalesprojectId, "Salesproject_entity", ["SALESPROJECTID", "MST_TEAM_ID", "PROJECTCODE"], null, "NoPhaseRequirementLoading"); @@ -447,6 +473,7 @@ $ChecklistEntryRegistry.salesprojectRoleProjectteam = function(){ */ $ChecklistEntryRegistry.salesprojectFurtherCustomerMeetings = function(){ return{ + context: ["Salesproject"], title: translate.text("Further customer meetings"), verifierFn: function(pSalesprojectId){ var activityCount = newSelect("count(*)").from("ACTIVITYLINK") @@ -472,6 +499,7 @@ $ChecklistEntryRegistry.salesprojectFurtherCustomerMeetings = function(){ */ $ChecklistEntryRegistry.salesprojectSegmentPrio = function(){ return{ + context: ["Salesproject"], title: translate.text("Prioritization based on segmentation parameters"), verifierFn: function(pSalesprojectId){ var classificStr = newSelect("CLASSIFICATIONVALUE") @@ -489,6 +517,7 @@ $ChecklistEntryRegistry.salesprojectSegmentPrio = function(){ */ $ChecklistEntryRegistry.salesprojectFirstCustConv = function(){ return{ + context: ["Salesproject"], title: translate.text("First customer conversation"), verifierFn: function(pSalesprojectId){ var activitiesSubSql = newSelect("ACTIVITY.ACTIVITYID").from("ACTIVITYLINK") @@ -514,6 +543,7 @@ $ChecklistEntryRegistry.salesprojectFirstCustConv = function(){ */ $ChecklistEntryRegistry.salesprojectContactsGenerationSource = function(){ return{ + context: ["Salesproject"], title: translate.text("Source / origin of the generation of contacts"), verifierFn: function(pSalesprojectId){ return new AttributeRelationQuery( @@ -524,3 +554,105 @@ $ChecklistEntryRegistry.salesprojectContactsGenerationSource = function(){ } }; } + +/* + * Checks if the organisation has a default address + * + */ +$ChecklistEntryRegistry.organisationDefaultAddress = function(){ + return{ + context: ["Organisation"], + title: translate.text("Default address"), + verifierFn: function(pContactId){ + + var address = ContactUtils.getDefaultAddressId(pContactId); + if(address) + { + return true; + } + return false; + } + }; +} + +/* + * Checks if the organisation has a default e-mial + * + */ +$ChecklistEntryRegistry.organisationDefaultMail = function(){ + return{ + context: ["Organisation"], + title: translate.text("Default mail"), + verifierFn: function(pContactId){ + var mailAddress = CommUtil.getStandardMail(pContactId); + if(mailAddress) + { + return true; + } + return false; + } + }; +} + +/* + * Checks if the organisation has a default phone number + * + */ +$ChecklistEntryRegistry.organisationDefaultPhone = function(){ + return{ + context: ["Organisation"], + title: translate.text("Default phone"), + verifierFn: function(pContactId){ + var phoneNumber = CommUtil.getStandardPhone(pContactId); + if(phoneNumber) + { + return true; + } + return false; + } + }; +} + +/* + * Checks if the organisation has an valid district contact + * + */ +$ChecklistEntryRegistry.organisationValidDistrictContact = function(){ + return{ + context: ["Organisation"], + title: translate.text("District contact assigned"), + verifierFn: function(pOrganisationId){ + + var params = [["OnlyValids_param", "true"], + ["ContactId_param", pOrganisationId]]; + + var spRows = $ChecklistEntryRegistry._getRows(null, "DistrictContact_entity", ["#UID"], params, null, null); + + if(spRows.length > 0 && spRows[0]["#UID"] && spRows[0]["#UID"] != "") + { + return true; + } + return false; + } + }; +} + + +/* + * Checks the given filter for the passed context + * + */ +$ChecklistEntryRegistry.filter = function(){ + return{ + title: translate.text("Filter"), + verifierFn: function(pRowId, pObjectType, pFilter){ + var spRows = $ChecklistEntryRegistry._getRows(pRowId, ContextUtils.getEntity(pObjectType), ["#UID"], null, null, JSON.parse(pFilter).filter); + + if(spRows.length > 0 && spRows[0]["#UID"] && spRows[0]["#UID"] != "") + { + return true; + } + return false; + } + }; +} \ No newline at end of file diff --git a/process/Checklist_lib/Checklist_lib.aod b/process/Checklist_lib/Checklist_lib.aod new file mode 100644 index 0000000000000000000000000000000000000000..98fe46b343629a1fde3dff97c14c8ecab60298f6 --- /dev/null +++ b/process/Checklist_lib/Checklist_lib.aod @@ -0,0 +1,10 @@ +<?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>Checklist_lib</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <process>%aditoprj%/process/Checklist_lib/process.js</process> + <alias>Data_alias</alias> + <variants> + <element>LIBRARY</element> + </variants> +</process> diff --git a/process/Checklist_lib/process.js b/process/Checklist_lib/process.js new file mode 100644 index 0000000000000000000000000000000000000000..2e4ac6762350480db3a7ce784a5f7aec7f6680f2 --- /dev/null +++ b/process/Checklist_lib/process.js @@ -0,0 +1,49 @@ +import("Context_lib"); +import("system.db"); +import("Sql_lib"); +/** + * Provides methods for checklists.<br> + * <b>Do not create an instance of this!</b> + * + * @class + */ +function ChecklistUtils(){} + +/** + * Returns the select part with case whens for checklist conditions.<br> + * + * @param {String} pContext <p> + * Context for checklist selection + * @return {String[]} <p> + * String with the case when select.<br> + */ +ChecklistUtils.getCaseWhenSqlSelectWithConditions = function (pContext) +{ + var checklists = newSelect("CHECKLISTID, COND") + .from("CHECKLIST") + .where("CHECKLIST.CONTEXT", pContext) + .table(); + var select = ""; + + if(checklists.length > 0){ + checklists.forEach(function([checklistId, cond], idx){ + + if(JSON.parse(cond).filter.childs.length == 0) + { + cond = "1=1" + } + else + { + cond = db.toFilterCondition(JSON.stringify(JSON.parse(cond).filter), ContextUtils.getEntity(pContext)); + } + + select += "case when (" + cond + ") then '" + checklistId + "' else '' end"; + + if(idx != checklists.length-1){ + select += ", "; + } + }); + } + + return select; +}; \ No newline at end of file diff --git a/process/Communication_lib/process.js b/process/Communication_lib/process.js index 8a99351a66231aafc8321312180c8c9cf4372af9..d20360d67262c6e3889eb0d12b8d53badad42600 100644 --- a/process/Communication_lib/process.js +++ b/process/Communication_lib/process.js @@ -313,6 +313,20 @@ CommUtil.getMediumAddrSubSqlByKey = function(pMediumKey, pContactField, pObjectT return selectAddr.toString(); } +/** + * Returns the standard number of a PHONE-COMMUNICATION.<br> + * + * @param {String} pContactId <p> + * The contact id.<br> + * @return {String} <p> + * Phone number. If there is no phone number, an empty string is returned.<br> + */ +CommUtil.getStandardPhone = function (pContactId) +{ + var query = CommUtil.getStandardSubSqlPhone(newWhere("COMMUNICATION.CONTACT_ID", pContactId)); + return db.cell(query); +} + /** * Provides static methods for validation of communication data.<br> * <b>Do not create an instance of this!</b> diff --git a/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess.aod b/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess.aod new file mode 100644 index 0000000000000000000000000000000000000000..ed466503107fca43699b98c955c1da0d77f95d82 --- /dev/null +++ b/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess.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>TransferSalesprojectPhaseDefinitionToChecklist_serverProcess</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/documentation.adoc</documentation> + <process>%aditoprj%/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/process.js</process> + <alias>Data_alias</alias> + <variants> + <element>EXECUTABLE</element> + </variants> +</process> diff --git a/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/documentation.adoc b/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..b98416e0c9cbed6ee32799068f6b90c5552f3699 --- /dev/null +++ b/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/documentation.adoc @@ -0,0 +1,6 @@ += Checklist Migration +This process can be used to, migrate the checklists. + +The SALESPROJECTPHASEDEFINITION table is no longer used. +The columns of the table were added to the CHECKLIST table and so the entries of the SALESPROJECTPHASEDEFINITION table +must be transferred. \ No newline at end of file diff --git a/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/process.js b/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/process.js new file mode 100644 index 0000000000000000000000000000000000000000..4587f5ee9896b427e5cbcadd0bac01c665ced53c --- /dev/null +++ b/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/process.js @@ -0,0 +1,18 @@ +import("system.db"); +import("KeywordRegistry_basic"); +import("Keyword_lib"); +import("Sql_lib"); + +var salesprojectPhaseDefs = newSelect("CHECKLIST_ID, PHASE, DESCRIPTION, AUTOPROBABILITY").from("SALESPROJECTPHASEDEFINITION").table(); +var updates = []; +var table = "CHECKLIST"; +var cols = ["TITLE", "DESCRIPTION", "COND", "CONTEXT", "AUTOPROBABILITY"]; + +salesprojectPhaseDefs.forEach(function([checklistId, phase, description, autoprobability]){ + let filterCond = "{\"entity\":\"Salesproject_entity\",\"filter\":{\"type\":\"group\",\"operator\":\"AND\",\"childs\":[{\"type\":\"row\",\"name\":\"PHASE\",\"operator\":\"EQUAL\",\"value\":\"" + KeywordUtils.getViewValue($KeywordRegistry.salesprojectPhase(), phase) + "\",\"key\":\"" + phase + "\",\"contenttype\":\"TEXT\"}]}}"; + let vals = [description, description, filterCond, "Salesproject", autoprobability]; + let cond = newWhere("CHECKLIST.CHECKLISTID", checklistId).toString(); + updates.push([table, cols, null, vals, cond]); +}); + +db.updates(updates); diff --git a/system/default/default.aod b/system/default/default.aod index 9a52a413a65379d11c6a4f41d481f78eef758db0..2958416d4fb2d2572c57f160e8c548158708767b 100644 --- a/system/default/default.aod +++ b/system/default/default.aod @@ -2,7 +2,6 @@ <system xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/system/1.1.0"> <name>default</name> <majorModelMode>DISTRIBUTED</majorModelMode> - <serverConfigPath>$ADITODATA/config/serverconfig_default.xml</serverConfigPath> <aditoHomePath>$ADITOHOME</aditoHomePath> <aditoDataPath>$PROJECTHOME/data</aditoDataPath> <loginUser>admin</loginUser>