From 3c139a581087261dbc27c19bf297f90f120d7fdd Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 9 Jun 2014 00:21:36 +0200 Subject: [PATCH] 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. --- .../_application_controller.js.coffee | 4 +- .../_application_controller_form.js.coffee | 26 +++++----- .../_application_controller_table.js.coffee | 4 +- .../controllers/_dashboard/ticket.js.coffee | 22 ++++---- .../controllers/agent_ticket_create.js.coffee | 48 ++++++++--------- .../controllers/agent_ticket_merge.js.coffee | 8 +-- .../customer_ticket_create.js.coffee | 36 ++++++------- .../app/controllers/ticket_overview.js.coffee | 38 +++++++------- .../app/controllers/ticket_zoom.js.coffee | 52 +++++++++---------- .../app/controllers/widget/link.js.coffee | 2 +- .../javascripts/app/models/overview.js.coffee | 14 ++--- .../javascripts/app/models/sla.js.coffee | 10 ++-- .../javascripts/app/models/ticket.js.coffee | 10 ++-- .../app/models/ticket_article.js.coffee | 25 +++++---- .../views/agent_ticket_view/detail.jst.eco | 4 +- .../app/views/popover/ticket.jst.eco | 4 +- .../app/views/ticket_zoom/info.jst.eco | 4 +- lib/sessions/backend/collections.rb | 2 +- .../agent_ticket_actions_level1_test.rb | 4 +- .../agent_ticket_actions_level2_test.rb | 2 +- 20 files changed, 159 insertions(+), 160 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller.js.coffee b/app/assets/javascripts/app/controllers/_application_controller.js.coffee index 860dc7957..63a6e1c23 100644 --- a/app/assets/javascripts/app/controllers/_application_controller.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller.js.coffee @@ -146,8 +146,8 @@ class App.Controller extends Spine.Controller { name: 'number', type: 'link', title: 'title', dataType: 'edit' }, { name: 'title', type: 'link', title: 'title', dataType: 'edit' }, { name: 'customer', class: 'user-popover', data: { id: true } }, - { name: 'ticket_state', translate: true, title: true }, - { name: 'ticket_priority', translate: true, title: true }, + { name: 'state', translate: true, title: true }, + { name: 'priority', translate: true, title: true }, { name: 'group', title: 'group' }, { name: 'owner', class: 'user-popover', data: { id: true } }, { name: 'created_at', callback: @frontendTime }, diff --git a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee index 8983a6657..66220fa66 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_form.js.coffee @@ -90,13 +90,13 @@ class App.ControllerForm extends App.Controller # colection as relation attribute_config = { - name: 'ticket_priority_id' + name: 'priority_id' display: 'Priority' tag: 'select' multiple: false null: false relation: 'TicketPriority' - default: defaults['ticket_priority_id'] + default: defaults['priority_id'] translate: true class: 'medium' } @@ -104,7 +104,7 @@ class App.ControllerForm extends App.Controller # colection as options attribute_config = { - name: 'ticket_priority_id' + name: 'priority_id' display: 'Priority' tag: 'select' multiple: false @@ -476,12 +476,12 @@ class App.ControllerForm extends App.Controller # select shown attributes loopData = [ { - value: 'x-zammad-ticket-ticket_priority_id' + value: 'x-zammad-ticket-priority_id' name: 'Ticket Priority' relation: 'TicketPriority' }, { - value: 'x-zammad-ticket-ticket_state_id' + value: 'x-zammad-ticket-state_id' name: 'Ticket State' relation: 'TicketState' }, @@ -509,12 +509,12 @@ class App.ControllerForm extends App.Controller options: { true: 'Yes', false: 'No'} }, { - value: 'x-zammad-article-ticket_article_type_id' + value: 'x-zammad-article-type_id' name: 'Article Type' relation: 'TicketArticleType' }, { - value: 'x-zammad-article-ticket_article_sender_id' + value: 'x-zammad-article-sender_id' name: 'Article Sender' relation: 'TicketArticleSender' }, @@ -866,9 +866,9 @@ class App.ControllerForm extends App.Controller } ) all } - else if key is 'tickets.ticket_state_id' + else if key is 'tickets.state_id' attribute_config = { - name: attribute.name + '::tickets.ticket_state_id' + name: attribute.name + '::tickets.state_id' display: 'State' tag: 'select' multiple: true @@ -880,9 +880,9 @@ class App.ControllerForm extends App.Controller class: 'medium' remove: true } - else if key is 'tickets.ticket_priority_id' + else if key is 'tickets.priority_id' attribute_config = { - name: attribute.name + '::tickets.ticket_priority_id' + name: attribute.name + '::tickets.priority_id' display: 'Priority' tag: 'select' multiple: true @@ -1033,13 +1033,13 @@ class App.ControllerForm extends App.Controller disable: false }, { - value: 'tickets.ticket_state_id' + value: 'tickets.state_id' name: 'State' selected: false disable: false }, { - value: 'tickets.ticket_priority_id' + value: 'tickets.priority_id' name: 'Priority' selected: true disable: false diff --git a/app/assets/javascripts/app/controllers/_application_controller_table.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_table.js.coffee index f824bc2e8..daf97c260 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_table.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_table.js.coffee @@ -23,8 +23,8 @@ class App.ControllerTable extends App.Controller { name: 'number', link: true } { name: 'title', link: true } { name: 'customer', class: 'user-popover', data: { id: true } } - { name: 'ticket_state', translate: true } - { name: 'ticket_priority', translate: true } + { name: 'state', translate: true } + { name: 'priority', translate: true } { name: 'group' }, { name: 'owner', class: 'user-popover', data: { id: true } } { name: 'created_at', callback: @frontendTime } diff --git a/app/assets/javascripts/app/controllers/_dashboard/ticket.js.coffee b/app/assets/javascripts/app/controllers/_dashboard/ticket.js.coffee index 8b374cc3d..5d1b7e6fd 100644 --- a/app/assets/javascripts/app/controllers/_dashboard/ticket.js.coffee +++ b/app/assets/javascripts/app/controllers/_dashboard/ticket.js.coffee @@ -143,10 +143,10 @@ class Settings extends App.ControllerModal overview: @overview, ) @configure_attributes_article = [ -# { 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: 'ticket_article_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: '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: '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: 'per_page', display: 'Items per page', @@ -163,7 +163,7 @@ class Settings extends App.ControllerModal class: 'medium', # item_class: 'pull-left', }, - { + { name: 'attributes', display: 'Attributes', tag: 'checkbox', @@ -174,8 +174,8 @@ class Settings extends App.ControllerModal number: 'Number' title: 'Title' customer: 'Customer' - ticket_state: 'State' - ticket_priority: 'Priority' + state: 'State' + priority: 'Priority' group: 'Group' owner: 'Owner' created_at: 'Age' @@ -190,7 +190,7 @@ class Settings extends App.ControllerModal class: 'medium', # item_class: 'pull-left', }, - { + { name: 'order_by', display: 'Order', tag: 'select', @@ -201,8 +201,8 @@ class Settings extends App.ControllerModal number: 'Number' title: 'Title' customer: 'Customer' - ticket_state: 'State' - ticket_priority: 'Priority' + state: 'State' + priority: 'Priority' group: 'Group' owner: 'Owner' created_at: 'Age' @@ -216,7 +216,7 @@ class Settings extends App.ControllerModal }, class: 'medium', }, - { + { name: 'order_by_direction', display: 'Direction', tag: 'select', diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee index 57fd1ec0a..73151e5f2 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -145,19 +145,19 @@ class App.TicketCreate extends App.Controller # set defaults defaults = - ticket_state_id: App.TicketState.findByAttribute( 'name', 'open' ).id - ticket_priority_id: App.TicketPriority.findByAttribute( 'name', '2 normal' ).id + state_id: App.TicketState.findByAttribute( 'name', 'open' ).id + priority_id: App.TicketPriority.findByAttribute( 'name', '2 normal' ).id # generate form 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: '»', 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: '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: '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: '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: '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: '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: '»', 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: '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: '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: 'state_id', display: 'State', tag: 'select', multiple: false, null: false, filter: @edit_form, relation: 'TicketState', default: defaults['state_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')( head: 'New Ticket' @@ -246,23 +246,23 @@ class App.TicketCreate extends App.Controller # create article if sender.name is 'Customer' params['article'] = { - to: (group && group.name) || '' - from: params.customer_id_autocompletion - subject: params.subject - body: params.body - ticket_article_type_id: type.id - ticket_article_sender_id: sender.id - form_id: @form_id + to: (group && group.name) || '' + from: params.customer_id_autocompletion + subject: params.subject + body: params.body + type_id: type.id + sender_id: sender.id + form_id: @form_id } else params['article'] = { - from: (group && group.name) || '' - to: params.customer_id_autocompletion - subject: params.subject - body: params.body - ticket_article_type_id: type.id - ticket_article_sender_id: sender.id - form_id: @form_id + from: (group && group.name) || '' + to: params.customer_id_autocompletion + subject: params.subject + body: params.body + type_id: type.id + sender_id: sender.id + form_id: @form_id } object.load(params) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee index e6db3c385..c353211df 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_merge.js.coffee @@ -37,8 +37,8 @@ class App.TicketMerge extends App.ControllerModal { name: 'number', link: true }, { name: 'title', link: true }, # { name: 'customer', class: 'user-popover', data: { id: true } }, - { name: 'ticket_state', translate: true }, -# { name: 'ticket_priority', translate: true }, + { name: 'state', translate: true }, +# { name: 'priority', translate: true }, { name: 'group' }, # { name: 'owner', class: 'user-popover', data: { id: true } }, { name: 'created_at', callback: @humanTime }, @@ -64,8 +64,8 @@ class App.TicketMerge extends App.ControllerModal { name: 'number', link: true }, { name: 'title', link: true }, # { name: 'customer', class: 'user-popover', data: { id: true } }, - { name: 'ticket_state', translate: true }, -# { name: 'ticket_priority', translate: true }, + { name: 'state', translate: true }, +# { name: 'priority', translate: true }, { name: 'group' }, # { name: 'owner', class: 'user-popover', data: { id: true } }, { name: 'created_at', callback: @humanTime }, diff --git a/app/assets/javascripts/app/controllers/customer_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/customer_ticket_create.js.coffee index 2d6296cdf..ce65556fb 100644 --- a/app/assets/javascripts/app/controllers/customer_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/customer_ticket_create.js.coffee @@ -57,10 +57,10 @@ class Index extends App.ControllerContent # set defaults defaults = template['options'] || {} - if !( 'ticket_state_id' of defaults ) - defaults['ticket_state_id'] = App.TicketState.findByAttribute( 'name', 'new' ) - if !( 'ticket_priority_id' of defaults ) - defaults['ticket_priority_id'] = App.TicketPriority.findByAttribute( 'name', '2 normal' ) + if !( 'state_id' of defaults ) + defaults['state_id'] = App.TicketState.findByAttribute( 'name', 'new' ) + if !( 'priority_id' of defaults ) + defaults['priority_id'] = App.TicketPriority.findByAttribute( 'name', '2 normal' ) groupFilter = (collection, type) => @@ -87,14 +87,14 @@ class Index extends App.ControllerContent return item if item && _.contains( group_ids, item.id.toString() ) ) - # generate form + # generate form 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: '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: '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: '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: 'state_id', display: 'State', tag: 'select', multiple: false, null: false, filter: @edit_form, relation: 'TicketState', default: defaults['state_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' ) @@ -129,11 +129,11 @@ class Index extends App.ControllerContent # set prio priority = App.TicketPriority.findByAttribute( 'name', '2 normal' ) - params.ticket_priority_id = priority.id + params.priority_id = priority.id # set state state = App.TicketState.findByAttribute( 'name', 'new' ) - params.ticket_state_id = state.id + params.state_id = state.id # fillup params if !params.title @@ -147,17 +147,17 @@ class Index extends App.ControllerContent sender = App.TicketArticleSender.findByAttribute( 'name', 'Customer' ) type = App.TicketArticleType.findByAttribute( 'name', 'web' ) if params.group_id - group = App.Group.find( params.group_id ) + group = App.Group.find( params.group_id ) # create article params['article'] = { - from: "#{ @Session.get('firstname') } #{ @Session.get('lastname') }" - to: (group && group.name) || '' - subject: params.subject - body: params.body - ticket_article_type_id: type.id - ticket_article_sender_id: sender.id - form_id: @form_id + from: "#{ @Session.get('firstname') } #{ @Session.get('lastname') }" + to: (group && group.name) || '' + subject: params.subject + body: params.body + type_id: type.id + sender_id: sender.id + form_id: @form_id } object.load(params) @@ -172,7 +172,7 @@ class Index extends App.ControllerContent @formValidate( form: e.target, errors: errors ) # save ticket, create article - else + else # disable form @formDisable(e) diff --git a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee index fc7536993..35bb81530 100644 --- a/app/assets/javascripts/app/controllers/ticket_overview.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_overview.js.coffee @@ -218,7 +218,7 @@ class Table extends App.ControllerContent if @el.find('.table-overview').find('[name="bulk"]:checked').length isnt 0 @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) => if @el.find('.table-overview').find('[name="bulk"]:checked').length == 0 @@ -253,10 +253,10 @@ class Table extends App.ControllerContent bulk_form: => @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: '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: '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: '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: '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: '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 @@ -359,10 +359,10 @@ class Settings extends App.ControllerModal overview: @overview, ) @configure_attributes_article = [ -# { 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: 'ticket_article_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: '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: '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: 'per_page' display: 'Items per page' @@ -392,8 +392,8 @@ class Settings extends App.ControllerModal number: 'Number' title: 'Title' customer: 'Customer' - ticket_state: 'State' - ticket_priority: 'Priority' + state: 'State' + priority: 'Priority' group: 'Group' owner: 'Owner' created_at: 'Age' @@ -406,7 +406,7 @@ class Settings extends App.ControllerModal article_count: 'Article Count' class: 'medium' }, - { + { name: 'order_by' display: 'Order' tag: 'select' @@ -417,8 +417,8 @@ class Settings extends App.ControllerModal number: 'Number' title: 'Title' customer: 'Customer' - ticket_state: 'State' - ticket_priority: 'Priority' + state: 'State' + priority: 'Priority' group: 'Group' owner: 'Owner' created_at: 'Age' @@ -431,7 +431,7 @@ class Settings extends App.ControllerModal article_count: 'Article Count' class: 'medium' }, - { + { name: 'order_by_direction' display: 'Direction' tag: 'select' @@ -443,7 +443,7 @@ class Settings extends App.ControllerModal DESC: 'down' class: 'medium' }, - { + { name: 'group_by' display: 'Group by' tag: 'select' @@ -453,8 +453,8 @@ class Settings extends App.ControllerModal translate: true options: customer: 'Customer' - ticket_state: 'State' - ticket_priority: 'Priority' + state: 'State' + priority: 'Priority' group: 'Group' owner: 'Owner' class: 'medium' @@ -467,7 +467,7 @@ class Settings extends App.ControllerModal # null: false, # relation: 'TicketArticleType', # default: '9', -# class: 'medium', +# class: 'medium', # item_class: 'pull-left', # }, ] diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 6f905e658..dc8ebeadc 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -336,25 +336,25 @@ class Edit extends App.Controller ) @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: '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: '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: 'state_id', display: 'State', tag: 'select', multiple: false, null: true, relation: 'TicketState', 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: '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') @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: '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: 'state_id', display: 'State', tag: 'select', multiple: false, null: true, relation: 'TicketState', 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 = [ - { 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: '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: '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: '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: '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: '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: '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: 'body', display: 'Text', tag: 'textarea', rows: 6, limit: 100, null: true, class: 'span7', item_class: '', upload: true }, ] if @isRole('Customer') @configure_attributes_article = [ @@ -390,7 +390,7 @@ class Edit extends App.Controller dependency: [ { bind: { - name: 'ticket_article_type_id' + name: 'type_id' relation: 'TicketArticleType' value: ['email'] }, @@ -401,7 +401,7 @@ class Edit extends App.Controller }, { bind: { - name: 'ticket_article_type_id' + name: 'type_id' relation: 'TicketArticleType' value: ['note', 'twitter status', 'twitter direct-message'] }, @@ -450,14 +450,14 @@ class Edit extends App.Controller # find sender_id if @isRole('Customer') - sender = App.TicketArticleSender.findByAttribute( 'name', 'Customer' ) - article_type = App.TicketArticleType.findByAttribute( 'name', 'web' ) - params.ticket_article_type_id = article_type.id - params.ticket_article_sender_id = sender.id + sender = App.TicketArticleSender.findByAttribute( 'name', 'Customer' ) + article_type = App.TicketArticleType.findByAttribute( 'name', 'web' ) + params.type_id = article_type.id + params.sender_id = sender.id else - sender = App.TicketArticleSender.findByAttribute( 'name', 'Agent' ) - article_type = App.TicketArticleType.find( params['ticket_article_type_id'] ) - params.ticket_article_sender_id = sender.id + sender = App.TicketArticleSender.findByAttribute( 'name', 'Agent' ) + article_type = App.TicketArticleType.find( params['type_id'] ) + params.sender_id = sender.id # update ticket ticket_update = {} @@ -641,16 +641,16 @@ class ArticleView extends App.Controller e.preventDefault() article_id = $(e.target).parents('[data-id]').data('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 ) # update form @checkIfSignatureIsNeeded(article_type) # preselect article type - @ui.el.find('[name="ticket_article_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="ticket_article_type_id"]').trigger('change') + @ui.el.find('[name="type_id"]').find('option:selected').removeAttr('selected') + @ui.el.find('[name="type_id"]').find('[value="' + article_type.id + '"]').attr('selected',true) + @ui.el.find('[name="type_id"]').trigger('change') # empty form #@ui.el.find('[name="to"]').val('') diff --git a/app/assets/javascripts/app/controllers/widget/link.js.coffee b/app/assets/javascripts/app/controllers/widget/link.js.coffee index 7cdcb9a4f..3136828ec 100644 --- a/app/assets/javascripts/app/controllers/widget/link.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/link.js.coffee @@ -41,7 +41,7 @@ class App.WidgetLink extends App.ControllerDrox if item['link_object'] is 'Ticket' ticket = App.Ticket.retrieve( item['link_object_value'] ) - if ticket.ticket_state.name is 'merged' + if ticket.state.name is 'merged' ticket.css = 'merged' list[ item['link_type'] ].push ticket diff --git a/app/assets/javascripts/app/models/overview.js.coffee b/app/assets/javascripts/app/models/overview.js.coffee index 626b0b5f4..8dca90e08 100644 --- a/app/assets/javascripts/app/models/overview.js.coffee +++ b/app/assets/javascripts/app/models/overview.js.coffee @@ -15,15 +15,15 @@ class App.Overview extends App.Model name: 'view::s' display: 'Attributes' tag: 'checkbox' - default: ['number', 'title', 'ticket_state', 'created_at'] + default: ['number', 'title', 'state', 'created_at'] null: false translate: true options: number: 'Number' title: 'Title' customer: 'Customer' - ticket_state: 'State' - ticket_priority: 'Priority' + state: 'State' + priority: 'Priority' group: 'Group' owner: 'Owner' created_at: 'Age' @@ -47,8 +47,8 @@ class App.Overview extends App.Model number: 'Number' title: 'Title' customer: 'Customer' - ticket_state: 'State' - ticket_priority: 'Priority' + state: 'State' + priority: 'Priority' group: 'Group' owner: 'Owner' created_at: 'Age' @@ -82,8 +82,8 @@ class App.Overview extends App.Model translate: true options: customer: 'Customer' - ticket_state: 'State' - ticket_priority: 'Priority' + state: 'State' + priority: 'Priority' group: 'Group' owner: 'Owner' class: 'span4' diff --git a/app/assets/javascripts/app/models/sla.js.coffee b/app/assets/javascripts/app/models/sla.js.coffee index c49ddb4cf..003df8976 100644 --- a/app/assets/javascripts/app/models/sla.js.coffee +++ b/app/assets/javascripts/app/models/sla.js.coffee @@ -25,11 +25,11 @@ class App.Sla extends App.Model nulloption: true translate: true options: - customer: 'Customer' - ticket_state: 'State' - ticket_priority: 'Priority' - group: 'Group' - owner: 'Owner' + customer: 'Customer' + state: 'State' + priority: 'Priority' + group: 'Group' + owner: 'Owner' class: 'span4' }, { name: 'updated_at', display: 'Updated', type: 'time', readonly: 1 }, diff --git a/app/assets/javascripts/app/models/ticket.js.coffee b/app/assets/javascripts/app/models/ticket.js.coffee index f7e585bac..901e6b102 100644 --- a/app/assets/javascripts/app/models/ticket.js.coffee +++ b/app/assets/javascripts/app/models/ticket.js.coffee @@ -1,5 +1,5 @@ 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 @url: @apiPath + '/tickets' @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: '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: 'ticket_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: 'state_id', display: 'State', tag: 'select', multiple: false, null: false, relation: 'TicketState', default: 'new', 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: '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%' }, @@ -26,10 +26,10 @@ class App.Ticket extends App.Model @_fillUp: (data) -> # priority - data.ticket_priority = App.TicketPriority.find( data.ticket_priority_id ) + data.priority = App.TicketPriority.find( data.priority_id ) # state - data.ticket_state = App.TicketState.find( data.ticket_state_id ) + data.state = App.TicketState.find( data.state_id ) # group data.group = App.Group.find( data.group_id ) diff --git a/app/assets/javascripts/app/models/ticket_article.js.coffee b/app/assets/javascripts/app/models/ticket_article.js.coffee index 859c6aa96..8bb740d8a 100644 --- a/app/assets/javascripts/app/models/ticket_article.js.coffee +++ b/app/assets/javascripts/app/models/ticket_article.js.coffee @@ -1,17 +1,17 @@ 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 @url: @apiPath + '/ticket_articles' @configure_attributes = [ - { name: 'ticket_id', display: 'TicketID', null: false, readonly: 1, }, - { 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: '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: '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: 'ticket_article_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: 'ticket_id', display: 'TicketID', null: false, readonly: 1, }, + { 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: '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: 'body', display: 'Text', tag: 'textarea', rows: 5, limit: 100, null: false, class: 'span8', }, + { name: 'type_id', display: 'Type', tag: 'select', multiple: false, null: false, relation: 'TicketArticleType', 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' }, ] uiUrl: -> @@ -29,12 +29,11 @@ class App.TicketArticle extends App.Model data.updated_by = App.User.retrieve( data.updated_by_id ) # add relations - data.article_type = App.TicketArticleType.find( data.ticket_article_type_id ) - data.article_sender = App.TicketArticleSender.find( data.ticket_article_sender_id ) + data.type = App.TicketArticleType.find( data.type_id ) + data.sender = App.TicketArticleSender.find( data.sender_id ) data - displayName: -> if @subject return @subject diff --git a/app/assets/javascripts/app/views/agent_ticket_view/detail.jst.eco b/app/assets/javascripts/app/views/agent_ticket_view/detail.jst.eco index 03449857e..9d6af49b8 100644 --- a/app/assets/javascripts/app/views/agent_ticket_view/detail.jst.eco +++ b/app/assets/javascripts/app/views/agent_ticket_view/detail.jst.eco @@ -17,7 +17,7 @@

