Generate list for overview group by based on current ticket attributes.
This commit is contained in:
parent
3c1744af0b
commit
c4c96d0f2b
3 changed files with 36 additions and 29 deletions
|
@ -4,6 +4,11 @@ class Index extends App.ControllerSubContent
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
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(
|
new App.ControllerGenericIndex(
|
||||||
el: @el
|
el: @el
|
||||||
id: @id
|
id: @id
|
||||||
|
|
|
@ -1430,49 +1430,43 @@ class App.OverviewSettings extends App.ControllerModal
|
||||||
})
|
})
|
||||||
|
|
||||||
@configure_attributes_article.push({
|
@configure_attributes_article.push({
|
||||||
name: "view::#{@view_mode}"
|
name: "view::#{@view_mode}"
|
||||||
display: 'Attributes'
|
display: 'Attributes'
|
||||||
tag: 'checkboxTicketAttributes'
|
tag: 'checkboxTicketAttributes'
|
||||||
default: @overview.view[@view_mode]
|
default: @overview.view[@view_mode]
|
||||||
null: false
|
null: false
|
||||||
translate: true
|
translate: true
|
||||||
sortBy: null
|
sortBy: null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'order::by'
|
name: 'order::by'
|
||||||
display: 'Order'
|
display: 'Order'
|
||||||
tag: 'selectTicketAttributes'
|
tag: 'selectTicketAttributes'
|
||||||
default: @overview.order.by
|
default: @overview.order.by
|
||||||
null: false
|
null: false
|
||||||
translate: true
|
translate: true
|
||||||
sortBy: null
|
sortBy: null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'order::direction'
|
name: 'order::direction'
|
||||||
display: 'Direction'
|
display: 'Direction'
|
||||||
tag: 'select'
|
tag: 'select'
|
||||||
default: @overview.order.direction
|
default: @overview.order.direction
|
||||||
null: false
|
null: false
|
||||||
translate: true
|
translate: true
|
||||||
options:
|
options:
|
||||||
ASC: 'up'
|
ASC: 'up'
|
||||||
DESC: 'down'
|
DESC: 'down'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'group_by'
|
name: 'group_by'
|
||||||
display: 'Group by'
|
display: 'Group by'
|
||||||
tag: 'select'
|
tag: 'select'
|
||||||
default: @overview.group_by
|
default: @overview.group_by
|
||||||
null: true
|
null: true
|
||||||
nulloption: true
|
nulloption: true
|
||||||
translate: true
|
translate: true
|
||||||
options:
|
options: App.Overview.groupByAttributes()
|
||||||
customer: 'Customer'
|
|
||||||
organization: 'Organization'
|
|
||||||
state: 'State'
|
|
||||||
priority: 'Priority'
|
|
||||||
group: 'Group'
|
|
||||||
owner: 'Owner'
|
|
||||||
})
|
})
|
||||||
|
|
||||||
controller = new App.ControllerForm(
|
controller = new App.ControllerForm(
|
||||||
|
|
|
@ -74,3 +74,11 @@ Sie können auch individuelle Übersichten für einzelne Agenten oder agenten Gr
|
||||||
|
|
||||||
uiUrl: ->
|
uiUrl: ->
|
||||||
"#ticket/view/#{@link}"
|
"#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
|
||||||
|
|
Loading…
Reference in a new issue