Fixed ticket history.
This commit is contained in:
parent
b731a9beaf
commit
dd27ad8566
3 changed files with 10 additions and 4 deletions
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue