|
@@ -71,13 +71,13 @@ public class ProceduresController {
|
|
|
HashMap<String, Object> response =
|
|
HashMap<String, Object> response =
|
|
|
pc.getActiveInstances( _new, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
pc.getActiveInstances( _new, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
|
|
|
|
|
|
- if (response != null && response.get("redirect") != null) {
|
|
|
|
|
- model.addAllAttributes(response);
|
|
|
|
|
- session.setAttribute("location", model.getAttribute("location"));
|
|
|
|
|
- return response.get("redirect").toString();
|
|
|
|
|
|
|
+ if (response == null) {
|
|
|
|
|
+ return "401";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return "401";
|
|
|
|
|
|
|
+ model.addAllAttributes(response);
|
|
|
|
|
+
|
|
|
|
|
+ return "procedures";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -133,9 +133,9 @@ public class ProceduresController {
|
|
|
|
|
|
|
|
HashMap<String, Object> response =
|
|
HashMap<String, Object> response =
|
|
|
pc.updateInstanciaTascaEvidencia(id, params, evidencias, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
pc.updateInstanciaTascaEvidencia(id, params, evidencias, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
|
- if (response != null && response.get("ammount") != null) {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (response != null && response.get("ammount") != null) {
|
|
|
model.addAllAttributes(response);
|
|
model.addAllAttributes(response);
|
|
|
- session.setAttribute("location", model.getAttribute("location"));
|
|
|
|
|
return response.get("ammount").toString();
|
|
return response.get("ammount").toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -159,13 +159,13 @@ public class ProceduresController {
|
|
|
|
|
|
|
|
HashMap<String, Object> response =
|
|
HashMap<String, Object> response =
|
|
|
pc.updateInstanciaTasca(id, params, evidencias, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
pc.updateInstanciaTasca(id, params, evidencias, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
|
- if (response != null && response.get("redirect") != null) {
|
|
|
|
|
- model.addAllAttributes(response);
|
|
|
|
|
- session.setAttribute("location", model.getAttribute("location"));
|
|
|
|
|
- return response.get("redirect").toString();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (response == null) {
|
|
|
|
|
+ return "401";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- return "401";
|
|
|
|
|
|
|
+ model.addAllAttributes(response);
|
|
|
|
|
+ return "procedures";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -185,14 +185,21 @@ public class ProceduresController {
|
|
|
public String saveDraft(Model model, Authentication auth, HttpSession session, @PathVariable BigInteger id, @RequestParam String text,
|
|
public String saveDraft(Model model, Authentication auth, HttpSession session, @PathVariable BigInteger id, @RequestParam String text,
|
|
|
@RequestParam boolean manual) {
|
|
@RequestParam boolean manual) {
|
|
|
HashMap<String, Object> response =
|
|
HashMap<String, Object> response =
|
|
|
- pc.saveDraft(session.getAttribute("location").toString(), id, text, manual, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
|
|
|
- if (response != null && response.get("date") != null) {
|
|
|
|
|
- model.addAllAttributes(response);
|
|
|
|
|
- session.setAttribute("location", model.getAttribute("location"));
|
|
|
|
|
- return response.get("date").toString();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ pc.saveDraft(id, text, manual, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
|
|
|
|
|
|
- return "401";
|
|
|
|
|
|
|
+ if(session.getAttribute("location") != null) {
|
|
|
|
|
+ model.addAttribute("location", session.getAttribute("location"));
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ session.setAttribute("location", "procedures");
|
|
|
|
|
+ model.addAttribute("location", "procedures");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (response == null) {
|
|
|
|
|
+ return "401";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return "procedures";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -207,12 +214,13 @@ public class ProceduresController {
|
|
|
public String getDrafts(Model model, Authentication auth, HttpSession session, @PathVariable BigInteger id) {
|
|
public String getDrafts(Model model, Authentication auth, HttpSession session, @PathVariable BigInteger id) {
|
|
|
HashMap<String, Object> response =
|
|
HashMap<String, Object> response =
|
|
|
pc.getDrafts(id);
|
|
pc.getDrafts(id);
|
|
|
- if (response != null && response.get("redirect") != null) {
|
|
|
|
|
- model.addAllAttributes(response);
|
|
|
|
|
- return response.get("redirect").toString();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (response == null) {
|
|
|
|
|
+ return "401";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return "401";
|
|
|
|
|
|
|
+ model.addAllAttributes(response);
|
|
|
|
|
+ return "procedure_versions";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -253,12 +261,13 @@ public class ProceduresController {
|
|
|
|
|
|
|
|
HashMap<String, Object> response =
|
|
HashMap<String, Object> response =
|
|
|
pc.getYearsByCenterTitulation(centres, titulacions, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
pc.getYearsByCenterTitulation(centres, titulacions, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
|
- if (response != null && response.get("redirect") != null) {
|
|
|
|
|
- model.addAllAttributes(response);
|
|
|
|
|
- return response.get("redirect").toString();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (response == null) {
|
|
|
|
|
+ return "401";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- return "401";
|
|
|
|
|
|
|
+ model.addAllAttributes(response);
|
|
|
|
|
+ return "components/selector_cursos";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// POST que se utiliza para conseguir los procedimiento que se han llevado a cabo por cursos y por titulación
|
|
// POST que se utiliza para conseguir los procedimiento que se han llevado a cabo por cursos y por titulación
|
|
@@ -269,12 +278,13 @@ public class ProceduresController {
|
|
|
@RequestParam("titulations[]") List<Integer> titulacions) throws IOException {
|
|
@RequestParam("titulations[]") List<Integer> titulacions) throws IOException {
|
|
|
HashMap<String, Object> response =
|
|
HashMap<String, Object> response =
|
|
|
pc.getProceduresByCenterTitulationYear(centres, cursos, titulacions, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
pc.getProceduresByCenterTitulationYear(centres, cursos, titulacions, ((Usuari) auth.getPrincipal()).getUsuari());
|
|
|
- if (response != null && response.get("redirect") != null) {
|
|
|
|
|
- model.addAllAttributes(response);
|
|
|
|
|
- return response.get("redirect").toString();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (response == null) {
|
|
|
|
|
+ return "401";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- return "401";
|
|
|
|
|
|
|
+ model.addAllAttributes(response);
|
|
|
|
|
+ return "components/selector_processos";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/ajax/find/procedure")
|
|
@PostMapping("/ajax/find/procedure")
|