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)
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"routes": [
|
||||
{
|
||||
"url": "/:id",
|
||||
"role": [ "MAIL_Editor", "MAIL_Reviewer", "MAIL_Sender", "EIC_Dev", "EIC_Admin" ],
|
||||
"controller" : "comms/mailings/MailingsController",
|
||||
"method": "mailing"
|
||||
},
|
||||
{
|
||||
"url": "/",
|
||||
"role": [ "MAIL_Editor", "MAIL_Reviewer", "MAIL_Sender", "EIC_Dev", "EIC_Admin" ],
|
||||
"controller" : "comms/mailings/MailingsController",
|
||||
"method": "dashboard"
|
||||
}
|
||||
],
|
||||
"models": [ "comms/templates/TemplatesModel",
|
||||
"comms/mailings/MailingsModel",
|
||||
"comms/mailings/ContactMgrModel"
|
||||
],
|
||||
"views": [
|
||||
"/comms/mailings/dashboard/MailingDashboardView",
|
||||
"comms/mailings/sheet/MailingSheetView",
|
||||
"comms/mailings/sheet/dialogs/MailingImportDialog",
|
||||
"comms/mailings/sheet/dialogs/MailingExclusionDialog",
|
||||
"comms/mailings/sheet/dialogs/MailingFetchDialog",
|
||||
"comms/mailings/sheet/dialogs/MailingMappingDialog",
|
||||
"comms/mailings/sheet/dialogs/MailingTestDialog",
|
||||
"comms/mailings/sheet/dialogs/MailingTemplatePreviewDialog",
|
||||
"comms/mailings/sheet/dialogs/MailingDuplicatesDialog",
|
||||
"templates/Ffs/dialogs/FileBrowserDialog"
|
||||
],
|
||||
"controllerDependencies": [
|
||||
"https://cdn.sheetjs.com/xlsx-0.20.2/package/dist/xlsx.full.min.js",
|
||||
"/helpers/basicDialogs",
|
||||
"/helpers/translator",
|
||||
"/helpers/validators",
|
||||
"/helpers/activeAttributes",
|
||||
"/thirdparty/eicui/plugins/FileUpload/FileUpload",
|
||||
"/thirdparty/eicui/plugins/NodeMap/NodeMap",
|
||||
"/thirdparty/eicui/plugins/Charts/Charts",
|
||||
"/libs/Ffs/fakeFileSystem"
|
||||
],
|
||||
"assets": {
|
||||
"json": [
|
||||
{"id":"wf-mailings", "name": "workflows/wf-mailings.json"}
|
||||
],
|
||||
"styles": [
|
||||
{"name":"NodeMap.css", "path":"/app/thirdparty/eicui/plugins/NodeMap/" },
|
||||
{"name":"FileUpload.css", "path":"/app/thirdparty/eicui/plugins/FileUpload/"},
|
||||
{"name":"Charts.css", "path":"/app/thirdparty/eicui/plugins/Charts/" }
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
class TemplatesController extends EICController {
|
||||
constructor() {
|
||||
super()
|
||||
}
|
||||
|
||||
async search() {
|
||||
app.User.getBusinessPermissions(['/templates'])
|
||||
.then(async payload => {
|
||||
if(payload['/templates'].permissions.length > 0) {
|
||||
let models = {
|
||||
templates: new TemplatesModel(payload['/templates'].permissions)
|
||||
}
|
||||
this.loadWindow('comms/templates/manager/TemplatesManagerView', {
|
||||
title: 'Templates',
|
||||
static: true,
|
||||
expanded: true
|
||||
},
|
||||
{
|
||||
models: models
|
||||
}
|
||||
)
|
||||
} else {
|
||||
ui.growl.append('Sorry, you do not have access to this resource', 'danger')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async tplAction(options) {
|
||||
app.User.getBusinessPermissions(['/templates'])
|
||||
.then(async payload => {
|
||||
if(payload['/templates'].permissions.length > 0) {
|
||||
const templateId = options.params.id;
|
||||
let models = {
|
||||
templates: new TemplatesModel(payload['/templates'].permissions)
|
||||
}
|
||||
// Edit template
|
||||
this.loadWindow(
|
||||
'comms/templates/editor/TemplatesEditorView',
|
||||
{
|
||||
title: 'Edit Template ' + templateId.substring(0, 6),
|
||||
static: true,
|
||||
expanded: true
|
||||
},
|
||||
{
|
||||
id: templateId,
|
||||
models: models
|
||||
})
|
||||
} else {
|
||||
ui.growl.append('Sorry, you do not have access to this resource', 'danger')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
app.registerClass('TemplatesController', TemplatesController);
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"routes": [
|
||||
{
|
||||
"url": "/templates",
|
||||
"role": [ "EIC_Dev", "EIC_Admin" ],
|
||||
"controller" : "comms/templates/TemplatesController",
|
||||
"method": "search"
|
||||
},
|
||||
{
|
||||
"url": "/:id",
|
||||
"role": [ "EIC_Dev", "EIC_Admin" ],
|
||||
"controller" : "comms/templates/TemplatesController",
|
||||
"method": "tplAction"
|
||||
}
|
||||
],
|
||||
"models": [ "comms/templates/TemplatesModel" ],
|
||||
"views": [
|
||||
"comms/templates/manager/TemplatesManagerView",
|
||||
"comms/templates/editor/TemplatesEditorView",
|
||||
"comms/templates/dialogs/TemplatesMailTestDialog",
|
||||
"comms/templates/dialogs/TemplatesUplImgDialog",
|
||||
"comms/templates/dialogs/TemplatesDecisionDialog",
|
||||
"templates/Ffs/dialogs/FileBrowserDialog"
|
||||
],
|
||||
"controllerDependencies": [
|
||||
"/helpers/basicDialogs",
|
||||
"/helpers/translator",
|
||||
"/helpers/validators",
|
||||
"/helpers/activeAttributes",
|
||||
"/libs/Ffs/fakeFileSystem",
|
||||
"/thirdparty/eicui/plugins/HtmlEditor/HtmlEditor",
|
||||
"/thirdparty/eicui/plugins/FileUpload/FileUpload"
|
||||
],
|
||||
"assets": {
|
||||
"styles": [
|
||||
{"name":"FileUpload.css", "path":"/app/thirdparty/eicui/plugins/FileUpload/"}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user