Fixed all users in ticket owner selection in zoom and bulk.

This commit is contained in:
Martin Edenhofer 2015-11-20 12:06:50 +01:00
parent 28dcee225d
commit 442da38eae
4 changed files with 23 additions and 19 deletions

View file

@ -458,16 +458,23 @@ class BulkForm extends App.Controller
super super
@configure_attributes_ticket = [ @configure_attributes_ticket = [
{ name: 'state_id', display: 'State', tag: 'select', multiple: false, null: true, relation: 'TicketState', filter: @bulk, translate: true, nulloption: true, default: '', class: '', item_class: '' }, { name: 'state_id', display: 'State', tag: 'select', multiple: false, null: true, relation: 'TicketState', translate: true, nulloption: true, default: '' },
{ name: 'priority_id', display: 'Priority', tag: 'select', multiple: false, null: true, relation: 'TicketPriority', filter: @bulk, translate: true, nulloption: true, default: '', class: '', item_class: '' }, { name: 'priority_id', display: 'Priority', tag: 'select', multiple: false, null: true, relation: 'TicketPriority', translate: true, nulloption: true, default: '' },
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: true, relation: 'Group', filter: @bulk, nulloption: true, class: '', item_class: '' }, { name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: true, relation: 'Group', nulloption: true },
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, relation: 'User', filter: @bulk, nulloption: true, class: '', item_class: '' } { name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, relation: 'User', nulloption: true }
] ]
@holder = @options.holder @holder = @options.holder
@visible = false @visible = false
load = (data) =>
App.Collection.loadAssets(data.assets)
@formMeta = data.form_meta
@render() @render()
@bindId = App.TicketCreateCollection.bind(load)
release: =>
App.TicketCreateCollection.unbind(@bindId)
render: -> render: ->
@el.css 'right', App.Utils.getScrollBarWidth() @el.css 'right', App.Utils.getScrollBarWidth()
@ -480,7 +487,11 @@ class BulkForm extends App.Controller
configure_attributes: @configure_attributes_ticket configure_attributes: @configure_attributes_ticket
className: 'create' className: 'create'
labelClass: 'input-group-addon' labelClass: 'input-group-addon'
form_data: @bulk handlers: [
@ticketFormChanges
]
params: {}
filter: @formMeta.filter
noFieldset: true noFieldset: true
) )
@ -490,7 +501,6 @@ class BulkForm extends App.Controller
configure_attributes: [{ name: 'body', display: 'Comment', tag: 'textarea', rows: 4, null: true, upload: false, item_class: 'flex' }] configure_attributes: [{ name: 'body', display: 'Comment', tag: 'textarea', rows: 4, null: true, upload: false, item_class: 'flex' }]
className: 'create' className: 'create'
labelClass: 'input-group-addon' labelClass: 'input-group-addon'
form_data: @bulk
noFieldset: true noFieldset: true
) )
@ -505,7 +515,6 @@ class BulkForm extends App.Controller
configure_attributes: @confirm_attributes configure_attributes: @confirm_attributes
className: 'create' className: 'create'
labelClass: 'input-group-addon' labelClass: 'input-group-addon'
form_data: @bulk
noFieldset: true noFieldset: true
) )

View file

@ -275,10 +275,7 @@ class TicketsController < ApplicationController
assets: assets, assets: assets,
links: link_list, links: link_list,
tags: tags, tags: tags,
form_meta: { form_meta: attributes_to_change[:form_meta],
filter: attributes_to_change[:filter],
dependencies: attributes_to_change[:dependencies],
}
} }
end end

View file

@ -47,9 +47,7 @@ returns
end end
state_types.each {|type| state_types.each {|type|
state_type = Ticket::StateType.find_by(name: type) state_type = Ticket::StateType.find_by(name: type)
next if !state_type next if !state_type
state_type.states.each {|state| state_type.states.each {|state|
assets = state.assets(assets) assets = state.assets(assets)
state_ids.push state.id state_ids.push state.id