diff --git a/entity/Activity_entity/Activity_entity.aod b/entity/Activity_entity/Activity_entity.aod index c30a7850c1a55e0e81719aea7257c0e8598e5b37..97cdc499fb89380aefa75d745a6dbc37ec5394ee 100644 --- a/entity/Activity_entity/Activity_entity.aod +++ b/entity/Activity_entity/Activity_entity.aod @@ -230,6 +230,18 @@ <fieldName>Activities</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>9b416661-628d-4f8d-b8dc-9543cf5bbb1c</name> + <entityName>Campaign_entity</entityName> + <fieldName>Activities</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>4869a849-8717-48ec-9dbd-73df96992042</name> + <entityName>CampaignStep_entity</entityName> + <fieldName>Activities</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValueChange.js b/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValueChange.js index a8754300a5ed02b50adf50695d4eef4f5b43aab8..45222625e116d1ca417a83bca89e9607377bf4a4 100644 --- a/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValueChange.js +++ b/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValueChange.js @@ -1,9 +1,7 @@ -import("system.logging"); import("system.vars"); import("system.neon"); import("Campaign_lib"); var stepId; -CampaignUtils.getDefaultCampaignStep(vars.get("$field.CAMPAIGN_ID")); - +stepId = CampaignUtils.getDefaultCampaignStep(vars.get("$field.CAMPAIGN_ID")); neon.setFieldValue("$field.CAMPAIGNSTEP_ID", stepId); \ No newline at end of file diff --git a/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/displayValueProcess.js b/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/displayValueProcess.js index 649caa2bc64329ecde4daf38beb3d1d35fe666b8..42912a8480cc5ba01a619786eda263c6068b51bf 100644 --- a/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/displayValueProcess.js +++ b/entity/CampaignAddParticipants_entity/entityfields/campaignstep_id/displayValueProcess.js @@ -1,4 +1,3 @@ -import("system.logging"); import("system.vars"); import("Campaign_lib"); import("system.result"); diff --git a/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js b/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js index cadda267735d1e2481992b20d9addead9611895c..109ef8e54dcca640ddac6994573261ebe153ca5a 100644 --- a/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js +++ b/entity/CampaignAddParticipants_entity/recordcontainers/jdito/onInsert.js @@ -36,6 +36,7 @@ else } var statementArray = []; +var logArray = []; logging.log("isUpdate -> " + isUpdate); for (participant in participants) { @@ -51,7 +52,7 @@ for (participant in participants) let valsCampaignParticipantLog = new Array(participants[participant], campaignId, newCampaignStepId, campaignParticipantLogId, vars.get("$sys.user"), vars.get("$sys.date")); statementArray.push(["CAMPAIGNPARTICIPANT", cols, null, updatedValues, condition]); - statementArray.push(["CAMPAIGNPARTICIPANTLOG", colNamesCampaignParticipantLog, null, valsCampaignParticipantLog]); + logArray.push(["CAMPAIGNPARTICIPANTLOG", colNamesCampaignParticipantLog, null, valsCampaignParticipantLog]); } else { @@ -68,7 +69,7 @@ for (participant in participants) let valsCampaignParticipantLog = new Array(campaignParticipantId, campaignId, newCampaignStepId, campaignParticipantLogId, vars.get("$sys.user"), vars.get("$sys.date")); statementArray.push(["CAMPAIGNPARTICIPANT", cols, null, valsCampaignParticipant]); - statementArray.push(["CAMPAIGNPARTICIPANTLOG", colNamesCampaignParticipantLog, null, valsCampaignParticipantLog]); + logArray.push(["CAMPAIGNPARTICIPANTLOG", colNamesCampaignParticipantLog, null, valsCampaignParticipantLog]); } } @@ -76,3 +77,5 @@ if(isUpdate == "true") db.updates(statementArray) else db.inserts(statementArray); + +db.inserts(logArray); \ No newline at end of file diff --git a/entity/CampaignCostChart_entity/CampaignCostChart_entity.aod b/entity/CampaignCostChart_entity/CampaignCostChart_entity.aod new file mode 100644 index 0000000000000000000000000000000000000000..7bc8fbfe93f8c363e428c57d9da324afafc3f9ce --- /dev/null +++ b/entity/CampaignCostChart_entity/CampaignCostChart_entity.aod @@ -0,0 +1,56 @@ +<?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.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.4"> + <name>CampaignCostChart_entity</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <recordContainer>jdito</recordContainer> + <entityFields> + <entityProvider> + <name>#PROVIDER</name> + </entityProvider> + <entityField> + <name>UID</name> + </entityField> + <entityField> + <name>PARENT</name> + </entityField> + <entityField> + <name>X</name> + <title>Cost</title> + </entityField> + <entityField> + <name>Y</name> + </entityField> + <entityParameter> + <name>CampaignId_param</name> + <expose v="true" /> + <mandatory v="true" /> + <description>PARAMETER</description> + </entityParameter> + <entityProvider> + <name>CostChart</name> + <fieldType>DEPENDENCY_IN</fieldType> + <dependencies> + <entityDependency> + <name>e519262b-ff42-4c26-9d28-4d9566eafcdc</name> + <entityName>Campaign_entity</entityName> + <fieldName>CampaignCostsChart</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> + </entityProvider> + </entityFields> + <recordContainers> + <jDitoRecordContainer> + <name>jdito</name> + <jDitoRecordAlias>Data_alias</jDitoRecordAlias> + <contentProcess>%aditoprj%/entity/CampaignCostChart_entity/recordcontainers/jdito/contentProcess.js</contentProcess> + <recordFields> + <element>UID.value</element> + <element>PARENT.value</element> + <element>X.value</element> + <element>X.displayValue</element> + <element>Y.value</element> + </recordFields> + </jDitoRecordContainer> + </recordContainers> +</entity> diff --git a/entity/CampaignCostChart_entity/recordcontainers/jdito/contentProcess.js b/entity/CampaignCostChart_entity/recordcontainers/jdito/contentProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..148ffa8a083a3719811da1b498be0f36ed1adfda --- /dev/null +++ b/entity/CampaignCostChart_entity/recordcontainers/jdito/contentProcess.js @@ -0,0 +1,72 @@ +import("system.result"); +import("system.util"); +import("Sql_lib"); +import("system.db"); +import("system.translate"); +import("system.vars"); +import("KeywordRegistry_basic"); +import("Keyword_lib"); +import("Campaign_lib"); + +var campaignId = vars.get("$param.CampaignId_param"); +var campaignName = CampaignUtils.getCampaignNameById(campaignId); + +var costSqlSelect = "select CAMPAIGNCOSTID, CAMPAIGNSTEP_ID, CAMPAIGNSTEP.NAME, CATEGORY, " + + KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.campaignStepCostCategory(), "CAMPAIGNCOST.CATEGORY") + + ", NET from CAMPAIGNCOST left join CAMPAIGNSTEP on CAMPAIGNSTEP_ID = CAMPAIGNSTEPID"; +var costData = db.table(SqlCondition.begin() + .andPrepare("CAMPAIGNCOST.CAMPAIGN_ID", campaignId) + .buildSql(costSqlSelect, "1=2") +); + +var types = { + FIX : "FIX", + VARIABLE : "VARIABLE" +}; +var campaignCost = {}; + +costData.forEach(function ([costId, stepId, stepName, categoryId, categoryName, netCost]) +{ + let type = stepId + ? types.VARIABLE + : types.FIX; + + if (!(type in this)) + { + let typeName = type == types.FIX + ? translate.text("Fix cost") + : translate.text("Variable costs") + this[type] = new CampaignCostNode("", typeName, 0); + } + if (type == types.VARIABLE && !(stepId in this)) + this[stepId] = new CampaignCostNode(type, translate.text("Step") + ": " + stepName, 0); + + categoryId = categoryId + stepId + type; + if (!(categoryId in this)) + this[categoryId] = new CampaignCostNode(stepId || type, categoryName, 0); + + netCost = Number(netCost); + this[categoryId].value += netCost; + this[type].value += netCost; + if (stepId) + this[stepId].value += netCost; +}, campaignCost); + +var records = []; +for (let i in campaignCost) + records.push([ + i, + campaignCost[i].parent, + i, + campaignCost[i].title, + campaignCost[i].value + ]); + +result.object(records); + +function CampaignCostNode (pParent, pTitle, pValue) +{ + this.parent = pParent; + this.title = pTitle; + this.value = Number(pValue); +} \ No newline at end of file diff --git a/entity/CampaignParticipantChart_entity/CampaignParticipantChart_entity.aod b/entity/CampaignParticipantChart_entity/CampaignParticipantChart_entity.aod new file mode 100644 index 0000000000000000000000000000000000000000..143dbb1f06ede974a5fa5ee7c37d056d9ec92c5f --- /dev/null +++ b/entity/CampaignParticipantChart_entity/CampaignParticipantChart_entity.aod @@ -0,0 +1,57 @@ +<?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.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.4"> + <name>CampaignParticipantChart_entity</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <recordContainer>jdito</recordContainer> + <entityFields> + <entityProvider> + <name>#PROVIDER</name> + </entityProvider> + <entityProvider> + <name>ParticipantChart</name> + <fieldType>DEPENDENCY_IN</fieldType> + <dependencies> + <entityDependency> + <name>59e7c7ff-a649-4efe-89dd-8fdb7967261b</name> + <entityName>Campaign_entity</entityName> + <fieldName>CampaignParticipantsChart</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> + </entityProvider> + <entityField> + <name>UID</name> + </entityField> + <entityField> + <name>X</name> + <title>Step</title> + </entityField> + <entityField> + <name>Y</name> + </entityField> + <entityField> + <name>CATEGORY</name> + </entityField> + <entityParameter> + <name>CampaignId_param</name> + <expose v="true" /> + <mandatory v="true" /> + <description>PARAMETER</description> + </entityParameter> + </entityFields> + <recordContainers> + <jDitoRecordContainer> + <name>jdito</name> + <jDitoRecordAlias>Data_alias</jDitoRecordAlias> + <contentProcess>%aditoprj%/entity/CampaignParticipantChart_entity/recordcontainers/jdito/contentProcess.js</contentProcess> + <recordFields> + <element>UID.value</element> + <element>CATEGORY.value</element> + <element>CATEGORY.displayValue</element> + <element>X.value</element> + <element>X.displayValue</element> + <element>Y.value</element> + </recordFields> + </jDitoRecordContainer> + </recordContainers> +</entity> diff --git a/entity/CampaignParticipantChart_entity/recordcontainers/jdito/contentProcess.js b/entity/CampaignParticipantChart_entity/recordcontainers/jdito/contentProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..e210588e47d8813e30295c7bb229e222752d4491 --- /dev/null +++ b/entity/CampaignParticipantChart_entity/recordcontainers/jdito/contentProcess.js @@ -0,0 +1,55 @@ +import("system.translate"); +import("system.result"); +import("system.db"); +import("Sql_lib"); +import("system.vars"); + +var campaignId = vars.get("$param.CampaignId_param"); + +var sqlSelect = "select CAMPAIGNSTEPID, CAMPAIGNSTEP.NAME, count(distinct CAMPAIGNPARTICIPANTID), MAXPARTICIPANTS, count(distinct CAMPAIGNPARTICIPANTLOGID) " + + "from CAMPAIGNSTEP left join CAMPAIGNPARTICIPANT on CAMPAIGNSTEPID = CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID " + + "left join CAMPAIGNPARTICIPANTLOG on CAMPAIGNSTEPID = CAMPAIGNPARTICIPANTLOG.CAMPAIGNSTEP_ID "; +var sqlGroupOrderBy = "group by CAMPAIGNSTEPID, CAMPAIGNSTEP.NAME, MAXPARTICIPANTS, CAMPAIGNSTEP.SORTING order by CAMPAIGNSTEP.SORTING"; + +var sqlQuery = SqlCondition.begin() + .andPrepare("CAMPAIGNSTEP.CAMPAIGN_ID", campaignId) + .buildSql(sqlSelect, "1=2", sqlGroupOrderBy); + +var stepData = db.table(sqlQuery); + +var categories = { + CURRENT : "CURRENT", + MAX : "MAX", + LOGGED : "LOGGED" +}; +var records = []; + +stepData.forEach(function ([stepId, stepName, currentCount, maxCount, loggedCount]) +{ + records.push([ + stepId + categories.CURRENT, + categories.CURRENT, + translate.text("Current participants"), + stepId, + stepName, + currentCount || 0, + ]); + records.push([ + stepId + categories.MAX, + categories.MAX, + translate.text("Max participants"), + stepId, + stepName, + maxCount || 0, + ]); + records.push([ + stepId + categories.LOGGED, + categories.LOGGED, + translate.text("Participated"), + stepId, + stepName, + loggedCount || 0, + ]); +}); + +result.object(records); \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod index a0153d6c26b181670facf33bab32b42902ecd1a1..92dde9b3b1b0d9866b8b0323cecf5b9e07add0c6 100644 --- a/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod +++ b/entity/CampaignParticipant_entity/CampaignParticipant_entity.aod @@ -83,9 +83,9 @@ <title>Campaign Step</title> <consumer>CampaignSteps</consumer> <mandatory v="true" /> + <groupable v="true" /> <state>EDITABLE</state> <displayValueProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/campaignstep_id/displayValueProcess.js</displayValueProcess> - <onValueChange>%aditoprj%/entity/CampaignParticipant_entity/entityfields/campaignstep_id/onValueChange.js</onValueChange> <onValueChangeTypes> <element>MASK</element> <element>PROCESS</element> diff --git a/entity/CampaignParticipant_entity/entityfields/campaign_id/stateProcess.js b/entity/CampaignParticipant_entity/entityfields/campaign_id/stateProcess.js index 08bb8ede9acc54fa91f0ae1b22db90a5f61cea36..ca54a5bcb39a3129766916d2a18ffd04748bee80 100644 --- a/entity/CampaignParticipant_entity/entityfields/campaign_id/stateProcess.js +++ b/entity/CampaignParticipant_entity/entityfields/campaign_id/stateProcess.js @@ -1,9 +1,9 @@ -import("system.neon"); -import("system.result"); -import("system.vars"); -import("system.logging"); - -if(vars.exists("$param.CampaignId_param") && vars.get("$param.CampaignId_param") != "") - result.string(neon.COMPONENTSTATE_READONLY); -else - result.string(neon.COMPONENTSTATE_EDITABLE); \ No newline at end of file +//import("system.neon"); +//import("system.result"); +//import("system.vars"); +// +//if(vars.exists("$param.CampaignId_param") && vars.get("$param.CampaignId_param") != null) +// result.string(neon.COMPONENTSTATE_READONLY); +//else +// result.string(neon.COMPONENTSTATE_EDITABLE); +//todo campaignllokup readonly? \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/entityfields/campaign_id/valueProcess.js b/entity/CampaignParticipant_entity/entityfields/campaign_id/valueProcess.js index 619a4eb3879036407125c0a0f51cf0419a54b1fc..786b8bb1a59bea4737695d019250ba76c377e867 100644 --- a/entity/CampaignParticipant_entity/entityfields/campaign_id/valueProcess.js +++ b/entity/CampaignParticipant_entity/entityfields/campaign_id/valueProcess.js @@ -5,5 +5,10 @@ import("system.vars"); if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.CampaignId_param") && vars.get("$param.CampaignId_param")) { + //todo + //Has to be set here because of a bug which prevents loading of the param in the value process + if(vars.exists("$param.CampaignStepId_param") && vars.get("$param.CampaignStepId_param")) + neon.setFieldValue("$field.CAMPAIGNSTEP_ID", vars.get("$param.CampaignStepId_param")); + result.string(vars.get("$param.CampaignId_param")); } \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/entityfields/campaignstep_id/displayValueProcess.js b/entity/CampaignParticipant_entity/entityfields/campaignstep_id/displayValueProcess.js index e99107695ed42802fee2490b171383bdc2de6ea6..6a379f5fd6249fc59ea18bfb2a2ad442aa88e7a8 100644 --- a/entity/CampaignParticipant_entity/entityfields/campaignstep_id/displayValueProcess.js +++ b/entity/CampaignParticipant_entity/entityfields/campaignstep_id/displayValueProcess.js @@ -1,7 +1,7 @@ -import("system.logging"); +import("Campaign_lib"); import("system.vars"); import("system.db"); import("system.result"); -logging.log("campaignstep_idim displayvalue -> " + vars.get("$field.CAMPAIGNSTEP_ID")); -result.string(db.cell("select NAME from CAMPAIGNSTEP where CAMPAIGNSTEPID = '" + vars.get("$field.CAMPAIGNSTEP_ID") + "'")); \ No newline at end of file + +result.string(CampaignUtils.getCampaignStepNameById(vars.get("$field.CAMPAIGNSTEP_ID"))); \ No newline at end of file diff --git a/entity/CampaignParticipant_entity/entityfields/campaignstep_id/onValueChange.js b/entity/CampaignParticipant_entity/entityfields/campaignstep_id/onValueChange.js deleted file mode 100644 index 786b3ee87f36dd8cee13c107c0ba28bc76dc008c..0000000000000000000000000000000000000000 --- a/entity/CampaignParticipant_entity/entityfields/campaignstep_id/onValueChange.js +++ /dev/null @@ -1,3 +0,0 @@ -import("system.vars"); -import("system.logging"); -logging.log("campaignstep_id im onValueChange -> " + vars.get("$field.CAMPAIGNSTEP_ID")); \ No newline at end of file diff --git a/entity/CampaignStep_entity/CampaignStep_entity.aod b/entity/CampaignStep_entity/CampaignStep_entity.aod index 491dce1b683f23324b5106dbd9f7c83f14ae7e32..8dd8aa144722e5bf7230b72799eb66b3c76acca4 100644 --- a/entity/CampaignStep_entity/CampaignStep_entity.aod +++ b/entity/CampaignStep_entity/CampaignStep_entity.aod @@ -10,6 +10,14 @@ <entityFields> <entityProvider> <name>#PROVIDER</name> + <dependencies> + <entityDependency> + <name>13f82959-7e04-449f-a657-c34f6b97f3be</name> + <entityName>Object_entity</entityName> + <fieldName>CampaignSteps</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> </entityProvider> <entityField> <name>CAMPAIGNSTEPID</name> @@ -119,6 +127,12 @@ <fieldName>CampaignSteps</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>3fde1e51-cc4c-4727-b4e7-fd30bed1ee04</name> + <entityName>Campaign_entity</entityName> + <fieldName>CampaignStepsReadonly</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> @@ -155,6 +169,7 @@ <title>Max participants</title> <contentType>NUMBER</contentType> <mandatory v="true" /> + <onValidation>%aditoprj%/entity/CampaignStep_entity/entityfields/maxparticipants/onValidation.js</onValidation> </entityField> <entityConsumer> <name>CampaignParticipantsConsumer</name> @@ -236,6 +251,63 @@ <fieldName>CampaignProvider</fieldName> </dependency> </entityConsumer> + <entityConsumer> + <name>Activities</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <title>Activities</title> + <dependency> + <name>dependency</name> + <entityName>Activity_entity</entityName> + <fieldName>LinkedObjects</fieldName> + </dependency> + <children> + <entityParameter> + <name>RowId_param</name> + <valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/activities/children/rowid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>ObjectId_param</name> + <valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/activities/children/objectid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>Tasks</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <title>Tasks</title> + <stateProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/tasks/stateProcess.js</stateProcess> + <dependency> + <name>dependency</name> + <entityName>Task_entity</entityName> + <fieldName>LinkedObjects</fieldName> + </dependency> + <children> + <entityParameter> + <name>RowId_param</name> + <valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/tasks/children/rowid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>ObjectId_param</name> + <valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/tasks/children/objectid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityActionField> + <name>newActivity</name> + <fieldType>ACTION</fieldType> + <title>New activity</title> + <onActionProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/newactivity/onActionProcess.js</onActionProcess> + <iconId>NEON:HISTORY</iconId> + <tooltip>New activity</tooltip> + <tooltipProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/newactivity/tooltipProcess.js</tooltipProcess> + </entityActionField> + <entityActionField> + <name>newTask</name> + <fieldType>ACTION</fieldType> + <title>New task</title> + <onActionProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/newtask/onActionProcess.js</onActionProcess> + <iconId>VAADIN:TASKS</iconId> + </entityActionField> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/CampaignStep_entity/entityfields/activities/children/objectid_param/valueProcess.js b/entity/CampaignStep_entity/entityfields/activities/children/objectid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..008915f61deac19ccdd40fff81701de63eb3b6a2 --- /dev/null +++ b/entity/CampaignStep_entity/entityfields/activities/children/objectid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/entity/CampaignStep_entity/entityfields/activities/children/rowid_param/valueProcess.js b/entity/CampaignStep_entity/entityfields/activities/children/rowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..73512b5ba01cbb1eb0c5c71d8b3bb16712f8f7bc --- /dev/null +++ b/entity/CampaignStep_entity/entityfields/activities/children/rowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.CAMPAIGNSTEPID")); \ No newline at end of file diff --git a/entity/CampaignStep_entity/entityfields/maxparticipants/onValidation.js b/entity/CampaignStep_entity/entityfields/maxparticipants/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..378e2a7a10e331996da72cd84e0bc1eb2b8d45b6 --- /dev/null +++ b/entity/CampaignStep_entity/entityfields/maxparticipants/onValidation.js @@ -0,0 +1,10 @@ +import("Campaign_lib"); +import("system.result"); +import("Entity_lib"); +import("system.vars"); + +var currentParticipantsCount = parseInt(vars.get("$field.CurrentMaxParticipantsInfo")[0]); +var newMaxParticipantsCount = parseInt(ProcessHandlingUtils.getOnValidationValue(vars.get("$field.MAXPARTICIPANTS"))); + +if(newMaxParticipantsCount < currentParticipantsCount) + result.string(CampaignUtils.getMaxParticipantsValidationMessage()); \ No newline at end of file diff --git a/entity/CampaignStep_entity/entityfields/newactivity/onActionProcess.js b/entity/CampaignStep_entity/entityfields/newactivity/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..59a786db9b15cca4809d11586ba9adc7b70fea37 --- /dev/null +++ b/entity/CampaignStep_entity/entityfields/newactivity/onActionProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("ActivityTask_lib"); + +ActivityUtils.createNewActivity(vars.getString("$field.CAMPAIGNSTEPID")); \ No newline at end of file diff --git a/entity/CampaignStep_entity/entityfields/newactivity/tooltipProcess.js b/entity/CampaignStep_entity/entityfields/newactivity/tooltipProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c71e677c22663c2295e524aa7f3ed3dd571724d7 --- /dev/null +++ b/entity/CampaignStep_entity/entityfields/newactivity/tooltipProcess.js @@ -0,0 +1,4 @@ +import("system.translate"); +import("system.result"); + +result.string(translate.text("New activity")); \ No newline at end of file diff --git a/entity/CampaignStep_entity/entityfields/newtask/onActionProcess.js b/entity/CampaignStep_entity/entityfields/newtask/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c674a6a4942409c114993fc541519e0b3c23a236 --- /dev/null +++ b/entity/CampaignStep_entity/entityfields/newtask/onActionProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("ActivityTask_lib"); + +TaskUtils.createNewTask(vars.get("$field.CAMPAIGNSTEPID")); \ No newline at end of file diff --git a/entity/CampaignStep_entity/entityfields/tasks/children/objectid_param/valueProcess.js b/entity/CampaignStep_entity/entityfields/tasks/children/objectid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..008915f61deac19ccdd40fff81701de63eb3b6a2 --- /dev/null +++ b/entity/CampaignStep_entity/entityfields/tasks/children/objectid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/entity/CampaignStep_entity/entityfields/tasks/children/rowid_param/valueProcess.js b/entity/CampaignStep_entity/entityfields/tasks/children/rowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..73512b5ba01cbb1eb0c5c71d8b3bb16712f8f7bc --- /dev/null +++ b/entity/CampaignStep_entity/entityfields/tasks/children/rowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.CAMPAIGNSTEPID")); \ No newline at end of file diff --git a/entity/CampaignStep_entity/entityfields/tasks/stateProcess.js b/entity/CampaignStep_entity/entityfields/tasks/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..527624728ab45db1d1e548022197a2e509eee432 --- /dev/null +++ b/entity/CampaignStep_entity/entityfields/tasks/stateProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("ActivityTask_lib"); +import("Context_lib"); + +if (TaskUtils.hasTasks(vars.get("$field.CAMPAIGNSTEPID"), ContextUtils.getCurrentContextId())) + result.string(neon.COMPONENTSTATE_EDITABLE); +else + result.string(neon.COMPONENTSTATE_INVISIBLE); \ No newline at end of file diff --git a/entity/Campaign_entity/Campaign_entity.aod b/entity/Campaign_entity/Campaign_entity.aod index 627cde03dbf2c846ba1938f79a9730204e29ec13..70adc52ce6aa6f8c7fb1cd2ace5226f8cc57e69b 100644 --- a/entity/Campaign_entity/Campaign_entity.aod +++ b/entity/Campaign_entity/Campaign_entity.aod @@ -10,6 +10,14 @@ <entityFields> <entityProvider> <name>#PROVIDER</name> + <dependencies> + <entityDependency> + <name>8db36fa6-e799-488c-882f-1141f781c9dc</name> + <entityName>Object_entity</entityName> + <fieldName>Campaigns</fieldName> + <isConsumer v="false" /> + </entityDependency> + </dependencies> </entityProvider> <entityField> <name>CAMPAIGNID</name> @@ -49,8 +57,9 @@ </entityField> <entityField> <name>DESCRIPTION</name> - <title>Description</title> + <title></title> <contentType>LONG_TEXT</contentType> + <titleProcess>%aditoprj%/entity/Campaign_entity/entityfields/description/titleProcess.js</titleProcess> </entityField> <entityField> <name>USER_NEW</name> @@ -77,6 +86,7 @@ <entityConsumer> <name>CampaignSteps</name> <fieldType>DEPENDENCY_OUT</fieldType> + <state>EDITABLE</state> <dependency> <name>dependency</name> <entityName>CampaignStep_entity</entityName> @@ -226,6 +236,116 @@ <title>Participants</title> <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/participantcount/valueProcess.js</valueProcess> </entityField> + <entityConsumer> + <name>Activities</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <title>Activities</title> + <dependency> + <name>dependency</name> + <entityName>Activity_entity</entityName> + <fieldName>LinkedObjects</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectId_param</name> + <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/activities/children/objectid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>RowId_param</name> + <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/activities/children/rowid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>Tasks</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <title>Tasks</title> + <stateProcess>%aditoprj%/entity/Campaign_entity/entityfields/tasks/stateProcess.js</stateProcess> + <dependency> + <name>dependency</name> + <entityName>Task_entity</entityName> + <fieldName>LinkedObjects</fieldName> + </dependency> + <children> + <entityParameter> + <name>ObjectId_param</name> + <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/tasks/children/objectid_param/valueProcess.js</valueProcess> + </entityParameter> + <entityParameter> + <name>RowId_param</name> + <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/tasks/children/rowid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityActionField> + <name>newActivity</name> + <fieldType>ACTION</fieldType> + <title>New activity</title> + <onActionProcess>%aditoprj%/entity/Campaign_entity/entityfields/newactivity/onActionProcess.js</onActionProcess> + <iconId>NEON:HISTORY</iconId> + <tooltip>New activity</tooltip> + <tooltipProcess>%aditoprj%/entity/Campaign_entity/entityfields/newactivity/tooltipProcess.js</tooltipProcess> + </entityActionField> + <entityActionField> + <name>newTask</name> + <fieldType>ACTION</fieldType> + <title>New task</title> + <onActionProcess>%aditoprj%/entity/Campaign_entity/entityfields/newtask/onActionProcess.js</onActionProcess> + <iconId>VAADIN:TASKS</iconId> + </entityActionField> + <entityConsumer> + <name>CampaignCostsChart</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <title>Charts</title> + <dependency> + <name>dependency</name> + <entityName>CampaignCostChart_entity</entityName> + <fieldName>CostChart</fieldName> + </dependency> + <children> + <entityParameter> + <name>CampaignId_param</name> + <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/campaigncostschart/children/campaignid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityConsumer> + <name>CampaignParticipantsChart</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <title>Chart 2</title> + <dependency> + <name>dependency</name> + <entityName>CampaignParticipantChart_entity</entityName> + <fieldName>ParticipantChart</fieldName> + </dependency> + <children> + <entityParameter> + <name>CampaignId_param</name> + <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/campaignparticipantschart/children/campaignid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> + <entityField> + <name>remainingRuntime</name> + <title>Remaining Runtime</title> + <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/remainingruntime/valueProcess.js</valueProcess> + </entityField> + <entityConsumer> + <name>CampaignStepsReadonly</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <state>READONLY</state> + <dependency> + <name>dependency</name> + <entityName>CampaignStep_entity</entityName> + <fieldName>CampaignSteps</fieldName> + </dependency> + <children> + <entityParameter> + <name>campaignId_param</name> + <valueProcess>%aditoprj%/entity/Campaign_entity/entityfields/campaignstepsreadonly/children/campaignid_param/valueProcess.js</valueProcess> + </entityParameter> + </children> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> diff --git a/entity/Campaign_entity/entityfields/activities/children/objectid_param/valueProcess.js b/entity/Campaign_entity/entityfields/activities/children/objectid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..008915f61deac19ccdd40fff81701de63eb3b6a2 --- /dev/null +++ b/entity/Campaign_entity/entityfields/activities/children/objectid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/activities/children/rowid_param/valueProcess.js b/entity/Campaign_entity/entityfields/activities/children/rowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3814648f507bd77edb266f38a807c1669e8c5f1e --- /dev/null +++ b/entity/Campaign_entity/entityfields/activities/children/rowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.CAMPAIGNID")); \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/campaigncostschart/children/campaignid_param/valueProcess.js b/entity/Campaign_entity/entityfields/campaigncostschart/children/campaignid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3814648f507bd77edb266f38a807c1669e8c5f1e --- /dev/null +++ b/entity/Campaign_entity/entityfields/campaigncostschart/children/campaignid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.CAMPAIGNID")); \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/campaignparticipantschart/children/campaignid_param/valueProcess.js b/entity/Campaign_entity/entityfields/campaignparticipantschart/children/campaignid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3814648f507bd77edb266f38a807c1669e8c5f1e --- /dev/null +++ b/entity/Campaign_entity/entityfields/campaignparticipantschart/children/campaignid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.CAMPAIGNID")); \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/campaignstepsreadonly/children/campaignid_param/valueProcess.js b/entity/Campaign_entity/entityfields/campaignstepsreadonly/children/campaignid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..ea290bfda9377cc69f8b4c727ccbe2cf83f493de --- /dev/null +++ b/entity/Campaign_entity/entityfields/campaignstepsreadonly/children/campaignid_param/valueProcess.js @@ -0,0 +1,5 @@ +import("system.logging"); +import("system.result"); +import("system.vars"); + +result.string(vars.getString("$field.CAMPAIGNID")); \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/description/titleProcess.js b/entity/Campaign_entity/entityfields/description/titleProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..076336c605a88532487f3d2043c0450d7021806e --- /dev/null +++ b/entity/Campaign_entity/entityfields/description/titleProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("system.translate"); + +if(vars.get("$sys.operatingstate") != neon.OPERATINGSTATE_VIEW) +{ + result.string(translate.text("Description")); +} \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/newactivity/onActionProcess.js b/entity/Campaign_entity/entityfields/newactivity/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3cc8f6e5013e0a16d03444898c3a7f2cfa366552 --- /dev/null +++ b/entity/Campaign_entity/entityfields/newactivity/onActionProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("ActivityTask_lib"); + +ActivityUtils.createNewActivity(vars.getString("$field.CAMPAIGNID")); \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/newactivity/tooltipProcess.js b/entity/Campaign_entity/entityfields/newactivity/tooltipProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..c71e677c22663c2295e524aa7f3ed3dd571724d7 --- /dev/null +++ b/entity/Campaign_entity/entityfields/newactivity/tooltipProcess.js @@ -0,0 +1,4 @@ +import("system.translate"); +import("system.result"); + +result.string(translate.text("New activity")); \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/newtask/onActionProcess.js b/entity/Campaign_entity/entityfields/newtask/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d870f4d21cebf7aeaf34d6b59f2157d03d8e82ff --- /dev/null +++ b/entity/Campaign_entity/entityfields/newtask/onActionProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("ActivityTask_lib"); + +TaskUtils.createNewTask(vars.get("$field.CAMPAIGNID")); \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/remainingruntime/valueProcess.js b/entity/Campaign_entity/entityfields/remainingruntime/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f1bb2d459a4c0944026218aac403ef0c3195f2e5 --- /dev/null +++ b/entity/Campaign_entity/entityfields/remainingruntime/valueProcess.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("4"); \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/tasks/children/objectid_param/valueProcess.js b/entity/Campaign_entity/entityfields/tasks/children/objectid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..008915f61deac19ccdd40fff81701de63eb3b6a2 --- /dev/null +++ b/entity/Campaign_entity/entityfields/tasks/children/objectid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.result"); +import("Context_lib"); + +result.string(ContextUtils.getCurrentContextId()); \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/tasks/children/rowid_param/valueProcess.js b/entity/Campaign_entity/entityfields/tasks/children/rowid_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3814648f507bd77edb266f38a807c1669e8c5f1e --- /dev/null +++ b/entity/Campaign_entity/entityfields/tasks/children/rowid_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(vars.get("$field.CAMPAIGNID")); \ No newline at end of file diff --git a/entity/Campaign_entity/entityfields/tasks/stateProcess.js b/entity/Campaign_entity/entityfields/tasks/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..d77c2eeb195571306ce7f9e977a5f9ad26b47079 --- /dev/null +++ b/entity/Campaign_entity/entityfields/tasks/stateProcess.js @@ -0,0 +1,10 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("ActivityTask_lib"); +import("Context_lib"); + +if (TaskUtils.hasTasks(vars.get("$field.CAMPAIGNID"), ContextUtils.getCurrentContextId())) + result.string(neon.COMPONENTSTATE_EDITABLE); +else + result.string(neon.COMPONENTSTATE_INVISIBLE); \ No newline at end of file diff --git a/entity/Campaign_entity/recordcontainers/db/onDBDelete.js b/entity/Campaign_entity/recordcontainers/db/onDBDelete.js index fe6d290a0d7833058d4503ef92c6a787bee31f28..af050049af87260fc04101c288c6d52cb1e231aa 100644 --- a/entity/Campaign_entity/recordcontainers/db/onDBDelete.js +++ b/entity/Campaign_entity/recordcontainers/db/onDBDelete.js @@ -2,7 +2,7 @@ import("system.db"); import("system.vars"); import("Sql_lib"); -var currentId = vars.getString("$field.SALESPROJECTID"); +var currentId = vars.getString("$field.CAMPAIGNID"); if (currentId) { diff --git a/entity/Object_entity/Object_entity.aod b/entity/Object_entity/Object_entity.aod index 903aaff0b915a374c9ba25632f9681cbe179aca7..9680fb42089f0284558ae840065658405838bfea 100644 --- a/entity/Object_entity/Object_entity.aod +++ b/entity/Object_entity/Object_entity.aod @@ -155,6 +155,24 @@ </entityParameter> </children> </entityProvider> + <entityConsumer> + <name>Campaigns</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>Campaign_entity</entityName> + <fieldName>#PROVIDER</fieldName> + </dependency> + </entityConsumer> + <entityConsumer> + <name>CampaignSteps</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>CampaignStep_entity</entityName> + <fieldName>#PROVIDER</fieldName> + </dependency> + </entityConsumer> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/Task_entity/Task_entity.aod b/entity/Task_entity/Task_entity.aod index 812645b694e63886c00984aaee24cd9e9cab8682..1d8e6ddc9d561d4320373529e5d1c4965bd3d467 100644 --- a/entity/Task_entity/Task_entity.aod +++ b/entity/Task_entity/Task_entity.aod @@ -359,6 +359,18 @@ <fieldName>Tasks</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>335e31ad-ab67-4567-b4ea-3668f04922b2</name> + <entityName>Campaign_entity</entityName> + <fieldName>Tasks</fieldName> + <isConsumer v="false" /> + </entityDependency> + <entityDependency> + <name>fbaa2f6c-0ba1-4c93-acae-d7b636581679</name> + <entityName>CampaignStep_entity</entityName> + <fieldName>Tasks</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> <children> <entityParameter> diff --git a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod index d19c9807a2bbc0b101f87b8c3f14464128137cb0..4ba1371106af3d7db62aee4bc2e22253640727ed 100644 --- a/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod +++ b/language/_____LANGUAGE_EXTRA/_____LANGUAGE_EXTRA.aod @@ -3090,6 +3090,12 @@ <entry> <key>The minimal count can't be larger than the maximal count!</key> </entry> + <entry> + <key>The max participants count has to be equal or greater than the count of the current participants!</key> + </entry> + <entry> + <key>Variable costs</key> + </entry> <entry> <key>Version number</key> </entry> @@ -3483,6 +3489,12 @@ <entry> <key>Notifications</key> </entry> + <entry> + <key>Overview</key> + </entry> + <entry> + <key>Participated</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> <sqlModels> diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index f5e2fe9289d349740dffd2e00392d2c83b88cc37..cde72b065a3bc7d795d351e702305f17f26553d7 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -70,6 +70,10 @@ <key>${ATTRIBUTE_VOID}</key> <value>Tag</value> </entry> + <entry> + <key>Campaign Period</key> + <value>Kampagnen Laufzeit</value> + </entry> <entry> <key>Turnover</key> <value>Umsatz</value> @@ -651,6 +655,10 @@ <key>Contract start date</key> <value>Vertragsbeginn</value> </entry> + <entry> + <key>Remaining Runtime</key> + <value>Restlaufzeit</value> + </entry> <entry> <key>Spare parts</key> <value>Ersatzteile</value> @@ -2609,6 +2617,10 @@ <key>Jersey</key> <value>Jersey</value> </entry> + <entry> + <key>Overview</key> + <value>Übersicht</value> + </entry> <entry> <key>Slovenia</key> <value>Slowenien</value> @@ -2621,6 +2633,10 @@ <key>Annually</key> <value>jährlich</value> </entry> + <entry> + <key>Participated</key> + <value>Teilgenommen</value> + </entry> <entry> <key>Colombia</key> <value>Kolumbien</value> @@ -3830,6 +3846,10 @@ <entry> <key>Imminent appointments for today </key> </entry> + <entry> + <key>Variable costs</key> + <value>Variable Kosten</value> + </entry> <entry> <key>To-Do</key> </entry> @@ -3983,6 +4003,10 @@ <key>per</key> <value>pro</value> </entry> + <entry> + <key>The max participants count has to be equal or greater than the count of the current participants!</key> + <value>Die maximale Teilnehmerzahl muss gleich oder größer der aktuellen Teilnehmerzahl sein!</value> + </entry> <entry> <key>Version number</key> </entry> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index 58d2b2aafab319cf38c42ee7cd63e7cb9e13a3ca..ae0173689a97afe2e7e44753e361a49730acfb50 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -3125,6 +3125,12 @@ <entry> <key>The minimal count can't be larger than the maximal count!</key> </entry> + <entry> + <key>The max participants count has to be equal or greater than the count of the current participants!</key> + </entry> + <entry> + <key>Variable costs</key> + </entry> <entry> <key>Version number</key> </entry> @@ -3518,6 +3524,12 @@ <entry> <key>Notifications</key> </entry> + <entry> + <key>Overview</key> + </entry> + <entry> + <key>Participated</key> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/neonContext/Campaign/Campaign.aod b/neonContext/Campaign/Campaign.aod index 44da77e955ace0671af2cb87a25685eaf48ff6ea..9d15d6f3ac8be8cd6778f29fa97c0d0bd5376317 100644 --- a/neonContext/Campaign/Campaign.aod +++ b/neonContext/Campaign/Campaign.aod @@ -31,5 +31,9 @@ <name>4a5377cc-af00-49c7-aad2-ac93e2752b3f</name> <view>CampaignCost_view</view> </neonViewReference> + <neonViewReference> + <name>484d39ea-5135-4bb2-a12d-cb7114e2981c</name> + <view>CampaignCharts_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonContext/CampaignCostChart/CampaignCostChart.aod b/neonContext/CampaignCostChart/CampaignCostChart.aod new file mode 100644 index 0000000000000000000000000000000000000000..a7a868378f8c090c93002ec738d965c303271acd --- /dev/null +++ b/neonContext/CampaignCostChart/CampaignCostChart.aod @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> + <name>CampaignCostChart</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <entity>CampaignCostChart_entity</entity> + <references> + <neonViewReference> + <name>c859b91d-d802-49c6-b330-5f66e80fe5c6</name> + <view>CampaignCostChart_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonContext/CampaignParticipantChart/CampaignParticipantChart.aod b/neonContext/CampaignParticipantChart/CampaignParticipantChart.aod new file mode 100644 index 0000000000000000000000000000000000000000..9f0506d6c9470c242a3cb21476da5a73e3b7d4e6 --- /dev/null +++ b/neonContext/CampaignParticipantChart/CampaignParticipantChart.aod @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.0"> + <name>CampaignParticipantChart</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <entity>CampaignParticipantChart_entity</entity> + <references> + <neonViewReference> + <name>820b8b1b-9b8e-47f9-a5b8-f0afb934909b</name> + <view>CampaignParticipantChart_view</view> + </neonViewReference> + </references> +</neonContext> diff --git a/neonContext/CampaignStep/CampaignStep.aod b/neonContext/CampaignStep/CampaignStep.aod index 17e6119fb7f175a1485f953f92a111e9f8f03fee..4347dcf41de3c2e0f603ab1f53a66f6acf4f4aae 100644 --- a/neonContext/CampaignStep/CampaignStep.aod +++ b/neonContext/CampaignStep/CampaignStep.aod @@ -34,5 +34,9 @@ <name>c1be17f6-c4ca-4d9d-8c3a-0cc8f75906f6</name> <view>CampaignStepAddParticipants_view</view> </neonViewReference> + <neonViewReference> + <name>ad879f25-4659-49d0-81ed-2e09c8b11ac1</name> + <view>CampaignStepParticipnatsPerStep_view</view> + </neonViewReference> </references> </neonContext> diff --git a/neonView/CampaignCharts_view/CampaignCharts_view.aod b/neonView/CampaignCharts_view/CampaignCharts_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..bb0f266e21de5d8c773a8e3c3f06a91131accb37 --- /dev/null +++ b/neonView/CampaignCharts_view/CampaignCharts_view.aod @@ -0,0 +1,23 @@ +<?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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>CampaignCharts_view</name> + <title>Overview</title> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <neonViewReference> + <name>e96b6827-e47e-4d85-a1fd-b1b52f36fe31</name> + <entityField>CampaignCostsChart</entityField> + <view>CampaignCostChart_view</view> + </neonViewReference> + <neonViewReference> + <name>e6d6c775-3d85-4a59-8df0-d57e7174ed90</name> + <entityField>CampaignParticipantsChart</entityField> + <view>CampaignParticipantChart_view</view> + </neonViewReference> + </children> +</neonView> diff --git a/neonView/CampaignCostChart_view/CampaignCostChart_view.aod b/neonView/CampaignCostChart_view/CampaignCostChart_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..70c5e7f5cbc9d4a8de285a96be5014a8cd3f09fb --- /dev/null +++ b/neonView/CampaignCostChart_view/CampaignCostChart_view.aod @@ -0,0 +1,21 @@ +<?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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>CampaignCostChart_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <singleDataChartViewTemplate> + <name>SingleDataChart</name> + <chartTitle>Cost</chartTitle> + <chartType>DONUT</chartType> + <xAxis>X</xAxis> + <yAxis>Y</yAxis> + <parentField>PARENT</parentField> + <entityField>#ENTITY</entityField> + </singleDataChartViewTemplate> + </children> +</neonView> diff --git a/neonView/CampaignMain_view/CampaignMain_view.aod b/neonView/CampaignMain_view/CampaignMain_view.aod index e35b2793103a62830da3077fb2619a2db03d079d..5c6f7bd263b95b137ddcb00f69ac6c5b2682431c 100644 --- a/neonView/CampaignMain_view/CampaignMain_view.aod +++ b/neonView/CampaignMain_view/CampaignMain_view.aod @@ -15,6 +15,11 @@ <entityField>#ENTITY</entityField> <view>CampaignPreview_view</view> </neonViewReference> + <neonViewReference> + <name>400f5a85-2691-47f6-9cc0-e7635828c5a5</name> + <entityField>#ENTITY</entityField> + <view>CampaignCharts_view</view> + </neonViewReference> <neonViewReference> <name>ad66a5a6-65fb-45d5-bf62-45661fc16e30</name> <entityField>CampaignSteps</entityField> @@ -30,5 +35,15 @@ <entityField>#ENTITY</entityField> <view>CampaignCost_view</view> </neonViewReference> + <neonViewReference> + <name>90d3d016-63e6-4e8a-98ee-30033bef49fc</name> + <entityField>Activities</entityField> + <view>ActivityFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>e28e5598-9366-4f5a-be8f-70dd3cc0399a</name> + <entityField>Tasks</entityField> + <view>TaskFilter_view</view> + </neonViewReference> </children> </neonView> diff --git a/neonView/CampaignParticipantChart_view/CampaignParticipantChart_view.aod b/neonView/CampaignParticipantChart_view/CampaignParticipantChart_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..eb58fcc3ea60134c733adedc6abc8955a1fa6d97 --- /dev/null +++ b/neonView/CampaignParticipantChart_view/CampaignParticipantChart_view.aod @@ -0,0 +1,21 @@ +<?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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>CampaignParticipantChart_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <boxLayout> + <name>layout</name> + </boxLayout> + </layout> + <children> + <multiDataChartViewTemplate> + <name>MultiDataChart</name> + <chartTitle>Participants</chartTitle> + <chartType>BAR</chartType> + <xAxis>X</xAxis> + <yAxis>Y</yAxis> + <categoryField>CATEGORY</categoryField> + <entityField>#ENTITY</entityField> + </multiDataChartViewTemplate> + </children> +</neonView> diff --git a/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod b/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod index cb62a6a056152b5bd834a2fad1f1451cd0c85b1c..47076d4fcbfaa6d6a4fc86fd32a52daa75f76456 100644 --- a/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod +++ b/neonView/CampaignParticipantFilter_view/CampaignParticipantFilter_view.aod @@ -4,28 +4,31 @@ <title></title> <description></description> <majorModelMode>DISTRIBUTED</majorModelMode> - <filterable v="false" /> + <filterable v="true" /> <layout> <boxLayout> <name>layout</name> </boxLayout> </layout> <children> - <tableViewTemplate> - <name>ParticipantsTable</name> + <treeTableViewTemplate> + <name>ParticipantsTreeTable</name> + <parentField>CAMPAIGNSTEP_ID</parentField> <favoriteActionGroup1>FilterViewActionGroup</favoriteActionGroup1> - <favoriteActionGroup2></favoriteActionGroup2> + <defaultGroupFields> + <element>CAMPAIGNSTEP_ID</element> + </defaultGroupFields> <entityField>#ENTITY</entityField> <columns> <neonTableColumn> - <name>85558e09-e1f0-4430-b779-f807f5763808</name> + <name>8bfe5a3d-e0c2-4a34-b510-984960c6de6f</name> <entityField>CONTACT_ID</entityField> </neonTableColumn> <neonTableColumn> - <name>fc7ef954-ec19-43cf-bc0c-908760f20144</name> + <name>feeea168-1cf9-4402-86ad-ede7d511750f</name> <entityField>CAMPAIGNSTEP_ID</entityField> </neonTableColumn> </columns> - </tableViewTemplate> + </treeTableViewTemplate> </children> </neonView> diff --git a/neonView/CampaignPreview_view/CampaignPreview_view.aod b/neonView/CampaignPreview_view/CampaignPreview_view.aod index a1d6b8859c18d6f830605335621dc7a623376ad4..b5772a5f1f39bf5a016365e44a55907e77d5d75c 100644 --- a/neonView/CampaignPreview_view/CampaignPreview_view.aod +++ b/neonView/CampaignPreview_view/CampaignPreview_view.aod @@ -16,12 +16,14 @@ <name>Header</name> <titleField>NAME</titleField> <subtitleField>STATE</subtitleField> - <descriptionField>DESCRIPTION</descriptionField> + <favoriteAction1>newActivity</favoriteAction1> <entityField>#ENTITY</entityField> <title></title> </cardViewTemplate> <genericViewTemplate> <name>TimespanGeneric</name> + <showDrawer v="true" /> + <drawerCaption>Campaign Period</drawerCaption> <entityField>#ENTITY</entityField> <title>Kampagnenzeitraum</title> <fields> @@ -35,6 +37,24 @@ </entityFieldLink> </fields> </genericViewTemplate> + <neonViewReference> + <name>4ae0c7d5-8573-4e4d-a047-2944d82aebe0</name> + <entityField>CampaignStepsReadonly</entityField> + <view>CampaignStepParticipnatsPerStep_view</view> + </neonViewReference> + <genericViewTemplate> + <name>Description</name> + <showDrawer v="true" /> + <hideLabels v="true" /> + <entityField>#ENTITY</entityField> + <title>Beschreibung</title> + <fields> + <entityFieldLink> + <name>d7c993ff-9696-4de8-9ba5-fc7c92a1a22b</name> + <entityField>DESCRIPTION</entityField> + </entityFieldLink> + </fields> + </genericViewTemplate> <scoreCardViewTemplate> <name>ScoreCard</name> <entityField>#ENTITY</entityField> @@ -44,8 +64,8 @@ <entityField>COST</entityField> </entityFieldLink> <entityFieldLink> - <name>1cdf9373-790e-47ae-a6ce-d7673cb8cdb2</name> - <entityField>participantCount</entityField> + <name>53123640-7524-426a-bb5c-16dab64cef76</name> + <entityField>remainingRuntime</entityField> </entityFieldLink> <entityFieldLink> <name>b689668f-1d48-4ff1-95d9-2e217547c853</name> diff --git a/neonView/CampaignStepMain_view/CampaignStepMain_view.aod b/neonView/CampaignStepMain_view/CampaignStepMain_view.aod index ba87160a9b109f44b7bcc99017b7c48ec0715d8d..0c083351809757f1e6c5e4a1395b279506d3a90e 100644 --- a/neonView/CampaignStepMain_view/CampaignStepMain_view.aod +++ b/neonView/CampaignStepMain_view/CampaignStepMain_view.aod @@ -29,5 +29,15 @@ <entityField>CampaignStepCosts</entityField> <view>CampaignCostExtendedFilter_view</view> </neonViewReference> + <neonViewReference> + <name>d99ab70c-2a08-408e-a665-1ef566c75650</name> + <entityField>Activities</entityField> + <view>ActivityFilter_view</view> + </neonViewReference> + <neonViewReference> + <name>4fd5e3cc-0696-4fc4-877b-440c0b6c2472</name> + <entityField>Tasks</entityField> + <view>TaskFilter_view</view> + </neonViewReference> </children> </neonView> diff --git a/neonView/CampaignStepParticipnatsPerStep_view/CampaignStepParticipnatsPerStep_view.aod b/neonView/CampaignStepParticipnatsPerStep_view/CampaignStepParticipnatsPerStep_view.aod new file mode 100644 index 0000000000000000000000000000000000000000..14cbf839e1a26fed98a124332c3fee57a6db2a07 --- /dev/null +++ b/neonView/CampaignStepParticipnatsPerStep_view/CampaignStepParticipnatsPerStep_view.aod @@ -0,0 +1,27 @@ +<?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.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.1"> + <name>CampaignStepParticipnatsPerStep_view</name> + <majorModelMode>DISTRIBUTED</majorModelMode> + <layout> + <noneLayout> + <name>layout</name> + </noneLayout> + </layout> + <children> + <titledListViewTemplate> + <name>ParticipantsPerStep</name> + <highlightingField>CurrentMaxParticipantsInfo</highlightingField> + <entityField>#ENTITY</entityField> + <columns> + <neonTableColumn> + <name>04ff1319-d06d-4738-a221-5755c016af70</name> + <entityField>NAME</entityField> + </neonTableColumn> + <neonTableColumn> + <name>4ea71a13-4108-47a5-9a28-2256618fdc2c</name> + <entityField>CurrentMaxParticipantsInfo</entityField> + </neonTableColumn> + </columns> + </titledListViewTemplate> + </children> +</neonView> diff --git a/neonView/CampaignStepPreview_view/CampaignStepPreview_view.aod b/neonView/CampaignStepPreview_view/CampaignStepPreview_view.aod index f3de7b97b364387b4ccc0e4782dcca1a011bf9c0..cd7903384570b3137e9860af17819761a704a9ab 100644 --- a/neonView/CampaignStepPreview_view/CampaignStepPreview_view.aod +++ b/neonView/CampaignStepPreview_view/CampaignStepPreview_view.aod @@ -15,11 +15,16 @@ <titleField>NAME</titleField> <subtitleField>STATE</subtitleField> <descriptionField>DESCRIPTION</descriptionField> + <favoriteAction1>newActivity</favoriteAction1> <entityField>#ENTITY</entityField> </cardViewTemplate> <genericViewTemplate> <name>CampaignStepInfosGeneric</name> + <editMode v="false" /> + <showDrawer v="true" /> + <drawerCaption></drawerCaption> <entityField>#ENTITY</entityField> + <title>Details</title> <fields> <entityFieldLink> <name>4cbf0232-1dab-47f9-b62a-b539d5035c53</name> @@ -29,12 +34,18 @@ <name>677875bc-6b50-4dd8-b8bf-eba5c0e94c56</name> <entityField>DATE_END</entityField> </entityFieldLink> + </fields> + </genericViewTemplate> + <genericViewTemplate> + <name>CampaignId</name> + <entityField>#ENTITY</entityField> + <fields> <entityFieldLink> - <name>a4dc1652-1c0c-4ca1-8f53-58e0b0c18177</name> + <name>cee78c4b-bbac-458a-ab1c-53734ea8c7f0</name> <entityField>CAMPAIGN_ID</entityField> </entityFieldLink> <entityFieldLink> - <name>1a30ddde-aaaf-43c5-ab4c-52581175ff12</name> + <name>0bffa6f8-cb18-47f8-a8f4-08cf9d718114</name> <entityField>CampaignStatus</entityField> </entityFieldLink> </fields> diff --git a/process/Campaign_lib/process.js b/process/Campaign_lib/process.js index d4932b0cc7df8f6d96b58e5e6588382503ed4d85..fc875f9b7770588efd2caf260adb7a5feae174b9 100644 --- a/process/Campaign_lib/process.js +++ b/process/Campaign_lib/process.js @@ -1,3 +1,4 @@ +import("system.translate"); import("system.logging"); import("system.vars"); import("system.db"); @@ -78,7 +79,7 @@ CampaignUtils.getParticipantCount = function(pCampaignId) let selectQuery = "select count(*) from CAMPAIGNPARTICIPANT"; let conditionField = "CAMPAIGNPARTICIPANT.CAMPAIGN_ID"; let defaultValue = 0; - + return _CampaignUtils._loadSingleValueFromDb(selectQuery, conditionField, pCampaignId, defaultValue); } @@ -102,7 +103,7 @@ CampaignUtils.getStepCount = function(pCampaignId) let selectQuery = "select count(*) from CAMPAIGNSTEP"; let conditionField = "CAMPAIGNSTEP.CAMPAIGN_ID"; let defaultValue = 0; - + return _CampaignUtils._loadSingleValueFromDb(selectQuery, conditionField, pCampaignId, defaultValue); } @@ -165,8 +166,7 @@ CampaignUtils.getDefaultCampaignStep = function(pCampaignId) { let selectQuery = "select CAMPAIGNSTEPID from CAMPAIGNSTEP " + "where CAMPAIGNSTEP.CAMPAIGN_ID = '" + pCampaignId + "' " + - "order by CAMPAIGNSTEP.SORTING asc " + - "fetch first 1 rows only"; + "order by CAMPAIGNSTEP.SORTING asc"; return db.cell(selectQuery) @@ -195,6 +195,15 @@ CampaignUtils.getCampaignEndDate = function(pCapmaignId) return db.cell(campaignIdCondition.buildSql("SELECT DATE_END, SORTING FROM CAMPAIGNSTEP", "1=2", "order by SORTING ASC FETCH FIRST 1 ROWS ONLY")); } +/** + * todo + */ +CampaignUtils.getMaxParticipantsValidationMessage = function() +{ + //todo how/where should this text be stored? + return translate.text("The max participants count has to be equal or greater than the count of the current participants!"); +} + /** * Methods for campaignmanagement. * Do not create an instance of this! diff --git a/process/Context_lib/process.js b/process/Context_lib/process.js index 12db5eafe807c4e4f6841f500d1ceda069e6e63a..39a53ff50e6a8ae0983da1ece4743bb30868f17e 100644 --- a/process/Context_lib/process.js +++ b/process/Context_lib/process.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.translate"); import("system.project"); import("system.vars"); @@ -383,11 +384,12 @@ ContextUtils.getSelectMap = function() maskingUtils.cast("CAMPAIGNSTEP.NAME", SQLTYPES.VARCHAR, 10) ], "", false)) .setContactIdField("CAMPAIGNPARTICIPANT.CONTACT_ID") - .setJoinExpression("join CAMPAIGNPARTICIPANT on CAMPAIGNPARTICIPANT.CAMPAIGN_ID = CAMPAIGN.CAMPAIGNID " + - "join CAMPAIGNSTEP on CAMPAIGNSTEP.CAMPAIGNSTEPID = CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID") + .setJoinExpression("left join CAMPAIGNPARTICIPANT on CAMPAIGNPARTICIPANT.CAMPAIGN_ID = CAMPAIGN.CAMPAIGNID " + + "left join CAMPAIGNSTEP on CAMPAIGNSTEP.CAMPAIGNSTEPID = CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID") .setCreationDateField("CAMPAIGNSTEP.DATE_START") .setStateField("CAMPAIGN.STATE") .setActiveStates(["e04c9c59-0590-463c-a10e-e25c583e9cf2", "42e1ee2b-0108-4ccf-ab43-29cbcb0377bf"]) + ,"CampaignStep" : ContextSelector.create("CAMPAIGNSTEP", "CAMPAIGNSTEPID", "NAME") } } diff --git a/process/Data_lib/process.js b/process/Data_lib/process.js index e6802ed44f10df422da714d12f634bafda9918e8..f6c7d2295ac9082b8a94fc01dcd6a3ba9e53322f 100644 --- a/process/Data_lib/process.js +++ b/process/Data_lib/process.js @@ -1,7 +1,7 @@ import("system.util"); /** - * This class is for data which is built in a children -> parent - way. Eich "row" consists of one UID and one parentId.<br> + * This class is for data which is built in a children -> parent - way. Each "row" consists of one UID and one parentId.<br> * The class makes sure that even if you add an child multiple times, the ID is corrected, so that the resulting array has only unique id's.<br> * <br> * Keep in mind for performance reasons that as soon, as you add a seccond item withe the same UID as an already added child, a tree-object is buiilt internally.<br>