diff --git a/backoffice/src/main/java/uy/edu/fing/tse/jsf/GestionHechosBean.java b/backoffice/src/main/java/uy/edu/fing/tse/jsf/GestionHechosBean.java index 6e9ac5320b874756df6dd225bcd0d8b0021fb3b7..47e9ba73939de8991cee49357dabb820284e6567 100644 --- a/backoffice/src/main/java/uy/edu/fing/tse/jsf/GestionHechosBean.java +++ b/backoffice/src/main/java/uy/edu/fing/tse/jsf/GestionHechosBean.java @@ -24,12 +24,17 @@ public class GestionHechosBean implements Serializable { public void init() { estados = service.listarEstados(); filteredFacts = service.listarHechos(); + facts = service.listarHechos(); } private List<State> estados; + private List<Fact> facts; + private List<Fact> filteredFacts; + + private String filterTitulo = ""; private String filterDesc = ""; private String filterEstado = ""; @@ -70,5 +75,16 @@ public class GestionHechosBean implements Serializable { public void setFilterEstado(String filterEstado) { this.filterEstado = filterEstado; } + + public List<Fact> getFacts() { + return facts; + } + + public void setFacts(List<Fact> facts) { + this.facts = facts; + } + public void setService(BusinessLocal service) { + this.service = service; + } } diff --git a/backoffice/src/main/webapp/jsf/gestionhechos.xhtml b/backoffice/src/main/webapp/jsf/gestionhechos.xhtml index 2ef7c6a053e36441b929619b1acfd8f9f7dd0e5e..6c774e667729ec5a219be1c9b773f68d66011b5c 100644 --- a/backoffice/src/main/webapp/jsf/gestionhechos.xhtml +++ b/backoffice/src/main/webapp/jsf/gestionhechos.xhtml @@ -15,7 +15,7 @@ <h:outputText value="#{sessionBean.user.mail}"/> </p:outputPanel> - <p:dataTable var="hecho" id="dataHecho" value="#{gestionHechos.filteredFacts}" widgetVar="NoticiasTable" + <p:dataTable var="hecho" id="dataHecho" value="#{gestionHechos.facts}" widgetVar="NoticiasTable" emptyMessage="Hecho no encontrada" filteredValue="#{gestionHechos.filteredFacts}"> <f:facet name="header"> <p:outputPanel> @@ -25,25 +25,41 @@ </p:outputPanel> </f:facet> - <p:column filterBy="#{gestionHechos.filterTitulo}" headerText="Titulo" filterMatchMode="contains"> + <p:column filterBy="#{hecho.title}" headerText="Titulo" filterMatchMode="contains"> <h:outputText value="#{hecho.title}"/> </p:column> - <p:column filterBy="#{gestionHechos.filterDesc}" headerText="Descripción" filterMatchMode="contains"> + <p:column filterBy="#{hecho.description}" headerText="Descripción" filterMatchMode="contains"> <h:outputText value="#{hecho.description}"/> </p:column> - <p:column filterBy="#{gestionHechos.filterEstado}" headerText="Estados" filterMatchMode="exact"> + <p:column filterBy="#{hecho.actualState.value}" headerText="Estados" filterMatchMode="exact"> <f:facet name="filter"> <p:selectOneMenu onchange="PF('NoticiasTable').filter()" styleClass="custom-filter"> <f:selectItem itemLabel="Select One" itemValue="#{null}" noSelectionOption="true"/> <f:selectItems value="#{gestionHechos.estados}" var="e" itemLabel="#{e.value}" - itemValue="#{e.value}"/> + itemValue="#{hecho.actualState.value}"/> </p:selectOneMenu> </f:facet> <h:outputText value="#{hecho.actualState.value}"/> </p:column> + + <p:column headerText="" style="text-align: center" > + + <p:growl id="message" showDetail="true" /> + + <p:commandButton value="Enviar Verificación" action="#{hecho.setEstado()}" update="@form" disabled="#{noticia.EstaVerifcado()}" > + <p:confirm header="Confirmar" message="¿Enviar Solicitud?" icon="pi pi-exclamation-triangle" /> + </p:commandButton> + + <p:confirmDialog global="true" showEffect="fade" hideEffect="fade"> + <p:commandButton value="Si" type="button" styleClass="ui-confirmdialog-yes" icon="pi pi-check" /> + <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="pi pi-times" /> + </p:confirmDialog> + </p:column> </p:dataTable> + </h:form> </ui:define> </ui:decorate> </body> -</html> \ No newline at end of file +</html> + diff --git a/central-dto/src/main/java/uy/edu/fing/tse/dto/Fact.java b/central-dto/src/main/java/uy/edu/fing/tse/dto/Fact.java index 1fdf5af1bd578fa29f1baca6e68517c7696f0995..ceed9b04f8edef764026750afcc542ce37ea9255 100644 --- a/central-dto/src/main/java/uy/edu/fing/tse/dto/Fact.java +++ b/central-dto/src/main/java/uy/edu/fing/tse/dto/Fact.java @@ -44,6 +44,10 @@ public final class Fact implements Serializable { return actualState; } + public State getActualState2() { + return actualState; + } + public void setActualState(State actualState) { this.actualState = actualState; }