From dd27ad8566879d449e31638d891a4539fc12d198 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 27 Jul 2013 01:49:52 +0200 Subject: [PATCH] Fixed ticket history. --- .../app/controllers/agent_ticket_history.js.coffee | 6 +++--- .../javascripts/app/models/_application_model.js.coffee | 7 ++++++- app/assets/javascripts/app/models/history.js.coffee | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_history.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_history.js.coffee index 4e0c25691..7ef9d98aa 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_history.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_history.js.coffee @@ -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 ) diff --git a/app/assets/javascripts/app/models/_application_model.js.coffee b/app/assets/javascripts/app/models/_application_model.js.coffee index 2ef17864a..5b2d8fccd 100644 --- a/app/assets/javascripts/app/models/_application_model.js.coffee +++ b/app/assets/javascripts/app/models/_application_model.js.coffee @@ -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 ) diff --git a/app/assets/javascripts/app/models/history.js.coffee b/app/assets/javascripts/app/models/history.js.coffee index 51d34727d..b18b32ab3 100644 --- a/app/assets/javascripts/app/models/history.js.coffee +++ b/app/assets/javascripts/app/models/history.js.coffee @@ -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