Fix work package time entries sorting

pull/1166/head
Hagen Schink 11 years ago
parent 70c1e845bf
commit f0768b1dd1
  1. 2
      app/assets/javascripts/angular/controllers/time-entries-controllers.js
  2. 14
      app/assets/javascripts/angular/helpers/components/path-helper.js
  3. 1
      app/controllers/timelog_controller.rb

@ -40,7 +40,7 @@ angular.module('openproject.timeEntries.controllers')
$scope.loadTimeEntries = function() {
$scope.isLoading = true;
$http.get(PathHelper.timeEntriesPath(gon.project_id),
$http.get(PathHelper.timeEntriesPath(gon.project_id, gon.work_package_id),
{
params: {
sort: SortService.getSortParam(),

@ -55,12 +55,16 @@ angular.module('openproject.helpers')
projectPath: function(projectIdentifier) {
return PathHelper.projectsPath() + '/' + projectIdentifier;
},
timeEntriesPath: function(projectIdentifier) {
if (projectIdentifier) {
return PathHelper.projectPath(projectIdentifier) + '/time_entries/';
} else {
return '/time_entries/';
timeEntriesPath: function(projectIdentifier, workPackageIdentifier) {
var path = '/time_entries/';
if (workPackageIdentifier) {
return PathHelper.workPackagePath(workPackageIdentifier) + path;
} else if (projectIdentifier) {
return PathHelper.projectPath(projectIdentifier) + path;
}
return path;
},
timeEntryPath: function(timeEntryIdentifier) {
return '/time_entries/' + timeEntryIdentifier;

@ -72,6 +72,7 @@ class TimelogController < ApplicationController
gon.rabl "app/views/timelog/index.rabl"
gon.project_id = @project.id if @project
gon.work_package_id = @issue.id if @issue
gon.sort_column = 'spent_on'
gon.sort_direction = 'desc'
gon.total_count = total_entry_count(cond)

Loading…
Cancel
Save