<%= ticket.title %> <%= ticket.number %> ?

- <%- @T( 'State' ) %> <%- @T( ticket.ticket_state.name ) %> + <%- @T( 'State' ) %> <%- @T( ticket.state.name ) %>
<%- @T( 'Group' ) %> <%= ticket.group.name %> @@ -28,7 +28,7 @@
- <%- @T( 'Priority' ) %> <%- @T( ticket.ticket_priority.name ) %> + <%- @T( 'Priority' ) %> <%- @T( ticket.priority.name ) %>
<%- @T( 'Owner' ) %> <%= ticket.owner.displayName() %> diff --git a/app/assets/javascripts/app/views/popover/ticket.jst.eco b/app/assets/javascripts/app/views/popover/ticket.jst.eco index 8c3045ec1..4a134eac7 100644 --- a/app/assets/javascripts/app/views/popover/ticket.jst.eco +++ b/app/assets/javascripts/app/views/popover/ticket.jst.eco @@ -5,10 +5,10 @@ <%- @P( @ticket.group ) %> - <%- @T( @ticket.ticket_state.name ) %> + <%- @T( @ticket.state.name ) %> - <%- @T( @ticket.ticket_priority.name ) %> + <%- @T( @ticket.priority.name ) %> diff --git a/app/assets/javascripts/app/views/ticket_zoom/info.jst.eco b/app/assets/javascripts/app/views/ticket_zoom/info.jst.eco index d27ae5a2c..45f3c87f6 100644 --- a/app/assets/javascripts/app/views/ticket_zoom/info.jst.eco +++ b/app/assets/javascripts/app/views/ticket_zoom/info.jst.eco @@ -3,10 +3,10 @@ <%- @T('Group') %><%= @ticket.group.name %> - <%- @T('State') %><%- @T( @ticket.ticket_state.name ) %> + <%- @T('State') %><%- @T( @ticket.state.name ) %> - <%- @T('Priority') %><%- @T( @ticket.ticket_priority.name ) %> + <%- @T('Priority') %><%- @T( @ticket.priority.name ) %> <%- @T('Age') %>? diff --git a/lib/sessions/backend/collections.rb b/lib/sessions/backend/collections.rb index 672afb773..d135a2afa 100644 --- a/lib/sessions/backend/collections.rb +++ b/lib/sessions/backend/collections.rb @@ -68,4 +68,4 @@ module Sessions::Backend::Collections } end -end +end \ No newline at end of file diff --git a/test/browser/agent_ticket_actions_level1_test.rb b/test/browser/agent_ticket_actions_level1_test.rb index 9b888c0e6..359577e64 100644 --- a/test/browser/agent_ticket_actions_level1_test.rb +++ b/test/browser/agent_ticket_actions_level1_test.rb @@ -39,7 +39,7 @@ class AgentTicketActionLevel1Test < TestCase # update ticket { :execute => 'select', - :css => '.active select[name="ticket_article_type_id"]', + :css => '.active select[name="type_id"]', :value => 'note', }, { @@ -94,7 +94,7 @@ class AgentTicketActionLevel1Test < TestCase # update ticket { :execute => 'select', - :css => '.content_permanent.active select[name="ticket_article_type_id"]', + :css => '.content_permanent.active select[name="type_id"]', :value => 'note', }, { diff --git a/test/browser/agent_ticket_actions_level2_test.rb b/test/browser/agent_ticket_actions_level2_test.rb index ad2fb597f..f8e7e1b4e 100644 --- a/test/browser/agent_ticket_actions_level2_test.rb +++ b/test/browser/agent_ticket_actions_level2_test.rb @@ -197,7 +197,7 @@ class AgentTicketActionsLevel2Test < TestCase { :where => :instance1, :execute => 'select', - :css => '.active .ticket-answer select[name="ticket_article_type_id"]', + :css => '.active .ticket-answer select[name="type_id"]', :value => 'note', }, {