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

View file

@ -222,17 +222,17 @@ class TicketsController < ApplicationController
# permission check
ticket = Ticket.find( params[:id] )
return if !ticket_permission( ticket )
return if !ticket_permission(ticket)
# get attributes to update
attributes_to_change = Ticket::ScreenOptions.attributes_to_change( user: current_user, ticket: ticket )
attributes_to_change = Ticket::ScreenOptions.attributes_to_change(user: current_user, ticket: ticket)
# get related users
assets = attributes_to_change[:assets]
assets = ticket.assets(assets)
# get related articles
articles = Ticket::Article.where( ticket_id: params[:id] )
articles = Ticket::Article.where(ticket_id: params[:id])
# get related users
article_ids = []
@ -275,10 +275,7 @@ class TicketsController < ApplicationController
assets: assets,
links: link_list,
tags: tags,
form_meta: {
filter: attributes_to_change[:filter],
dependencies: attributes_to_change[:dependencies],
}
form_meta: attributes_to_change[:form_meta],
}
end

View file

@ -47,9 +47,7 @@ returns
end
state_types.each {|type|
state_type = Ticket::StateType.find_by(name: type)
next if !state_type
state_type.states.each {|state|
assets = state.assets(assets)
state_ids.push state.id
@ -87,7 +85,7 @@ returns
}
dependencies = { group_id: { '' => { owner_id: [] } } }
Group.where( active: true ).each { |group|
Group.where(active: true).each { |group|
assets = group.assets(assets)
dependencies[:group_id][group.id] = { owner_id: [] }
group.users.each {|user|