|
|
|
@ -7,16 +7,19 @@
|
|
|
|
package planosactuacao;
|
|
|
|
package planosactuacao;
|
|
|
|
|
|
|
|
|
|
|
|
import com.sun.rave.web.ui.appbase.AbstractPageBean;
|
|
|
|
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.Button;
|
|
|
|
import com.sun.webui.jsf.component.Calendar;
|
|
|
|
import com.sun.webui.jsf.component.Calendar;
|
|
|
|
import com.sun.webui.jsf.component.Checkbox;
|
|
|
|
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.PanelGroup;
|
|
|
|
import com.sun.webui.jsf.component.StaticText;
|
|
|
|
import com.sun.webui.jsf.component.StaticText;
|
|
|
|
import com.sun.webui.jsf.component.TextArea;
|
|
|
|
import com.sun.webui.jsf.component.TextArea;
|
|
|
|
import com.sun.webui.jsf.component.TextField;
|
|
|
|
import com.sun.webui.jsf.component.TextField;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.sun.webui.jsf.model.Option;
|
|
|
|
import db.entidades.Area;
|
|
|
|
import db.entidades.Area;
|
|
|
|
|
|
|
|
import db.entidades.EstadoMedida;
|
|
|
|
import db.entidades.Medida;
|
|
|
|
import db.entidades.Medida;
|
|
|
|
import db.entidades.PlanoActuacao;
|
|
|
|
import db.entidades.PlanoActuacao;
|
|
|
|
import db.entidades.PostoTrabalho;
|
|
|
|
import db.entidades.PostoTrabalho;
|
|
|
|
@ -931,6 +934,7 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
gridValor.getChildren().add(grd);
|
|
|
|
gridValor.getChildren().add(grd);
|
|
|
|
|
|
|
|
|
|
|
|
gridMedida = new HtmlPanelGrid();
|
|
|
|
gridMedida = new HtmlPanelGrid();
|
|
|
|
|
|
|
|
gridMedida.setId( "gridMedida_" + m.getId() );
|
|
|
|
gridMedida.setStyleClass("centerBlock");
|
|
|
|
gridMedida.setStyleClass("centerBlock");
|
|
|
|
gridMedida.setWidth("98%");
|
|
|
|
gridMedida.setWidth("98%");
|
|
|
|
gridMedida.setColumns(1);
|
|
|
|
gridMedida.setColumns(1);
|
|
|
|
@ -949,6 +953,52 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
gridMedida.getChildren().add(pg);
|
|
|
|
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 );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1547,6 +1597,11 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
Integer id = iter.next();
|
|
|
|
Integer id = iter.next();
|
|
|
|
Risco r = valores.get(id);
|
|
|
|
Risco r = valores.get(id);
|
|
|
|
pdp.updateRisco(r);
|
|
|
|
pdp.updateRisco(r);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( fase == Global.FASE_SIPRP_CONCLUSAO )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
pdp.updateMedidas( r );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -1640,6 +1695,10 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
r = fillValorFields(r);
|
|
|
|
r = fillValorFields(r);
|
|
|
|
//pdp.updateValor(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().remove(r.getId());
|
|
|
|
// getSessionBean1().getValoresHash().put(r.getId(), r);
|
|
|
|
// getSessionBean1().getValoresHash().put(r.getId(), r);
|
|
|
|
getSessionBean1().getRiscosHash().remove(r.getId());
|
|
|
|
getSessionBean1().getRiscosHash().remove(r.getId());
|
|
|
|
@ -1794,6 +1853,20 @@ public class EditarPlano extends AbstractPageBean {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|