Name
global.PlannedTaskConsoleMetadata
Description
No description available
Script
var PlannedTaskConsoleMetadata = Class.create();
PlannedTaskConsoleMetadata.prototype = {
initialize: function(consoleId) {
this.console = new PlannedTaskCustomConsole(consoleId);
},
getCurrencyCode: function() {
if ( GlidePluginManager.isActive('com.snc.financial_planning_pmo') )
return PPMCurrencyHelper.defaultCurrencySymbol();
else {
var currencyCode;
if( GlidePropertiesDB.get('glide.i18n.single_currency') == 'true' )
currencyCode = GlidePropertiesDB.get('glide.i18n.single_currency.code');
if (!currencyCode)
currencyCode = 'USD';
var currencyTypes = new GlideRecord('fx_currency');
currencyTypes.addQuery('code', currencyCode);
currencyTypes.query();
currencyTypes.next();
return currencyTypes.symbol + '';
}
},
portalMetadata: function(entity,context) {
var columnConfig = (new SNC.PlannedTaskAPI()).entityMetadata(entity, context);
columnConfig = (new JSON()).decode(columnConfig);
var glideSession = gs.getSession();
return {
columnConfig: columnConfig,
tooltipConfig: ['state', 'time_constraint', 'start_date', 'end_date', 'duration', 'percent_complete'],
workbenchUrl: '#',
canAddPhase: false,
currencySymbol: this.getCurrencyCode(),
timeZone: glideSession.getTimeZoneName(),
brMode: false,
calculation_type: "automatic",
childSysClass: "planned_task",
title: this.console.name(),
dateFormat: gs.getDateFormat(),
dateTimeFormat: gs.getDateTimeFormat()
};
},
metadata: function() {
var columnConfig = (new SNC.PlannedTaskAPI()).entityMetadata('pm_project', 'my_gantt');
columnConfig = (new JSON()).decode(columnConfig);
var glideSession = gs.getSession();
return {
columnConfig: columnConfig,
tooltipConfig: ['state', 'time_constraint', 'start_date', 'end_date', 'duration', 'percent_complete'],
workbenchUrl: '#',
canAddPhase: false,
currencySymbol: this.getCurrencyCode(),
timeZone: glideSession.getTimeZoneName(),
brMode: false,
calculation_type: "automatic",
childSysClass: "planned_task",
title: this.console.name(),
dateFormat: gs.getDateFormat(),
dateTimeFormat: gs.getDateTimeFormat()
};
},
overviewTableMetadata: function(reqdColumns, metadata) {
var tableColumns = [];
reqdColumns.forEach(function(c) {
var tc = metadata.columnConfig.filter(function(mc) {
return c.trim() == mc.json_column.trim();
});
if ( tc.length > 0 )
tableColumns.push(tc[0]);
});
var tableMetadata = [];
tableColumns.forEach(function(tc) {
var col = tc.json_column;
if ( tc.type == 'glide_duration' || tc.type == 'choice' || tc.type == 'reference' )
col = 'dv_' + tc.json_column;
tableMetadata.push({column: col, label: tc.label, type: tc.type});
});
return tableMetadata;
},
type: 'PlannedTaskConsoleMetadata'
};
Sys ID
3ade1dc037330200455726877e41f19d