Fixed issue #245 - No tag in conditions for new Overviews, Triggers, Schedulers and SLAs.

This commit is contained in:
Rolf Schmidt 2017-04-12 16:27:00 +02:00
parent ee96e5aa91
commit 284d9e34b4

View file

@ -580,7 +580,7 @@ condition example
value = "%#{selector['value']}%" value = "%#{selector['value']}%"
bind_params.push value bind_params.push value
elsif selector['operator'] == 'contains all' && attributes[0] == 'ticket' && attributes[1] == 'tags' elsif selector['operator'] == 'contains all' && attributes[0] == 'ticket' && attributes[1] == 'tags'
query += "#{selector['value'].count} = ( query += "? = (
SELECT SELECT
COUNT(*) COUNT(*)
FROM FROM
@ -594,6 +594,7 @@ condition example
tag_items.id = tags.tag_item_id AND tag_items.id = tags.tag_item_id AND
tag_items.name IN (?) tag_items.name IN (?)
)" )"
bind_params.push selector['value'].count
bind_params.push selector['value'] bind_params.push selector['value']
elsif selector['operator'] == 'contains one' && attributes[0] == 'ticket' && attributes[1] == 'tags' elsif selector['operator'] == 'contains one' && attributes[0] == 'ticket' && attributes[1] == 'tags'
query += "1 <= ( query += "1 <= (
@ -641,7 +642,9 @@ condition example
tag_objects.name = 'Ticket' AND tag_objects.name = 'Ticket' AND
tag_items.id = tags.tag_item_id AND tag_items.id = tags.tag_item_id AND
tag_items.name IN (?) tag_items.name IN (?)
) BETWEEN ( #{selector['value'].count} - 1 ) AND #{selector['value'].count}" ) BETWEEN ? AND ?"
bind_params.push selector['value'].count - 1
bind_params.push selector['value'].count
bind_params.push selector['value'] bind_params.push selector['value']
elsif selector['operator'] == 'before (absolute)' elsif selector['operator'] == 'before (absolute)'
query += "#{attribute} <= ?" query += "#{attribute} <= ?"