Skip to content
Snippets Groups Projects
Commit 61368136 authored by Robert Loipfinger's avatar Robert Loipfinger
Browse files

Kommunikationsdaten für Personen repariert

parent 5dd4789a
No related branches found
No related tags found
No related merge requests found
import("system.text");
import("system.result");
import("system.vars");
import("Sql_lib");
import("Keyword_lib");
var cond, relId, mediumCategories, keywordUtil;
cond = "";
if(vars.exists("$param.RelId_param") && (relId = vars.get("$param.RelId_param")) != null){
cond += " and COMM.RELATION_ID in ('" + relId + "')";//TODO: quoting/prevent sql-injection
}
if (vars.exists("$param.MediumCategoriesFilter_param") && (mediumCategories = vars.get("$param.MediumCategoriesFilter_param")) != null){
mediumCategories = text.decodeMS(mediumCategories);
keywordUtil = new KeywordUtils();
var kwd = keywordUtil.createKeyword("COMM.MEDIUM");
kwd.filter(function(id, name, customs){
return mediumCategories.indexOf(customs.category) > -1;
});
mediumIds = kwd.toArray("id");
if (mediumIds.length == 0)
throw new Error();//TODO: add message
cond += " and COMM.MEDIUM_ID in (" + mediumIds.join(", ") + ")";
}
import("system.logging");
import("system.text");
import("system.result");
import("system.vars");
import("Sql_lib");
import("Keyword_lib");
var cond, relId, mediumCategories, keywordUtil;
cond = "";
if(vars.exists("$param.RelId_param")){
relId = vars.get("$param.RelId_param");
if (relId != null && relId != "" && relId != undefined)
{
cond += " and COMM.RELATION_ID in ('" + relId + "')";//TODO: quoting/prevent sql-injection
}
}
if (vars.exists("$param.MediumCategoriesFilter_param")){
mediumCategories = vars.get("$param.MediumCategoriesFilter_param");
if (mediumCategories != null && mediumCategories != "" && mediumCategories != undefined)
{
mediumCategories = text.decodeMS(mediumCategories);
keywordUtil = new KeywordUtils();
var kwd = keywordUtil.createKeyword("COMM.MEDIUM");
kwd.filter(function(id, name, customs){
return mediumCategories.indexOf(customs.category) > -1;
});
mediumIds = kwd.toArray("id");
if (mediumIds.length == 0)
throw new Error();//TODO: add message
cond += " and COMM.MEDIUM_ID in (" + mediumIds.join(", ") + ")";
}
}
result.string(cond ? "1 = 1 " + cond: "1 = 2");
\ No newline at end of file
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