diff --git a/app/controllers/ticket_overviews_controller.rb b/app/controllers/ticket_overviews_controller.rb index 1ff1249e8..82c68029e 100644 --- a/app/controllers/ticket_overviews_controller.rb +++ b/app/controllers/ticket_overviews_controller.rb @@ -6,23 +6,32 @@ class TicketOverviewsController < ApplicationController def show # build up attributes hash - overview_selected = nil - overviews = Overview.all + overview_selected = nil + overview_selected_raw = nil + overviews = Overview.all overviews.each { |overview| + # for cleanup reasons, remove me later! + overview.condition.each { |item, value | + if item == 'owner_id' + overview.condition[item] = 'current_user.id' + end + } + + # remember selected view + if params[:view] && params[:view] == overview.meta[:url] + overview_selected = overview + overview_selected_raw = Marshal.load( Marshal.dump(overview.attributes) ) + end + # replace 'current_user.id' with current_user.id overview.condition.each { |item, value | if value == 'current_user.id' overview.condition[item] = current_user.id end } - - # remember selected view - if params[:view] && params[:view] == overview.meta[:url] - overview_selected = overview - end } - + # sortby # prio # state @@ -108,7 +117,7 @@ class TicketOverviewsController < ApplicationController # return result render :json => { - :overview => overview_selected, + :overview => overview_selected_raw, :tickets => tickets, :tickets_count => tickets_count, :users => users,