From ce2ed08e1b5cc88975bbd8158122180bc9715cec Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Tue, 5 Sep 2017 16:05:28 +0200 Subject: [PATCH] Fixed #1331 - Delete action for tickets not working. --- .../_ui_element/ticket_perform_action.coffee | 17 +++++++++-------- app/assets/javascripts/app/models/job.coffee | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.coffee b/app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.coffee index e64d6edf4..c5718de48 100644 --- a/app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.coffee +++ b/app/assets/javascripts/app/controllers/_ui_element/ticket_perform_action.coffee @@ -33,14 +33,15 @@ class App.UiElement.ticket_perform_action elements["#{groupKey}.#{config.name}"] = config # add ticket deletion action - elements['ticket.action'] = - name: 'action' - display: 'Action' - tag: 'select' - null: false - translate: true - options: - delete: 'delete' + if attribute.ticket_delete + elements['ticket.action'] = + name: 'action' + display: 'Action' + tag: 'select' + null: false + translate: true + options: + delete: 'Delete' [defaults, groups, elements] diff --git a/app/assets/javascripts/app/models/job.coffee b/app/assets/javascripts/app/models/job.coffee index 996e3dfc7..d061c2db0 100644 --- a/app/assets/javascripts/app/models/job.coffee +++ b/app/assets/javascripts/app/models/job.coffee @@ -6,7 +6,7 @@ class App.Job extends App.Model { name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, null: false }, { name: 'timeplan', display: 'When should the job run?', tag: 'timer', null: true }, { name: 'condition', display: 'Conditions for effected objects', tag: 'ticket_selector', null: true }, - { name: 'perform', display: 'Execute changes on objects', tag: 'ticket_perform_action', null: true, notification: true }, + { name: 'perform', display: 'Execute changes on objects', tag: 'ticket_perform_action', null: true, notification: true, ticket_delete: true }, { name: 'disable_notification', display: 'Disable Notifications', tag: 'boolean', default: true }, { name: 'note', display: 'Note', tag: 'textarea', note: 'Notes are visible to agents only, never to customers.', limit: 250, null: true }, { name: 'active', display: 'Active', tag: 'active', default: true },