unclean SPARC
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
class ICMPController extends EICController {
|
||||
|
||||
constructor(params) {
|
||||
super(params)
|
||||
app.meta.add('icmp-techdd-status', app.Assets.Store.json['icmp-techdd-status']);
|
||||
app.meta.add('icmp-fundings', app.Assets.Store.json['icmp-fundings']);
|
||||
app.meta.add('icmp-countries', app.Assets.Store.json['icmp-countries']);
|
||||
app.meta.add('icmp-instruments', app.Assets.Store.json['icmp-instruments']);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns
|
||||
*/
|
||||
Dashboard() {
|
||||
console.log('here')
|
||||
ui.lock();
|
||||
|
||||
app.User.getBusinessPermissions([ '/icmp/projects' ])
|
||||
.then(async payload => {
|
||||
|
||||
ui.unlock();
|
||||
|
||||
if(payload['/icmp/projects'].permissions.length > 0) {
|
||||
let models = {
|
||||
projects: new ICMPProjectsModel(payload['/icmp/projects'].permissions)
|
||||
};
|
||||
|
||||
if(app.User.hasRole('PROJECT_PO') || app.User.hasRole('PROJECT_FIO')) {
|
||||
this.loadWindow(
|
||||
'projects/icmp/ProjectFundingPODashboardView',
|
||||
{ title: 'ICMP', static: true, expanded: true },
|
||||
{ models: models } );
|
||||
return;
|
||||
}
|
||||
|
||||
if(app.User.hasRole('PROJECT_TechDDExpert')) {
|
||||
this.loadWindow(
|
||||
'projects/icmp/ProjectFundingExpertDashboardView',
|
||||
{ title: 'ICMP', static: true, expanded: true },
|
||||
{ models: models } );
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
ui.growl.append('You don\'t have access to this resource', 'danger' );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {*} options
|
||||
*/
|
||||
project(options) {
|
||||
|
||||
let number = options.params.number
|
||||
let node = options.params.node
|
||||
let nodeId = options.params.nodeId
|
||||
|
||||
ui.lock();
|
||||
|
||||
app.User.getBusinessPermissions([`/icmp/projects/${number}`])
|
||||
.then(async payload => {
|
||||
|
||||
if(payload[`/icmp/projects/${number}`].permissions.length > 0) {
|
||||
ui.unlock();
|
||||
|
||||
let models = {
|
||||
project: new ICMPProjectModel(payload[`/icmp/projects/${number}`].permissions)
|
||||
};
|
||||
|
||||
this.loadWindow(
|
||||
'projects/icmp/ProjectFundingProjectView',
|
||||
{ title: 'Project sheet', static: true, expanded: true },
|
||||
{
|
||||
models: models,
|
||||
projectNumber: number,
|
||||
node: node,
|
||||
nodeId: nodeId,
|
||||
});
|
||||
} else {
|
||||
ui.growl.append('You don\'t have access to this resource', 'danger' );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
app.registerClass('ICMPController', ICMPController);
|
||||
Reference in New Issue
Block a user