Mark notes as internal per default (to clarify updates sent to customer).

This commit is contained in:
Martin Edenhofer 2016-07-12 12:01:02 +02:00
parent 8f5d9063a4
commit eb9bb6b0fa
3 changed files with 49 additions and 16 deletions

View file

@ -520,7 +520,7 @@ class App.TicketZoom extends App.Controller
cc: '' cc: ''
type: 'note' type: 'note'
body: '' body: ''
internal: '' internal: 'true'
in_reply_to: '' in_reply_to: ''
currentStore currentStore

View file

@ -68,7 +68,7 @@ class App.TicketZoomArticleActions extends App.Controller
#if @article.type.name is 'note' #if @article.type.name is 'note'
# actions.push [] # actions.push []
group = @ticket.group group = @ticket.group
if group.email_address_id && (article.type.name is 'email' || article.type.name is 'phone' || article.type.name is 'web') if group.email_address_id && (article.type.name is 'email' || article.type.name is 'web')
actions.push { actions.push {
name: 'reply' name: 'reply'
type: 'emailReply' type: 'emailReply'
@ -115,6 +115,13 @@ class App.TicketZoomArticleActions extends App.Controller
icon: 'reply-all' icon: 'reply-all'
href: '#' href: '#'
} }
if article.sender.name is 'Customer' && article.type.name is 'phone'
actions.push {
name: 'reply'
type: 'emailReply'
icon: 'reply'
href: '#'
}
if article.type.name is 'twitter status' if article.type.name is 'twitter status'
actions.push { actions.push {
name: 'reply' name: 'reply'

View file

@ -55,6 +55,7 @@ class App.TicketZoomArticleNew extends App.Controller
name: 'note' name: 'note'
icon: 'note' icon: 'note'
attributes: [] attributes: []
internal: true,
features: ['attachment'] features: ['attachment']
} }
if possibleArticleType.email if possibleArticleType.email
@ -62,6 +63,7 @@ class App.TicketZoomArticleNew extends App.Controller
name: 'email' name: 'email'
icon: 'email' icon: 'email'
attributes: ['to', 'cc'] attributes: ['to', 'cc']
internal: false,
features: ['attachment'] features: ['attachment']
} }
if possibleArticleType['facebook feed comment'] if possibleArticleType['facebook feed comment']
@ -69,6 +71,7 @@ class App.TicketZoomArticleNew extends App.Controller
name: 'facebook feed comment' name: 'facebook feed comment'
icon: 'facebook' icon: 'facebook'
attributes: [] attributes: []
internal: false,
features: [] features: []
} }
if possibleArticleType['twitter status'] if possibleArticleType['twitter status']
@ -76,6 +79,7 @@ class App.TicketZoomArticleNew extends App.Controller
name: 'twitter status' name: 'twitter status'
icon: 'twitter' icon: 'twitter'
attributes: [] attributes: []
internal: false,
features: ['body:limit'] features: ['body:limit']
maxTextLength: 140 maxTextLength: 140
warningTextLength: 30 warningTextLength: 30
@ -85,6 +89,7 @@ class App.TicketZoomArticleNew extends App.Controller
name: 'twitter direct-message' name: 'twitter direct-message'
icon: 'twitter' icon: 'twitter'
attributes: ['to'] attributes: ['to']
internal: false,
features: ['body:limit'] features: ['body:limit']
maxTextLength: 10000 maxTextLength: 10000
warningTextLength: 500 warningTextLength: 500
@ -94,6 +99,7 @@ class App.TicketZoomArticleNew extends App.Controller
name: 'phone' name: 'phone'
icon: 'phone' icon: 'phone'
attributes: [] attributes: []
internal: false,
features: ['attachment'] features: ['attachment']
} }
@ -104,6 +110,7 @@ class App.TicketZoomArticleNew extends App.Controller
name: 'note' name: 'note'
icon: 'note' icon: 'note'
attributes: [] attributes: []
internal: false,
features: ['attachment'] features: ['attachment']
}, },
] ]
@ -376,20 +383,12 @@ class App.TicketZoomArticleNew extends App.Controller
changeType: (e) -> changeType: (e) ->
$(e.target).addClass('active').siblings('.active').removeClass('active') $(e.target).addClass('active').siblings('.active').removeClass('active')
toggleVisibility: (event) -> toggleVisibility: (e, internal) ->
event.stopPropagation() e.stopPropagation()
if @articleNewEdit.hasClass 'is-public' if @articleNewEdit.hasClass('is-public')
@articleNewEdit @setArticleInternal(true)
.removeClass 'is-public'
.addClass 'is-internal'
@$('[name=internal]').val 'true'
else else
@articleNewEdit @setArticleInternal(false)
.addClass 'is-public'
.removeClass 'is-internal'
@$('[name=internal]').val ''
showSelectableArticleType: (event) => showSelectableArticleType: (event) =>
event.stopPropagation() event.stopPropagation()
@ -407,6 +406,21 @@ class App.TicketZoomArticleNew extends App.Controller
hideSelectableArticleType: => hideSelectableArticleType: =>
@el.find('.js-articleTypes').addClass('is-hidden') @el.find('.js-articleTypes').addClass('is-hidden')
setArticleInternal: (internal) =>
if internal is true
@articleNewEdit
.removeClass('is-public')
.addClass('is-internal')
@$('[name=internal]').val('true')
return
@articleNewEdit
.addClass('is-public')
.removeClass('is-internal')
@$('[name=internal]').val('')
setArticleType: (type) => setArticleType: (type) =>
wasScrolledToBottom = @isScrolledToBottom() wasScrolledToBottom = @isScrolledToBottom()
@type = type @type = type
@ -414,6 +428,18 @@ class App.TicketZoomArticleNew extends App.Controller
@articleNewEdit.attr('data-type', type) @articleNewEdit.attr('data-type', type)
@$('.js-selectableTypes').addClass('hide').filter("[data-type='#{type}']").removeClass('hide') @$('.js-selectableTypes').addClass('hide').filter("[data-type='#{type}']").removeClass('hide')
# get config
config = {}
for articleTypeConfig in @articleTypes
if articleTypeConfig.name is type
config = articleTypeConfig
if config
if config.internal
@setArticleInternal(true)
else
@setArticleInternal(false)
# detect current signature (use current group_id, if not set, use ticket.group_id) # detect current signature (use current group_id, if not set, use ticket.group_id)
ticketCurrent = App.Ticket.fullLocal(@ticket_id) ticketCurrent = App.Ticket.fullLocal(@ticket_id)
group_id = ticketCurrent.group_id group_id = ticketCurrent.group_id