Skip to content
Snippets Groups Projects

Resolve "Store last location enqueued and suggest as room when enqueuing again"

Files

@@ -31,6 +31,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.transaction.Transactional;
import nl.tudelft.labracore.api.dto.*;
@@ -119,6 +120,9 @@ public class LabController {
@Autowired
private RoleDTOService roleService;
@Autowired
private HttpSession session;
/**
* Gets the page with information on the lab with the given id. This page is different for TAs than for
* students. For students, this page shows their history of requests and their current requests. For TAs,
@@ -209,6 +213,10 @@ public class LabController {
model.addAttribute("request", new LabRequestCreateDTO());
model.addAttribute("rType", "lab");
if (session.getAttribute("lastKnownLocation") != null) {
model.addAttribute("lastKnownLocation", session.getAttribute("lastKnownLocation"));
}
return "lab/enqueue/lab";
} else {
model.addAttribute("request", new SelectionRequestCreateDTO());
@@ -284,6 +292,11 @@ public class LabController {
dto.setSession(lab);
rs.createRequest(dto, student.getId(), true);
if (dto.getComment() != null) {
session.setAttribute("lastKnownLocation", dto.getComment());
}
return "redirect:/lab/" + lab.getId();
}
Loading