From c8737893851f62786e01a15b83db59a6feffee91 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 24 Jan 2015 13:51:04 +0100 Subject: [PATCH] Fixed check if init owner selection of new ticket screen is empty. --- app/models/ticket/screen_options.rb | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/app/models/ticket/screen_options.rb b/app/models/ticket/screen_options.rb index fb435ebab..008cf8289 100644 --- a/app/models/ticket/screen_options.rb +++ b/app/models/ticket/screen_options.rb @@ -32,12 +32,12 @@ list attributes returns result = { - :type_id => type_ids, - :state_id => state_ids, - :priority_id => priority_ids, - :owner_id => owner_ids, - :group_id => group_ids, - :group_id__owner_id => groups_users, + :type_id => type_ids, + :state_id => state_ids, + :priority_id => priority_ids, + :owner_id => owner_ids, + :group_id => group_ids, + :group_id__owner_id => groups_users, } =end @@ -103,7 +103,7 @@ returns agents[ user.id ] = 1 } - dependencies = { :group_id => { '' => [] } } + dependencies = { :group_id => { '' => { :owner_id => [] } } } Group.where( :active => true ).each { |group| assets = group.assets(assets) dependencies[:group_id][group.id] = { :owner_id => [] } @@ -115,9 +115,9 @@ returns } return { - :assets => assets, - :filter => filter, - :dependencies => dependencies, + :assets => assets, + :filter => filter, + :dependencies => dependencies, } end @@ -126,8 +126,8 @@ returns list tickets by customer groupd in state categroie open and closed result = Ticket::ScreenOptions.list_by_customer( - :customer_id => 123, - :limit => 15, # optional, default 15 + :customer_id => 123, + :limit => 15, # optional, default 15 ) returns @@ -147,13 +147,13 @@ returns # get tickets tickets_open = Ticket.where( - :customer_id => data[:customer_id], - :state_id => state_list_open + :customer_id => data[:customer_id], + :state_id => state_list_open ).limit( data[:limit] || 15 ).order('created_at DESC') tickets_closed = Ticket.where( - :customer_id => data[:customer_id], - :state_id => state_list_closed + :customer_id => data[:customer_id], + :state_id => state_list_closed ).limit( data[:limit] || 15 ).order('created_at DESC') return { @@ -162,4 +162,4 @@ returns } end -end +end \ No newline at end of file