|
|
|
@ -230,14 +230,23 @@ public class Task implements Mappable { |
|
|
|
map.put(ESTIMATED_TIME, estimatedTime); |
|
|
|
map.put(ESTIMATED_TIME, estimatedTime); |
|
|
|
map.put(START_DATE,start); |
|
|
|
map.put(START_DATE,start); |
|
|
|
map.put(DUE_DATE,dueDate); |
|
|
|
map.put(DUE_DATE,dueDate); |
|
|
|
map.put(SHOW_CLOSED,showClosed); |
|
|
|
|
|
|
|
map.put(NO_INDEX,noIndex); |
|
|
|
map.put(NO_INDEX,noIndex); |
|
|
|
map.put(MEMBERS,memberMap); |
|
|
|
map.put(MEMBERS,memberMap); |
|
|
|
map.put(REQUIRED_TASKS_IDS,requiredTasksIds); |
|
|
|
map.put(REQUIRED_TASKS_IDS,requiredTasksIds); |
|
|
|
|
|
|
|
map.put(SHOW_CLOSED,showClosed); |
|
|
|
|
|
|
|
map.put(TOTAL_PRIO,totalPrio()); |
|
|
|
|
|
|
|
|
|
|
|
return map; |
|
|
|
return map; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int totalPrio() { |
|
|
|
|
|
|
|
if (dueDate == null) return priority; |
|
|
|
|
|
|
|
var diff = (int) (dueDate.toEpochDay()-LocalDate.now().toEpochDay()); |
|
|
|
|
|
|
|
if (diff <= 0) return priority + 100; // due date has passed
|
|
|
|
|
|
|
|
if (diff < 100) return priority + 100 - diff; // due within the next 100 days
|
|
|
|
|
|
|
|
return priority; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String toString() { |
|
|
|
public String toString() { |
|
|
|
|