{{refidtest = queries['refid']}} {{if refidtest==null}} {{else}} {{refid = queries['refid']}} {{end}} {{isgroupcond=false}} {{isactcond=false}} {{trig_group=0}} {{trig_group_count=(ev_trig_group_count refid)}} {{for trig_group in 0..(trig_group_count-1)}} {{index=0}} {{for trigger in (event_triggers refid)}} {{if trigger.trigger_group_id==trig_group}}
{{if trig_if_edit refid index trig_group}}
{{if index==0 && trig_group==0}} WHEN {{else}} {{op1=''}} {{op2=''}} {{if index==0}} {{op1='selected'}} {{else}} {{op2='selected'}} {{end}} {{end}}
{{else}} {{if index==0}}
{{if trig_group==0}}WHEN{{else}}OR WHEN{{end}}
{{else}}
AND IF
{{end}} {{end}}
{{iscondition=false}} {{if index==0}} {{ifclass='hs-bg-red-l4'}} {{else}} {{ifclass='hs-bg-blue-l4'}} {{iscondition=true}} {{end}} {{trigger_set_condition refid index groupindex iscondition}}
{{if trig_if_edit refid index trig_group}}
{{if index==0 }} {{else}} {{end}}
{{includefileraw includes\triggers.html}}
{{else}}
{{event_trigger_format refid index trig_group}}
{{end}}
{{if trig_if_edit refid index trig_group}} {{if is_trig_jui_plugin refid index trig_group}} {{else}} {{end}} {{else}} {{end}} {{if index>0 || trig_group>0}} {{end}} {{if index==((ev_trigs_in_group refid trig_group)-1)}} {{else}} {{end}}
{{index=index+1}} {{end}} {{end}} {{end}}