use project-specific custom field api.

pull/863/head
Nils Kenneweg 11 years ago committed by Martin Czuchra
parent 4d7e0c6ef5
commit 7d51457ff6
  1. 6
      app/assets/javascripts/timelines/TimelineLoader.js
  2. 5
      app/assets/javascripts/timelines/ui.js

@ -676,6 +676,10 @@ Timeline.TimelineLoader = (function () {
};
TimelineLoader.prototype.registerGlobalElements = function () {
var projectPrefix = this.globalPrefix +
this.options.project_prefix +
"/" +
this.options.project_id;
this.loader.register(
Timeline.Status.identifier,
@ -688,7 +692,7 @@ Timeline.TimelineLoader = (function () {
{ url : this.globalPrefix + '/colors.json' });
this.loader.register(
Timeline.CustomFields.identifier,
{ url : this.globalPrefix + '/custom_fields.json' });
{ url : projectPrefix + '/planning_element_custom_fields.json' });
this.loader.register(
Timeline.ProjectType.identifier,
{ url : this.globalPrefix + '/project_types.json' });

@ -867,7 +867,10 @@ jQuery.extend(Timeline, {
var header = function(key) {
var th = jQuery('<th></th>');
if (key.substr(0, 3) === "cf_") {
th.append(timeline.custom_fields[parseInt(key.substr(3), 10)].name);
var timeline_id = parseInt(key.substr(3), 10);
if (timeline.custom_fields[timeline_id]) {
th.append(timeline.custom_fields[timeline_id].name);
}
} else {
th.append(timeline.i18n('timelines.filter.column.' + key));
}

Loading…
Cancel
Save