|
|
|
|
@ -7,16 +7,19 @@
|
|
|
|
|
package planosactuacao;
|
|
|
|
|
|
|
|
|
|
import com.sun.rave.web.ui.appbase.AbstractPageBean;
|
|
|
|
|
import com.sun.webui.jsf.component.Anchor;
|
|
|
|
|
|
|
|
|
|
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.Option;
|
|
|
|
|
import db.entidades.Area;
|
|
|
|
|
import db.entidades.EstadoMedida;
|
|
|
|
|
import db.entidades.Medida;
|
|
|
|
|
import db.entidades.PlanoActuacao;
|
|
|
|
|
import db.entidades.PostoTrabalho;
|
|
|
|
|
@ -101,7 +104,7 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
|
TextArea txtParecerDns;
|
|
|
|
|
TextArea txtParecerDl;
|
|
|
|
|
TextArea txtVerificacaoSiprp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public HtmlPanelGrid getGridLayout() {
|
|
|
|
|
return gridLayout;
|
|
|
|
|
@ -445,7 +448,7 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initialize(PlanoActuacao p)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
//Test.showPlanoTree(p);
|
|
|
|
|
//getSessionBean1().setPaginationPageNr(1);
|
|
|
|
|
Pagination pagination = new Pagination(p);
|
|
|
|
|
@ -931,7 +934,8 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
|
gridValor.getChildren().add(grd);
|
|
|
|
|
|
|
|
|
|
gridMedida = new HtmlPanelGrid();
|
|
|
|
|
gridMedida.setStyleClass("centerBlock");
|
|
|
|
|
gridMedida.setId( "gridMedida_" + m.getId() );
|
|
|
|
|
gridMedida.setStyleClass("centerBlock");
|
|
|
|
|
gridMedida.setWidth("98%");
|
|
|
|
|
gridMedida.setColumns(1);
|
|
|
|
|
gridMedida.setColumnClasses("gridColLeft");
|
|
|
|
|
@ -948,7 +952,53 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
|
pg.getChildren().add(st);
|
|
|
|
|
gridMedida.getChildren().add(pg);
|
|
|
|
|
|
|
|
|
|
showPostos(m);
|
|
|
|
|
showPostos(m);
|
|
|
|
|
|
|
|
|
|
Utilizador u = getSessionBean1().getCurrentUser();
|
|
|
|
|
PlanoActuacao planoActual = getSessionBean1().getPlanoActuacao();
|
|
|
|
|
if ( planoActual.getFase().intValue() == Global.FASE_SIPRP_CONCLUSAO )
|
|
|
|
|
{
|
|
|
|
|
List< EstadoMedida > opts = null;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
opts = pdp.getEstadoMedidas();
|
|
|
|
|
}
|
|
|
|
|
catch ( Exception e )
|
|
|
|
|
{
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DropDown drop = new DropDown();
|
|
|
|
|
Option opt[] = null;
|
|
|
|
|
if ( opts != null )
|
|
|
|
|
{
|
|
|
|
|
opt = new Option[ (opts.size() + 1) ];
|
|
|
|
|
opt[ 0 ] = new Option( 0, "" );
|
|
|
|
|
for ( int i = 0; i < opts.size(); i++ )
|
|
|
|
|
{
|
|
|
|
|
EstadoMedida em = opts.get( i );
|
|
|
|
|
opt[ (i+1) ] = new Option( em.getId(), em.getDescricao() );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
opt = new Option[ 1 ];
|
|
|
|
|
opt[ 0 ] = new Option( 0, "" );
|
|
|
|
|
}
|
|
|
|
|
drop.setItems( opt );
|
|
|
|
|
|
|
|
|
|
drop.setId( "drop_" + r.getId() + "_" + m.getId() );
|
|
|
|
|
drop.setSelected( m.getValidarMedidaId() == null ? 0 : m.getValidarMedidaId() );
|
|
|
|
|
|
|
|
|
|
StaticText dropLabel = new StaticText();
|
|
|
|
|
dropLabel.setText( "Validar Medida: " );
|
|
|
|
|
|
|
|
|
|
PanelGroup valPG = new PanelGroup();
|
|
|
|
|
valPG.setId( "valPG_" + m.getId() );
|
|
|
|
|
valPG.getChildren().add( dropLabel );
|
|
|
|
|
valPG.getChildren().add( drop );
|
|
|
|
|
gridMedida.getChildren().add( valPG );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -1099,7 +1149,7 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
|
java.util.GregorianCalendar gcalendar = new java.util.GregorianCalendar();
|
|
|
|
|
gcalendar.set(2000,1,1);
|
|
|
|
|
dtInicio.setMinDate(gcalendar.getTime());
|
|
|
|
|
grd.getChildren().add(dtInicio);
|
|
|
|
|
grd.getChildren().add(dtInicio);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@ -1519,15 +1569,15 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
|
{
|
|
|
|
|
p.setValidacao_hs(new Boolean(true));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pdp.updatePlano(p);
|
|
|
|
|
|
|
|
|
|
//Valor curValor = getSessionBean1().getCurrentValor();
|
|
|
|
|
Risco curValor = getSessionBean1().getCurrentRisco();
|
|
|
|
|
Risco curValor = getSessionBean1().getCurrentRisco();
|
|
|
|
|
curValor = fillValorFields(curValor);
|
|
|
|
|
// getSessionBean1().getValoresHash().remove(curValor.getId());
|
|
|
|
|
// getSessionBean1().getValoresHash().put(curValor.getId(), curValor);
|
|
|
|
|
// getSessionBean1().getValoresHash().put(curValor.getId(), curValor);
|
|
|
|
|
getSessionBean1().getRiscosHash().remove(curValor.getId());
|
|
|
|
|
getSessionBean1().getRiscosHash().put(curValor.getId(), curValor);
|
|
|
|
|
|
|
|
|
|
@ -1547,6 +1597,11 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
|
Integer id = iter.next();
|
|
|
|
|
Risco r = valores.get(id);
|
|
|
|
|
pdp.updateRisco(r);
|
|
|
|
|
|
|
|
|
|
if ( fase == Global.FASE_SIPRP_CONCLUSAO )
|
|
|
|
|
{
|
|
|
|
|
pdp.updateMedidas( r );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1617,7 +1672,7 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
|
{
|
|
|
|
|
p.setValidacao_hs(new Boolean(true));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
@ -1628,7 +1683,7 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// Risco r = getSessionBean1().getCurrentRisco();
|
|
|
|
|
@ -1639,7 +1694,11 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
|
Risco r = getSessionBean1().getCurrentRisco();
|
|
|
|
|
r = fillValorFields(r);
|
|
|
|
|
//pdp.updateValor(r);
|
|
|
|
|
pdp.updateRisco(r);
|
|
|
|
|
pdp.updateRisco(r);
|
|
|
|
|
if ( fase == Global.FASE_SIPRP_CONCLUSAO )
|
|
|
|
|
{
|
|
|
|
|
pdp.updateMedidas( r );
|
|
|
|
|
}
|
|
|
|
|
// getSessionBean1().getValoresHash().remove(r.getId());
|
|
|
|
|
// getSessionBean1().getValoresHash().put(r.getId(), r);
|
|
|
|
|
getSessionBean1().getRiscosHash().remove(r.getId());
|
|
|
|
|
@ -1792,8 +1851,22 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
|
{
|
|
|
|
|
r.setVerificacao_siprp((String) txtVerificacaoSiprp.getText());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for( Medida m: r.getMedidas() )
|
|
|
|
|
{
|
|
|
|
|
gridMedida = (HtmlPanelGrid) gridArea.findComponent("form1:gridMedida_" + m.getId() );
|
|
|
|
|
PanelGroup gridValPG = ( PanelGroup ) gridMedida.findComponent( "valPG_" + m.getId() );
|
|
|
|
|
|
|
|
|
|
DropDown drop = ( DropDown ) gridValPG.findComponent("drop_" + r.getId() + "_" + m.getId());
|
|
|
|
|
if( drop != null )
|
|
|
|
|
{
|
|
|
|
|
Integer optID = ( Integer ) drop.getSelected();
|
|
|
|
|
m.setValidarMedidaId( optID.intValue() == 0 ? null : optID );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return r;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|