11/10/2008

git-svn-id: https://svn.coded.pt/svn/SIPRP@785 bb69d46d-e84e-40c8-a05a-06db0d633741
lxbfYeaa
L Luís = 17 years ago
parent 0e4f0544d8
commit e49c36c7da

@ -15,14 +15,13 @@ import java.util.Vector;
public class PlanoActuacao {
private Integer id;
private Integer estabelecimento_id;
private Integer estado;
private Integer fase;
private String descricao;
private Vector<Risco> riscos;
//
private Date data_visita;
private Integer tecnico_hs_id;
private Integer fase;
private String fase_nome;
private String tecnico_hs_nome;
private String loja_nome;
@ -43,12 +42,12 @@ public class PlanoActuacao {
this.estabelecimento_id = estabelecimento_id;
}
public Integer getEstado() {
return estado;
public Integer getFase() {
return fase;
}
public void setEstado(Integer estado) {
this.estado = estado;
public void setFase(Integer fase) {
this.fase = fase;
}
public String getDescricao() {
@ -83,14 +82,6 @@ public class PlanoActuacao {
this.tecnico_hs_id = tecnico_hs_id;
}
public Integer getFase() {
return fase;
}
public void setFase(Integer fase) {
this.fase = fase;
}
public String getFase_nome() {
return fase_nome;
}

@ -42,6 +42,7 @@ public class PlanosDataProvider extends GenericDataProvider{
String sql = "";
//To Do sql string here :
sql = "UPDATE planos_actuacao SET fase = " + p.getFase() + " ";
sql += "WHERE id = " + p.getId();
System.out.println("SQL UPDATE PLANO : " + sql);
@ -57,19 +58,19 @@ public class PlanosDataProvider extends GenericDataProvider{
switch(userType)
{
case Global.TECNICO_HS:
sql += "WHERE estado = 1 OR estado = 5";
sql += "WHERE fase = 1 OR fase = 5";
break;
case Global.RESPONSAVEL_SEGURANCA:
sql += "WHERE estado = 2";
sql += "WHERE fase = 2";
break;
case Global.DIRECTOR_LOJA:
sql += "WHERE estado = 3";
sql += "WHERE fase = 3";
break;
case Global.DIRECTOR_NACIONAL_SEGURANCA:
sql += "WHERE estado = 4";
sql += "WHERE fase = 4";
break;
}
@ -79,10 +80,41 @@ public class PlanosDataProvider extends GenericDataProvider{
return list;
}
public ArrayList getPlanosSeguimento(Utilizador u) throws Exception
{
Statement st = createStatement();
int userType = u.getTipo().intValue();
String sql = "select * from planos_actuacao ";
switch(userType)
{
case Global.TECNICO_HS:
sql += "WHERE fase <> 1 AND fase <> 5 AND fase <> 6";
break;
case Global.RESPONSAVEL_SEGURANCA:
sql += "WHERE fase <> 2 AND fase <> 6";
break;
case Global.DIRECTOR_LOJA:
sql += "WHERE fase <> 3 AND fase <> 6";
break;
case Global.DIRECTOR_NACIONAL_SEGURANCA:
sql += "WHERE fase <> 4 AND fase <> 6";
break;
}
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillPlanoFields(rs);
return list;
}
public ArrayList getPlanosConcluidos(Utilizador u) throws Exception
{
Statement st = createStatement();
String sql = "select * from planos_actuacao where estado = 6";
String sql = "select * from planos_actuacao where fase = 6";
ResultSet rs = st.executeQuery(sql);
ArrayList list = fillPlanoFields(rs);
return list;
@ -99,7 +131,8 @@ public class PlanosDataProvider extends GenericDataProvider{
PlanoActuacao pa = new PlanoActuacao();
pa.setId( new Integer( rs.getInt("id") ) );
pa.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id")));
pa.setEstado( new Integer( rs.getInt("estado") ) );
pa.setFase( new Integer( rs.getInt("fase") ) );
pa.setData_visita(rs.getDate("data_visita"));
list.add(pa);
}while(rs.next());

@ -15,25 +15,25 @@ import global.Global;
*/
public class SendMail extends Mail{
public void sendMail(Utilizador u, PlanoActuacao p)
public static void sendMail(Utilizador u, PlanoActuacao p)
{
int estado = p.getEstado().intValue();
switch(estado)
int fase = p.getFase().intValue();
switch(fase)
{
// case Global.ESTADO_CRIACAO_TSHS:
// break;
//
// case Global.ESTADO_EDICAO_SEGURANCA:
// break;
//
// case Global.ESTADO_VALIDACAO_DIR_LOJA:
// break;
//
// case Global.ESTADO_VALIDACAO_DNS:
// break;
//
// case Global.ESTADO_VERIFICACAO_TSHS:
// break;
case Global.FASE_SIPRP_EMISSAO:
break;
case Global.FASE_SEGURANCA_PREENCHIMENTO:
break;
case Global.FASE_DIR_LOJA_VALIDACAO:
break;
case Global.FASE_DNS_PARECER:
break;
case Global.FASE_SIPRP_CONCLUSAO:
break;
}
}
}

@ -10,7 +10,9 @@ import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Calendar;
import com.sun.webui.jsf.component.TextArea;
import com.sun.webui.jsf.component.TextField;
import com.sun.webui.jsf.model.DefaultOptionsList;
import com.sun.webui.jsf.model.DefaultTableDataProvider;
import com.sun.webui.jsf.model.SingleSelectOptionsList;
import javax.faces.component.html.HtmlPanelGrid;
import tabledataproviders.*;
import javax.faces.FacesException;
@ -43,6 +45,15 @@ public class Dummy extends AbstractPageBean {
public void setGrid(HtmlPanelGrid hpg) {
this.grid = hpg;
}
private SingleSelectOptionsList dropDown1DefaultOptions = new SingleSelectOptionsList();
public SingleSelectOptionsList getDropDown1DefaultOptions() {
return dropDown1DefaultOptions;
}
public void setDropDown1DefaultOptions(SingleSelectOptionsList ssol) {
this.dropDown1DefaultOptions = ssol;
}
// </editor-fold>

@ -9,18 +9,27 @@ package planosactuacao;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.Calendar;
import com.sun.webui.jsf.component.Checkbox;
import com.sun.webui.jsf.component.DropDown;
import com.sun.webui.jsf.component.PanelGroup;
import com.sun.webui.jsf.component.StaticText;
import com.sun.webui.jsf.component.TextArea;
import com.sun.webui.jsf.component.TextField;
import com.sun.webui.jsf.model.SingleSelectOptionsList;
import db.entidades.Medida;
import db.entidades.PlanoActuacao;
import db.entidades.PostoTrabalho;
import db.entidades.Risco;
import db.entidades.Utilizador;
import db.providers.PlanosDataProvider;
import global.Global;
import java.util.Vector;
import javax.faces.FacesException;
import javax.faces.component.html.HtmlInputHidden;
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
import mail.Mail;
import utils.JSFUtils;
/**
@ -122,6 +131,87 @@ public class EditarPlano extends AbstractPageBean {
public void setButCancelar(Button b) {
this.butCancelar = b;
}
private StaticText lblMsg = new StaticText();
public StaticText getLblMsg() {
return lblMsg;
}
public void setLblMsg(StaticText st) {
this.lblMsg = st;
}
private HtmlPanelGrid gridValidar = new HtmlPanelGrid();
public HtmlPanelGrid getGridValidar() {
return gridValidar;
}
public void setGridValidar(HtmlPanelGrid hpg) {
this.gridValidar = hpg;
}
private Checkbox chkValidacao = new Checkbox();
public Checkbox getChkValidacao() {
return chkValidacao;
}
public void setChkValidacao(Checkbox c) {
this.chkValidacao = c;
}
private SingleSelectOptionsList drpIrParaDefaultOptions = new SingleSelectOptionsList();
public SingleSelectOptionsList getDrpIrParaDefaultOptions() {
return drpIrParaDefaultOptions;
}
public void setDrpIrParaDefaultOptions(SingleSelectOptionsList ssol) {
this.drpIrParaDefaultOptions = ssol;
}
private HtmlPanelGrid gridParecer = new HtmlPanelGrid();
public HtmlPanelGrid getGridParecer() {
return gridParecer;
}
public void setGridParecer(HtmlPanelGrid hpg) {
this.gridParecer = hpg;
}
private TextArea txtParecer = new TextArea();
public TextArea getTxtParecer() {
return txtParecer;
}
public void setTxtParecer(TextArea ta) {
this.txtParecer = ta;
}
private HtmlInputHidden hidValidacao = new HtmlInputHidden();
public HtmlInputHidden getHidValidacao() {
return hidValidacao;
}
public void setHidValidacao(HtmlInputHidden hih) {
this.hidValidacao = hih;
}
private StaticText stIrPara = new StaticText();
public StaticText getStIrPara() {
return stIrPara;
}
public void setStIrPara(StaticText st) {
this.stIrPara = st;
}
private DropDown drpIrPara = new DropDown();
public DropDown getDrpIrPara() {
return drpIrPara;
}
public void setDrpIrPara(DropDown dd) {
this.drpIrPara = dd;
}
/**
* <p>Construct a new Page bean instance.</p>
@ -163,7 +253,13 @@ public class EditarPlano extends AbstractPageBean {
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
Utilizador u = getSessionBean1().getCurrentUser();
if(u.getTipo().intValue() != Global.DIRECTOR_NACIONAL_SEGURANCA)
{
stIrPara.setStyleClass("hidden");
drpIrPara.setStyleClass("hidden");
}
}
/**
@ -205,6 +301,9 @@ public class EditarPlano extends AbstractPageBean {
medidas = getSessionBean1().getMedidas();
postos = getSessionBean1().getPostos();
}
lblMsg.setText(getSessionBean1().getMsg());
getSessionBean1().setMsg("");
}
/**
@ -418,7 +517,7 @@ public class EditarPlano extends AbstractPageBean {
plano = new PlanoActuacao();
plano.setId(new Integer(1));
plano.setEstabelecimento_id(new Integer(1));
plano.setEstado(new Integer(1));
plano.setFase(new Integer(1));
getSessionBean1().setPlanoId(new Integer(1));
plano.setDescricao("Plano 1");
@ -634,6 +733,37 @@ public class EditarPlano extends AbstractPageBean {
private void initialize()
{
Utilizador u = getSessionBean1().getCurrentUser();
if(u.getTipo().intValue() == Global.DIRECTOR_NACIONAL_SEGURANCA)
{
hidValidacao.setValue("dns");
}
//gridValidar.setStyleClass("hidden");
//System.out.println("VISIBILITY : " + gridValidar.getStyleClass());
//System.out.println("USER TYPE : " + u.getTipo().intValue());
if(u.getTipo().intValue() != Global.DIRECTOR_LOJA && u.getTipo().intValue() != Global.DIRECTOR_NACIONAL_SEGURANCA)
{
//gridValidar.setStyleClass("visible");
//System.out.println("VISIBILITY B : " + gridValidar.getStyleClass());
gridValidar.setRendered(false);
//txtParecer.setStyleClass("hidden");
}
else
{
//txtParecer.setRendered(false);
gridParecer.setStyleClass("hidden");
}
// else
// {
// if(u.getTipo().intValue() != Global.DIRECTOR_NACIONAL_SEGURANCA)
// {
// //txtParecer.setStyleClass("visible");
// txtParecer.setRendered(false);
// }
// }
gridPlano.setWidth("100%");
gridPlano.setColumns(1);
gridPlano.setColumnClasses("gridColCenter");
@ -666,13 +796,140 @@ public class EditarPlano extends AbstractPageBean {
public String butEnviar_action() {
// TODO: Process the action. Return value is a navigation
// case name where null will return to the same page.
processEnviar();
try
{
processEnviar();
return "lista_planos";
}
catch(Exception ex)
{
getSessionBean1().setMsg("Erro no envio do Plano");
}
return null;
}
private void processEnviar()
private void processEnviar() throws Exception
{
boolean processo_validado = true;
int dns_next_fase = 2;
PlanoActuacao p = getSessionBean1().getPlanoActuacao();
//dummy : later on get fase from plano
//int fase = getSessionBean1().getFase();
int fase = p.getFase().intValue();
switch(fase)
{
// case Global.FASE_SIPRP_EMISSAO:
// break;
case Global.FASE_SEGURANCA_PREENCHIMENTO:
case Global.FASE_SIPRP_CONCLUSAO:
fase++;
break;
case Global.FASE_DIR_LOJA_VALIDACAO:
if(processo_validado)
{
fase++;
}
else
{
fase = Global.FASE_SEGURANCA_PREENCHIMENTO; //fase 2
}
break;
case Global.FASE_DNS_PARECER:
if(processo_validado)
{
fase++;
}
else
{
fase = dns_next_fase;
}
break;
}
//dummy : later on will update db with new fase
//getSessionBean1().setFase(fase);
PlanosDataProvider pdp = new PlanosDataProvider();
p.setFase(new Integer(fase));
pdp.updatePlano(p);
enviarMail(fase);
}
public void enviarMail(int fase)
{
String assunto = "";
String mail_text = "";
switch(fase)
{
// case Global.FASE_SIPRP_EMISSAO:
// break;
case Global.FASE_SEGURANCA_PREENCHIMENTO:
assunto = "PLANOS - SEGURANÇA (PREENCHIMENTO)";
mail_text = "Notifica-se que o Plano passou para a fase Segurança(Preenchimento)";
break;
case Global.FASE_DIR_LOJA_VALIDACAO:
assunto = "PLANOS - DIRECTOR LOJA (VALIDAÇÃO)";
mail_text = "Notifica-se que o Plano passou para a fase Director de Loja(Validação)";
break;
case Global.FASE_DNS_PARECER:
assunto = "PLANOS - DNS (PARECER)";
mail_text = "Notifica-se que o Plano passou para a fase Dns(Parecer)";
break;
case Global.FASE_SIPRP_CONCLUSAO:
assunto = "PLANOS - TSHS SIPRP (CONCLUSÃO)";
mail_text = "Notifica-se que o Plano passou para a fase TSHS(Conclusão)";
break;
}
if(fase < Global.FASE_CONCLUIDO) // nao envia para ninguem na fase Concluido
{
Mail mail = new Mail();
try
{
mail.send("lluis@evolute.pt", Mail.ENDERECO_ENVIO, assunto, mail_text);
System.out.println("EMAIL ENVIADO !!");
}
catch(Exception ex)
{
ex.printStackTrace();
System.out.println("ERRO NO ENVIO DO EMAIL !!");
}
}
}
public void chkValidacao_processValueChange(ValueChangeEvent event) {
if(chkValidacao.getSelected() != null)
{
Boolean selected = (Boolean) chkValidacao.getSelected();
if(selected.booleanValue())
{
//txtParecer.setRendered(true);
gridParecer.setStyleClass("visible");
}
else
{
//txtParecer.setRendered(false);
gridParecer.setStyleClass("hidden");
}
}
else
{
//txtParecer.setRendered(false);
gridParecer.setStyleClass("hidden");
}
}
}

@ -6,16 +6,19 @@
package planosactuacao;
import com.sun.data.provider.RowKey;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.Table;
import com.sun.webui.jsf.component.TableRowGroup;
import db.entidades.PlanoActuacao;
import db.providers.UtilizadoresDataProvider;
import db.entidades.Utilizador;
import db.providers.PlanosDataProvider;
import global.Global;
import java.util.ArrayList;
import java.util.Calendar;
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
import tabledataproviders.PlanosActualDataProvider;
import utils.JSFUtils;
/**
@ -220,6 +223,10 @@ public class ListaPlanos extends AbstractPageBean {
public String goEditarPlano_action() {
// TODO: Process the action. Return value is a navigation
// case name where null will return to the same page.
PlanoActuacao p = getTableActivosRowData();
getSessionBean1().setPlanoActuacao(p);
//dummy
//getSessionBean1().setFase(2);
return "editar_plano";
}
@ -232,60 +239,217 @@ public class ListaPlanos extends AbstractPageBean {
private void initialize()
{
//Dummy : to remove later
ArrayList listActivos = new ArrayList();
PlanoActuacao pa = new PlanoActuacao();
PlanosDataProvider pdp = new PlanosDataProvider();
Utilizador u = getSessionBean1().getCurrentUser();
Calendar cal = Calendar.getInstance();
//Planos Activos
try
{
ArrayList listActivos = pdp.getPlanosActivos(u);
try
{
PlanoActuacao pa = (PlanoActuacao) listActivos.get(0);
if(pa.getId().intValue() == 1)
{
pa.setFase_nome(Global.FASES_TEXTO[pa.getFase().intValue() - 1]);
pa.setLoja_nome("Setubal");
pa.setTecnico_hs_id(new Integer(7));
pa.setTecnico_hs_nome("Ana");
}
pa = (PlanoActuacao) listActivos.get(1);
if(pa.getId().intValue() == 2)
{
pa.setFase_nome(Global.FASES_TEXTO[pa.getFase().intValue() - 1]);
pa.setLoja_nome("Cascais");
pa.setTecnico_hs_id(new Integer(7));
pa.setTecnico_hs_nome("Sónia");
}
cal.set( cal.YEAR, 2008 );
cal.set( cal.MONTH, cal.SEPTEMBER );
cal.set( cal.DATE, 3 );
cal.set( cal.HOUR_OF_DAY, 0 );
cal.set( cal.MINUTE, 0 );
cal.set( cal.SECOND, 0 );
cal.set( cal.MILLISECOND, 0 );
pa = (PlanoActuacao) listActivos.get(2);
if(pa.getId().intValue() == 3)
{
pa.setFase_nome(Global.FASES_TEXTO[pa.getFase().intValue() - 1]);
pa.setLoja_nome("Sintra");
pa.setTecnico_hs_id(new Integer(7));
pa.setTecnico_hs_nome("Pedro");
}
java.sql.Date dataVisita =
new java.sql.Date( cal.getTime().getTime() );
}
catch(Exception ex1)
{
ex1.printStackTrace();
}
getSessionBean1().getPlanosActualDataProvider().setList(listActivos);
}
catch(Exception ex)
{
ex.printStackTrace();
}
pa.setData_visita(dataVisita);
pa.setEstabelecimento_id(new Integer(12));
pa.setFase(2);
pa.setFase_nome("SIPRP (Emissão)");
pa.setLoja_nome("Setubal");
pa.setTecnico_hs_id(new Integer(7));
pa.setTecnico_hs_nome("Ana");
listActivos.add(pa);
pa = new PlanoActuacao();
cal.set( cal.YEAR, 2008 );
cal.set( cal.MONTH, cal.OCTOBER );
cal.set( cal.DATE, 12 );
//Planos Seguimento
try
{
ArrayList listSeguimento = pdp.getPlanosSeguimento(u);
try
{
PlanoActuacao pa = (PlanoActuacao) listSeguimento.get(0);
if(pa.getId().intValue() == 1)
{
pa.setFase_nome(Global.FASES_TEXTO[pa.getFase().intValue() - 1]);
pa.setLoja_nome("Setubal");
pa.setTecnico_hs_id(new Integer(7));
pa.setTecnico_hs_nome("Ana");
}
pa = (PlanoActuacao) listSeguimento.get(1);
if(pa.getId().intValue() == 2)
{
pa.setFase_nome(Global.FASES_TEXTO[pa.getFase().intValue() - 1]);
pa.setLoja_nome("Cascais");
pa.setTecnico_hs_id(new Integer(7));
pa.setTecnico_hs_nome("Sónia");
}
cal.set( cal.HOUR_OF_DAY, 0 );
cal.set( cal.MINUTE, 0 );
cal.set( cal.SECOND, 0 );
cal.set( cal.MILLISECOND, 0 );
dataVisita =
new java.sql.Date( cal.getTime().getTime() );
pa = (PlanoActuacao) listSeguimento.get(2);
if(pa.getId().intValue() == 3)
{
pa.setFase_nome(Global.FASES_TEXTO[pa.getFase().intValue() - 1]);
pa.setLoja_nome("Sintra");
pa.setTecnico_hs_id(new Integer(7));
pa.setTecnico_hs_nome("Pedro");
}
}
catch(Exception ex1)
{
ex1.printStackTrace();
}
getSessionBean1().getPlanosSeguimentoDataProvider().setList(listSeguimento);
}
catch(Exception ex)
{
ex.printStackTrace();
}
pa.setData_visita(dataVisita);
pa.setEstabelecimento_id(new Integer(12));
pa.setFase(2);
pa.setFase_nome("DNS (Parecer)");
pa.setLoja_nome("Cascais");
pa.setTecnico_hs_id(new Integer(7));
pa.setTecnico_hs_nome("Sónia");
listActivos.add(pa);
//Planos Concluidos
try
{
ArrayList listConcluidos = pdp.getPlanosConcluidos(u);
try
{
PlanoActuacao pa = (PlanoActuacao) listConcluidos.get(0);
if(pa.getId().intValue() == 1)
{
pa.setFase_nome(Global.FASES_TEXTO[pa.getFase().intValue() - 1]);
pa.setLoja_nome("Setubal");
pa.setTecnico_hs_id(new Integer(7));
pa.setTecnico_hs_nome("Ana");
}
pa = (PlanoActuacao) listConcluidos.get(1);
if(pa.getId().intValue() == 2)
{
pa.setFase_nome(Global.FASES_TEXTO[pa.getFase().intValue() - 1]);
pa.setLoja_nome("Cascais");
pa.setTecnico_hs_id(new Integer(7));
pa.setTecnico_hs_nome("Sónia");
}
pa = (PlanoActuacao) listConcluidos.get(2);
if(pa.getId().intValue() == 3)
{
pa.setFase_nome(Global.FASES_TEXTO[pa.getFase().intValue() - 1]);
pa.setLoja_nome("Sintra");
pa.setTecnico_hs_id(new Integer(7));
pa.setTecnico_hs_nome("Pedro");
}
}
catch(Exception ex1)
{
ex1.printStackTrace();
}
getSessionBean1().getPlanosConcluidosDataProvider().setList(listConcluidos);
}
catch(Exception ex)
{
ex.printStackTrace();
}
getSessionBean1().getPlanosActualDataProvider().setList(listActivos);
//Dummy : to remove later
// ArrayList listActivos = new ArrayList();
// PlanoActuacao pa = new PlanoActuacao();
//
// Calendar cal = Calendar.getInstance();
//
// cal.set( cal.YEAR, 2008 );
// cal.set( cal.MONTH, cal.SEPTEMBER );
// cal.set( cal.DATE, 3 );
//
// cal.set( cal.HOUR_OF_DAY, 0 );
// cal.set( cal.MINUTE, 0 );
// cal.set( cal.SECOND, 0 );
// cal.set( cal.MILLISECOND, 0 );
//
// java.sql.Date dataVisita =
// new java.sql.Date( cal.getTime().getTime() );
//
// pa.setData_visita(dataVisita);
// pa.setEstabelecimento_id(new Integer(12));
// pa.setFase(2);
// pa.setFase_nome("SIPRP (Emissão)");
// pa.setLoja_nome("Setubal");
// pa.setTecnico_hs_id(new Integer(7));
// pa.setTecnico_hs_nome("Ana");
// listActivos.add(pa);
//
// pa = new PlanoActuacao();
//
// cal.set( cal.YEAR, 2008 );
// cal.set( cal.MONTH, cal.OCTOBER );
// cal.set( cal.DATE, 12 );
//
// cal.set( cal.HOUR_OF_DAY, 0 );
// cal.set( cal.MINUTE, 0 );
// cal.set( cal.SECOND, 0 );
// cal.set( cal.MILLISECOND, 0 );
//
// dataVisita =
// new java.sql.Date( cal.getTime().getTime() );
//
// pa.setData_visita(dataVisita);
// pa.setEstabelecimento_id(new Integer(12));
// pa.setFase(2);
// pa.setFase_nome("DNS (Parecer)");
// pa.setLoja_nome("Cascais");
// pa.setTecnico_hs_id(new Integer(7));
// pa.setTecnico_hs_nome("Sónia");
// listActivos.add(pa);
//End Dummy
}
private PlanoActuacao getTableActivosRowData()
{
RowKey rk = tableRowGroup1.getRowKey();
int k = Integer.parseInt(rk.getRowId());
PlanosActualDataProvider provider = (PlanosActualDataProvider) tableRowGroup1.getSourceData();
ArrayList list = (ArrayList) provider.getList();
PlanoActuacao p = (PlanoActuacao)list.get(k);
return p;
}
}

@ -8,6 +8,7 @@ package planosactuacao;
import com.sun.rave.web.ui.appbase.AbstractSessionBean;
import db.entidades.Medida;
import db.entidades.PlanoActuacao;
import db.entidades.PostoTrabalho;
import db.entidades.Risco;
import db.entidades.Utilizador;
@ -33,6 +34,7 @@ public class SessionBean1 extends AbstractSessionBean {
private String msg;
private Integer planoId;
private PlanoActuacao planoActuacao = null;
private Vector<Risco> riscos = new Vector<Risco>();
private Vector<Medida> medidas = new Vector<Medida>();
private Vector<PostoTrabalho> postos = new Vector<PostoTrabalho>();
@ -53,12 +55,14 @@ public class SessionBean1 extends AbstractSessionBean {
// </editor-fold>
//menu
private boolean disableMenu;
private boolean disableMenuAnalises;
private boolean disableMenuPlanos;
private boolean disableMenuUtilizadores;
private boolean disableMenuDadosUtilizador;
private boolean disableMenu = false;
private boolean disableMenuAnalises = false;
private boolean disableMenuPlanos = false;
private boolean disableMenuUtilizadores = false;
private boolean disableMenuDadosUtilizador = false;
//fase
private int fase = 1;
/**
* <p>Construct a new session data bean instance.</p>
@ -288,4 +292,20 @@ public class SessionBean1 extends AbstractSessionBean {
this.disableMenuDadosUtilizador = disableMenuDadosUtilizador;
}
public int getFase() {
return fase;
}
public void setFase(int fase) {
this.fase = fase;
}
public PlanoActuacao getPlanoActuacao() {
return planoActuacao;
}
public void setPlanoActuacao(PlanoActuacao planoActuacao) {
this.planoActuacao = planoActuacao;
}
}

@ -29,31 +29,20 @@
<webuijsf:body id="body1" style="-rave-layout: grid">
<webuijsf:form id="form1">
<h:panelGrid binding="#{Dummy.grid}" columns="1" id="grid" style="height: 72px; left: 216px; top: 24px; position: absolute; width: 96px"/>
<h:panelGrid columnClasses="gridCol30,gridCol70" columns="2" id="gridPanel1"
style="height: 24px; left: 120px; top: 192px; position: absolute; width: 80%" styleClass="centerBlock" width="552">
<webuijsf:panelGroup id="groupPanel1">
<webuijsf:image id="image1" url="/resources/images/SIPRP_logo_small.jpg"/>
<webuijsf:staticText escape="false" id="staticText1" style="" text="&amp;nbsp;"/>
<webuijsf:image height="40" id="image2" style="" url="/resources/images/logo_auchan_small.jpg"/>
</webuijsf:panelGroup>
<h:panelGrid columnClasses="gridColRight" columns="1" id="gridPanel2" style="height: 24px; width: 80%" styleClass="centerBlock">
<webuijsf:panelGroup id="groupPanel2" style="">
<webuijsf:hyperlink actionExpression="#{Dummy.lnkAnaliseAcidentes_action}" id="lnkAnaliseAcidentes1" text="análises acidentes&gt;&gt;"/>
</webuijsf:panelGroup>
<webuijsf:panelGroup id="groupPanel3">
<webuijsf:staticText escape="false" id="lblUser1" styleClass="label" text="#{SessionBean1.currentUser.login}"/>
<webuijsf:staticText escape="false" id="staticText2" text="&amp;nbsp;&amp;nbsp;&amp;nbsp;"/>
<webuijsf:hyperlink id="lnkPlanosActuacao1" text="planos actuação"/>
<webuijsf:staticText escape="false" id="staticText3" text="&amp;nbsp;|&amp;nbsp;"/>
<webuijsf:hyperlink id="lnkGerirUtilizadores1" style="" text="gerir utilizadores"/>
<webuijsf:staticText escape="false" id="staticText4" text="&amp;nbsp;|&amp;nbsp;"/>
<webuijsf:hyperlink id="lnkDadosUtilizador1" style="" text="alterar dados utilizador"/>
<webuijsf:staticText escape="false" id="staticText5" text="&amp;nbsp;|&amp;nbsp;"/>
<webuijsf:hyperlink actionExpression="#{Dummy.lnkLogout_action}" id="lnkLogout1" text="sair&gt;&gt;"/>
</webuijsf:panelGroup>
</h:panelGrid>
<webuijsf:panelGroup id="groupPanel1">
<webuijsf:staticText escape="false" id="staticText1" styleClass="label" text="Enviar para:&amp;nbsp;"/>
<webuijsf:dropDown id="dropDown1" items="#{Dummy.dropDown1DefaultOptions.options}"/>
</webuijsf:panelGroup>
<webuijsf:textArea columns="60" id="txtParecer1" rows="4" style="left: 336px; top: 24px; position: absolute"/>
<h:panelGrid columnClasses="gridColLeft10,gridColLeft90" columns="2" id="gridPanel1"
style="height: 24px; left: 120px; top: 216px; position: absolute" width="240">
<webuijsf:staticText id="staticText3" styleClass="label" text="Parecer:"/>
<webuijsf:textArea columns="60" id="txtParecer3" rows="4"/>
</h:panelGrid>
<webuijsf:hyperlink id="hyperlink1" style="color: #008000; left: 432px; top: 144px; position: absolute" text="Hyperlink"/>
<webuijsf:panelGroup id="groupPanel2" style="left: 408px; top: 96px; position: absolute; width: 100%">
<webuijsf:staticText id="staticText2" styleClass="label" text="Parecer:"/>
<webuijsf:textArea columns="60" id="txtParecer2" rows="4"/>
</webuijsf:panelGroup>
</webuijsf:form>
</webuijsf:body>
</webuijsf:html>

@ -11,18 +11,57 @@
<webuijsf:html id="html1">
<webuijsf:head id="head1">
<webuijsf:link id="link1" url="/resources/stylesheet.css"/>
<style></style>
<script>
function show(chk)
{
hid = document.getElementById("form1:hidValidacao");
if(hid.value == 'dns')
{
if(chk.checked)
{
document.getElementById("form1:gridParecer").className = "";
document.getElementById("_form1:groupPanel2:stIrPara").className = "hidden";
document.getElementById("_form1:groupPanel2:drpIrPara").className = "hidden";
}
else
{
document.getElementById("form1:gridParecer").className = "hidden";
document.getElementById("_form1:groupPanel2:stIrPara").className = "";
document.getElementById("_form1:groupPanel2:drpIrPara").className = "";
}
}
}
</script>
</webuijsf:head>
<webuijsf:body id="body1">
<webuijsf:form id="form1">
<div style="left: 0px; top: 0px; width: 100%">
<jsp:directive.include file="Header.jspf"/>
</div>
<h:inputHidden binding="#{EditarPlano.hidValidacao}" id="hidValidacao"/>
<h:panelGrid columns="1" id="gridBaseLayout" style="left: 24px; top: 96px; width: 100%" styleClass="centerBlock">
<webuijsf:staticText escape="false" id="staticText1" style="font-size: 36px" text="&amp;nbsp;"/>
<h:panelGrid columnClasses="gridColCenter" columns="1" id="gridMsg" style="height: 24px; width: 100%">
<webuijsf:staticText binding="#{EditarPlano.lblMsg}" id="lblMsg" styleClass="labelMsg "/>
</h:panelGrid>
<webuijsf:staticText escape="false" id="lblTop" style="" styleClass="label" text="Plano de actuação da auditoria 02/10/2008"/>
<h:panelGrid binding="#{EditarPlano.gridLayout}" columnClasses="gridColLeft" columns="1" id="gridLayout"
style="height: 24px; width: 80%" styleClass="centerBlock"/>
<h:panelGrid binding="#{EditarPlano.gridValidar}" columns="1" id="gridValidar" style="height: 24px; width: 80%"
styleClass="centerBlock" width="408">
<h:panelGrid columnClasses="gridColLeft20,gridColLeft80" columns="2" id="gridValidar2" style="height: 24px; width: 100%">
<webuijsf:panelGroup id="groupPanel3">
<webuijsf:staticText id="staticText2" styleClass="label" text="Validar processo:"/>
<webuijsf:checkbox binding="#{EditarPlano.chkValidacao}" id="chkValidacao" onChange="show(this)" valueChangeListenerExpression="#{EditarPlano.chkValidacao_processValueChange}"/>
</webuijsf:panelGroup>
<h:panelGrid binding="#{EditarPlano.gridParecer}" columnClasses="gridColLeft10,gridColLeft90" columns="2" id="gridParecer"
style="height: 24px" styleClass="hidden" width="240">
<webuijsf:staticText id="staticText3" styleClass="label" text="Parecer:"/>
<webuijsf:textArea binding="#{EditarPlano.txtParecer}" columns="60" id="txtParecer" rows="4"/>
</h:panelGrid>
</h:panelGrid>
</h:panelGrid>
<h:panelGrid columns="1" id="gridButtons1" style="height: 24px; width: 80%" styleClass="centerBlock">
<h:panelGrid columnClasses="gridColLeft,gridColRight" columns="2" id="gridPanel1" style="height: 24px; width: 100%">
<webuijsf:button binding="#{EditarPlano.butLimparDados}" id="butLimparDados" style="width: 95px" text="Limpar dados"/>
@ -36,8 +75,11 @@
<h:panelGrid columnClasses="gridColLeft,gridColRight" columns="2" id="gridPanel2" style="height: 24px; width: 100%">
<webuijsf:button binding="#{EditarPlano.butCancelar}" id="butCancelar" style="width: 95px" text="Cancelar"/>
<webuijsf:panelGroup id="groupPanel2" style="width: 194px">
<webuijsf:button actionExpression="#{EditarPlano.butEnviar_action}" binding="#{EditarPlano.butEnviar}" id="butEnviar"
style="width: 153px" text="Enviar a Director de Loja&gt;&gt;"/>
<webuijsf:staticText binding="#{EditarPlano.stIrPara}" escape="false" id="stIrPara" styleClass="label" text="Enviar para:&amp;nbsp;"/>
<webuijsf:dropDown binding="#{EditarPlano.drpIrPara}" id="drpIrPara"
items="#{EditarPlano.drpIrParaDefaultOptions.options}" style="" width="150"/>
<webuijsf:staticText escape="false" id="staticText4" text="&amp;nbsp;&amp;nbsp;"/>
<webuijsf:button actionExpression="#{EditarPlano.butEnviar_action}" binding="#{EditarPlano.butEnviar}" id="butEnviar" style="width: 153px"/>
</webuijsf:panelGroup>
</h:panelGrid>
</h:panelGrid>

@ -50,6 +50,30 @@ body {background-color: #f8f8f0;}
text-align : left;
}
.gridColLeft10{
text-align : left;
vertical-align: top;
width : 10%;
}
.gridColLeft20{
text-align : left;
vertical-align: top;
width : 20%;
}
.gridColLeft80{
text-align : left;
vertical-align: top;
width : 80%;
}
.gridColLeft90{
text-align : left;
vertical-align: top;
width : 90%;
}
.gridColCenter {
text-align: center;
}
@ -95,6 +119,16 @@ body {background-color: #f8f8f0;}
font-size :14px ;
}
.visible {
/* visibility: visible; */
display : block;
}
.hidden {
/* visibility: hidden; */
display : none;
}
.infoMessage {
font-size : 13px;
color: black;

Loading…
Cancel
Save