Skip to content
Snippets Groups Projects
Commit 0f4117ba authored by David Büchler's avatar David Büchler
Browse files

Umbau des CampaignPlanning_entity.aod auf einen JditoRecordContainer

Anpassung des CampaignPlanning_entity.aod darauf, dass die korrekten Previes angezeigt werden
Anpassung, dass beim neuen Erstellen einer Stufe in der KampagnenPlanung die KampagnenId immer mitgegeben wird
Einfügen eines Flags das steuert, ob Root-Elemente im Gantt als normaler Step oder als Gruppierungselement behandelt werden sollen
Vorbereitung auf Löschen von Kampagne und Stufe im CampaignPlanning_entity.aod, Funktionen in der Campaign_lib müssen noch erstellt werden.
parent 46f0000f
No related branches found
No related tags found
No related merge requests found
Showing with 136 additions and 20 deletions
<?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.5" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.5">
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.6" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.6">
<name>CampaignPlanning_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<icon>NEON:GROUP_APPOINTMENT</icon>
<title>Campaign planning</title>
<recordContainer>recordContainer</recordContainer>
<recordContainer>jditoRecordContainer</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
<targetContextField>targetContext</targetContextField>
<targetIdField>UID</targetIdField>
</entityProvider>
<entityField>
<name>DATE_START</name>
......@@ -19,10 +21,6 @@
<title>End date</title>
<contentType>DATE</contentType>
</entityField>
<entityField>
<name>STEP_NAME</name>
<title>Step name</title>
</entityField>
<entityField>
<name>STEP_DESCRIPTION</name>
<searchable v="false" />
......@@ -41,10 +39,6 @@
<title>Campaign</title>
<searchable v="false" />
</entityField>
<entityField>
<name>CAMPAIGN_NAME</name>
<title>Campaign name</title>
</entityField>
<entityActionGroup>
<name>NewGanttEntries</name>
<title>New module</title>
......@@ -52,20 +46,29 @@
<children>
<entityActionField>
<name>CreateNewCampaign_action</name>
<fieldType>ACTION</fieldType>
<title>New campaign</title>
<onActionProcess>%aditoprj%/entity/CampaignPlanning_entity/entityfields/newganttentries/children/createnewcampaign_action/onActionProcess.js</onActionProcess>
<iconId>NEON:GROUP_APPOINTMENT</iconId>
</entityActionField>
<entityActionField>
<name>CreateNewCampaignStep_action</name>
<fieldType>ACTION</fieldType>
<title>New campaign step</title>
<onActionProcess>%aditoprj%/entity/CampaignPlanning_entity/entityfields/newganttentries/children/createnewcampaignstep_action/onActionProcess.js</onActionProcess>
<iconId>NEON:GROUP_APPOINTMENT</iconId>
</entityActionField>
</children>
</entityActionGroup>
<entityField>
<name>targetContext</name>
<valueProcess>%aditoprj%/entity/CampaignPlanning_entity/entityfields/targetcontext/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>UID</name>
<title>UID</title>
</entityField>
<entityField>
<name>NAME</name>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......@@ -124,5 +127,21 @@
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
<jDitoRecordContainer>
<name>jditoRecordContainer</name>
<jDitoRecordAlias>Data_alias</jDitoRecordAlias>
<contentProcess>%aditoprj%/entity/CampaignPlanning_entity/recordcontainers/jditorecordcontainer/contentProcess.js</contentProcess>
<onDelete>%aditoprj%/entity/CampaignPlanning_entity/recordcontainers/jditorecordcontainer/onDelete.js</onDelete>
<recordFields>
<element>UID.value</element>
<element>NAME.value</element>
<element>PREDECESSOR_STEP_ID.value</element>
<element>STEP_DESCRIPTION.value</element>
<element>DATE_START.value</element>
<element>DATE_END.value</element>
<element>CAMPAIGN_ID.value</element>
<element>targetContext.value</element>
</recordFields>
</jDitoRecordContainer>
</recordContainers>
</entity>
......@@ -2,5 +2,4 @@ import("system.neon");
import("system.vars");
import("Campaign_lib");
CampaignUtils.openNewCampaignView();
neon.refreshAll();
\ No newline at end of file
CampaignUtils.openNewCampaignView();
\ No newline at end of file
import("Campaign_lib");
import("system.vars");
import("system.logging");
var campaignId = "";
var selectedElement = vars.get("$sys.selectionRows");
......
import("system.util");
import("system.db");
import("system.result");
import("system.vars");
var UID = 0;
var CAMPAIGNNAME = 1;
var PREDECESSORSTEP_ID = 2;
var CAMPAIGNID = 6;
var TARGET_CONTEXT_ROOT_ELEMENT = "Campaign";
var TARGET_CONTEXT_ELEMENT = "CampaignStep";
var resultRay = [];
var campaignsQuery = "select CAMPAIGNID, CAMPAIGN.\"NAME\""
+ "from CAMPAIGN ";
var stepsQuery = "select CAMPAIGNSTEPID, CAMPAIGNSTEP.\"NAME\", CAMPAIGNSTEP.PREDECESSORSTEP_ID,"
+ " CAMPAIGNSTEP.DESCRIPTION, CAMPAIGNSTEP.DATE_START, CAMPAIGNSTEP.DATE_END, CAMPAIGNID"
+ " from CAMPAIGN"
+ " join CAMPAIGNSTEP on CAMPAIGN.CAMPAIGNID = CAMPAIGNSTEP.CAMPAIGN_ID order by SORTING"
var campaignsRows = db.table(campaignsQuery);
var stepsRows = db.table(stepsQuery);
//First add all Campaign Rows to the resultRay. These are the Root Rows in the Treetable
for (var campaignRowIndex in campaignsRows)
{
let campaignRow = campaignsRows[campaignRowIndex];
resultRay.push([campaignRow[UID], campaignRow[CAMPAIGNNAME], null, null, null, null, campaignRow[UID], TARGET_CONTEXT_ROOT_ELEMENT]);
}
/*
* Then, add all CampaignStep Rows. If a StepRow has no Predecessor it has to be connected to the
* respective CampaignRow which is at the Root Level. The target context gets added at the end of
* the array.
*/
for (var currentRowIndex in stepsRows)
{
let currentRow = stepsRows[currentRowIndex];
if(currentRow[PREDECESSORSTEP_ID] == "")
currentRow[PREDECESSORSTEP_ID] = currentRow[CAMPAIGNID];
//Add the TargetContext
currentRow.splice(currentRow.length, 0, TARGET_CONTEXT_ELEMENT);
resultRay.push(currentRow);
}
result.object(resultRay);
\ No newline at end of file
import("system.vars");
import("system.logging");
import("Campaign_lib");
logging.log(" in onDelete -> ");
var selectedRows = vars.get("$sys.selectionRows");
if(selectedElement.length > 0)
{
if(selectedElement[0].targetContext == "CampaignStep")
CampaignUtils.deleteCampaignStepData(selectedElement[0].UID);
else
CampaignUtils.deleteCampaignData(selectedElement[0].UID);
}
\ No newline at end of file
......@@ -316,6 +316,11 @@
<textInputAllowed v="true" />
<stateProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/predecessorstep_id/stateProcess.js</stateProcess>
<displayValueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/predecessorstep_id/displayValueProcess.js</displayValueProcess>
<onValueChangeTypes>
<element>MASK</element>
<element>PROCESS</element>
<element>PROCESS_SETVALUE</element>
</onValueChangeTypes>
</entityField>
<entityConsumer>
<name>CampaignStepsConsumer</name>
......
......@@ -14,16 +14,15 @@
<name>CampaignPlanningGantt</name>
<beginDateField>DATE_START</beginDateField>
<endDateField>DATE_END</endDateField>
<titleField>STEP_NAME</titleField>
<titleField>NAME</titleField>
<descriptionField>STEP_DESCRIPTION</descriptionField>
<uidField>STEP_ID</uidField>
<uidField>UID</uidField>
<stepPredecessorIdField>PREDECESSOR_STEP_ID</stepPredecessorIdField>
<groupedProjectIdField>CAMPAIGN_ID</groupedProjectIdField>
<groupedProjectNameField>CAMPAIGN_NAME</groupedProjectNameField>
<displayRootElementsAsGroupHeaders v="true" />
<favoriteActionGroup2>NewGanttEntries</favoriteActionGroup2>
<entityField>#ENTITY</entityField>
<isCreatable v="true" />
<isEditable v="true" />
<isEditable v="false" />
<isDeletable v="true" />
<title></title>
</ganttViewTemplate>
......
......@@ -17,6 +17,7 @@
<descriptionField>DESCRIPTION</descriptionField>
<uidField>CAMPAIGNSTEPID</uidField>
<stepPredecessorIdField>PREDECESSORSTEP_ID</stepPredecessorIdField>
<displayRootElementsAsGroupHeaders v="false" />
<entityField>#ENTITY</entityField>
<isCreatable v="true" />
<isEditable v="true" />
......
......@@ -226,6 +226,36 @@ CampaignUtils.getMaxParticipantsValidationMessage = function()
return translate.text("The max participants count has to be equal or greater than the count of the current participants!");
}
/**
* todo
*/
CampaignUtils.deleteCampaignStepData = function(pCampaignStepId)
{
//todo
/*
* delete:
* step
* reference to step in other steps
* all log entries regarding this step
* all participants in this step
* all costs in this step
*/
}
/**
* todo
*/
CampaignUtils.deleteCampaignData = function(pCampaignId)
{
//todo
/*
* delete:
* steps with function deleteCampaignStepData
* all members
* campaign itself
*/
}
/**
* Methods for campaignmanagement.
* Do not create an instance of this!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment