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

Der Kampagnenstatus wird nun im Kampagnenschritt angezeigt

Im Firmen View kann nun die selektion als Serienaktion zur Kampagne hinzugefügt werden
Einzelne Firmen können nun über das Firmen Preview zu einer Kampagne hinzugefügt werden
parent 4e53b794
No related branches found
No related tags found
No related merge requests found
Showing
with 106 additions and 16 deletions
......@@ -168,8 +168,15 @@
<entityField>
<name>CurrentMaxParticipantsInfo</name>
<title>Participants</title>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/currentmaxparticipantsinfo/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>CampaignStatus</name>
<title>Campaign status</title>
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/CampaignStep_entity/entityfields/campaignstatus/valueProcess.js</valueProcess>
</entityField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.result");
import("system.vars");
import("Campaign_lib");
let campaignId = vars.get("$field.CAMPAIGN_ID");
result.string(CampaignUtils.getCampaignStatusByCampaignId(campaignId))
\ No newline at end of file
......@@ -782,6 +782,30 @@
<searchable v="false" />
<valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/date_new_contact/valueProcess.js</valueProcess>
</entityField>
<entityActionGroup>
<name>campaignActionGroup</name>
<children>
<entityActionField>
<name>addToCampaignFromTable</name>
<fieldType>ACTION</fieldType>
<title>Add to Campaign</title>
<onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/onActionProcess.js</onActionProcess>
<isObjectAction v="false" />
<isSelectionAction v="true" />
<iconId>NEON:GROUP_APPOINTMENT</iconId>
<tooltip>Add the selection to a campaign</tooltip>
<tooltipProcess>%aditoprj%/entity/Organisation_entity/entityfields/campaignactiongroup/children/addtocampaignfromtable/tooltipProcess.js</tooltipProcess>
</entityActionField>
</children>
</entityActionGroup>
<entityActionField>
<name>addToCampaign</name>
<fieldType>ACTION</fieldType>
<title>Add to Campaign</title>
<onActionProcess>%aditoprj%/entity/Organisation_entity/entityfields/addtocampaign/onActionProcess.js</onActionProcess>
<iconId>NEON:GROUP_APPOINTMENT</iconId>
<tooltip>Choose a campaign and a step to add the contact to a campaign</tooltip>
</entityActionField>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.vars");
import("Campaign_lib");
CampaignUtils.addParticipant(vars.getString("$field.CONTACTID"));
\ No newline at end of file
import("system.vars");
import("system.logging");
import("system.logging");
import("system.neon");
import("Campaign_lib");
if(vars.exists("$sys.selection")) //selektierte IDs als Array
{
CampaignUtils.addParticipants(vars.getString("$sys.selection"));
}
\ No newline at end of file
import("system.translate");
import("system.result");
result.string(translate.text("Add the selection to a campaign"));
\ No newline at end of file
......@@ -798,6 +798,7 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
<title>Add to Campaign</title>
<onActionProcess>%aditoprj%/entity/Person_entity/entityfields/addtocampaign/onActionProcess.js</onActionProcess>
<actionOrder v="1" />
<iconId>NEON:GROUP_APPOINTMENT</iconId>
<tooltip>Choose a campaign and a step to add the contact to a campaign</tooltip>
</entityActionField>
<entityConsumer>
......
......@@ -30,6 +30,10 @@
<name>1d6cc036-f0db-445f-a614-565a4c509933</name>
<entityField>CurrentMaxParticipantsInfo</entityField>
</entityFieldLink>
<entityFieldLink>
<name>88fbd366-0107-44b7-8d9c-f4fee89c0637</name>
<entityField>CampaignStatus</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
</children>
......
......@@ -32,6 +32,7 @@
<children>
<tableViewTemplate>
<name>Organisations</name>
<favoriteActionGroup1>campaignActionGroup</favoriteActionGroup1>
<entityField>#ENTITY</entityField>
<columns>
<neonTableColumn>
......
import("system.db");
import("system.neon");
import("Sql_lib");
import("Keyword_lib");
import("KeywordRegistry_basic");
/**
* Methods for campaignmanagement.
......@@ -30,28 +32,42 @@ CampaignUtils.addParticipants = function(pRowIds)
_CampaignUtils._openAddParticipantContext("CampaignAddParticipants", pRowIds, "campaignParticipants_param", "CampaignAddParticipantsEdit_view");
}
/**
* todo
*/
CampaignUtils.getCampaignNameById = function(pCampaignId)
{
let name = "";
if (pCampaignId)
{
name = db.cell(SqlCondition.begin()
.andPrepare("CAMPAIGN.CAMPAIGNID", pCampaignId)
.buildSql("select CAMPAIGN.NAME from CAMPAIGN"));
}
return name;
let selectQuery = "select CAMPAIGN.NAME from CAMPAIGN";
let conditionField = "CAMPAIGN.CAMPAIGNID";
let defaultValue = "";
return _CampaignUtils._loadSingleValueFromDb(selectQuery, conditionField, pCampaignId, defaultValue);
}
/**
* todo
*/
CampaignUtils.getParticipantCountForStep = function(pCampaignStepId)
{
let count = 0;
if (pCampaignStepId)
{
count = db.cell(SqlCondition.begin()
.andPrepare("CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID", pCampaignStepId)
.buildSql("select count(*) from CAMPAIGNPARTICIPANT"));
}
return count;
let selectQuery = "select count(*) from CAMPAIGNPARTICIPANT";
let conditionField = "CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID";
let defaultValue = 0;
return _CampaignUtils._loadSingleValueFromDb(selectQuery, conditionField, pCampaignStepId, defaultValue);
}
/**
* todo
*/
CampaignUtils.getCampaignStatusByCampaignId = function(pCampaignId)
{
let selectQuery = "select CAMPAIGN.STATE from CAMPAIGN";
let conditionField = "CAMPAIGN.CAMPAIGNID";
let defaultValue = "";
let campaignState = $KeywordRegistry.campaignState();
let statusId = _CampaignUtils._loadSingleValueFromDb(selectQuery, conditionField, pCampaignId, defaultValue);
return KeywordUtils.getViewValue(campaignState, statusId);
}
/**
......@@ -84,6 +100,18 @@ _CampaignUtils._openAddParticipantContext = function(pContext, pRowIds, pEntityP
neon.openContext(pContext, pView, null, neon.OPERATINGSTATE_NEW, params);
}
_CampaignUtils._loadSingleValueFromDb = function(pSelectQuery, pConditionField, pConditionValue, pDefaultValue)
{
let res = pDefaultValue;
if (pConditionValue)
{
res = db.cell(SqlCondition.begin()
.andPrepare(pConditionField, pConditionValue)
.buildSql(pSelectQuery));
}
return res;
}
/**
* todo
*/
......
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