Renamed alternative_user_options to possible_groups_owners

This commit is contained in:
Billy Zhou 2018-08-21 16:22:04 +08:00
parent d42d0ff469
commit 16a4c2dcd1
2 changed files with 4 additions and 4 deletions

View file

@ -1281,7 +1281,7 @@ class BulkForm extends App.Controller
continue if attribute.name != 'owner_id' continue if attribute.name != 'owner_id'
{users, groups} = @validUsersForTicketSelection() {users, groups} = @validUsersForTicketSelection()
options = _.map(users, (user) -> {value: user.id, name: user.displayName()} ) options = _.map(users, (user) -> {value: user.id, name: user.displayName()} )
attribute.alternative_user_options = options attribute.possible_groups_owners = options
new App.ControllerForm( new App.ControllerForm(
el: @$('#form-ticket-bulk') el: @$('#form-ticket-bulk')

View file

@ -7,14 +7,14 @@ class OwnerFormHandlerDependencies
owner_attribute = _.find(attributes, (o) -> o.name == 'owner_id') owner_attribute = _.find(attributes, (o) -> o.name == 'owner_id')
return if !owner_attribute return if !owner_attribute
return if 'alternative_user_options' not of owner_attribute return if 'possible_groups_owners' not of owner_attribute
# fetch contents using User relation if a Group has been selected, otherwise render alternative_user_options # fetch contents using User relation if a Group has been selected, otherwise render possible_groups_owners
if params.group_id if params.group_id
owner_attribute.relation = 'User' owner_attribute.relation = 'User'
delete owner_attribute['options'] delete owner_attribute['options']
else else
owner_attribute.options = owner_attribute.alternative_user_options owner_attribute.options = owner_attribute.possible_groups_owners
delete owner_attribute['relation'] delete owner_attribute['relation']
# replace new option list # replace new option list