cgaspard / mantiskanban

Mantis Kanban that uses ajax and mantisconnect
45 stars 33 forks source link

project returns no columns #8

Closed dreed47 closed 11 years ago

dreed47 commented 11 years ago

If project is using custom fields but is NOT using a custom field for kanban status the default mantis status are not used. The result is that no status columns are displayed. The issue is with the BuildKanbanListFromMantisStatuses() function about line 170. The if statement should also check for the existence of the Kanban._listIDField field and if not there then fall to the else.

cgaspard commented 11 years ago

Confirmed. I'll release a patch shortly.

dreed47 commented 11 years ago

just FYI....I fixed this by making the function look like this:

function BuildKanbanListFromMantisStatuses() { var hasCutomFieldForStatus = false; Kanban.UsingCustomField = false; if(Mantis.ProjectCustomFields.length > 0) { for(var cf = 0; cf < Mantis.ProjectCustomFields.length; cf++) { var customfield = Mantis.ProjectCustomFields[cf] if(customfield.field.name == Kanban._listIDField) { hasCutomFieldForStatus = true; Kanban.UsingCustomField = true; var possiblevalues = customfield.possible_values.split("|"); for(var pv = 0; pv < possiblevalues.length; pv++ ) { possiblevalue = possiblevalues[pv]; var newKanbanList = new KanbanList(possiblevalue); newKanbanList.UsesCustomField = true; Kanban.AddListToArray(newKanbanList); } } else { for(var si = 0; si < Mantis.Statuses.length; si++) { var status = Mantis.Statuses[si] Kanban.AddListToArray(new KanbanList(status)); } } } } else { for(var si = 0; si < Mantis.Statuses.length; si++) { var status = Mantis.Statuses[si] Kanban.AddListToArray(new KanbanList(status)); } }

}

cgaspard commented 11 years ago

Fixed in latest commit.

https://github.com/cgaspard/mantiskanban/commit/a2ca344b3f5244595cf5b8e1da9a6762eae4452d