Creating progression from cares or consent behavior.
This commit is contained in:
parent
0cf2c6c19e
commit
b34045ad34
|
|
@ -2,6 +2,8 @@ package fr.geoffrey.medical_training_tracker.controller;
|
||||||
|
|
||||||
import static fr.geoffrey.medical_training_tracker.controller.IndexController.MODEL_MAP_NAVBAR_PAGE;
|
import static fr.geoffrey.medical_training_tracker.controller.IndexController.MODEL_MAP_NAVBAR_PAGE;
|
||||||
import fr.geoffrey.medical_training_tracker.dao.bean.Animal;
|
import fr.geoffrey.medical_training_tracker.dao.bean.Animal;
|
||||||
|
import fr.geoffrey.medical_training_tracker.dao.bean.Care;
|
||||||
|
import fr.geoffrey.medical_training_tracker.dao.bean.ConsentBehavior;
|
||||||
import fr.geoffrey.medical_training_tracker.services.IServiceAnimal;
|
import fr.geoffrey.medical_training_tracker.services.IServiceAnimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
@ -24,6 +26,8 @@ public class AnimalController {
|
||||||
public static final String MODEL_MAP_ANIMAL_CARE_ID = "MODEL_MAP_ANIMAL_CARE_ID";
|
public static final String MODEL_MAP_ANIMAL_CARE_ID = "MODEL_MAP_ANIMAL_CARE_ID";
|
||||||
public static final String MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID = "MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID";
|
public static final String MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID = "MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID";
|
||||||
public static final String MODEL_MAP_PROGRESSION = "MODEL_MAP_PROGRESSION";
|
public static final String MODEL_MAP_PROGRESSION = "MODEL_MAP_PROGRESSION";
|
||||||
|
public static final String MODEL_MAP_LIST_REMAINING_CONSENT_BEHAVIORS = "MODEL_MAP_LIST_REMAINING_CONSENT_BEHAVIORS";
|
||||||
|
public static final String MODEL_MAP_LIST_REMAINING_CARES = "MODEL_MAP_LIST_REMAINING_CARES";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
IServiceAnimal serviceAnimal;
|
IServiceAnimal serviceAnimal;
|
||||||
|
|
@ -214,6 +218,55 @@ public class AnimalController {
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = IndexController.URL_ANIMAL_PROGRESSION_ADD, method = RequestMethod.POST)
|
||||||
|
public String doPostAddProgression(final ModelMap pModel, HttpSession httpSession,
|
||||||
|
@PathVariable(value = "animal_id") final int animalId,
|
||||||
|
@RequestParam(name = "care_id", required = true) int careId,
|
||||||
|
@RequestParam(name = "consent_behavior_id", required = true) int consentBehaviorId) {
|
||||||
|
String ret;
|
||||||
|
|
||||||
|
if (LoginController.isUserAlreadyAuth(httpSession)) {
|
||||||
|
Authentication authentication = (Authentication) httpSession.getAttribute(IndexController.SESSION_ATTRIBUTE_AUTHENTICATION);
|
||||||
|
Object oUserDetails = authentication.getPrincipal();
|
||||||
|
if (oUserDetails instanceof UserDetails) {
|
||||||
|
UserDetails userDetails = (UserDetails) oUserDetails;
|
||||||
|
|
||||||
|
serviceAnimal.addProgression(animalId, careId, consentBehaviorId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO Where do redirection ?
|
||||||
|
ret = IndexController.URL_REDIRECT + IndexController.URL_ANIMAL_CARES_AND_BEHAVIORS_LIST.replaceAll("\\{animal_id\\}", animalId + "");
|
||||||
|
} else {
|
||||||
|
ret = IndexController.URL_REDIRECT + IndexController.URL_LOGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = IndexController.URL_ANIMAL_PROGRESSION_DELETE, method = RequestMethod.POST)
|
||||||
|
public String doPostDeleteProgression(final ModelMap pModel, HttpSession httpSession,
|
||||||
|
@PathVariable(value = "animal_id") final int animalId,
|
||||||
|
@PathVariable(value = "progression_id") final int progressionId) {
|
||||||
|
String ret;
|
||||||
|
|
||||||
|
if (LoginController.isUserAlreadyAuth(httpSession)) {
|
||||||
|
Authentication authentication = (Authentication) httpSession.getAttribute(IndexController.SESSION_ATTRIBUTE_AUTHENTICATION);
|
||||||
|
Object oUserDetails = authentication.getPrincipal();
|
||||||
|
if (oUserDetails instanceof UserDetails) {
|
||||||
|
UserDetails userDetails = (UserDetails) oUserDetails;
|
||||||
|
|
||||||
|
serviceAnimal.deleteAnimalProgression(animalId, userDetails.getUsername(), progressionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO Where do redirection ?
|
||||||
|
ret = IndexController.URL_REDIRECT + IndexController.URL_ANIMAL_CARES_AND_BEHAVIORS_LIST.replaceAll("\\{animal_id\\}", animalId + "");
|
||||||
|
} else {
|
||||||
|
ret = IndexController.URL_REDIRECT + IndexController.URL_LOGIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
|
||||||
@RequestMapping(value = IndexController.URL_ANIMAL_CARE, method = RequestMethod.GET)
|
@RequestMapping(value = IndexController.URL_ANIMAL_CARE, method = RequestMethod.GET)
|
||||||
|
|
@ -233,6 +286,12 @@ public class AnimalController {
|
||||||
|
|
||||||
List<Animal> animals = serviceAnimal.getAnimals(userDetails.getUsername());
|
List<Animal> animals = serviceAnimal.getAnimals(userDetails.getUsername());
|
||||||
pModel.addAttribute(MODEL_MAP_ANIMAL_LIST, animals);
|
pModel.addAttribute(MODEL_MAP_ANIMAL_LIST, animals);
|
||||||
|
|
||||||
|
List<ConsentBehavior> listRemainingConsentBehaviors = serviceAnimal.getAnimalConsentBehaviors(userDetails.getUsername(), animalId);
|
||||||
|
for (ConsentBehavior cb: animal.getListConsentBehavior()) {
|
||||||
|
listRemainingConsentBehaviors.remove(cb);
|
||||||
|
}
|
||||||
|
pModel.addAttribute(MODEL_MAP_LIST_REMAINING_CONSENT_BEHAVIORS, listRemainingConsentBehaviors);
|
||||||
|
|
||||||
pModel.addAttribute(MODEL_MAP_ANIMAL_CARE_ID, careId);
|
pModel.addAttribute(MODEL_MAP_ANIMAL_CARE_ID, careId);
|
||||||
}
|
}
|
||||||
|
|
@ -262,6 +321,12 @@ public class AnimalController {
|
||||||
|
|
||||||
List<Animal> animals = serviceAnimal.getAnimals(userDetails.getUsername());
|
List<Animal> animals = serviceAnimal.getAnimals(userDetails.getUsername());
|
||||||
pModel.addAttribute(MODEL_MAP_ANIMAL_LIST, animals);
|
pModel.addAttribute(MODEL_MAP_ANIMAL_LIST, animals);
|
||||||
|
|
||||||
|
List<Care> listRemainingCares = serviceAnimal.getAnimalCares(userDetails.getUsername(), animalId);
|
||||||
|
for (Care care: animal.getListCares()) {
|
||||||
|
listRemainingCares.remove(care);
|
||||||
|
}
|
||||||
|
pModel.addAttribute(MODEL_MAP_LIST_REMAINING_CARES, listRemainingCares);
|
||||||
|
|
||||||
pModel.addAttribute(MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID, consentBehaviorId);
|
pModel.addAttribute(MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID, consentBehaviorId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,12 @@ public class IndexController {
|
||||||
// Add URL
|
// Add URL
|
||||||
public static final String URL_ANIMAL_CARES_ADD = "/animal/{animal_id}/add/care";
|
public static final String URL_ANIMAL_CARES_ADD = "/animal/{animal_id}/add/care";
|
||||||
public static final String URL_ANIMAL_CONSENT_BEHAVIOR_ADD = "/animal/{animal_id}/add/consent_behavior";
|
public static final String URL_ANIMAL_CONSENT_BEHAVIOR_ADD = "/animal/{animal_id}/add/consent_behavior";
|
||||||
|
public static final String URL_ANIMAL_PROGRESSION_ADD = "/animal/{animal_id}/add/progression";
|
||||||
// Delete URL
|
// Delete URL
|
||||||
public static final String URL_ANIMAL_DELETE = "/animal/delete/{animal_id}";
|
public static final String URL_ANIMAL_DELETE = "/animal/delete/{animal_id}";
|
||||||
public static final String URL_ANIMAL_CARES_DELETE = "/animal/{animal_id}/delete/care/{care_id}";
|
public static final String URL_ANIMAL_CARES_DELETE = "/animal/{animal_id}/delete/care/{care_id}";
|
||||||
public static final String URL_ANIMAL_CONSENT_BEHAVIOR_DELETE = "/animal/{animal_id}/delete/consent_behavior/{consent_behavior_id}";
|
public static final String URL_ANIMAL_CONSENT_BEHAVIOR_DELETE = "/animal/{animal_id}/delete/consent_behavior/{consent_behavior_id}";
|
||||||
|
public static final String URL_ANIMAL_PROGRESSION_DELETE = "/animal/{animal_id}/delete/progression/{progression_id}";
|
||||||
|
|
||||||
public static final String URL_REDIRECT = "redirect:";
|
public static final String URL_REDIRECT = "redirect:";
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
|
|
||||||
|
|
@ -19,4 +19,6 @@ public interface IProgressionDao extends CommonDao {
|
||||||
public void fillAnimalProgressionByMe(Animal animal, String progressionByMe);
|
public void fillAnimalProgressionByMe(Animal animal, String progressionByMe);
|
||||||
public void fillAnimalProgressionBySomeoneElse(Animal animal, String progressionBySomeoneElse);
|
public void fillAnimalProgressionBySomeoneElse(Animal animal, String progressionBySomeoneElse);
|
||||||
public void fillAnimalProgressionByVeterinary(Animal animal, String progressionByVeterinary);
|
public void fillAnimalProgressionByVeterinary(Animal animal, String progressionByVeterinary);
|
||||||
|
|
||||||
|
public void addProgression(int animalId, int careId, int consentBehaviorId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -493,4 +493,42 @@ public class ProgressionDao extends PostgresSqlDao implements IProgressionDao {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addProgression(int animalId, int careId, int consentBehaviorId) {
|
||||||
|
Connection conn = null;
|
||||||
|
PreparedStatement statement = null;
|
||||||
|
try {
|
||||||
|
conn = mDataSource.getConnection();
|
||||||
|
statement = conn.prepareStatement("INSERT INTO "+TABLE_NAME+" (id, animal, care, consent_behavior, progression_by_me, progression_by_someone_else, progression_by_veterinary) VALUES (nextval(?), ?, ?, ?, ?, ?, ?);");
|
||||||
|
statement.setString(1, SEQUENCE_NAME);
|
||||||
|
statement.setInt(2, animalId);
|
||||||
|
statement.setInt(3, careId);
|
||||||
|
statement.setInt(4, consentBehaviorId);
|
||||||
|
statement.setString(5, Progression.PROGRESSION_VALUE_NOT_TRAINED);
|
||||||
|
statement.setString(6, Progression.PROGRESSION_VALUE_NOT_TRAINED);
|
||||||
|
statement.setString(7, Progression.PROGRESSION_VALUE_NOT_TRAINED);
|
||||||
|
System.out.println(IndexController.LOG_TAG + " SQL -> " + statement.toString());
|
||||||
|
statement.executeUpdate();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println(IndexController.LOG_TAG + " SQLException -> addProgression()");
|
||||||
|
System.err.println(ex.getMessage());
|
||||||
|
ex.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (statement != null) {
|
||||||
|
try {
|
||||||
|
statement.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println(IndexController.LOG_TAG + " Failed close statement -> addProgression()");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (conn != null) {
|
||||||
|
try {
|
||||||
|
conn.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println(IndexController.LOG_TAG + " Failed close connection -> addProgression()");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,29 @@ public class Care {
|
||||||
public void setDescription(String description) {
|
public void setDescription(String description) {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 3;
|
||||||
|
hash = 53 * hash + this.id;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (getClass() != obj.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final Care other = (Care) obj;
|
||||||
|
if (this.id != other.id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,29 @@ public class ConsentBehavior {
|
||||||
public void setDescription(String description) {
|
public void setDescription(String description) {
|
||||||
this.description = description;
|
this.description = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 7;
|
||||||
|
hash = 41 * hash + this.id;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (getClass() != obj.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final ConsentBehavior other = (ConsentBehavior) obj;
|
||||||
|
if (this.id != other.id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package fr.geoffrey.medical_training_tracker.services;
|
package fr.geoffrey.medical_training_tracker.services;
|
||||||
|
|
||||||
import fr.geoffrey.medical_training_tracker.dao.bean.Animal;
|
import fr.geoffrey.medical_training_tracker.dao.bean.Animal;
|
||||||
|
import fr.geoffrey.medical_training_tracker.dao.bean.Care;
|
||||||
|
import fr.geoffrey.medical_training_tracker.dao.bean.ConsentBehavior;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface IServiceAnimal {
|
public interface IServiceAnimal {
|
||||||
|
|
@ -10,11 +12,13 @@ public interface IServiceAnimal {
|
||||||
public Animal getAnimalCareProgression(String owner, int animalId, int careId);
|
public Animal getAnimalCareProgression(String owner, int animalId, int careId);
|
||||||
public Animal getAnimalConsentBehaviorProgression(String owner, int animalId, int consentBehaviorId);
|
public Animal getAnimalConsentBehaviorProgression(String owner, int animalId, int consentBehaviorId);
|
||||||
public Animal getAnimalProgressionByMe(String username, int animalId, String progressionValue);
|
public Animal getAnimalProgressionByMe(String username, int animalId, String progressionValue);
|
||||||
|
public List<ConsentBehavior> getAnimalConsentBehaviors(String username, int animalId);
|
||||||
|
public List<Care> getAnimalCares(String username, int animalId);
|
||||||
|
|
||||||
public void addAnimal(String name, String owner);
|
public void addAnimal(String name, String owner);
|
||||||
public void addCare(int animalId, String name, String description);
|
public void addCare(int animalId, String name, String description);
|
||||||
public void addConsentBehavior(int animalId, String name, String description);
|
public void addConsentBehavior(int animalId, String name, String description);
|
||||||
// public void addProgression(int animalId,, int careId, int consentBehaviorId)
|
public void addProgression(int animalId, int careId, int consentBehaviorId);
|
||||||
|
|
||||||
public void deleteAnimal(int animalId, String owner);
|
public void deleteAnimal(int animalId, String owner);
|
||||||
public void deleteAnimalCare(int animalId, String owner, int careId);
|
public void deleteAnimalCare(int animalId, String owner, int careId);
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import fr.geoffrey.medical_training_tracker.dao.ICareDao;
|
||||||
import fr.geoffrey.medical_training_tracker.dao.IConsentBehaviorDao;
|
import fr.geoffrey.medical_training_tracker.dao.IConsentBehaviorDao;
|
||||||
import fr.geoffrey.medical_training_tracker.dao.IProgressionDao;
|
import fr.geoffrey.medical_training_tracker.dao.IProgressionDao;
|
||||||
import fr.geoffrey.medical_training_tracker.dao.bean.Animal;
|
import fr.geoffrey.medical_training_tracker.dao.bean.Animal;
|
||||||
|
import fr.geoffrey.medical_training_tracker.dao.bean.Care;
|
||||||
|
import fr.geoffrey.medical_training_tracker.dao.bean.ConsentBehavior;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -115,4 +117,19 @@ public class ServiceAnimal implements IServiceAnimal {
|
||||||
}
|
}
|
||||||
return animal;
|
return animal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConsentBehavior> getAnimalConsentBehaviors(String username, int animalId) {
|
||||||
|
return consentBehaviorDao.getAllAnialConsentBehavior(username, animalId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Care> getAnimalCares(String username, int animalId) {
|
||||||
|
return careDao.getAllAnimalCares(username, animalId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addProgression(int animalId, int careId, int consentBehaviorId) {
|
||||||
|
progressionDao.addProgression(animalId, careId, consentBehaviorId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
|
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
|
||||||
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
|
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
|
||||||
<%@ page isELIgnored="false" %>
|
<%@ page isELIgnored="false" %>
|
||||||
|
<spring:url value="/animal/${MODEL_MAP_ANIMAL.getId()}/delete/progression" var="animalDeleteProgressionURL" />
|
||||||
|
<spring:url value="/animal/${MODEL_MAP_ANIMAL.getId()}/add/progression" var="animalAddProgressionURL" />
|
||||||
|
|
||||||
<%@ include file="base/language.jsp" %>
|
<%@ include file="base/language.jsp" %>
|
||||||
|
|
||||||
|
|
@ -34,6 +36,7 @@
|
||||||
<h4>${MODEL_MAP_ANIMAL.getConsentBehaviorById(MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID).getName()}</h4>
|
<h4>${MODEL_MAP_ANIMAL.getConsentBehaviorById(MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID).getName()}</h4>
|
||||||
<p>${MODEL_MAP_ANIMAL.getConsentBehaviorById(MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID).getDescription()}</p>
|
<p>${MODEL_MAP_ANIMAL.getConsentBehaviorById(MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID).getDescription()}</p>
|
||||||
<h4>Progression</h4>
|
<h4>Progression</h4>
|
||||||
|
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -41,6 +44,7 @@
|
||||||
<th>Réalisé par moi</th>
|
<th>Réalisé par moi</th>
|
||||||
<th>Réalisé par quelqu'un d'autre</th>
|
<th>Réalisé par quelqu'un d'autre</th>
|
||||||
<th>Réalisé par le vétérinaire</th>
|
<th>Réalisé par le vétérinaire</th>
|
||||||
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
@ -62,10 +66,32 @@
|
||||||
<c:if test="${progression.getProgressionByVeterinary() == 'CURRENTLY_TRAINING'}">info</c:if>
|
<c:if test="${progression.getProgressionByVeterinary() == 'CURRENTLY_TRAINING'}">info</c:if>
|
||||||
<c:if test="${progression.getProgressionByVeterinary() == 'NOT_TRAINED'}">active</c:if>
|
<c:if test="${progression.getProgressionByVeterinary() == 'NOT_TRAINED'}">active</c:if>
|
||||||
">${progression.getProgressionByVeterinary()}</td>
|
">${progression.getProgressionByVeterinary()}</td>
|
||||||
|
<td>
|
||||||
|
<!--TODO MODIFICATION-->
|
||||||
|
<form class="pull-right" action="${animalDeleteProgressionURL}/${progression.getId()}" method="POST">
|
||||||
|
<button class="btn btn-danger" type="submit" data-toggle="tooltip" data-placement="bottom" title="Suppression"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
<h4>Ajouter un soins pour ce comportement de consentement</h4>
|
||||||
|
<form class="form-inline" action="${animalAddProgressionURL}" method="POST">
|
||||||
|
<label class="sr-only" for="form_consent_behavior_id">Consent Behavior ID</label>
|
||||||
|
<input id="form_consent_behavior_id" name="consent_behavior_id" value="${MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID}" hidden />
|
||||||
|
<label class="sr-only" for="form_care_id">Care ID</label>
|
||||||
|
<select id="form_care_id" class="form-control" name="care_id">
|
||||||
|
<c:forEach items="${MODEL_MAP_LIST_REMAINING_CARES}" var="care">
|
||||||
|
<option value="${care.getId()}">${care.getName()}</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
<input id="form_care_id" name="care_id" value="${MODEL_MAP_ANIMAL_CONSENT_BEHAVIOR_ID}" hidden />
|
||||||
|
<button class="btn btn-success" type="submit" data-toggle="tooltip" data-placement="bottom" title="Ajouter"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
|
||||||
|
</form>
|
||||||
|
|
||||||
<%@ include file="base/footer.jsp" %>
|
<%@ include file="base/footer.jsp" %>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
|
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
|
||||||
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
|
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
|
||||||
<%@ page isELIgnored="false" %>
|
<%@ page isELIgnored="false" %>
|
||||||
|
<spring:url value="/animal/${MODEL_MAP_ANIMAL.getId()}/delete/progression" var="animalDeleteProgressionURL" />
|
||||||
|
<spring:url value="/animal/${MODEL_MAP_ANIMAL.getId()}/add/progression" var="animalAddProgressionURL" />
|
||||||
|
|
||||||
<%@ include file="base/language.jsp" %>
|
<%@ include file="base/language.jsp" %>
|
||||||
|
|
||||||
|
|
@ -34,6 +36,7 @@
|
||||||
<h4>${MODEL_MAP_ANIMAL.getCareById(MODEL_MAP_ANIMAL_CARE_ID).getName()}</h4>
|
<h4>${MODEL_MAP_ANIMAL.getCareById(MODEL_MAP_ANIMAL_CARE_ID).getName()}</h4>
|
||||||
<p>${MODEL_MAP_ANIMAL.getCareById(MODEL_MAP_ANIMAL_CARE_ID).getDescription()}</p>
|
<p>${MODEL_MAP_ANIMAL.getCareById(MODEL_MAP_ANIMAL_CARE_ID).getDescription()}</p>
|
||||||
<h4>Progression</h4>
|
<h4>Progression</h4>
|
||||||
|
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -41,6 +44,7 @@
|
||||||
<th>Réalisé par moi</th>
|
<th>Réalisé par moi</th>
|
||||||
<th>Réalisé par quelqu'un d'autre</th>
|
<th>Réalisé par quelqu'un d'autre</th>
|
||||||
<th>Réalisé par le vétérinaire</th>
|
<th>Réalisé par le vétérinaire</th>
|
||||||
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
@ -51,10 +55,10 @@
|
||||||
<c:if test="${progression.getProgressionByMe() == 'TRAINED'}">success</c:if>
|
<c:if test="${progression.getProgressionByMe() == 'TRAINED'}">success</c:if>
|
||||||
<c:if test="${progression.getProgressionByMe() == 'CURRENTLY_TRAINING'}">info</c:if>
|
<c:if test="${progression.getProgressionByMe() == 'CURRENTLY_TRAINING'}">info</c:if>
|
||||||
<c:if test="${progression.getProgressionByMe() == 'NOT_TRAINED'}">active</c:if>
|
<c:if test="${progression.getProgressionByMe() == 'NOT_TRAINED'}">active</c:if>
|
||||||
">
|
">
|
||||||
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_me/${progression.getProgressionByMe()}">
|
<a href="${animalURL}/${MODEL_MAP_ANIMAL.getId()}/progression_by_me/${progression.getProgressionByMe()}">
|
||||||
${progression.getProgressionByMe()}
|
${progression.getProgressionByMe()}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="
|
<td class="
|
||||||
<c:if test="${progression.getProgressionBySomeoneElse() == 'TRAINED'}">success</c:if>
|
<c:if test="${progression.getProgressionBySomeoneElse() == 'TRAINED'}">success</c:if>
|
||||||
|
|
@ -66,10 +70,31 @@
|
||||||
<c:if test="${progression.getProgressionByVeterinary() == 'CURRENTLY_TRAINING'}">info</c:if>
|
<c:if test="${progression.getProgressionByVeterinary() == 'CURRENTLY_TRAINING'}">info</c:if>
|
||||||
<c:if test="${progression.getProgressionByVeterinary() == 'NOT_TRAINED'}">active</c:if>
|
<c:if test="${progression.getProgressionByVeterinary() == 'NOT_TRAINED'}">active</c:if>
|
||||||
">${progression.getProgressionByVeterinary()}</td>
|
">${progression.getProgressionByVeterinary()}</td>
|
||||||
|
<td>
|
||||||
|
<!--TODO MODIFICATION-->
|
||||||
|
<form class="pull-right" action="${animalDeleteProgressionURL}/${progression.getId()}" method="POST">
|
||||||
|
<button class="btn btn-danger" type="submit" data-toggle="tooltip" data-placement="bottom" title="Suppression"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
<h4>Ajouter un comportement de consentement pour ce soin</h4>
|
||||||
|
<form class="form-inline" action="${animalAddProgressionURL}" method="POST">
|
||||||
|
<label class="sr-only" for="form_care_id">Care ID</label>
|
||||||
|
<input id="form_care_id" name="care_id" value="${MODEL_MAP_ANIMAL_CARE_ID}" hidden />
|
||||||
|
<label class="sr-only" for="form_consent_behavior_id">Consent Behavior ID</label>
|
||||||
|
<select id="form_consent_behavior_id" class="form-control" name="consent_behavior_id">
|
||||||
|
<c:forEach items="${MODEL_MAP_LIST_REMAINING_CONSENT_BEHAVIORS}" var="consent_behavior">
|
||||||
|
<option value="${consent_behavior.getId()}">${consent_behavior.getName()}</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
<button class="btn btn-success" type="submit" data-toggle="tooltip" data-placement="bottom" title="Ajouter"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span></button>
|
||||||
|
</form>
|
||||||
|
|
||||||
<%@ include file="base/footer.jsp" %>
|
<%@ include file="base/footer.jsp" %>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue