unclean SPARC

This commit is contained in:
STEINNI
2025-08-27 07:03:09 +00:00
commit f308460931
430 changed files with 54426 additions and 0 deletions
@@ -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);