Merge pull request #111 from finnlabs/fix/17242_spent_time_assigned_to_wrong_group_and_order_of_costs_attributes_wrong

17242 Spent time assigned to wrong group and order of cost's attributes wrong
pull/6827/head
ulferts 10 years ago
commit 173f0c5935
  1. 21
      app/assets/javascripts/angular/openproject-costs-app.js

@ -33,22 +33,29 @@ openprojectCostsApp.run(['HookService',
'ConfigurationService',
'WorkPackagesOverviewService',
function(HookService, ConfigurationService, WorkPackagesOverviewService) {
var addAttributesToGroup = function(group, attributes) {
angular.forEach(attributes, function(id, attribute) {
WorkPackagesOverviewService.addAttributeToGroup(group, id || attribute);
});
};
var setupCostsAttributes = function() {
var position = WorkPackagesOverviewService.getGroupedWorkPackageOverviewAttributes().length - 1;
var costsAttributes = {
overallCosts: null,
spentHours: 'spentHoursLinked',
costObject: null,
summarizedCostEntries: 'spentUnits'
overallCosts: null,
summarizedCostEntries: 'spentUnits',
};
var estimatesAndTimeAttributes = {
spentHours: 'spentHoursLinked'
};
WorkPackagesOverviewService.removeAttribute('spentTime');
WorkPackagesOverviewService.addGroup('costs', position);
angular.forEach(costsAttributes, function(id, costAttribute) {
WorkPackagesOverviewService.addAttributeToGroup('costs', id || costAttribute);
});
}
addAttributesToGroup('costs', costsAttributes);
addAttributesToGroup('estimatesAndTime', estimatesAndTimeAttributes);
};
if (ConfigurationService.isModuleEnabled('costs_module')) {
setupCostsAttributes();

Loading…
Cancel
Save