Fixed not working ticket overview.

This commit is contained in:
Martin Edenhofer 2012-07-30 17:16:35 +02:00
parent 3512afc5c4
commit 15f4c57356
3 changed files with 14 additions and 14 deletions

View file

@ -76,6 +76,7 @@ class App.DashboardTicket extends App.Controller
@overview = data.overview
@tickets_count = data.tickets_count
@tickets = data.tickets
@ticket_list = data.ticket_list
pages_total = parseInt( ( @tickets_count / @overview.view.d.per_page ) + 0.99999 ) || 1
html = App.view('dashboard/ticket')(
@ -93,8 +94,8 @@ class App.DashboardTicket extends App.Controller
i = start
while i < end
i = i + 1
if @tickets[ i - 1 ]
@tickets_in_table.push @tickets[ i - 1 ]
if @ticket_list[ i - 1 ]
@tickets_in_table.push App.Ticket.find( @ticket_list[ i - 1 ] )
shown_all_attributes = @ticketTableAttributes( App.Overview.find(@overview.id).view.d.overview )
table = @table(
@ -104,7 +105,7 @@ class App.DashboardTicket extends App.Controller
checkbox: false,
)
if _.isEmpty(@tickets)
if _.isEmpty(@ticket_list)
table = ''
table = '-none-'

View file

@ -48,6 +48,7 @@ class Index extends App.Controller
@overview = cache.overview
@tickets_count = cache.tickets_count
@tickets = cache.tickets
@ticket_list = cache.ticket_list
@load(cache)
# get data
@ -86,14 +87,9 @@ class Index extends App.Controller
# load ticket collection
@loadCollection( type: 'Ticket', data: data.tickets )
# remember ticket order
if @start_page is 1
@tickets = data.tickets
else
@tickets = @tickets.concat( data.tickets )
# remember ticket count
@tickets_count = data.tickets_count
@ticket_list_show = []
for ticket_id in @ticket_list
@ticket_list_show.push App.Ticket.find(ticket_id)
# remeber bulk attributes
@bulk = data.bulk
@ -163,7 +159,7 @@ class Index extends App.Controller
table = @table(
overview_extended: shown_all_attributes,
model: App.Ticket,
objects: @tickets,
objects: @ticket_list_show,
checkbox: true,
)

View file

@ -100,7 +100,9 @@ module Session
puts 'push overview ' + overview.meta[:url].to_s
users = {}
tickets = []
ticket_list = []
overview_data[:tickets].each {|ticket|
ticket_list.push ticket.id
self.jobs_ticket( ticket.id, state_client_ids[client_id], tickets, users )
}
@ -108,6 +110,7 @@ puts 'push overview ' + overview.meta[:url].to_s
Session.transaction( client_id, {
:data => {
:overview => overview_data[:overview],
:ticket_list => ticket_list,
:tickets => tickets,
:tickets_count => overview_data[:tickets_count],
:users => users,