Moved to naive sort order of ticket attributes.
This commit is contained in:
parent
da2ce8e1b4
commit
08bacb77d9
6 changed files with 29 additions and 44 deletions
|
@ -169,14 +169,14 @@ class App.ControllerGenericIndex extends App.Controller
|
||||||
# append content table
|
# append content table
|
||||||
params = _.extend(
|
params = _.extend(
|
||||||
{
|
{
|
||||||
el: @$('.table-overview')
|
el: @$('.table-overview')
|
||||||
model: App[ @genericObject ]
|
model: App[ @genericObject ]
|
||||||
objects: objects
|
objects: objects
|
||||||
bindRow:
|
bindRow:
|
||||||
events:
|
events:
|
||||||
'click': @edit
|
click: @edit
|
||||||
container: @container
|
container: @container
|
||||||
explanation: @pageData.explanation or 'none'
|
explanation: @pageData.explanation
|
||||||
groupBy: @groupBy
|
groupBy: @groupBy
|
||||||
dndCallback: @dndCallback
|
dndCallback: @dndCallback
|
||||||
},
|
},
|
||||||
|
@ -504,7 +504,7 @@ class App.ControllerNavSidbar extends App.Controller
|
||||||
return if !position
|
return if !position
|
||||||
if position.main
|
if position.main
|
||||||
@$('.main').scrollTop(position.main)
|
@$('.main').scrollTop(position.main)
|
||||||
if position.main
|
if position.sidebar
|
||||||
@$('.sidebar').scrollTop(position.sidebar)
|
@$('.sidebar').scrollTop(position.sidebar)
|
||||||
|
|
||||||
currentPosition: =>
|
currentPosition: =>
|
||||||
|
|
|
@ -2,12 +2,8 @@
|
||||||
class App.UiElement.checkboxTicketAttributes extends App.UiElement.ApplicationUiElement
|
class App.UiElement.checkboxTicketAttributes extends App.UiElement.ApplicationUiElement
|
||||||
@render: (attribute, params) ->
|
@render: (attribute, params) ->
|
||||||
|
|
||||||
configureAttributes = App.Ticket.configure_attributes
|
|
||||||
for row, localAttribute of App.Ticket.attributesGet()
|
|
||||||
configureAttributes.push localAttribute
|
|
||||||
attributeOptionsArray = []
|
attributeOptionsArray = []
|
||||||
attributeOptions = {}
|
for name, row of App.Ticket.attributesGet()
|
||||||
for row in configureAttributes
|
|
||||||
|
|
||||||
# ignore passwords
|
# ignore passwords
|
||||||
if row.type isnt 'password' && row.type isnt 'tag' && row.name isnt 'tags'
|
if row.type isnt 'password' && row.type isnt 'tag' && row.name isnt 'tags'
|
||||||
|
@ -19,14 +15,14 @@ class App.UiElement.checkboxTicketAttributes extends App.UiElement.ApplicationUi
|
||||||
else if row.name.substr(row.name.length-3,3) is '_id'
|
else if row.name.substr(row.name.length-3,3) is '_id'
|
||||||
nameTmp = row.name.substr(0, row.name.length-3)
|
nameTmp = row.name.substr(0, row.name.length-3)
|
||||||
|
|
||||||
if !attributeOptions[ nameTmp ]
|
attributeOptionsArray.push(
|
||||||
attributeOptions[ nameTmp ] = row.display
|
{
|
||||||
attributeOptionsArray.push(
|
value: nameTmp
|
||||||
{
|
name: row.display
|
||||||
value: nameTmp
|
}
|
||||||
name: row.display
|
)
|
||||||
}
|
|
||||||
)
|
attribute.sortBy = null
|
||||||
attribute.item_class = 'checkbox'
|
attribute.item_class = 'checkbox'
|
||||||
attribute.options = attributeOptions
|
attribute.options = attributeOptionsArray
|
||||||
App.UiElement.checkbox.render(attribute, params)
|
App.UiElement.checkbox.render(attribute, params)
|
||||||
|
|
|
@ -2,12 +2,8 @@
|
||||||
class App.UiElement.selectTicketAttributes extends App.UiElement.ApplicationUiElement
|
class App.UiElement.selectTicketAttributes extends App.UiElement.ApplicationUiElement
|
||||||
@render: (attribute, params) ->
|
@render: (attribute, params) ->
|
||||||
|
|
||||||
configureAttributes = App.Ticket.configure_attributes
|
|
||||||
for row, localAttribute of App.Ticket.attributesGet()
|
|
||||||
configureAttributes.push localAttribute
|
|
||||||
attributeOptionsArray = []
|
attributeOptionsArray = []
|
||||||
attributeOptions = {}
|
for name, row of App.Ticket.attributesGet()
|
||||||
for row in configureAttributes
|
|
||||||
|
|
||||||
# ignore passwords
|
# ignore passwords
|
||||||
if row.type isnt 'password' && row.type isnt 'tag' && row.name isnt 'tags'
|
if row.type isnt 'password' && row.type isnt 'tag' && row.name isnt 'tags'
|
||||||
|
@ -19,13 +15,13 @@ class App.UiElement.selectTicketAttributes extends App.UiElement.ApplicationUiEl
|
||||||
else if row.name.substr(row.name.length-3,3) is '_id'
|
else if row.name.substr(row.name.length-3,3) is '_id'
|
||||||
nameTmp = row.name.substr(0, row.name.length-3)
|
nameTmp = row.name.substr(0, row.name.length-3)
|
||||||
|
|
||||||
if !attributeOptions[ nameTmp ]
|
attributeOptionsArray.push(
|
||||||
attributeOptions[ nameTmp ] = row.display
|
{
|
||||||
attributeOptionsArray.push(
|
value: nameTmp
|
||||||
{
|
name: row.display
|
||||||
value: nameTmp
|
}
|
||||||
name: row.display
|
)
|
||||||
}
|
|
||||||
)
|
attribute.sortBy = null
|
||||||
attribute.options = attributeOptions
|
attribute.options = attributeOptionsArray
|
||||||
App.UiElement.select.render(attribute, params)
|
App.UiElement.select.render(attribute, params)
|
||||||
|
|
|
@ -576,7 +576,7 @@ class App.Model extends Spine.Model
|
||||||
# lookup relations
|
# lookup relations
|
||||||
if attribute.relation
|
if attribute.relation
|
||||||
|
|
||||||
# relations if if not calling object, to prevent loops
|
# relations - not calling object it self, to prevent loops
|
||||||
if !_.contains(classNames, @className)
|
if !_.contains(classNames, @className)
|
||||||
|
|
||||||
# only if relation model exists
|
# only if relation model exists
|
||||||
|
|
|
@ -10,7 +10,7 @@ class App.Ticket extends App.Model
|
||||||
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, limit: 100, null: false, relation: 'Group', width: '10%', edit: true },
|
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, limit: 100, null: false, relation: 'Group', width: '10%', edit: true },
|
||||||
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, limit: 100, null: true, relation: 'User', width: '12%', edit: true },
|
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, limit: 100, null: true, relation: 'User', width: '12%', edit: true },
|
||||||
{ name: 'state_id', display: 'State', tag: 'select', multiple: false, null: false, relation: 'TicketState', default: 'new', width: '12%', edit: true, customer: true },
|
{ name: 'state_id', display: 'State', tag: 'select', multiple: false, null: false, relation: 'TicketState', default: 'new', width: '12%', edit: true, customer: true },
|
||||||
{ name: 'pending_time', display: 'Pending Time', tag: 'datetime', null: true, width: '130px' },
|
{ name: 'pending_time', display: 'Pending till', tag: 'datetime', null: true, width: '130px' },
|
||||||
{ name: 'priority_id', display: 'Priority', tag: 'select', multiple: false, null: false, relation: 'TicketPriority', default: '2 normal', width: '12%', edit: true, customer: true },
|
{ name: 'priority_id', display: 'Priority', tag: 'select', multiple: false, null: false, relation: 'TicketPriority', default: '2 normal', width: '12%', edit: true, customer: true },
|
||||||
{ name: 'article_count', display: 'Article#', readonly: 1, width: '12%' },
|
{ name: 'article_count', display: 'Article#', readonly: 1, width: '12%' },
|
||||||
{ name: 'escalation_at', display: 'Escalation', tag: 'datetime', null: true, readonly: 1, width: '110px', class: 'escalation' },
|
{ name: 'escalation_at', display: 'Escalation', tag: 'datetime', null: true, readonly: 1, width: '110px', class: 'escalation' },
|
||||||
|
@ -26,7 +26,7 @@ class App.Ticket extends App.Model
|
||||||
]
|
]
|
||||||
|
|
||||||
uiUrl: ->
|
uiUrl: ->
|
||||||
'#ticket/zoom/' + @id
|
"#ticket/zoom/#{@id}"
|
||||||
|
|
||||||
getState: ->
|
getState: ->
|
||||||
type = App.TicketState.find(@state_id)
|
type = App.TicketState.find(@state_id)
|
||||||
|
|
|
@ -2690,13 +2690,6 @@ Permission.create_if_not_exists(
|
||||||
translations: ['Channel - Formular']
|
translations: ['Channel - Formular']
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
Permission.create_if_not_exists(
|
|
||||||
name: 'admin.channel_web',
|
|
||||||
note: 'Manage %s',
|
|
||||||
preferences: {
|
|
||||||
translations: ['Channel - Web']
|
|
||||||
},
|
|
||||||
)
|
|
||||||
Permission.create_if_not_exists(
|
Permission.create_if_not_exists(
|
||||||
name: 'admin.channel_email',
|
name: 'admin.channel_email',
|
||||||
note: 'Manage %s',
|
note: 'Manage %s',
|
||||||
|
|
Loading…
Reference in a new issue