|
|
@ -34,8 +34,13 @@ angular.module('openproject.viewModels') |
|
|
|
'$timeout', |
|
|
|
'$timeout', |
|
|
|
'WorkPackageService', |
|
|
|
'WorkPackageService', |
|
|
|
'ApiHelper', |
|
|
|
'ApiHelper', |
|
|
|
|
|
|
|
'PathHelper', |
|
|
|
'MAX_AUTOCOMPLETER_ADDITION_ITERATIONS', |
|
|
|
'MAX_AUTOCOMPLETER_ADDITION_ITERATIONS', |
|
|
|
function($timeout, WorkPackageService, ApiHelper, MAX_AUTOCOMPLETER_ADDITION_ITERATIONS) { |
|
|
|
function($timeout, |
|
|
|
|
|
|
|
WorkPackageService, |
|
|
|
|
|
|
|
ApiHelper, |
|
|
|
|
|
|
|
PathHelper, |
|
|
|
|
|
|
|
MAX_AUTOCOMPLETER_ADDITION_ITERATIONS) { |
|
|
|
function CommonRelationsHandler(workPackage, |
|
|
|
function CommonRelationsHandler(workPackage, |
|
|
|
relations, |
|
|
|
relations, |
|
|
|
relationsId) { |
|
|
|
relationsId) { |
|
|
@ -97,9 +102,12 @@ angular.module('openproject.viewModels') |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
addAutocompleter: function(retries, workPackage, relationsId) { |
|
|
|
addAutocompleter: function(retries, workPackage, relationsId) { |
|
|
|
|
|
|
|
var projectId = workPackage.props.projectId; |
|
|
|
|
|
|
|
var workPackageId = workPackage.props.id; |
|
|
|
|
|
|
|
|
|
|
|
if (angular.element('#relation_to_id-' + relationsId).size() === 1) { |
|
|
|
if (angular.element('#relation_to_id-' + relationsId).size() === 1) { |
|
|
|
// Massive hack alert - Using old prototype autocomplete ///////////
|
|
|
|
// Massive hack alert - Using old prototype autocomplete ///////////
|
|
|
|
var url = PathHelper.workPackageAutoCompletePath(workPackage.props.projectId, workPackage.props.id); |
|
|
|
var url = PathHelper.staticWorkPackageAutoCompletePath(projectId, workPackageId); |
|
|
|
new Ajax.Autocompleter('relation_to_id-' + relationsId, |
|
|
|
new Ajax.Autocompleter('relation_to_id-' + relationsId, |
|
|
|
'related_issue_candidates-' + relationsId, |
|
|
|
'related_issue_candidates-' + relationsId, |
|
|
|
url, |
|
|
|
url, |
|
|
|