Added two new categories.

This commit is contained in:
Martin Edenhofer 2015-09-07 01:54:47 +02:00
parent 18893526d9
commit 4fea5e12d7

View file

@ -9,7 +9,7 @@ class Ticket::State < ApplicationModel
list tickets by customer list tickets by customer
states = Ticket::State.by_category('open') # open|closed states = Ticket::State.by_category('open') # open|closed|work_on|pending_reminder
returns: returns:
@ -22,6 +22,14 @@ returns:
return Ticket::State.where( return Ticket::State.where(
state_type_id: Ticket::StateType.where( name: ['new', 'open', 'pending reminder', 'pending action'] ) state_type_id: Ticket::StateType.where( name: ['new', 'open', 'pending reminder', 'pending action'] )
) )
elsif category == 'pending_reminder'
return Ticket::State.where(
state_type_id: Ticket::StateType.where( name: ['pending reminder'] )
)
elsif category == 'work_on'
return Ticket::State.where(
state_type_id: Ticket::StateType.where( name: ['new', 'open'] )
)
elsif category == 'closed' elsif category == 'closed'
return Ticket::State.where( return Ticket::State.where(
state_type_id: Ticket::StateType.where( name: ['closed'] ) state_type_id: Ticket::StateType.where( name: ['closed'] )