Fix WP new path

pull/2185/head
Hagen Schink 10 years ago
parent 49ea876593
commit 327b5aa107
  1. 7
      app/assets/javascripts/angular/work_packages/controllers/work-packages-list-controller.js
  2. 6
      public/templates/work_packages.list.html

@ -42,11 +42,12 @@ angular.module('openproject.workPackages.controllers')
'PaginationService',
'AuthorisationService',
'UrlParamsHelper',
'PathHelper',
'OPERATORS_AND_LABELS_BY_FILTER_TYPE',
function($scope, $rootScope, $state, $location, latestTab,
I18n, WorkPackagesTableService,
WorkPackageService, ProjectService, QueryService, PaginationService,
AuthorisationService, UrlParamsHelper,
AuthorisationService, UrlParamsHelper, PathHelper,
OPERATORS_AND_LABELS_BY_FILTER_TYPE) {
// Setup
@ -302,4 +303,8 @@ angular.module('openproject.workPackages.controllers')
$state.go(latestTab.getStateName(), { workPackageId: id, query_props: $location.search().query_props });
}
};
$scope.workPackageNewPath = function(typeId) {
return PathHelper.staticWorkPackageNewWithParametersPath($scope.projectIdentifier, { type_id: typeId })
};
}]);

@ -75,7 +75,11 @@
<div class="dropdown dropdown-relative dropdown-anchor-right" id="tasksDropdown">
<ul class="dropdown-menu">
<li ng-repeat="type in availableTypes"><a ng-href="work_packages/new?work_package[type_id]={{type.id}}">{{type.name}}</a></li>
<li ng-repeat="type in availableTypes">
<a ng-href="{{ workPackageNewPath(type.id) }}">
{{type.name}}
</a>
</li>
</ul>
</div>

Loading…
Cancel
Save