Small memory footprint improvements.

This commit is contained in:
Martin Edenhofer 2019-04-07 07:46:29 +02:00
parent 13854f7fa7
commit 57b17f7b81
3 changed files with 7 additions and 7 deletions

View file

@ -30,8 +30,8 @@ class App.Ticket extends App.Model
"#ticket/zoom/#{@id}"
getState: ->
type = App.TicketState.find(@state_id)
stateType = App.TicketStateType.find(type.state_type_id)
type = App.TicketState.findNative(@state_id)
stateType = App.TicketStateType.findNative(type.state_type_id)
state = 'closed'
if stateType.name is 'new' || stateType.name is 'open'
state = 'open'
@ -56,8 +56,8 @@ class App.Ticket extends App.Model
@getState()
iconTitle: ->
type = App.TicketState.find(@state_id)
stateType = App.TicketStateType.find(type.state_type_id)
type = App.TicketState.findNative(@state_id)
stateType = App.TicketStateType.findNative(type.state_type_id)
if stateType.name is 'pending reminder' && @pending_time && new Date( Date.parse(@pending_time) ) < new Date
return "#{App.i18n.translateInline(type.displayName())} - #{App.i18n.translateInline('reached')}"
if @escalation_at && new Date( Date.parse(@escalation_at) ) < new Date

View file

@ -28,14 +28,14 @@ class App.TicketArticle extends App.Model
if @subject
return @subject
if App.Ticket.exists(@ticket_id)
ticket = App.Ticket.find(@ticket_id)
ticket = App.Ticket.findNative(@ticket_id)
if ticket
return ticket.title
'???'
iconActivity: (user) ->
return if !user
ticket = App.Ticket.find(@ticket_id)
ticket = App.Ticket.findNative(@ticket_id)
if ticket.owner_id == user.id
return 'important'
''

View file

@ -279,7 +279,7 @@ class App.User extends App.Model
if user_role_ids
for role_id in user_role_ids
if App.Role.exists(role_id)
role = App.Role.find(role_id)
role = App.Role.findNative(role_id)
if role.group_ids
for local_group_id, local_permission of role.group_ids
if _.include(local_permission, permission) || _.include(local_permission, 'full')