implemented user column in time tracking list

This commit is contained in:
2025-09-29 12:03:39 +02:00
parent 68ed3a7495
commit 121453937c
2 changed files with 15 additions and 2 deletions

View File

@@ -196,14 +196,21 @@ public class TimeModule extends BaseHandler implements TimeService {
boolean showClosed = false;
var times = timeDb.listTimes(taskIds, showClosed);
times.putAll(timeDb.listUserTimes(user.id(), showClosed));
taskIds = times.values().stream().map(Time::taskIds).flatMap(Collection::stream).collect(toSet());
taskIds.clear();
var userIds = new HashSet<Long>();
times.values().forEach(time -> {
taskIds.addAll(time.taskIds());
userIds.add(time.userId());
});
var tasks = taskService().load(taskIds);
var users = userService().list(null,null,userIds);
var result = new HashMap<String,Object>();
var docList = documentService().docsReferencedByTimes(times.keySet());
result.put(DOCUMENTS,docList);
result.put(TIMES,mapValues(times));
result.put(TASKS,mapValues(tasks));
result.put(PROJECTS,mapValues(projects));
result.put(USERS,mapValues(users));
return sendContent(ex,result);
}