Skip to content
Snippets Groups Projects
Commit d4e65b44 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

merged origin/2020.2.0 into 2020.2

parents 83fa304f 4c99abbc
No related branches found
No related tags found
No related merge requests found
......@@ -19,10 +19,10 @@ var colNamesCampaignParticipantLog = CampaignUtils.getParticipantLogInsertColumn
if(participantRowIds != null && participantRowIds.length > 0)
{
let contactIdsToHandle = participantRowIds;
var contactIdsToHandle = participantRowIds;
if(isUpdate == "false")
contactIdsToHandle = vars.get("$field.campaignparticipantContactIds");
contactIdsToHandle = JSON.parse(vars.get("$field.campaignparticipantContactIds"));
_handleRowIds(contactIdsToHandle, campaignId);
}
......@@ -37,13 +37,13 @@ if (!vars.exists("$param.currentCampaignId_param") || !vars.get("$param.currentC
function _handleCondition(pCampaignId, pTargetTableName, pCondition)
{
let contactIdsToHandle = [];
var contactIdsToHandle = [];
var contextComingFrom = "Person";
let useRightJoinToGetOrgs = "false";
if(pTargetTableName == "ORGANISATION")
{
useRightJoinToGetOrgs = "true";
pCondition += " and PERSON.PERSONID is NULL"
pCondition += " and PERSON.PERSONID is NULL";
contextComingFrom = "Organisation";
}
/*
......@@ -55,10 +55,10 @@ function _handleCondition(pCampaignId, pTargetTableName, pCondition)
*/
if(isUpdate == "true")
{
contactIdsToHandle = CampaignUtils.GetContactIdsInCampaignByCondition(pCampaignId, pCondition, useRightJoinToGetOrgs)
contactIdsToHandle = CampaignUtils.GetContactIdsInCampaignByCondition(pCampaignId, pCondition);
}
else
contactIdsToHandle = CampaignUtils.GetContactIdsNotInCampaignByCondition(pCampaignId, pCondition, useRightJoinToGetOrgs);
contactIdsToHandle = CampaignUtils.GetContactIdsNotInCampaignByCondition(pCampaignId, pCondition, contextComingFrom);
_handleRowIds(contactIdsToHandle, pCampaignId);
}
......@@ -75,7 +75,7 @@ function _handleRowIds(pParticipantRowIds, pCampaignId)
"DATE_EDIT"
];
let oldSteps = newSelect("CAMPAIGNPARTICIPANTID, CAMPAIGNSTEP_ID")
var oldSteps = newSelect("CAMPAIGNPARTICIPANTID, CAMPAIGNSTEP_ID")
.from("CAMPAIGNPARTICIPANT")
.whereIfSet("CAMPAIGNPARTICIPANT.CONTACT_ID", pParticipantRowIds, SqlBuilder.IN())
.and("CAMPAIGNPARTICIPANT.CAMPAIGN_ID", pCampaignId)
......@@ -98,28 +98,28 @@ function _handleRowIds(pParticipantRowIds, pCampaignId)
];
}
let statementArray = [];
let logArray = [];
var statementArray = [];
var logArray = [];
for (let participant in pParticipantRowIds)
for (var participant in pParticipantRowIds)
{
let campaignParticipantLogId = util.getNewUUID();
var campaignParticipantLogId = util.getNewUUID();
var valsCampaignParticipantLog;
if(isUpdate == "true")
{
let oldCampaignStepId = oldStepIds[pParticipantRowIds[participant]] || "";
var oldCampaignStepId = oldStepIds[pParticipantRowIds[participant]] || "";
let updatedValues = [
var updatedValues = [
newCampaignStepId,
vars.get("$sys.user"),
vars.get("$sys.date")
];
let condition = newWhere("CAMPAIGNPARTICIPANT.CONTACT_ID", pParticipantRowIds[participant])
var condition = newWhere("CAMPAIGNPARTICIPANT.CONTACT_ID", pParticipantRowIds[participant])
.and("CAMPAIGNPARTICIPANT.CAMPAIGN_ID", pCampaignId)
.or("CAMPAIGNPARTICIPANT.CAMPAIGNPARTICIPANTID", pParticipantRowIds[participant]);
let valsCampaignParticipantLog = [
valsCampaignParticipantLog = [
campaignParticipantLogId,
campaignId,
newCampaignStepId,
......@@ -134,9 +134,9 @@ function _handleRowIds(pParticipantRowIds, pCampaignId)
}
else
{
let campaignParticipantId = util.getNewUUID();
var campaignParticipantId = util.getNewUUID();
let valsCampaignParticipant = [
var valsCampaignParticipant = [
campaignParticipantId,
pParticipantRowIds[participant],
campaignId,
......@@ -145,7 +145,7 @@ function _handleRowIds(pParticipantRowIds, pCampaignId)
vars.get("$sys.date")
];
let valsCampaignParticipantLog = [
valsCampaignParticipantLog = [
campaignParticipantLogId,
campaignId,
newCampaignStepId,
......@@ -169,6 +169,4 @@ function _handleRowIds(pParticipantRowIds, pCampaignId)
if(logArray.length > 0)
db.inserts(logArray);
neon.refreshAll();
}
\ No newline at end of file
......@@ -5,4 +5,11 @@ import("system.vars");
if (vars.get("$sys.validationerrors"))
result.string(neon.COMPONENTSTATE_DISABLED);
else
result.string(neon.COMPONENTSTATE_EDITABLE);
\ No newline at end of file
{
var contactCount = JSON.parse(vars.get("$field.campaignparticipantContactIds")).length;
if (contactCount == 0)
result.string(neon.COMPONENTSTATE_DISABLED);
else
result.string(neon.COMPONENTSTATE_EDITABLE);
}
\ No newline at end of file
......@@ -22,15 +22,17 @@ if(vars.get("$field.CAMPAIGN_ID"))
else if(comingfrom == "Person")
filteredContactIds = FilterViewActionUtils.contactIdsFilter(selection)
contactIds = CampaignUtils.GetContactIdsNotInCampaignByCondition(vars.get("$field.CAMPAIGN_ID"), selection);
contactIds = CampaignUtils.GetContactIdsNotInCampaignByCondition(vars.get("$field.CAMPAIGN_ID"), selection, comingfrom);
}
else if(isUpdate)
{
if (vars.get("$param.campaignParticipantsCondition_param"))
{
contactIds = CampaignUtils.GetContactIdsInCampaignByCondition(vars.get("$field.CAMPAIGN_ID"), JSON.parse(vars.get("$param.campaignParticipantsCondition_param")).condition, false);
} else{
var contactFilterCondition = JSON.parse(vars.get("$param.campaignParticipantsCondition_param")).condition;
contactIds = CampaignUtils.GetContactIdsNotInCampaignByCondition(vars.get("$field.CAMPAIGN_ID"), contactFilterCondition, comingfrom);
}
else
{
contactIds = selection;
}
}
......
......@@ -1293,13 +1293,17 @@
</aggregateFieldDbMapping>
<aggregateFieldDbMapping>
<name>COUNT_aggregate.value</name>
<recordfield>OFFER.OFFER_ID</recordfield>
<recordfield>OFFER.OFFERID</recordfield>
<aggregateType>COUNT</aggregateType>
</aggregateFieldDbMapping>
<aggregateFieldDbMapping>
<name>PROBABILITY_aggregate.value</name>
<expression>%aditoprj%/entity/Offer_entity/recordcontainers/db/recordfieldmappings/probability_aggregate.value/expression.js</expression>
</aggregateFieldDbMapping>
<dbRecordFieldMapping>
<name>OFFER_ID.value</name>
<recordfield>OFFER.OFFER_ID</recordfield>
</dbRecordFieldMapping>
</recordFieldMappings>
<filterExtensions>
<filterExtensionSet>
......
......@@ -7272,6 +7272,18 @@
<entry>
<key>Mailbridge failed: user '%0' is unknown, contact an administrator.</key>
</entry>
<entry>
<key>Count Chart</key>
</entry>
<entry>
<key>Sum Chart</key>
</entry>
<entry>
<key>Probability Chart</key>
</entry>
<entry>
<key>Probability in %</key>
</entry>
</keyValueMap>
<font name="Dialog" style="0" size="11" />
<sqlModels>
......
......@@ -9646,6 +9646,22 @@ Bitte Datumseingabe prüfen</value>
<key>Mailbridge failed: user '%0' is unknown, contact an administrator.</key>
<value>Mailbridge fehlgeschlagen: Benutzer '%0' ist unbekannt, kontaktieren sie einen Administrator.</value>
</entry>
<entry>
<key>Count Chart</key>
<value>Anzahl Diagramm</value>
</entry>
<entry>
<key>Sum Chart</key>
<value>Summen Diagramm</value>
</entry>
<entry>
<key>Probability Chart</key>
<value>Wahrscheinlichkeit Diagramm</value>
</entry>
<entry>
<key>Probability in %</key>
<value>Wahrscheinlichkeit in %</value>
</entry>
</keyValueMap>
<font name="Dialog" style="0" size="11" />
</language>
......@@ -7353,6 +7353,18 @@
<entry>
<key>Mailbridge failed: user '%0' is unknown, contact an administrator.</key>
</entry>
<entry>
<key>Count Chart</key>
</entry>
<entry>
<key>Sum Chart</key>
</entry>
<entry>
<key>Probability Chart</key>
</entry>
<entry>
<key>Probability in %</key>
</entry>
</keyValueMap>
<font name="Dialog" style="0" size="11" />
</language>
......@@ -140,7 +140,12 @@
<name>DynamicMultiDataChartCount</name>
<chartType>COLUMN</chartType>
<yAxisLabel>Count</yAxisLabel>
<shareParent v="false" />
<entityField>#ENTITY</entityField>
<defaultGroupFields>
<element>STATUS</element>
</defaultGroupFields>
<title>Count Chart</title>
<columns>
<neonDynamicMultiDataChartColumn>
<name>4bbc9650-47fd-4a59-8e1e-bb60ceb85795</name>
......@@ -153,7 +158,12 @@
<name>DynamicMultiDataChartSum</name>
<chartType>COLUMN</chartType>
<yAxisLabel>Total in euros</yAxisLabel>
<shareParent v="false" />
<entityField>#ENTITY</entityField>
<defaultGroupFields>
<element>STATUS</element>
</defaultGroupFields>
<title>Sum Chart</title>
<columns>
<neonDynamicMultiDataChartColumn>
<name>e5d14506-5205-43d0-89cb-416bf6debd25</name>
......@@ -162,5 +172,23 @@
</neonDynamicMultiDataChartColumn>
</columns>
</dynamicMultiDataChartViewTemplate>
<dynamicMultiDataChartViewTemplate>
<name>DynamicMultiDataChartProb</name>
<chartType>COLUMN</chartType>
<yAxisLabel>Probability in %</yAxisLabel>
<shareParent v="false" />
<entityField>#ENTITY</entityField>
<defaultGroupFields>
<element>STATUS</element>
</defaultGroupFields>
<title>Probability Chart</title>
<columns>
<neonDynamicMultiDataChartColumn>
<name>e5d14506-5205-43d0-89cb-416bf6debd25</name>
<entityField>PROBABILITY</entityField>
<aggregateEntityField>PROBABILITY_aggregate</aggregateEntityField>
</neonDynamicMultiDataChartColumn>
</columns>
</dynamicMultiDataChartViewTemplate>
</children>
</neonView>
......@@ -520,37 +520,39 @@ CampaignUtils.GetContactIdsNotInCampaignByRowIds = function(pCampaignId, pPartic
* @param {String} pCampaignId <p>
* The id of the campaign.<br>
* @param {String} pCondition (optional) <p>
* An condition which could used to<br>
* limit the search result.<br>
* @param {Boolean} pRightJoinContacts <p>
* Case if its true, a prefix will used<br>
* to do a right join.<br>
* An condition which is used to limit the search contact results.<br>
* @param {String} [pOrigin=Organisation] <br/>
* id from which context we are coming from, e.g. "Person"
* @return {String[]} <p>
* The contact ids they arent in the campaign.<br>
*/
CampaignUtils.GetContactIdsNotInCampaignByCondition = function(pCampaignId, pCondition, pRightJoinContacts)
CampaignUtils.GetContactIdsNotInCampaignByCondition = function(pCampaignId, pCondition, pOrigin)
{
let query = newSelect("CONTACT.CONTACTID").from("PERSON");
var origin = pOrigin || "Organisation";
//subselect for excluding entries that are already in the campaign
var subselect = newSelect("CAMPAIGNPARTICIPANT.CONTACT_ID")
.from("CAMPAIGNPARTICIPANT")
.where("CAMPAIGNPARTICIPANT.CAMPAIGN_ID", pCampaignId);
if (pRightJoinContacts == "true")
query.rightJoin("CONTACT", "CONTACT.PERSON_ID = PERSON.PERSONID");
else
query.join("CONTACT", "CONTACT.PERSON_ID = PERSON.PERSONID");
if(pCondition != "")
subselect = newSelect("CAMPAIGNPARTICIPANT.CONTACT_ID")
.from("CAMPAIGNPARTICIPANT")
.where(pCondition);
.from("CAMPAIGNPARTICIPANT")
.where("CAMPAIGNPARTICIPANT.CAMPAIGN_ID", pCampaignId);
var query = newSelect("CONTACT.CONTACTID")
.from("CONTACT");
if (origin == "Person")
query.leftJoin("PERSON", "CONTACT.PERSON_ID = PERSON.PERSONID");
query.join("ORGANISATION", "ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID")
.leftJoin("ADDRESS", "ADDRESS.ADDRESSID = CONTACT.ADDRESS_ID")
.where("CONTACT.CONTACTID",
subselect
, SqlBuilder.NOT_IN()
);
if (origin == "Organisation")
query.and("CONTACT.PERSON_ID is null");
//pCondition is always a contact related condition string and not a campaignparticipant related condition
if(pCondition != "")
query.and(pCondition);
return query.arrayColumn();
}
......@@ -564,14 +566,11 @@ CampaignUtils.GetContactIdsNotInCampaignByCondition = function(pCampaignId, pCon
* @param {String} pCondition <p>
* The condition which shall be used, to<br>
* limit the search result.<br>
* @param {Boolean} [pRightJoinContacts=false] <p>
* Currently not used.<br>
* <p>
* @return {String[]} <p>
* The contact ids which are in the given<br>
* campaign.<br>
*/
CampaignUtils.GetContactIdsInCampaignByCondition = function(pCampaignId, pCondition, pRightJoinContacts)
CampaignUtils.GetContactIdsInCampaignByCondition = function(pCampaignId, pCondition)
{
let query = newSelect("CONTACT.CONTACTID").from("CONTACT");
......
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