Fixed ticket history.

This commit is contained in:
Martin Edenhofer 2013-07-27 01:49:52 +02:00
parent b731a9beaf
commit dd27ad8566
3 changed files with 10 additions and 4 deletions

View file

@ -44,7 +44,7 @@ class App.TicketHistory extends App.ControllerModal
render: ->
@html App.view('agent_ticket_history')(
objects: App.History.all()
objects: App.History.search()
)
@modalShow()
@ -62,13 +62,13 @@ class App.TicketHistory extends App.ControllerModal
if isSorted.length
@sortstate = 'notsorted'
@html App.view('agent_ticket_history')(
objects: App.History.all()
objects: App.History.search()
state: @sortstate
)
else
@sortstate = 'sorted'
@html App.view('agent_ticket_history')(
objects: App.History.all().reverse()
objects: App.History.search().reverse()
state: @sortstate
)

View file

@ -207,9 +207,14 @@ class App.Model extends Spine.Model
@search: (params) ->
all = @all()
all_complied = []
if !params
for item in all
item_new = @find( item.id )
all_complied.push @_fillUp(item_new)
return all_complied
for item in all
item_new = @find( item.id )
all_complied.push item_new
all_complied.push @_fillUp(item_new)
if params.filter
all_complied = @_filter( all_complied, params.filter )

View file

@ -16,4 +16,5 @@ class App.History extends App.Model
if data.history_object_id
data.object = App.HistoryObject.find( data.history_object_id )
return data