Fixed ticket history.

This commit is contained in:
Martin Edenhofer 2012-10-05 09:10:14 +02:00
parent 3f6d889b5c
commit 6010dfe9ab
4 changed files with 16 additions and 3 deletions

View file

@ -43,4 +43,9 @@ class App.TicketHistory extends App.ControllerModal
) )
@modalShow() @modalShow()
# enable user popups
@userPopups() @userPopups()
# show frontend times
@delay( @frontendTimeUpdate, 200 )

View file

@ -101,7 +101,7 @@ class _Singleton
find: ( type, id, callback ) -> find: ( type, id, callback ) ->
console.log( 'find', type, id ) # console.log( 'find', type, id )
# if App[type].exists( id ) && !callback # if App[type].exists( id ) && !callback
if App[type].exists( id ) if App[type].exists( id )
# console.log( 'find exists', type, id ) # console.log( 'find exists', type, id )
@ -211,7 +211,12 @@ class _Singleton
App[params.type].refresh( object, options: { clear: true } ) App[params.type].refresh( object, options: { clear: true } )
all: (type) -> all: (type) ->
App[type].all() all = App[type].all()
all_complied = []
for item in all
item_new = @find( type, item.id )
all_complied.push item_new
return all_complied
deleteAll: (type) -> deleteAll: (type) ->
App[type].deleteAll() App[type].deleteAll()

View file

@ -18,7 +18,8 @@
<% open = true %> <% open = true %>
<% last_user = object['created_by_id'] %> <% last_user = object['created_by_id'] %>
<% lasttime = object['created_at'] %> <% lasttime = object['created_at'] %>
<span class="user-data" data-id="<%= object['created_by']['id'] %>"><%= object['created_by']['realname'] %></span> - <%= object['created_at'] %> - <%= object['humanTime'] %> <span class="user-data" data-id="<%= object['created_by']['id'] %>"><%= object['created_by']['realname'] %></span> -
<span class="humanTimeFromNow" data-time="<%- object['created_at'] %>">?</span>
<ul> <ul>
<% end %> <% end %>
<li> <li>

View file

@ -158,6 +158,8 @@ class TicketsController < ApplicationController
# get related users # get related users
users = {} users = {}
users[ ticket.owner_id ] = User.user_data_full( ticket.owner_id )
users[ ticket.customer_id ] = User.user_data_full( ticket.customer_id )
history.each do |item| history.each do |item|
users[ item['created_by_id'] ] = User.user_data_full( item['created_by_id'] ) users[ item['created_by_id'] ] = User.user_data_full( item['created_by_id'] )
if item['history_object'] == 'Ticket::Article' if item['history_object'] == 'Ticket::Article'