Correcciones sobre interfaz.
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
|
||||||
xmlns:p="http://primefaces.org/ui">
|
xmlns:p="http://primefaces.org/ui">
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
<ui:composition template="../header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form id="visitForm">
|
<h:form id="visitForm">
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-2">
|
||||||
<div class="ui-inputgroup">
|
<div class="ui-inputgroup">
|
||||||
<p:calendar id="fecha" value="#{AddVisit.date}" pattern="dd/MM/yyyy" showButtonPanel="true" autocomplete="true" required="true"
|
<p:datePicker id="fecha" value="#{AddVisit.date}" pattern="dd/MM/yyyy" showIcon="true" showOn="none" showButtonBar="true" autocomplete="true" required="true"
|
||||||
requiredMessage="Especifique la fecha de la visita." />
|
requiredMessage="Especifique la fecha de la visita." />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,7 +48,10 @@
|
|||||||
<p:outputLabel for="hora" value="Hora:" />
|
<p:outputLabel for="hora" value="Hora:" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-2">
|
||||||
<p:calendar id="hora" value="#{AddVisit.time}" pattern="HH:mm" showButtonPanel="true" autocomplete="true" required="true" requiredMessage="Especifique la hora de la visita." />
|
<p:datePicker id="hora" value="#{AddVisit.time}" timeOnly="true" pattern="HH:mm" showIcon="true" showButtonBar="true" autocomplete="true" required="true"
|
||||||
|
requiredMessage="Especifique la hora de la visita." validatorMessage="Especifique una hora en el rango de las 06:00 a las 22:00 horas">
|
||||||
|
<f:convertDateTime type="localTime" pattern="HH:mm" />
|
||||||
|
</p:datePicker>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-8">
|
<div class="ui-g-8">
|
||||||
<p:message for="hora" display="text" />
|
<p:message for="hora" display="text" />
|
||||||
@@ -64,16 +67,6 @@
|
|||||||
<p:message for="observaciones" display="text" />
|
<p:message for="observaciones" display="text" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:outputLabel for="resultado" value="Resultado:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-8">
|
|
||||||
<p:inputTextarea id="resultado" value="#{AddVisit.result}" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-2">
|
|
||||||
<p:message for="resultado" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-12 ui-g-nopad">
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
<div class="ui-g-4 ui-md-4" />
|
<div class="ui-g-4 ui-md-4" />
|
||||||
<div class="ui-g-2 ui-md-2 ">
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-2">
|
||||||
<div class="ui-inputgroup">
|
<div class="ui-inputgroup">
|
||||||
<p:datePicker id="fecha" value="#{VisitView.date}" pattern="dd/MM/yyyy" showIcon="true" readonlyInput="true" showOn="none" readonly="true" showButtonBar="true"
|
<p:datePicker id="fecha" value="#{VisitView.date}" pattern="dd/MM/yyyy" showIcon="true" showOn="none" readonly="true" readonlyInput="true" showButtonBar="true"
|
||||||
autocomplete="true" required="true" requiredMessage="Especifique la fecha de la visita." />
|
autocomplete="true" required="true" requiredMessage="Especifique la fecha de la visita." />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
<p:outputLabel for="hora" value="Hora:" />
|
<p:outputLabel for="hora" value="Hora:" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-2">
|
||||||
<p:datePicker id="hora" value="#{VisitView.time}" timeOnly="true" pattern="HH:mm" showIcon="true" showButtonBar="true" autocomplete="true" required="true"
|
<p:datePicker id="hora" value="#{VisitView.time}" timeOnly="true" pattern="HH:mm" showIcon="true" showButtonBar="true" autocomplete="true" readonly="true" readonlyInput="true" required="true"
|
||||||
requiredMessage="Especifique la hora de la visita.">
|
requiredMessage="Especifique la hora de la visita.">
|
||||||
<f:convertDateTime type="localTime" pattern="HH:mm" />
|
<f:convertDateTime type="localTime" pattern="HH:mm" />
|
||||||
</p:datePicker>
|
</p:datePicker>
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package managedbean.visit;
|
package managedbean.visit;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.sql.Time;
|
import java.time.LocalTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.faces.application.FacesMessage;
|
||||||
|
import javax.faces.view.ViewScoped;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
import TO.FamilyDoctorTO;
|
import TO.FamilyDoctorTO;
|
||||||
@@ -14,21 +16,21 @@ import managedbean.common.ManagedBeanBase;
|
|||||||
import managedbean.common.SessionUtils;
|
import managedbean.common.SessionUtils;
|
||||||
|
|
||||||
@Named("AddVisit")
|
@Named("AddVisit")
|
||||||
@RequestScoped
|
@ViewScoped
|
||||||
public class AddVisitMBean extends ManagedBeanBase implements Serializable {
|
public class AddVisitMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private Date date;
|
private Date date;
|
||||||
private Time time;
|
private LocalTime time;
|
||||||
private String observations;
|
private String observations;
|
||||||
private String result;
|
private String result;
|
||||||
private String patientDisplayName;
|
private String patientDisplayName;
|
||||||
private String familyDoctorDisplayName;
|
private String familyDoctorDisplayName;
|
||||||
private PatientTO patient;
|
private PatientTO patient;
|
||||||
private FamilyDoctorTO familyDoctor;
|
private FamilyDoctorTO familyDoctor;
|
||||||
|
|
||||||
public AddVisitMBean() {
|
public AddVisitMBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,15 +38,16 @@ public class AddVisitMBean extends ManagedBeanBase implements Serializable {
|
|||||||
public void init() {
|
public void init() {
|
||||||
// El usuario actual es un medico de familia, recuperamos su Id de la sessión actual
|
// El usuario actual es un medico de familia, recuperamos su Id de la sessión actual
|
||||||
Integer patientId = Integer.valueOf(SessionUtils.getUserId());
|
Integer patientId = Integer.valueOf(SessionUtils.getUserId());
|
||||||
|
|
||||||
this.patient = this.getRemoteManagerCommon().findPatientById(patientId);
|
this.patient = this.getRemoteManagerCommon().findPatientById(patientId);
|
||||||
this.familyDoctor = this.patient.getFamilyDoctor();
|
this.familyDoctor = this.patient.getFamilyDoctor();
|
||||||
|
|
||||||
this.date = new Date();
|
this.date = new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveData() {
|
public void saveData() {
|
||||||
// TODO: Añadir la nueva visita a la BBDD
|
// TODO: Añadir la nueva visita a la BBDD
|
||||||
|
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Visita creada", "La nueva visita se ha registrado correctamente en el sistema.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getDate() {
|
public Date getDate() {
|
||||||
@@ -55,11 +58,11 @@ public class AddVisitMBean extends ManagedBeanBase implements Serializable {
|
|||||||
this.date = date;
|
this.date = date;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Time getTime() {
|
public LocalTime getTime() {
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTime(Time time) {
|
public void setTime(LocalTime time) {
|
||||||
this.time = time;
|
this.time = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user