Generate list for overview group by based on current ticket attributes.

This commit is contained in:
Martin Edenhofer 2018-02-28 01:11:23 +01:00
parent 3c1744af0b
commit c4c96d0f2b
3 changed files with 36 additions and 29 deletions

View file

@ -4,6 +4,11 @@ class Index extends App.ControllerSubContent
constructor: ->
super
# update group by with current attributes
for attribute in App.Overview.configure_attributes
if attribute.name is 'group_by'
attribute.options = App.Overview.groupByAttributes()
new App.ControllerGenericIndex(
el: @el
id: @id

View file

@ -1430,49 +1430,43 @@ class App.OverviewSettings extends App.ControllerModal
})
@configure_attributes_article.push({
name: "view::#{@view_mode}"
display: 'Attributes'
tag: 'checkboxTicketAttributes'
default: @overview.view[@view_mode]
null: false
name: "view::#{@view_mode}"
display: 'Attributes'
tag: 'checkboxTicketAttributes'
default: @overview.view[@view_mode]
null: false
translate: true
sortBy: null
sortBy: null
},
{
name: 'order::by'
display: 'Order'
tag: 'selectTicketAttributes'
default: @overview.order.by
null: false
name: 'order::by'
display: 'Order'
tag: 'selectTicketAttributes'
default: @overview.order.by
null: false
translate: true
sortBy: null
sortBy: null
},
{
name: 'order::direction'
display: 'Direction'
tag: 'select'
default: @overview.order.direction
null: false
name: 'order::direction'
display: 'Direction'
tag: 'select'
default: @overview.order.direction
null: false
translate: true
options:
ASC: 'up'
DESC: 'down'
},
{
name: 'group_by'
display: 'Group by'
tag: 'select'
default: @overview.group_by
null: true
name: 'group_by'
display: 'Group by'
tag: 'select'
default: @overview.group_by
null: true
nulloption: true
translate: true
options:
customer: 'Customer'
organization: 'Organization'
state: 'State'
priority: 'Priority'
group: 'Group'
owner: 'Owner'
options: App.Overview.groupByAttributes()
})
controller = new App.ControllerForm(

View file

@ -74,3 +74,11 @@ Sie können auch individuelle Übersichten für einzelne Agenten oder agenten Gr
uiUrl: ->
"#ticket/view/#{@link}"
@groupByAttributes: ->
groupByAttributes = {}
for key, attribute of App.Ticket.attributesGet()
if !key.match(/(_at|_no)$/) && attribute.tag isnt 'datetime' && key isnt 'number' && key isnt 'tags'
key = key.replace(/_(id|ids)$/, '')
groupByAttributes[key] = attribute.display
groupByAttributes