unclean SPARC
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
class MailingsController extends EICController {
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
|
||||
app.meta.add('wf-mailings', app.Assets.Store.json['wf-mailings'])
|
||||
}
|
||||
|
||||
async dashboard(options) {
|
||||
|
||||
app.User.getBusinessPermissions(['/mailings'])
|
||||
.then(async payload => {
|
||||
if(payload['/mailings'].permissions.length > 0) {
|
||||
let models = {
|
||||
mailings: new MailingsModel(payload['/mailings'].permissions)
|
||||
}
|
||||
|
||||
await app.Assets.loadHtml({name:'mailing/tile.html'})
|
||||
this.loadWindow(
|
||||
'comms/mailings/dashboard/MailingDashboardView',
|
||||
{
|
||||
title: 'Mailings',
|
||||
static: true,
|
||||
expanded: true
|
||||
},
|
||||
{
|
||||
models: models
|
||||
}
|
||||
)
|
||||
} else {
|
||||
ui.growl.append('Sorry, you do not have access to this resource', 'danger')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async mailing(options) {
|
||||
app.User.getBusinessPermissions(['/mailings', '/templates', '/contactMgr'])
|
||||
.then(async payload => {
|
||||
if(payload['/mailings'].permissions.length > 0) {
|
||||
let models = {
|
||||
mailings: new MailingsModel(payload['/mailings'].permissions),
|
||||
templates : new TemplatesModel(payload['/templates'].permissions),
|
||||
contactMgr: new ContactMgrModel(payload['/contactMgr'].permissions),
|
||||
}
|
||||
|
||||
this.loadWindow('comms/mailings/sheet/MailingSheetView', {
|
||||
title: 'Mailing sheet',
|
||||
static: true,
|
||||
expanded: true
|
||||
},{
|
||||
id: options.params.id,
|
||||
models: models
|
||||
})
|
||||
} else {
|
||||
ui.growl.append('Sorry, you do not have access to this resource', 'danger')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
app.registerClass('MailingsController', MailingsController)
|
||||
|
||||
Reference in New Issue
Block a user