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
|
@ -174,9 +174,9 @@ class App.ControllerGenericIndex extends App.Controller
|
|||
objects: objects
|
||||
bindRow:
|
||||
events:
|
||||
'click': @edit
|
||||
click: @edit
|
||||
container: @container
|
||||
explanation: @pageData.explanation or 'none'
|
||||
explanation: @pageData.explanation
|
||||
groupBy: @groupBy
|
||||
dndCallback: @dndCallback
|
||||
},
|
||||
|
@ -504,7 +504,7 @@ class App.ControllerNavSidbar extends App.Controller
|
|||
return if !position
|
||||
if position.main
|
||||
@$('.main').scrollTop(position.main)
|
||||
if position.main
|
||||
if position.sidebar
|
||||
@$('.sidebar').scrollTop(position.sidebar)
|
||||
|
||||
currentPosition: =>
|
||||
|
|
|
@ -2,12 +2,8 @@
|
|||
class App.UiElement.checkboxTicketAttributes extends App.UiElement.ApplicationUiElement
|
||||
@render: (attribute, params) ->
|
||||
|
||||
configureAttributes = App.Ticket.configure_attributes
|
||||
for row, localAttribute of App.Ticket.attributesGet()
|
||||
configureAttributes.push localAttribute
|
||||
attributeOptionsArray = []
|
||||
attributeOptions = {}
|
||||
for row in configureAttributes
|
||||
for name, row of App.Ticket.attributesGet()
|
||||
|
||||
# ignore passwords
|
||||
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'
|
||||
nameTmp = row.name.substr(0, row.name.length-3)
|
||||
|
||||
if !attributeOptions[ nameTmp ]
|
||||
attributeOptions[ nameTmp ] = row.display
|
||||
attributeOptionsArray.push(
|
||||
{
|
||||
value: nameTmp
|
||||
name: row.display
|
||||
}
|
||||
)
|
||||
|
||||
attribute.sortBy = null
|
||||
attribute.item_class = 'checkbox'
|
||||
attribute.options = attributeOptions
|
||||
attribute.options = attributeOptionsArray
|
||||
App.UiElement.checkbox.render(attribute, params)
|
||||
|
|
|
@ -2,12 +2,8 @@
|
|||
class App.UiElement.selectTicketAttributes extends App.UiElement.ApplicationUiElement
|
||||
@render: (attribute, params) ->
|
||||
|
||||
configureAttributes = App.Ticket.configure_attributes
|
||||
for row, localAttribute of App.Ticket.attributesGet()
|
||||
configureAttributes.push localAttribute
|
||||
attributeOptionsArray = []
|
||||
attributeOptions = {}
|
||||
for row in configureAttributes
|
||||
for name, row of App.Ticket.attributesGet()
|
||||
|
||||
# ignore passwords
|
||||
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'
|
||||
nameTmp = row.name.substr(0, row.name.length-3)
|
||||
|
||||
if !attributeOptions[ nameTmp ]
|
||||
attributeOptions[ nameTmp ] = row.display
|
||||
attributeOptionsArray.push(
|
||||
{
|
||||
value: nameTmp
|
||||
name: row.display
|
||||
}
|
||||
)
|
||||
attribute.options = attributeOptions
|
||||
|
||||
attribute.sortBy = null
|
||||
attribute.options = attributeOptionsArray
|
||||
App.UiElement.select.render(attribute, params)
|
||||
|
|
|
@ -576,7 +576,7 @@ class App.Model extends Spine.Model
|
|||
# lookup relations
|
||||
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)
|
||||
|
||||
# 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: '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: '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: 'article_count', display: 'Article#', readonly: 1, width: '12%' },
|
||||
{ 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: ->
|
||||
'#ticket/zoom/' + @id
|
||||
"#ticket/zoom/#{@id}"
|
||||
|
||||
getState: ->
|
||||
type = App.TicketState.find(@state_id)
|
||||
|
|
|
@ -2690,13 +2690,6 @@ Permission.create_if_not_exists(
|
|||
translations: ['Channel - Formular']
|
||||
},
|
||||
)
|
||||
Permission.create_if_not_exists(
|
||||
name: 'admin.channel_web',
|
||||
note: 'Manage %s',
|
||||
preferences: {
|
||||
translations: ['Channel - Web']
|
||||
},
|
||||
)
|
||||
Permission.create_if_not_exists(
|
||||
name: 'admin.channel_email',
|
||||
note: 'Manage %s',
|
||||
|
|
Loading…
Reference in a new issue