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: ->
|
render: ->
|
||||||
|
|
||||||
@html App.view('agent_ticket_history')(
|
@html App.view('agent_ticket_history')(
|
||||||
objects: App.History.all()
|
objects: App.History.search()
|
||||||
)
|
)
|
||||||
|
|
||||||
@modalShow()
|
@modalShow()
|
||||||
|
@ -62,13 +62,13 @@ class App.TicketHistory extends App.ControllerModal
|
||||||
if isSorted.length
|
if isSorted.length
|
||||||
@sortstate = 'notsorted'
|
@sortstate = 'notsorted'
|
||||||
@html App.view('agent_ticket_history')(
|
@html App.view('agent_ticket_history')(
|
||||||
objects: App.History.all()
|
objects: App.History.search()
|
||||||
state: @sortstate
|
state: @sortstate
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
@sortstate = 'sorted'
|
@sortstate = 'sorted'
|
||||||
@html App.view('agent_ticket_history')(
|
@html App.view('agent_ticket_history')(
|
||||||
objects: App.History.all().reverse()
|
objects: App.History.search().reverse()
|
||||||
state: @sortstate
|
state: @sortstate
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -207,9 +207,14 @@ class App.Model extends Spine.Model
|
||||||
@search: (params) ->
|
@search: (params) ->
|
||||||
all = @all()
|
all = @all()
|
||||||
all_complied = []
|
all_complied = []
|
||||||
|
if !params
|
||||||
for item in all
|
for item in all
|
||||||
item_new = @find( item.id )
|
item_new = @find( item.id )
|
||||||
all_complied.push item_new
|
all_complied.push @_fillUp(item_new)
|
||||||
|
return all_complied
|
||||||
|
for item in all
|
||||||
|
item_new = @find( item.id )
|
||||||
|
all_complied.push @_fillUp(item_new)
|
||||||
|
|
||||||
if params.filter
|
if params.filter
|
||||||
all_complied = @_filter( all_complied, params.filter )
|
all_complied = @_filter( all_complied, params.filter )
|
||||||
|
|
|
@ -16,4 +16,5 @@ class App.History extends App.Model
|
||||||
if data.history_object_id
|
if data.history_object_id
|
||||||
data.object = App.HistoryObject.find( data.history_object_id )
|
data.object = App.HistoryObject.find( data.history_object_id )
|
||||||
|
|
||||||
|
return data
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue