Skip to content
Snippets Groups Projects
Commit 0a17d3d3 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

fix support ticket behaviour if status whitelist is empty

parent 9b74c175
No related branches found
No related tags found
No related merge requests found
...@@ -10,13 +10,18 @@ if (vars.get("$param.OnlyActives_param") == "true") ...@@ -10,13 +10,18 @@ if (vars.get("$param.OnlyActives_param") == "true")
cond.and("AB_KEYWORD_ENTRY.ISACTIVE", "1"); cond.and("AB_KEYWORD_ENTRY.ISACTIVE", "1");
} }
if (vars.get("$param.ExcludedKeyIdsSubquery_param")) if (vars.exists("$param.ExcludedKeyIdsSubquery_param") && vars.get("$param.ExcludedKeyIdsSubquery_param"))
{ cond.and("AB_KEYWORD_ENTRY.KEYID", "(" + vars.get("$param.ExcludedKeyIdsSubquery_param") + ")", "not in ?");
cond.and("AB_KEYWORD_ENTRY.KEYID not in ( " + vars.get("$param.ExcludedKeyIdsSubquery_param") + ")");
}
if (vars.getString("$param.WhitelistIds_param")) if (vars.getString("$param.WhitelistIds_param"))
cond.and("AB_KEYWORD_ENTRY.KEYID", JSON.parse(vars.getString("$param.WhitelistIds_param")), SqlBuilder.IN()); {
var whitelist = JSON.parse(vars.getString("$param.WhitelistIds_param"));
if (whitelist.length > 0)
cond.and("AB_KEYWORD_ENTRY.KEYID", JSON.parse(vars.getString("$param.WhitelistIds_param")), SqlBuilder.IN());
else
cond.and("1=2"); // force empty result if whitelist is empty
}
//TODO: use a preparedCondition (.build instead of .toString) when available #1030812 #1034026 //TODO: use a preparedCondition (.build instead of .translate) when available #1030812 #1034026
result.string(cond.toString()); result.string(cond.translate("1 = 1"));
\ No newline at end of file
...@@ -121,9 +121,10 @@ TicketUtils.prototype.getTypeAttributes = function() ...@@ -121,9 +121,10 @@ TicketUtils.prototype.getTypeAttributes = function()
*/ */
TicketUtils.prototype.getAvailableStatus = function() TicketUtils.prototype.getAvailableStatus = function()
{ {
states = JSON.parse(KeywordUtils.getAttributeRelation(this.type, $KeywordRegistry.ticketType(), "availableStatus", "")) var states = JSON.parse(KeywordUtils.getAttributeRelation(this.type, $KeywordRegistry.ticketType(), "availableStatus", "[]"))
if (states == null) if (states == null)
return ""; return [];
return states; return states;
} }
......
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