Fixes #3522 - Google and Microsoft 365 are missing filter & signature page content.

This commit is contained in:
Rolf Schmidt 2021-04-26 10:54:02 +01:00 committed by Martin Edenhofer
parent 9bc1d212ce
commit 7125e54b13
3 changed files with 144 additions and 146 deletions

View file

@ -0,0 +1,48 @@
class App.ChannelEmailFilter extends App.Controller
events:
'click [data-type=new]': 'new'
constructor: ->
super
App.PostmasterFilter.subscribe(@render, initFetch: true)
render: =>
data = App.PostmasterFilter.search(sortBy: 'name')
template = $( '<div><div class="overview"></div><a data-type="new" class="btn btn--success">' + App.i18n.translateContent('New') + '</a></div>' )
description = 'With filters you can e. g. dispatch new tickets into certain groups or set a certain priority for tickets of a VIP customer.'
new App.ControllerTable(
el: template.find('.overview')
model: App.PostmasterFilter
objects: data
bindRow:
events:
'click': @edit
explanation: description
)
@html template
new: (e) =>
e.preventDefault()
new App.ControllerGenericNew(
pageData:
object: 'Postmaster Filter'
genericObject: 'PostmasterFilter'
container: @el.closest('.content')
callback: @load
large: true
)
edit: (id, e) =>
e.preventDefault()
new App.ControllerGenericEdit(
id: id,
pageData:
object: 'Postmaster Filter'
genericObject: 'PostmasterFilter'
container: @el.closest('.content')
callback: @load
large: true
)

View file

@ -0,0 +1,94 @@
class App.ChannelEmailSignature extends App.Controller
events:
'click [data-type=new]': 'new'
constructor: ->
super
App.Signature.subscribe(@render, initFetch: true)
render: =>
data = App.Signature.search(sortBy: 'name')
template = $( '<div><div class="overview"></div><a data-type="new" class="btn btn--success">' + App.i18n.translateContent('New') + '</a></div>' )
description = '''
You can define different signatures for each group. So you can have different email signatures for different departments.
Once you have created a signature here, you need also to edit the groups where you want to use it.
'''
new App.ControllerTable(
el: template.find('.overview')
model: App.Signature
objects: data
bindRow:
events:
'click': @edit
explanation: description
)
@html template
new: (e) =>
e.preventDefault()
new ChannelEmailSignatureEdit(
container: @el.closest('.content')
)
edit: (id, e) =>
e.preventDefault()
item = App.Signature.find(id)
new ChannelEmailSignatureEdit(
object: item
container: @el.closest('.content')
)
class ChannelEmailSignatureEdit extends App.ControllerModal
buttonClose: true
buttonCancel: true
buttonSubmit: true
head: 'Signature'
content: =>
if @object
@form = new App.ControllerForm(
model: App.Signature
params: @object
autofocus: true
)
else
@form = new App.ControllerForm(
model: App.Signature
autofocus: true
)
@form.form
onSubmit: (e) =>
# get params
params = @formParam(e.target)
object = @object || new App.Signature
object.load(params)
# validate form
errors = @form.validate(params)
# show errors in form
if errors
@log 'error', errors
@formValidate(form: e.target, errors: errors)
return false
# disable form
@formDisable(e)
# save object
object.save(
done: =>
@close()
fail: (settings, details) =>
@log 'errors', details
@formEnable(e)
@form.showAlert(details.error_human || details.error || 'Unable to create object!')
)

View file

@ -15,12 +15,12 @@ class ChannelEmail extends App.ControllerTabs
{ {
name: 'Filter', name: 'Filter',
target: 'c-filter', target: 'c-filter',
controller: ChannelEmailFilter, controller: App.ChannelEmailFilter,
}, },
{ {
name: 'Signatures', name: 'Signatures',
target: 'c-signature', target: 'c-signature',
controller: ChannelEmailSignature, controller: App.ChannelEmailSignature,
}, },
{ {
name: 'Settings', name: 'Settings',
@ -32,150 +32,6 @@ class ChannelEmail extends App.ControllerTabs
@render() @render()
class ChannelEmailFilter extends App.Controller
events:
'click [data-type=new]': 'new'
constructor: ->
super
App.PostmasterFilter.subscribe(@render, initFetch: true)
render: =>
data = App.PostmasterFilter.search(sortBy: 'name')
template = $( '<div><div class="overview"></div><a data-type="new" class="btn btn--success">' + App.i18n.translateContent('New') + '</a></div>' )
description = 'With filters you can e. g. dispatch new tickets into certain groups or set a certain priority for tickets of a VIP customer.'
new App.ControllerTable(
el: template.find('.overview')
model: App.PostmasterFilter
objects: data
bindRow:
events:
'click': @edit
explanation: description
)
@html template
new: (e) =>
e.preventDefault()
new App.ControllerGenericNew(
pageData:
object: 'Postmaster Filter'
genericObject: 'PostmasterFilter'
container: @el.closest('.content')
callback: @load
large: true
)
edit: (id, e) =>
e.preventDefault()
new App.ControllerGenericEdit(
id: id,
pageData:
object: 'Postmaster Filter'
genericObject: 'PostmasterFilter'
container: @el.closest('.content')
callback: @load
large: true
)
class ChannelEmailSignature extends App.Controller
events:
'click [data-type=new]': 'new'
constructor: ->
super
App.Signature.subscribe(@render, initFetch: true)
render: =>
data = App.Signature.search(sortBy: 'name')
template = $( '<div><div class="overview"></div><a data-type="new" class="btn btn--success">' + App.i18n.translateContent('New') + '</a></div>' )
description = '''
You can define different signatures for each group. So you can have different email signatures for different departments.
Once you have created a signature here, you need also to edit the groups where you want to use it.
'''
new App.ControllerTable(
el: template.find('.overview')
model: App.Signature
objects: data
bindRow:
events:
'click': @edit
explanation: description
)
@html template
new: (e) =>
e.preventDefault()
new ChannelEmailSignatureEdit(
container: @el.closest('.content')
)
edit: (id, e) =>
e.preventDefault()
item = App.Signature.find(id)
new ChannelEmailSignatureEdit(
object: item
container: @el.closest('.content')
)
class ChannelEmailSignatureEdit extends App.ControllerModal
buttonClose: true
buttonCancel: true
buttonSubmit: true
head: 'Signature'
content: =>
if @object
@form = new App.ControllerForm(
model: App.Signature
params: @object
autofocus: true
)
else
@form = new App.ControllerForm(
model: App.Signature
autofocus: true
)
@form.form
onSubmit: (e) =>
# get params
params = @formParam(e.target)
object = @object || new App.Signature
object.load(params)
# validate form
errors = @form.validate(params)
# show errors in form
if errors
@log 'error', errors
@formValidate(form: e.target, errors: errors)
return false
# disable form
@formDisable(e)
# save object
object.save(
done: =>
@close()
fail: (settings, details) =>
@log 'errors', details
@formEnable(e)
@form.showAlert(details.error_human || details.error || 'Unable to create object!')
)
class ChannelEmailAccountOverview extends App.Controller class ChannelEmailAccountOverview extends App.Controller
events: events:
'click .js-channelNew': 'wizard' 'click .js-channelNew': 'wizard'