Skip to content
Snippets Groups Projects
Commit ea0b9c90 authored by Sophia Leierseder's avatar Sophia Leierseder
Browse files

improvement icon comm restriction

parent e30e6a75
No related branches found
No related tags found
No related merge requests found
import("system.result");
import("Sql_lib");
import("system.db");
import("system.logging");
import("system.vars");
import("system.neon");
import("system.result");
var stepmedium = db.cell(SqlCondition.begin()
.andPrepareVars("CAMPAIGNSTEP.CAMPAIGNSTEPID", "$field.CAMPAIGNSTEP_ID")
.buildSql("select STEPMEDIUM from CAMPAIGNSTEP", "1=2"));
import("Campaign_lib");
//var commrescolor = CampaignUtils.checkforCommRestrictions();
var commres = db.cell(SqlCondition.begin()
.andPrepareVars("COMMRESTRICTION.CONTACT_ID", "$field.CONTACT_ID")
.andPrepareVars("COMMRESTRICTION.MEDIUM", stepmedium)
.buildSql("select MEDIUM from COMMRESTRICTION", "1=2"));
.andPrepareVars("CAMPAIGNSTEP.CAMPAIGNSTEPID", "$field.CAMPAIGNSTEP_ID")
.buildSql("select MEDIUM from CAMPAIGNSTEP join COMMRESTRICTION on MEDIUM = STEPMEDIUM", "1=2"));
if(commres)
{
result.string(neon.PRIORITY_HIGH_COLOR);
......
import("system.logging");
import("system.result");
import("KeywordRegistry_basic");
import("Keyword_lib");
import("system.result");
import("Sql_lib");
import("system.logging");
import("system.vars");
import("system.db");
import("Campaign_lib");
//var contact = vars.get("$field.CONTACT_ID");
var stepmedium = db.cell(SqlCondition.begin()
.andPrepareVars("CAMPAIGNSTEP.CAMPAIGNSTEPID", "$field.CAMPAIGNSTEP_ID")
.buildSql("select STEPMEDIUM from CAMPAIGNSTEP", "1=2"));
//logging.log(stepmedium.toSource());
// commres is an array with all the keyword-IDs from a contacts comm restrictions
var commres = db.table(SqlCondition.begin()
.andPrepareVars("COMMRESTRICTION.CONTACT_ID", "$field.CONTACT_ID")
.andPrepareVars("COMMRESTRICTION.MEDIUM", stepmedium)
.buildSql("select MEDIUM from COMMRESTRICTION", "1=2"));
//logging.log(commres.toSource());
var med;
var ban;
for(var i = 0; i < commres.length; i++)
var commres = CampaignUtils.checkforCommRestrictions();
if(commres)
{
if(commres[i] == stepmedium)
{
med = stepmedium
}
}
if(med)
{
var keywordAttributes = KeywordUtils.getAttributeRelationsByKey(stepmedium, $KeywordRegistry.communicationMediumCampaign())
ban = keywordAttributes.AdvertisingBanIcon;
var keywordAttributes = KeywordUtils.getAttributeRelationsByKey(commres, $KeywordRegistry.communicationMediumCampaign())
result.string(keywordAttributes.AdvertisingBanIcon);
}
else
{
ban = "VAADIN:CHECK";
}
result.string(ban)
result.string("VAADIN:CHECK");
}
\ No newline at end of file
......@@ -301,6 +301,14 @@ CampaignUtils.updateCampaignStep = function(pCampaignStepId, pDateStart, pDateEn
db.updateData("CAMPAIGNSTEP", columnsToUpdate, null, newValues, campaignStepIdCondition)
}
CampaignUtils.checkforCommRestrictions = function()
{
return db.cell(SqlCondition.begin()
.andPrepareVars("COMMRESTRICTION.CONTACT_ID", "$field.CONTACT_ID")
.andPrepareVars("CAMPAIGNSTEP.CAMPAIGNSTEPID", "$field.CAMPAIGNSTEP_ID")
.buildSql("select MEDIUM from CAMPAIGNSTEP join COMMRESTRICTION on MEDIUM = STEPMEDIUM", "1=2"));
}
/**
......
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