Renamed tickets.ticket_priority to tickets.priority, tickets.ticket_state to ticket.state, ticket_articles.ticket_article_sender to ticket_articles.sender and ticket_articles.ticket_article_type to ticket_articles.type.
This commit is contained in:
parent
065fbb2bba
commit
3c139a5810
20 changed files with 159 additions and 160 deletions
|
@ -146,8 +146,8 @@ class App.Controller extends Spine.Controller
|
||||||
{ name: 'number', type: 'link', title: 'title', dataType: 'edit' },
|
{ name: 'number', type: 'link', title: 'title', dataType: 'edit' },
|
||||||
{ name: 'title', type: 'link', title: 'title', dataType: 'edit' },
|
{ name: 'title', type: 'link', title: 'title', dataType: 'edit' },
|
||||||
{ name: 'customer', class: 'user-popover', data: { id: true } },
|
{ name: 'customer', class: 'user-popover', data: { id: true } },
|
||||||
{ name: 'ticket_state', translate: true, title: true },
|
{ name: 'state', translate: true, title: true },
|
||||||
{ name: 'ticket_priority', translate: true, title: true },
|
{ name: 'priority', translate: true, title: true },
|
||||||
{ name: 'group', title: 'group' },
|
{ name: 'group', title: 'group' },
|
||||||
{ name: 'owner', class: 'user-popover', data: { id: true } },
|
{ name: 'owner', class: 'user-popover', data: { id: true } },
|
||||||
{ name: 'created_at', callback: @frontendTime },
|
{ name: 'created_at', callback: @frontendTime },
|
||||||
|
|
|
@ -90,13 +90,13 @@ class App.ControllerForm extends App.Controller
|
||||||
|
|
||||||
# colection as relation
|
# colection as relation
|
||||||
attribute_config = {
|
attribute_config = {
|
||||||
name: 'ticket_priority_id'
|
name: 'priority_id'
|
||||||
display: 'Priority'
|
display: 'Priority'
|
||||||
tag: 'select'
|
tag: 'select'
|
||||||
multiple: false
|
multiple: false
|
||||||
null: false
|
null: false
|
||||||
relation: 'TicketPriority'
|
relation: 'TicketPriority'
|
||||||
default: defaults['ticket_priority_id']
|
default: defaults['priority_id']
|
||||||
translate: true
|
translate: true
|
||||||
class: 'medium'
|
class: 'medium'
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ class App.ControllerForm extends App.Controller
|
||||||
|
|
||||||
# colection as options
|
# colection as options
|
||||||
attribute_config = {
|
attribute_config = {
|
||||||
name: 'ticket_priority_id'
|
name: 'priority_id'
|
||||||
display: 'Priority'
|
display: 'Priority'
|
||||||
tag: 'select'
|
tag: 'select'
|
||||||
multiple: false
|
multiple: false
|
||||||
|
@ -476,12 +476,12 @@ class App.ControllerForm extends App.Controller
|
||||||
# select shown attributes
|
# select shown attributes
|
||||||
loopData = [
|
loopData = [
|
||||||
{
|
{
|
||||||
value: 'x-zammad-ticket-ticket_priority_id'
|
value: 'x-zammad-ticket-priority_id'
|
||||||
name: 'Ticket Priority'
|
name: 'Ticket Priority'
|
||||||
relation: 'TicketPriority'
|
relation: 'TicketPriority'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'x-zammad-ticket-ticket_state_id'
|
value: 'x-zammad-ticket-state_id'
|
||||||
name: 'Ticket State'
|
name: 'Ticket State'
|
||||||
relation: 'TicketState'
|
relation: 'TicketState'
|
||||||
},
|
},
|
||||||
|
@ -509,12 +509,12 @@ class App.ControllerForm extends App.Controller
|
||||||
options: { true: 'Yes', false: 'No'}
|
options: { true: 'Yes', false: 'No'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'x-zammad-article-ticket_article_type_id'
|
value: 'x-zammad-article-type_id'
|
||||||
name: 'Article Type'
|
name: 'Article Type'
|
||||||
relation: 'TicketArticleType'
|
relation: 'TicketArticleType'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'x-zammad-article-ticket_article_sender_id'
|
value: 'x-zammad-article-sender_id'
|
||||||
name: 'Article Sender'
|
name: 'Article Sender'
|
||||||
relation: 'TicketArticleSender'
|
relation: 'TicketArticleSender'
|
||||||
},
|
},
|
||||||
|
@ -866,9 +866,9 @@ class App.ControllerForm extends App.Controller
|
||||||
} )
|
} )
|
||||||
all
|
all
|
||||||
}
|
}
|
||||||
else if key is 'tickets.ticket_state_id'
|
else if key is 'tickets.state_id'
|
||||||
attribute_config = {
|
attribute_config = {
|
||||||
name: attribute.name + '::tickets.ticket_state_id'
|
name: attribute.name + '::tickets.state_id'
|
||||||
display: 'State'
|
display: 'State'
|
||||||
tag: 'select'
|
tag: 'select'
|
||||||
multiple: true
|
multiple: true
|
||||||
|
@ -880,9 +880,9 @@ class App.ControllerForm extends App.Controller
|
||||||
class: 'medium'
|
class: 'medium'
|
||||||
remove: true
|
remove: true
|
||||||
}
|
}
|
||||||
else if key is 'tickets.ticket_priority_id'
|
else if key is 'tickets.priority_id'
|
||||||
attribute_config = {
|
attribute_config = {
|
||||||
name: attribute.name + '::tickets.ticket_priority_id'
|
name: attribute.name + '::tickets.priority_id'
|
||||||
display: 'Priority'
|
display: 'Priority'
|
||||||
tag: 'select'
|
tag: 'select'
|
||||||
multiple: true
|
multiple: true
|
||||||
|
@ -1033,13 +1033,13 @@ class App.ControllerForm extends App.Controller
|
||||||
disable: false
|
disable: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'tickets.ticket_state_id'
|
value: 'tickets.state_id'
|
||||||
name: 'State'
|
name: 'State'
|
||||||
selected: false
|
selected: false
|
||||||
disable: false
|
disable: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 'tickets.ticket_priority_id'
|
value: 'tickets.priority_id'
|
||||||
name: 'Priority'
|
name: 'Priority'
|
||||||
selected: true
|
selected: true
|
||||||
disable: false
|
disable: false
|
||||||
|
|
|
@ -23,8 +23,8 @@ class App.ControllerTable extends App.Controller
|
||||||
{ name: 'number', link: true }
|
{ name: 'number', link: true }
|
||||||
{ name: 'title', link: true }
|
{ name: 'title', link: true }
|
||||||
{ name: 'customer', class: 'user-popover', data: { id: true } }
|
{ name: 'customer', class: 'user-popover', data: { id: true } }
|
||||||
{ name: 'ticket_state', translate: true }
|
{ name: 'state', translate: true }
|
||||||
{ name: 'ticket_priority', translate: true }
|
{ name: 'priority', translate: true }
|
||||||
{ name: 'group' },
|
{ name: 'group' },
|
||||||
{ name: 'owner', class: 'user-popover', data: { id: true } }
|
{ name: 'owner', class: 'user-popover', data: { id: true } }
|
||||||
{ name: 'created_at', callback: @frontendTime }
|
{ name: 'created_at', callback: @frontendTime }
|
||||||
|
|
|
@ -143,10 +143,10 @@ class Settings extends App.ControllerModal
|
||||||
overview: @overview,
|
overview: @overview,
|
||||||
)
|
)
|
||||||
@configure_attributes_article = [
|
@configure_attributes_article = [
|
||||||
# { name: 'from', display: 'From', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8', },
|
# { name: 'from', display: 'From', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8', },
|
||||||
# { name: 'to', display: 'To', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', item_class: 'hide' },
|
# { name: 'to', display: 'To', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', item_class: 'hide' },
|
||||||
# { name: 'ticket_article_type_id', display: 'Type', tag: 'select', multiple: false, null: true, relation: 'TicketArticleType', default: '9', class: 'medium', item_class: 'pull-left' },
|
# { name: 'type_id', display: 'Type', tag: 'select', multiple: false, null: true, relation: 'TicketArticleType', default: '9', class: 'medium', item_class: 'pull-left' },
|
||||||
# { name: 'internal', display: 'Visibility', tag: 'radio', default: false, null: true, options: { true: 'internal', false: 'public' }, class: 'medium', item_class: 'pull-left' },
|
# { name: 'internal', display: 'Visibility', tag: 'radio', default: false, null: true, options: { true: 'internal', false: 'public' }, class: 'medium', item_class: 'pull-left' },
|
||||||
{
|
{
|
||||||
name: 'per_page',
|
name: 'per_page',
|
||||||
display: 'Items per page',
|
display: 'Items per page',
|
||||||
|
@ -163,7 +163,7 @@ class Settings extends App.ControllerModal
|
||||||
class: 'medium',
|
class: 'medium',
|
||||||
# item_class: 'pull-left',
|
# item_class: 'pull-left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'attributes',
|
name: 'attributes',
|
||||||
display: 'Attributes',
|
display: 'Attributes',
|
||||||
tag: 'checkbox',
|
tag: 'checkbox',
|
||||||
|
@ -174,8 +174,8 @@ class Settings extends App.ControllerModal
|
||||||
number: 'Number'
|
number: 'Number'
|
||||||
title: 'Title'
|
title: 'Title'
|
||||||
customer: 'Customer'
|
customer: 'Customer'
|
||||||
ticket_state: 'State'
|
state: 'State'
|
||||||
ticket_priority: 'Priority'
|
priority: 'Priority'
|
||||||
group: 'Group'
|
group: 'Group'
|
||||||
owner: 'Owner'
|
owner: 'Owner'
|
||||||
created_at: 'Age'
|
created_at: 'Age'
|
||||||
|
@ -190,7 +190,7 @@ class Settings extends App.ControllerModal
|
||||||
class: 'medium',
|
class: 'medium',
|
||||||
# item_class: 'pull-left',
|
# item_class: 'pull-left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'order_by',
|
name: 'order_by',
|
||||||
display: 'Order',
|
display: 'Order',
|
||||||
tag: 'select',
|
tag: 'select',
|
||||||
|
@ -201,8 +201,8 @@ class Settings extends App.ControllerModal
|
||||||
number: 'Number'
|
number: 'Number'
|
||||||
title: 'Title'
|
title: 'Title'
|
||||||
customer: 'Customer'
|
customer: 'Customer'
|
||||||
ticket_state: 'State'
|
state: 'State'
|
||||||
ticket_priority: 'Priority'
|
priority: 'Priority'
|
||||||
group: 'Group'
|
group: 'Group'
|
||||||
owner: 'Owner'
|
owner: 'Owner'
|
||||||
created_at: 'Age'
|
created_at: 'Age'
|
||||||
|
@ -216,7 +216,7 @@ class Settings extends App.ControllerModal
|
||||||
},
|
},
|
||||||
class: 'medium',
|
class: 'medium',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'order_by_direction',
|
name: 'order_by_direction',
|
||||||
display: 'Direction',
|
display: 'Direction',
|
||||||
tag: 'select',
|
tag: 'select',
|
||||||
|
|
|
@ -145,19 +145,19 @@ class App.TicketCreate extends App.Controller
|
||||||
|
|
||||||
# set defaults
|
# set defaults
|
||||||
defaults =
|
defaults =
|
||||||
ticket_state_id: App.TicketState.findByAttribute( 'name', 'open' ).id
|
state_id: App.TicketState.findByAttribute( 'name', 'open' ).id
|
||||||
ticket_priority_id: App.TicketPriority.findByAttribute( 'name', '2 normal' ).id
|
priority_id: App.TicketPriority.findByAttribute( 'name', '2 normal' ).id
|
||||||
|
|
||||||
# generate form
|
# generate form
|
||||||
configure_attributes = [
|
configure_attributes = [
|
||||||
{ name: 'customer_id', display: 'Customer', tag: 'autocompletion', type: 'text', limit: 200, null: false, relation: 'User', class: 'span7', autocapitalize: false, help: 'Select the customer of the Ticket or create one.', link: '<a href="" class="customer_new">»</a>', callback: @localUserInfo, source: @apiPath + '/users/search', minLengt: 2 },
|
{ name: 'customer_id', display: 'Customer', tag: 'autocompletion', type: 'text', limit: 200, null: false, relation: 'User', class: 'span7', autocapitalize: false, help: 'Select the customer of the Ticket or create one.', link: '<a href="" class="customer_new">»</a>', callback: @localUserInfo, source: @apiPath + '/users/search', minLengt: 2 },
|
||||||
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: false, filter: @edit_form, nulloption: true, relation: 'Group', default: defaults['group_id'], class: 'span7', },
|
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: false, filter: @edit_form, nulloption: true, relation: 'Group', default: defaults['group_id'], class: 'span7', },
|
||||||
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, filter: @edit_form, nulloption: true, relation: 'User', default: defaults['owner_id'], class: 'span7', },
|
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, filter: @edit_form, nulloption: true, relation: 'User', default: defaults['owner_id'], class: 'span7', },
|
||||||
{ name: 'tags', display: 'Tags', tag: 'tag', type: 'text', null: true, default: defaults['tags'], class: 'span7', },
|
{ name: 'tags', display: 'Tags', tag: 'tag', type: 'text', null: true, default: defaults['tags'], class: 'span7', },
|
||||||
{ name: 'subject', display: 'Subject', tag: 'input', type: 'text', limit: 200, null: false, default: defaults['subject'], class: 'span7', },
|
{ name: 'subject', display: 'Subject', tag: 'input', type: 'text', limit: 200, null: false, default: defaults['subject'], class: 'span7', },
|
||||||
{ name: 'body', display: 'Text', tag: 'textarea', rows: 8, null: false, default: defaults['body'], class: 'span7', upload: true },
|
{ name: 'body', display: 'Text', tag: 'textarea', rows: 8, null: false, default: defaults['body'], class: 'span7', upload: true },
|
||||||
{ name: 'ticket_state_id', display: 'State', tag: 'select', multiple: false, null: false, filter: @edit_form, relation: 'TicketState', default: defaults['ticket_state_id'], translate: true, class: 'medium' },
|
{ name: 'state_id', display: 'State', tag: 'select', multiple: false, null: false, filter: @edit_form, relation: 'TicketState', default: defaults['state_id'], translate: true, class: 'medium' },
|
||||||
{ name: 'ticket_priority_id', display: 'Priority', tag: 'select', multiple: false, null: false, filter: @edit_form, relation: 'TicketPriority', default: defaults['ticket_priority_id'], translate: true, class: 'medium' },
|
{ name: 'priority_id', display: 'Priority', tag: 'select', multiple: false, null: false, filter: @edit_form, relation: 'TicketPriority', default: defaults['priority_id'], translate: true, class: 'medium' },
|
||||||
]
|
]
|
||||||
@html App.view('agent_ticket_create')(
|
@html App.view('agent_ticket_create')(
|
||||||
head: 'New Ticket'
|
head: 'New Ticket'
|
||||||
|
@ -246,23 +246,23 @@ class App.TicketCreate extends App.Controller
|
||||||
# create article
|
# create article
|
||||||
if sender.name is 'Customer'
|
if sender.name is 'Customer'
|
||||||
params['article'] = {
|
params['article'] = {
|
||||||
to: (group && group.name) || ''
|
to: (group && group.name) || ''
|
||||||
from: params.customer_id_autocompletion
|
from: params.customer_id_autocompletion
|
||||||
subject: params.subject
|
subject: params.subject
|
||||||
body: params.body
|
body: params.body
|
||||||
ticket_article_type_id: type.id
|
type_id: type.id
|
||||||
ticket_article_sender_id: sender.id
|
sender_id: sender.id
|
||||||
form_id: @form_id
|
form_id: @form_id
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
params['article'] = {
|
params['article'] = {
|
||||||
from: (group && group.name) || ''
|
from: (group && group.name) || ''
|
||||||
to: params.customer_id_autocompletion
|
to: params.customer_id_autocompletion
|
||||||
subject: params.subject
|
subject: params.subject
|
||||||
body: params.body
|
body: params.body
|
||||||
ticket_article_type_id: type.id
|
type_id: type.id
|
||||||
ticket_article_sender_id: sender.id
|
sender_id: sender.id
|
||||||
form_id: @form_id
|
form_id: @form_id
|
||||||
}
|
}
|
||||||
|
|
||||||
object.load(params)
|
object.load(params)
|
||||||
|
|
|
@ -37,8 +37,8 @@ class App.TicketMerge extends App.ControllerModal
|
||||||
{ name: 'number', link: true },
|
{ name: 'number', link: true },
|
||||||
{ name: 'title', link: true },
|
{ name: 'title', link: true },
|
||||||
# { name: 'customer', class: 'user-popover', data: { id: true } },
|
# { name: 'customer', class: 'user-popover', data: { id: true } },
|
||||||
{ name: 'ticket_state', translate: true },
|
{ name: 'state', translate: true },
|
||||||
# { name: 'ticket_priority', translate: true },
|
# { name: 'priority', translate: true },
|
||||||
{ name: 'group' },
|
{ name: 'group' },
|
||||||
# { name: 'owner', class: 'user-popover', data: { id: true } },
|
# { name: 'owner', class: 'user-popover', data: { id: true } },
|
||||||
{ name: 'created_at', callback: @humanTime },
|
{ name: 'created_at', callback: @humanTime },
|
||||||
|
@ -64,8 +64,8 @@ class App.TicketMerge extends App.ControllerModal
|
||||||
{ name: 'number', link: true },
|
{ name: 'number', link: true },
|
||||||
{ name: 'title', link: true },
|
{ name: 'title', link: true },
|
||||||
# { name: 'customer', class: 'user-popover', data: { id: true } },
|
# { name: 'customer', class: 'user-popover', data: { id: true } },
|
||||||
{ name: 'ticket_state', translate: true },
|
{ name: 'state', translate: true },
|
||||||
# { name: 'ticket_priority', translate: true },
|
# { name: 'priority', translate: true },
|
||||||
{ name: 'group' },
|
{ name: 'group' },
|
||||||
# { name: 'owner', class: 'user-popover', data: { id: true } },
|
# { name: 'owner', class: 'user-popover', data: { id: true } },
|
||||||
{ name: 'created_at', callback: @humanTime },
|
{ name: 'created_at', callback: @humanTime },
|
||||||
|
|
|
@ -57,10 +57,10 @@ class Index extends App.ControllerContent
|
||||||
|
|
||||||
# set defaults
|
# set defaults
|
||||||
defaults = template['options'] || {}
|
defaults = template['options'] || {}
|
||||||
if !( 'ticket_state_id' of defaults )
|
if !( 'state_id' of defaults )
|
||||||
defaults['ticket_state_id'] = App.TicketState.findByAttribute( 'name', 'new' )
|
defaults['state_id'] = App.TicketState.findByAttribute( 'name', 'new' )
|
||||||
if !( 'ticket_priority_id' of defaults )
|
if !( 'priority_id' of defaults )
|
||||||
defaults['ticket_priority_id'] = App.TicketPriority.findByAttribute( 'name', '2 normal' )
|
defaults['priority_id'] = App.TicketPriority.findByAttribute( 'name', '2 normal' )
|
||||||
|
|
||||||
groupFilter = (collection, type) =>
|
groupFilter = (collection, type) =>
|
||||||
|
|
||||||
|
@ -87,14 +87,14 @@ class Index extends App.ControllerContent
|
||||||
return item if item && _.contains( group_ids, item.id.toString() )
|
return item if item && _.contains( group_ids, item.id.toString() )
|
||||||
)
|
)
|
||||||
|
|
||||||
# generate form
|
# generate form
|
||||||
configure_attributes = [
|
configure_attributes = [
|
||||||
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: false, filter: groupFilter, nulloption: true, relation: 'Group', default: defaults['group_id'], class: 'span7', },
|
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: false, filter: groupFilter, nulloption: true, relation: 'Group', default: defaults['group_id'], class: 'span7', },
|
||||||
# { name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, filter: @edit_form, nulloption: true, relation: 'User', default: defaults['owner_id'], class: 'span7', },
|
# { name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, filter: @edit_form, nulloption: true, relation: 'User', default: defaults['owner_id'], class: 'span7', },
|
||||||
{ name: 'subject', display: 'Subject', tag: 'input', type: 'text', limit: 100, null: false, default: defaults['subject'], class: 'span7', },
|
{ name: 'subject', display: 'Subject', tag: 'input', type: 'text', limit: 100, null: false, default: defaults['subject'], class: 'span7', },
|
||||||
{ name: 'body', display: 'Text', tag: 'textarea', rows: 10, null: false, default: defaults['body'], class: 'span7', upload: true },
|
{ name: 'body', display: 'Text', tag: 'textarea', rows: 10, null: false, default: defaults['body'], class: 'span7', upload: true },
|
||||||
# { name: 'ticket_state_id', display: 'State', tag: 'select', multiple: false, null: false, filter: @edit_form, relation: 'TicketState', default: defaults['ticket_state_id'], translate: true, class: 'medium' },
|
# { name: 'state_id', display: 'State', tag: 'select', multiple: false, null: false, filter: @edit_form, relation: 'TicketState', default: defaults['state_id'], translate: true, class: 'medium' },
|
||||||
# { name: 'ticket_priority_id', display: 'Priority', tag: 'select', multiple: false, null: false, filter: @edit_form, relation: 'TicketPriority', default: defaults['ticket_priority_id'], translate: true, class: 'medium' },
|
# { name: 'priority_id', display: 'Priority', tag: 'select', multiple: false, null: false, filter: @edit_form, relation: 'TicketPriority', default: defaults['priority_id'], translate: true, class: 'medium' },
|
||||||
]
|
]
|
||||||
@html App.view('customer_ticket_create')( head: 'New Ticket' )
|
@html App.view('customer_ticket_create')( head: 'New Ticket' )
|
||||||
|
|
||||||
|
@ -129,11 +129,11 @@ class Index extends App.ControllerContent
|
||||||
|
|
||||||
# set prio
|
# set prio
|
||||||
priority = App.TicketPriority.findByAttribute( 'name', '2 normal' )
|
priority = App.TicketPriority.findByAttribute( 'name', '2 normal' )
|
||||||
params.ticket_priority_id = priority.id
|
params.priority_id = priority.id
|
||||||
|
|
||||||
# set state
|
# set state
|
||||||
state = App.TicketState.findByAttribute( 'name', 'new' )
|
state = App.TicketState.findByAttribute( 'name', 'new' )
|
||||||
params.ticket_state_id = state.id
|
params.state_id = state.id
|
||||||
|
|
||||||
# fillup params
|
# fillup params
|
||||||
if !params.title
|
if !params.title
|
||||||
|
@ -147,17 +147,17 @@ class Index extends App.ControllerContent
|
||||||
sender = App.TicketArticleSender.findByAttribute( 'name', 'Customer' )
|
sender = App.TicketArticleSender.findByAttribute( 'name', 'Customer' )
|
||||||
type = App.TicketArticleType.findByAttribute( 'name', 'web' )
|
type = App.TicketArticleType.findByAttribute( 'name', 'web' )
|
||||||
if params.group_id
|
if params.group_id
|
||||||
group = App.Group.find( params.group_id )
|
group = App.Group.find( params.group_id )
|
||||||
|
|
||||||
# create article
|
# create article
|
||||||
params['article'] = {
|
params['article'] = {
|
||||||
from: "#{ @Session.get('firstname') } #{ @Session.get('lastname') }"
|
from: "#{ @Session.get('firstname') } #{ @Session.get('lastname') }"
|
||||||
to: (group && group.name) || ''
|
to: (group && group.name) || ''
|
||||||
subject: params.subject
|
subject: params.subject
|
||||||
body: params.body
|
body: params.body
|
||||||
ticket_article_type_id: type.id
|
type_id: type.id
|
||||||
ticket_article_sender_id: sender.id
|
sender_id: sender.id
|
||||||
form_id: @form_id
|
form_id: @form_id
|
||||||
}
|
}
|
||||||
|
|
||||||
object.load(params)
|
object.load(params)
|
||||||
|
@ -172,7 +172,7 @@ class Index extends App.ControllerContent
|
||||||
@formValidate( form: e.target, errors: errors )
|
@formValidate( form: e.target, errors: errors )
|
||||||
|
|
||||||
# save ticket, create article
|
# save ticket, create article
|
||||||
else
|
else
|
||||||
|
|
||||||
# disable form
|
# disable form
|
||||||
@formDisable(e)
|
@formDisable(e)
|
||||||
|
|
|
@ -218,7 +218,7 @@ class Table extends App.ControllerContent
|
||||||
if @el.find('.table-overview').find('[name="bulk"]:checked').length isnt 0
|
if @el.find('.table-overview').find('[name="bulk"]:checked').length isnt 0
|
||||||
@el.find('.bulk-action').removeClass('hide')
|
@el.find('.bulk-action').removeClass('hide')
|
||||||
|
|
||||||
# show/hide bulk action
|
# show/hide bulk action
|
||||||
@el.find('.table-overview').delegate('[name="bulk"], [name="bulk_all"]', 'click', (e) =>
|
@el.find('.table-overview').delegate('[name="bulk"], [name="bulk_all"]', 'click', (e) =>
|
||||||
if @el.find('.table-overview').find('[name="bulk"]:checked').length == 0
|
if @el.find('.table-overview').find('[name="bulk"]:checked').length == 0
|
||||||
|
|
||||||
|
@ -253,10 +253,10 @@ class Table extends App.ControllerContent
|
||||||
|
|
||||||
bulk_form: =>
|
bulk_form: =>
|
||||||
@configure_attributes_ticket = [
|
@configure_attributes_ticket = [
|
||||||
{ name: 'ticket_state_id', display: 'State', tag: 'select', multiple: false, null: true, relation: 'TicketState', filter: @bulk, translate: true, nulloption: true, default: '', class: 'span2', item_class: 'pull-left' },
|
{ name: 'state_id', display: 'State', tag: 'select', multiple: false, null: true, relation: 'TicketState', filter: @bulk, translate: true, nulloption: true, default: '', class: 'span2', item_class: 'pull-left' },
|
||||||
{ name: 'ticket_priority_id', display: 'Priority', tag: 'select', multiple: false, null: true, relation: 'TicketPriority', filter: @bulk, translate: true, nulloption: true, default: '', class: 'span2', item_class: 'pull-left' },
|
{ name: 'priority_id', display: 'Priority', tag: 'select', multiple: false, null: true, relation: 'TicketPriority', filter: @bulk, translate: true, nulloption: true, default: '', class: 'span2', item_class: 'pull-left' },
|
||||||
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: true, relation: 'Group', filter: @bulk, nulloption: true, class: 'span2', item_class: 'pull-left' },
|
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: true, relation: 'Group', filter: @bulk, nulloption: true, class: 'span2', item_class: 'pull-left' },
|
||||||
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, relation: 'User', filter: @bulk, nulloption: true, class: 'span2', item_class: 'pull-left' },
|
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, relation: 'User', filter: @bulk, nulloption: true, class: 'span2', item_class: 'pull-left' },
|
||||||
]
|
]
|
||||||
|
|
||||||
# render init page
|
# render init page
|
||||||
|
@ -359,10 +359,10 @@ class Settings extends App.ControllerModal
|
||||||
overview: @overview,
|
overview: @overview,
|
||||||
)
|
)
|
||||||
@configure_attributes_article = [
|
@configure_attributes_article = [
|
||||||
# { name: 'from', display: 'From', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8', },
|
# { name: 'from', display: 'From', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8', },
|
||||||
# { name: 'to', display: 'To', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', item_class: 'hide' },
|
# { name: 'to', display: 'To', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', item_class: 'hide' },
|
||||||
# { name: 'ticket_article_type_id', display: 'Type', tag: 'select', multiple: false, null: true, relation: 'TicketArticleType', default: '9', class: 'medium', item_class: 'pull-left' },
|
# { name: 'type_id', display: 'Type', tag: 'select', multiple: false, null: true, relation: 'TicketArticleType', default: '9', class: 'medium', item_class: 'pull-left' },
|
||||||
# { name: 'internal', display: 'Visibility', tag: 'radio', default: false, null: true, options: { true: 'internal', false: 'public' }, class: 'medium', item_class: 'pull-left' },
|
# { name: 'internal', display: 'Visibility', tag: 'radio', default: false, null: true, options: { true: 'internal', false: 'public' }, class: 'medium', item_class: 'pull-left' },
|
||||||
{
|
{
|
||||||
name: 'per_page'
|
name: 'per_page'
|
||||||
display: 'Items per page'
|
display: 'Items per page'
|
||||||
|
@ -392,8 +392,8 @@ class Settings extends App.ControllerModal
|
||||||
number: 'Number'
|
number: 'Number'
|
||||||
title: 'Title'
|
title: 'Title'
|
||||||
customer: 'Customer'
|
customer: 'Customer'
|
||||||
ticket_state: 'State'
|
state: 'State'
|
||||||
ticket_priority: 'Priority'
|
priority: 'Priority'
|
||||||
group: 'Group'
|
group: 'Group'
|
||||||
owner: 'Owner'
|
owner: 'Owner'
|
||||||
created_at: 'Age'
|
created_at: 'Age'
|
||||||
|
@ -406,7 +406,7 @@ class Settings extends App.ControllerModal
|
||||||
article_count: 'Article Count'
|
article_count: 'Article Count'
|
||||||
class: 'medium'
|
class: 'medium'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'order_by'
|
name: 'order_by'
|
||||||
display: 'Order'
|
display: 'Order'
|
||||||
tag: 'select'
|
tag: 'select'
|
||||||
|
@ -417,8 +417,8 @@ class Settings extends App.ControllerModal
|
||||||
number: 'Number'
|
number: 'Number'
|
||||||
title: 'Title'
|
title: 'Title'
|
||||||
customer: 'Customer'
|
customer: 'Customer'
|
||||||
ticket_state: 'State'
|
state: 'State'
|
||||||
ticket_priority: 'Priority'
|
priority: 'Priority'
|
||||||
group: 'Group'
|
group: 'Group'
|
||||||
owner: 'Owner'
|
owner: 'Owner'
|
||||||
created_at: 'Age'
|
created_at: 'Age'
|
||||||
|
@ -431,7 +431,7 @@ class Settings extends App.ControllerModal
|
||||||
article_count: 'Article Count'
|
article_count: 'Article Count'
|
||||||
class: 'medium'
|
class: 'medium'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'order_by_direction'
|
name: 'order_by_direction'
|
||||||
display: 'Direction'
|
display: 'Direction'
|
||||||
tag: 'select'
|
tag: 'select'
|
||||||
|
@ -443,7 +443,7 @@ class Settings extends App.ControllerModal
|
||||||
DESC: 'down'
|
DESC: 'down'
|
||||||
class: 'medium'
|
class: 'medium'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'group_by'
|
name: 'group_by'
|
||||||
display: 'Group by'
|
display: 'Group by'
|
||||||
tag: 'select'
|
tag: 'select'
|
||||||
|
@ -453,8 +453,8 @@ class Settings extends App.ControllerModal
|
||||||
translate: true
|
translate: true
|
||||||
options:
|
options:
|
||||||
customer: 'Customer'
|
customer: 'Customer'
|
||||||
ticket_state: 'State'
|
state: 'State'
|
||||||
ticket_priority: 'Priority'
|
priority: 'Priority'
|
||||||
group: 'Group'
|
group: 'Group'
|
||||||
owner: 'Owner'
|
owner: 'Owner'
|
||||||
class: 'medium'
|
class: 'medium'
|
||||||
|
@ -467,7 +467,7 @@ class Settings extends App.ControllerModal
|
||||||
# null: false,
|
# null: false,
|
||||||
# relation: 'TicketArticleType',
|
# relation: 'TicketArticleType',
|
||||||
# default: '9',
|
# default: '9',
|
||||||
# class: 'medium',
|
# class: 'medium',
|
||||||
# item_class: 'pull-left',
|
# item_class: 'pull-left',
|
||||||
# },
|
# },
|
||||||
]
|
]
|
||||||
|
|
|
@ -336,25 +336,25 @@ class Edit extends App.Controller
|
||||||
)
|
)
|
||||||
|
|
||||||
@configure_attributes_ticket = [
|
@configure_attributes_ticket = [
|
||||||
{ name: 'ticket_state_id', display: 'State', tag: 'select', multiple: false, null: true, relation: 'TicketState', filter: @edit_form, translate: true, class: 'span2', item_class: 'pull-left' },
|
{ name: 'state_id', display: 'State', tag: 'select', multiple: false, null: true, relation: 'TicketState', filter: @edit_form, translate: true, class: 'span2', item_class: 'pull-left' },
|
||||||
{ name: 'ticket_priority_id', display: 'Priority', tag: 'select', multiple: false, null: true, relation: 'TicketPriority', filter: @edit_form, translate: true, class: 'span2', item_class: 'pull-left' },
|
{ name: 'priority_id', display: 'Priority', tag: 'select', multiple: false, null: true, relation: 'TicketPriority', filter: @edit_form, translate: true, class: 'span2', item_class: 'pull-left' },
|
||||||
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: true, relation: 'Group', filter: @edit_form, class: 'span2', item_class: 'pull-left' },
|
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, null: true, relation: 'Group', filter: @edit_form, class: 'span2', item_class: 'pull-left' },
|
||||||
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, relation: 'User', filter: @edit_form, nulloption: true, class: 'span2', item_class: 'pull-left' },
|
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, null: true, relation: 'User', filter: @edit_form, nulloption: true, class: 'span2', item_class: 'pull-left' },
|
||||||
]
|
]
|
||||||
if @isRole('Customer')
|
if @isRole('Customer')
|
||||||
@configure_attributes_ticket = [
|
@configure_attributes_ticket = [
|
||||||
{ name: 'ticket_state_id', display: 'State', tag: 'select', multiple: false, null: true, relation: 'TicketState', filter: @edit_form, translate: true, class: 'span2', item_class: 'pull-left' },
|
{ name: 'state_id', display: 'State', tag: 'select', multiple: false, null: true, relation: 'TicketState', filter: @edit_form, translate: true, class: 'span2', item_class: 'pull-left' },
|
||||||
{ name: 'ticket_priority_id', display: 'Priority', tag: 'select', multiple: false, null: true, relation: 'TicketPriority', filter: @edit_form, translate: true, class: 'span2', item_class: 'pull-left' },
|
{ name: 'priority_id', display: 'Priority', tag: 'select', multiple: false, null: true, relation: 'TicketPriority', filter: @edit_form, translate: true, class: 'span2', item_class: 'pull-left' },
|
||||||
]
|
]
|
||||||
|
|
||||||
@configure_attributes_article = [
|
@configure_attributes_article = [
|
||||||
{ name: 'ticket_article_type_id', display: 'Type', tag: 'select', multiple: false, null: true, relation: 'TicketArticleType', filter: @edit_form, default: '9', translate: true, class: 'medium' },
|
{ name: 'type_id', display: 'Type', tag: 'select', multiple: false, null: true, relation: 'TicketArticleType', filter: @edit_form, default: '9', translate: true, class: 'medium' },
|
||||||
{ name: 'internal', display: 'Visibility', tag: 'select', null: true, options: { true: 'internal', false: 'public' }, class: 'medium', item_class: '', default: false },
|
{ name: 'internal', display: 'Visibility', tag: 'select', null: true, options: { true: 'internal', false: 'public' }, class: 'medium', item_class: '', default: false },
|
||||||
{ name: 'to', display: 'To', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', hide: true },
|
{ name: 'to', display: 'To', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', hide: true },
|
||||||
{ name: 'cc', display: 'Cc', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', hide: true },
|
{ name: 'cc', display: 'Cc', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', hide: true },
|
||||||
# { name: 'subject', display: 'Subject', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', hide: true },
|
# { name: 'subject', display: 'Subject', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', hide: true },
|
||||||
{ name: 'in_reply_to', display: 'In Reply to', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', item_class: 'hide' },
|
{ name: 'in_reply_to', display: 'In Reply to', tag: 'input', type: 'text', limit: 100, null: true, class: 'span7', item_class: 'hide' },
|
||||||
{ name: 'body', display: 'Text', tag: 'textarea', rows: 6, limit: 100, null: true, class: 'span7', item_class: '', upload: true },
|
{ name: 'body', display: 'Text', tag: 'textarea', rows: 6, limit: 100, null: true, class: 'span7', item_class: '', upload: true },
|
||||||
]
|
]
|
||||||
if @isRole('Customer')
|
if @isRole('Customer')
|
||||||
@configure_attributes_article = [
|
@configure_attributes_article = [
|
||||||
|
@ -390,7 +390,7 @@ class Edit extends App.Controller
|
||||||
dependency: [
|
dependency: [
|
||||||
{
|
{
|
||||||
bind: {
|
bind: {
|
||||||
name: 'ticket_article_type_id'
|
name: 'type_id'
|
||||||
relation: 'TicketArticleType'
|
relation: 'TicketArticleType'
|
||||||
value: ['email']
|
value: ['email']
|
||||||
},
|
},
|
||||||
|
@ -401,7 +401,7 @@ class Edit extends App.Controller
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
bind: {
|
bind: {
|
||||||
name: 'ticket_article_type_id'
|
name: 'type_id'
|
||||||
relation: 'TicketArticleType'
|
relation: 'TicketArticleType'
|
||||||
value: ['note', 'twitter status', 'twitter direct-message']
|
value: ['note', 'twitter status', 'twitter direct-message']
|
||||||
},
|
},
|
||||||
|
@ -450,14 +450,14 @@ class Edit extends App.Controller
|
||||||
|
|
||||||
# find sender_id
|
# find sender_id
|
||||||
if @isRole('Customer')
|
if @isRole('Customer')
|
||||||
sender = App.TicketArticleSender.findByAttribute( 'name', 'Customer' )
|
sender = App.TicketArticleSender.findByAttribute( 'name', 'Customer' )
|
||||||
article_type = App.TicketArticleType.findByAttribute( 'name', 'web' )
|
article_type = App.TicketArticleType.findByAttribute( 'name', 'web' )
|
||||||
params.ticket_article_type_id = article_type.id
|
params.type_id = article_type.id
|
||||||
params.ticket_article_sender_id = sender.id
|
params.sender_id = sender.id
|
||||||
else
|
else
|
||||||
sender = App.TicketArticleSender.findByAttribute( 'name', 'Agent' )
|
sender = App.TicketArticleSender.findByAttribute( 'name', 'Agent' )
|
||||||
article_type = App.TicketArticleType.find( params['ticket_article_type_id'] )
|
article_type = App.TicketArticleType.find( params['type_id'] )
|
||||||
params.ticket_article_sender_id = sender.id
|
params.sender_id = sender.id
|
||||||
|
|
||||||
# update ticket
|
# update ticket
|
||||||
ticket_update = {}
|
ticket_update = {}
|
||||||
|
@ -641,16 +641,16 @@ class ArticleView extends App.Controller
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
article_id = $(e.target).parents('[data-id]').data('id')
|
article_id = $(e.target).parents('[data-id]').data('id')
|
||||||
article = App.TicketArticle.find( article_id )
|
article = App.TicketArticle.find( article_id )
|
||||||
article_type = App.TicketArticleType.find( article.ticket_article_type_id )
|
article_type = App.TicketArticleType.find( article.type_id )
|
||||||
customer = App.User.find( article.created_by_id )
|
customer = App.User.find( article.created_by_id )
|
||||||
|
|
||||||
# update form
|
# update form
|
||||||
@checkIfSignatureIsNeeded(article_type)
|
@checkIfSignatureIsNeeded(article_type)
|
||||||
|
|
||||||
# preselect article type
|
# preselect article type
|
||||||
@ui.el.find('[name="ticket_article_type_id"]').find('option:selected').removeAttr('selected')
|
@ui.el.find('[name="type_id"]').find('option:selected').removeAttr('selected')
|
||||||
@ui.el.find('[name="ticket_article_type_id"]').find('[value="' + article_type.id + '"]').attr('selected',true)
|
@ui.el.find('[name="type_id"]').find('[value="' + article_type.id + '"]').attr('selected',true)
|
||||||
@ui.el.find('[name="ticket_article_type_id"]').trigger('change')
|
@ui.el.find('[name="type_id"]').trigger('change')
|
||||||
|
|
||||||
# empty form
|
# empty form
|
||||||
#@ui.el.find('[name="to"]').val('')
|
#@ui.el.find('[name="to"]').val('')
|
||||||
|
|
|
@ -41,7 +41,7 @@ class App.WidgetLink extends App.ControllerDrox
|
||||||
|
|
||||||
if item['link_object'] is 'Ticket'
|
if item['link_object'] is 'Ticket'
|
||||||
ticket = App.Ticket.retrieve( item['link_object_value'] )
|
ticket = App.Ticket.retrieve( item['link_object_value'] )
|
||||||
if ticket.ticket_state.name is 'merged'
|
if ticket.state.name is 'merged'
|
||||||
ticket.css = 'merged'
|
ticket.css = 'merged'
|
||||||
list[ item['link_type'] ].push ticket
|
list[ item['link_type'] ].push ticket
|
||||||
|
|
||||||
|
|
|
@ -15,15 +15,15 @@ class App.Overview extends App.Model
|
||||||
name: 'view::s'
|
name: 'view::s'
|
||||||
display: 'Attributes'
|
display: 'Attributes'
|
||||||
tag: 'checkbox'
|
tag: 'checkbox'
|
||||||
default: ['number', 'title', 'ticket_state', 'created_at']
|
default: ['number', 'title', 'state', 'created_at']
|
||||||
null: false
|
null: false
|
||||||
translate: true
|
translate: true
|
||||||
options:
|
options:
|
||||||
number: 'Number'
|
number: 'Number'
|
||||||
title: 'Title'
|
title: 'Title'
|
||||||
customer: 'Customer'
|
customer: 'Customer'
|
||||||
ticket_state: 'State'
|
state: 'State'
|
||||||
ticket_priority: 'Priority'
|
priority: 'Priority'
|
||||||
group: 'Group'
|
group: 'Group'
|
||||||
owner: 'Owner'
|
owner: 'Owner'
|
||||||
created_at: 'Age'
|
created_at: 'Age'
|
||||||
|
@ -47,8 +47,8 @@ class App.Overview extends App.Model
|
||||||
number: 'Number'
|
number: 'Number'
|
||||||
title: 'Title'
|
title: 'Title'
|
||||||
customer: 'Customer'
|
customer: 'Customer'
|
||||||
ticket_state: 'State'
|
state: 'State'
|
||||||
ticket_priority: 'Priority'
|
priority: 'Priority'
|
||||||
group: 'Group'
|
group: 'Group'
|
||||||
owner: 'Owner'
|
owner: 'Owner'
|
||||||
created_at: 'Age'
|
created_at: 'Age'
|
||||||
|
@ -82,8 +82,8 @@ class App.Overview extends App.Model
|
||||||
translate: true
|
translate: true
|
||||||
options:
|
options:
|
||||||
customer: 'Customer'
|
customer: 'Customer'
|
||||||
ticket_state: 'State'
|
state: 'State'
|
||||||
ticket_priority: 'Priority'
|
priority: 'Priority'
|
||||||
group: 'Group'
|
group: 'Group'
|
||||||
owner: 'Owner'
|
owner: 'Owner'
|
||||||
class: 'span4'
|
class: 'span4'
|
||||||
|
|
|
@ -25,11 +25,11 @@ class App.Sla extends App.Model
|
||||||
nulloption: true
|
nulloption: true
|
||||||
translate: true
|
translate: true
|
||||||
options:
|
options:
|
||||||
customer: 'Customer'
|
customer: 'Customer'
|
||||||
ticket_state: 'State'
|
state: 'State'
|
||||||
ticket_priority: 'Priority'
|
priority: 'Priority'
|
||||||
group: 'Group'
|
group: 'Group'
|
||||||
owner: 'Owner'
|
owner: 'Owner'
|
||||||
class: 'span4'
|
class: 'span4'
|
||||||
},
|
},
|
||||||
{ name: 'updated_at', display: 'Updated', type: 'time', readonly: 1 },
|
{ name: 'updated_at', display: 'Updated', type: 'time', readonly: 1 },
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class App.Ticket extends App.Model
|
class App.Ticket extends App.Model
|
||||||
@configure 'Ticket', 'number', 'title', 'group_id', 'owner_id', 'customer_id', 'ticket_state_id', 'ticket_priority_id', 'article', 'tags', 'updated_at'
|
@configure 'Ticket', 'number', 'title', 'group_id', 'owner_id', 'customer_id', 'state_id', 'priority_id', 'article', 'tags', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: @apiPath + '/tickets'
|
@url: @apiPath + '/tickets'
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
|
@ -8,8 +8,8 @@ class App.Ticket extends App.Model
|
||||||
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, limit: 100, null: false, class: 'span8', relation: 'Group', style: 'width: 10%' },
|
{ name: 'group_id', display: 'Group', tag: 'select', multiple: false, limit: 100, null: false, class: 'span8', relation: 'Group', style: 'width: 10%' },
|
||||||
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, limit: 100, null: true, class: 'span8', relation: 'User', style: 'width: 12%' },
|
{ name: 'owner_id', display: 'Owner', tag: 'select', multiple: false, limit: 100, null: true, class: 'span8', relation: 'User', style: 'width: 12%' },
|
||||||
{ name: 'title', display: 'Title', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8' },
|
{ name: 'title', display: 'Title', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8' },
|
||||||
{ name: 'ticket_state_id', display: 'State', tag: 'select', multiple: false, null: false, relation: 'TicketState', default: 'new', class: 'medium', style: 'width: 12%' },
|
{ name: 'state_id', display: 'State', tag: 'select', multiple: false, null: false, relation: 'TicketState', default: 'new', class: 'medium', style: 'width: 12%' },
|
||||||
{ name: 'ticket_priority_id', display: 'Priority', tag: 'select', multiple: false, null: false, relation: 'TicketPriority', default: '2 normal', class: 'medium', style: 'width: 12%' },
|
{ name: 'priority_id', display: 'Priority', tag: 'select', multiple: false, null: false, relation: 'TicketPriority', default: '2 normal', class: 'medium', style: 'width: 12%' },
|
||||||
{ name: 'created_at', display: 'Created', tag: 'time', style: 'width: 12%' },
|
{ name: 'created_at', display: 'Created', tag: 'time', style: 'width: 12%' },
|
||||||
{ name: 'last_contact', display: 'Last contact', tag: 'time', null: true, style: 'width: 12%' },
|
{ name: 'last_contact', display: 'Last contact', tag: 'time', null: true, style: 'width: 12%' },
|
||||||
{ name: 'last_contact_agent', display: 'Last contact (Agent)', tag: 'time', null: true, style: 'width: 12%' },
|
{ name: 'last_contact_agent', display: 'Last contact (Agent)', tag: 'time', null: true, style: 'width: 12%' },
|
||||||
|
@ -26,10 +26,10 @@ class App.Ticket extends App.Model
|
||||||
@_fillUp: (data) ->
|
@_fillUp: (data) ->
|
||||||
|
|
||||||
# priority
|
# priority
|
||||||
data.ticket_priority = App.TicketPriority.find( data.ticket_priority_id )
|
data.priority = App.TicketPriority.find( data.priority_id )
|
||||||
|
|
||||||
# state
|
# state
|
||||||
data.ticket_state = App.TicketState.find( data.ticket_state_id )
|
data.state = App.TicketState.find( data.state_id )
|
||||||
|
|
||||||
# group
|
# group
|
||||||
data.group = App.Group.find( data.group_id )
|
data.group = App.Group.find( data.group_id )
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
class App.TicketArticle extends App.Model
|
class App.TicketArticle extends App.Model
|
||||||
@configure 'TicketArticle', 'from', 'to', 'cc', 'subject', 'body', 'ticket_id', 'ticket_article_type_id', 'ticket_article_sender_id', 'internal', 'in_reply_to', 'form_id', 'updated_at'
|
@configure 'TicketArticle', 'from', 'to', 'cc', 'subject', 'body', 'ticket_id', 'type_id', 'sender_id', 'internal', 'in_reply_to', 'form_id', 'updated_at'
|
||||||
@extend Spine.Model.Ajax
|
@extend Spine.Model.Ajax
|
||||||
@url: @apiPath + '/ticket_articles'
|
@url: @apiPath + '/ticket_articles'
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'ticket_id', display: 'TicketID', null: false, readonly: 1, },
|
{ name: 'ticket_id', display: 'TicketID', null: false, readonly: 1, },
|
||||||
{ name: 'from', display: 'From', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8', },
|
{ name: 'from', display: 'From', tag: 'input', type: 'text', limit: 100, null: false, class: 'span8', },
|
||||||
{ name: 'to', display: 'To', tag: 'input', type: 'text', limit: 100, null: true, class: 'span8', },
|
{ name: 'to', display: 'To', tag: 'input', type: 'text', limit: 100, null: true, class: 'span8', },
|
||||||
{ name: 'cc', display: 'Cc', tag: 'input', type: 'text', limit: 100, null: true, class: 'span8', },
|
{ name: 'cc', display: 'Cc', tag: 'input', type: 'text', limit: 100, null: true, class: 'span8', },
|
||||||
{ name: 'subject', display: 'Subject', tag: 'input', type: 'text', limit: 100, null: true, class: 'span8', },
|
{ name: 'subject', display: 'Subject', tag: 'input', type: 'text', limit: 100, null: true, class: 'span8', },
|
||||||
{ name: 'body', display: 'Text', tag: 'textarea', rows: 5, limit: 100, null: false, class: 'span8', },
|
{ name: 'body', display: 'Text', tag: 'textarea', rows: 5, limit: 100, null: false, class: 'span8', },
|
||||||
{ name: 'ticket_article_type_id', display: 'Type', tag: 'select', multiple: false, null: false, relation: 'TicketArticleType', default: '', class: 'medium' },
|
{ name: 'type_id', display: 'Type', tag: 'select', multiple: false, null: false, relation: 'TicketArticleType', default: '', class: 'medium' },
|
||||||
{ name: 'ticket_article_sender_id', display: 'Sender', tag: 'select', multiple: false, null: false, relation: 'TicketArticleSender', default: '', class: 'medium' },
|
{ name: 'sender_id', display: 'Sender', tag: 'select', multiple: false, null: false, relation: 'TicketArticleSender', default: '', class: 'medium' },
|
||||||
{ name: 'internal', display: 'Visibility', tag: 'radio', default: false, null: true, options: { true: 'internal', false: 'public' }, class: 'medium' },
|
{ name: 'internal', display: 'Visibility', tag: 'radio', default: false, null: true, options: { true: 'internal', false: 'public' }, class: 'medium' },
|
||||||
]
|
]
|
||||||
|
|
||||||
uiUrl: ->
|
uiUrl: ->
|
||||||
|
@ -29,12 +29,11 @@ class App.TicketArticle extends App.Model
|
||||||
data.updated_by = App.User.retrieve( data.updated_by_id )
|
data.updated_by = App.User.retrieve( data.updated_by_id )
|
||||||
|
|
||||||
# add relations
|
# add relations
|
||||||
data.article_type = App.TicketArticleType.find( data.ticket_article_type_id )
|
data.type = App.TicketArticleType.find( data.type_id )
|
||||||
data.article_sender = App.TicketArticleSender.find( data.ticket_article_sender_id )
|
data.sender = App.TicketArticleSender.find( data.sender_id )
|
||||||
|
|
||||||
data
|
data
|
||||||
|
|
||||||
|
|
||||||
displayName: ->
|
displayName: ->
|
||||||
if @subject
|
if @subject
|
||||||
return @subject
|
return @subject
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<h3><a href="#" data-type="edit"><%= ticket.title %></a> <small><%= ticket.number %> <span class="humanTimeFromNow" data-time="<%= ticket.created_at %>">?</span></small></h3>
|
<h3><a href="#" data-type="edit"><%= ticket.title %></a> <small><%= ticket.number %> <span class="humanTimeFromNow" data-time="<%= ticket.created_at %>">?</span></small></h3>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span2">
|
<div class="span2">
|
||||||
<b><%- @T( 'State' ) %></b> <%- @T( ticket.ticket_state.name ) %>
|
<b><%- @T( 'State' ) %></b> <%- @T( ticket.state.name ) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="span2">
|
<div class="span2">
|
||||||
<b><%- @T( 'Group' ) %></b> <%= ticket.group.name %>
|
<b><%- @T( 'Group' ) %></b> <%= ticket.group.name %>
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="span2">
|
<div class="span2">
|
||||||
<b><%- @T( 'Priority' ) %></b> <%- @T( ticket.ticket_priority.name ) %>
|
<b><%- @T( 'Priority' ) %></b> <%- @T( ticket.priority.name ) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="span2">
|
<div class="span2">
|
||||||
<b><%- @T( 'Owner' ) %></b> <%= ticket.owner.displayName() %>
|
<b><%- @T( 'Owner' ) %></b> <%= ticket.owner.displayName() %>
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%- @P( @ticket.group ) %></td>
|
<td><%- @P( @ticket.group ) %></td>
|
||||||
<td><%- @T( @ticket.ticket_state.name ) %></td>
|
<td><%- @T( @ticket.state.name ) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%- @T( @ticket.ticket_priority.name ) %></td>
|
<td><%- @T( @ticket.priority.name ) %></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
<td><%- @T('Group') %></td><td><%= @ticket.group.name %></td>
|
<td><%- @T('Group') %></td><td><%= @ticket.group.name %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%- @T('State') %></td><td><%- @T( @ticket.ticket_state.name ) %></td>
|
<td><%- @T('State') %></td><td><%- @T( @ticket.state.name ) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%- @T('Priority') %></td><td><%- @T( @ticket.ticket_priority.name ) %></td>
|
<td><%- @T('Priority') %></td><td><%- @T( @ticket.priority.name ) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%- @T('Age') %></td><td><span class="humanTimeFromNow" data-time="<%- @ticket.created_at %>">?</span></td>
|
<td><%- @T('Age') %></td><td><span class="humanTimeFromNow" data-time="<%- @ticket.created_at %>">?</span></td>
|
||||||
|
|
|
@ -68,4 +68,4 @@ module Sessions::Backend::Collections
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -39,7 +39,7 @@ class AgentTicketActionLevel1Test < TestCase
|
||||||
# update ticket
|
# update ticket
|
||||||
{
|
{
|
||||||
:execute => 'select',
|
:execute => 'select',
|
||||||
:css => '.active select[name="ticket_article_type_id"]',
|
:css => '.active select[name="type_id"]',
|
||||||
:value => 'note',
|
:value => 'note',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -94,7 +94,7 @@ class AgentTicketActionLevel1Test < TestCase
|
||||||
# update ticket
|
# update ticket
|
||||||
{
|
{
|
||||||
:execute => 'select',
|
:execute => 'select',
|
||||||
:css => '.content_permanent.active select[name="ticket_article_type_id"]',
|
:css => '.content_permanent.active select[name="type_id"]',
|
||||||
:value => 'note',
|
:value => 'note',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -197,7 +197,7 @@ class AgentTicketActionsLevel2Test < TestCase
|
||||||
{
|
{
|
||||||
:where => :instance1,
|
:where => :instance1,
|
||||||
:execute => 'select',
|
:execute => 'select',
|
||||||
:css => '.active .ticket-answer select[name="ticket_article_type_id"]',
|
:css => '.active .ticket-answer select[name="type_id"]',
|
||||||
:value => 'note',
|
:value => 'note',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue