|
|
|
|
@ -455,15 +455,10 @@ public class EditarPlano extends AbstractPageBean
|
|
|
|
|
return "lista_planos";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initialize(PlanoActuacao p)
|
|
|
|
|
private void initialize( PlanoActuacao p )
|
|
|
|
|
{
|
|
|
|
|
//Test.showPlanoTree(p);
|
|
|
|
|
//getSessionBean1().setPaginationPageNr(1);
|
|
|
|
|
Pagination pagination = new Pagination(p);
|
|
|
|
|
getSessionBean1().setPagination(pagination);
|
|
|
|
|
Pagination pagination = new Pagination( p );
|
|
|
|
|
getSessionBean1().setPagination( pagination );
|
|
|
|
|
Utilizador u = getSessionBean1().getCurrentUser();
|
|
|
|
|
if(u.getTipo().intValue() == Global.DIRECTOR_NACIONAL_SEGURANCA)
|
|
|
|
|
{
|
|
|
|
|
@ -1722,7 +1717,6 @@ public class EditarPlano extends AbstractPageBean
|
|
|
|
|
|
|
|
|
|
public String butGravarRisco_action()
|
|
|
|
|
{
|
|
|
|
|
// PlanosDataProvider pdp = new PlanosDataProvider();
|
|
|
|
|
PlanoActuacao p = getSessionBean1().getPlanoActuacao();
|
|
|
|
|
int fase = p.getFase().intValue();
|
|
|
|
|
switch(fase)
|
|
|
|
|
@ -1801,14 +1795,8 @@ public class EditarPlano extends AbstractPageBean
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// Risco r = getSessionBean1().getCurrentRisco();
|
|
|
|
|
// r = fillRiscoFields(r);
|
|
|
|
|
// pdp.updateRisco(r);
|
|
|
|
|
|
|
|
|
|
//Valor v = getSessionBean1().getCurrentValor();
|
|
|
|
|
Risco r = getSessionBean1().getCurrentRisco();
|
|
|
|
|
r = fillValorFields(r);
|
|
|
|
|
//pdp.updateValor(r);
|
|
|
|
|
r = fillValorFields( r );
|
|
|
|
|
|
|
|
|
|
PlanosDataProvider pdp = PlanosDataProvider.getInstance();
|
|
|
|
|
pdp.updateRisco( r );
|
|
|
|
|
@ -1816,40 +1804,30 @@ public class EditarPlano extends AbstractPageBean
|
|
|
|
|
{
|
|
|
|
|
pdp.updateMedidas( r );
|
|
|
|
|
}
|
|
|
|
|
// getSessionBean1().getValoresHash().remove(r.getId());
|
|
|
|
|
// getSessionBean1().getValoresHash().put(r.getId(), r);
|
|
|
|
|
getSessionBean1().getRiscosHash().remove(r.getId());
|
|
|
|
|
getSessionBean1().getRiscosHash().put(r.getId(), r);
|
|
|
|
|
getSessionBean1().getRiscosHash().remove( r.getId() );
|
|
|
|
|
getSessionBean1().getRiscosHash().put( r.getId(), r );
|
|
|
|
|
|
|
|
|
|
Pagination pagination = getSessionBean1().getPagination();
|
|
|
|
|
|
|
|
|
|
////r = pagination.nextRisco();
|
|
|
|
|
r = pagination.nextValor();
|
|
|
|
|
//Risco r = getSessionBean1().getRiscosHash().get(r.getId());
|
|
|
|
|
///////r = getSessionBean1().getRiscosHash().get(r.getId());
|
|
|
|
|
Area a = getSessionBean1().getAreasHash().get(r.getArea_id());
|
|
|
|
|
//if(v != null)
|
|
|
|
|
if(r != null)
|
|
|
|
|
Area a = getSessionBean1().getAreasHash().get( r.getArea_id() );
|
|
|
|
|
if ( r != null )
|
|
|
|
|
{
|
|
|
|
|
//gridPlano = (HtmlPanelGrid) gridLayout.findComponent("form1:gridPlano");
|
|
|
|
|
gridArea = (HtmlPanelGrid) gridPlano.findComponent("form1:gridArea");
|
|
|
|
|
if(gridArea.getChildren() != null)
|
|
|
|
|
gridArea = ( HtmlPanelGrid ) gridPlano.findComponent( "form1:gridArea" );
|
|
|
|
|
if ( gridArea.getChildren() != null )
|
|
|
|
|
{
|
|
|
|
|
gridArea.getChildren().clear();
|
|
|
|
|
}
|
|
|
|
|
showArea(a);
|
|
|
|
|
showRisco(r);
|
|
|
|
|
showValor(r);
|
|
|
|
|
showResponsavel(r);
|
|
|
|
|
showArea( a );
|
|
|
|
|
showRisco( r );
|
|
|
|
|
showValor( r );
|
|
|
|
|
showResponsavel( r );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
ErrorLogger.logException( ex );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Risco r = getNextRisco(getSessionBean1().getPlanoId());
|
|
|
|
|
//fillRisco(r);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -2570,35 +2548,29 @@ public class EditarPlano extends AbstractPageBean
|
|
|
|
|
getSessionBean1().setRiscosHash(riscosHash);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void paginacao_actionListener(ActionEvent e)
|
|
|
|
|
public void paginacao_actionListener( ActionEvent e )
|
|
|
|
|
{
|
|
|
|
|
Risco curValor = getSessionBean1().getCurrentRisco();
|
|
|
|
|
curValor = fillValorFields(curValor);
|
|
|
|
|
// getSessionBean1().getValoresHash().remove(curValor.getId());
|
|
|
|
|
// getSessionBean1().getValoresHash().put(curValor.getId(), curValor);
|
|
|
|
|
getSessionBean1().getRiscosHash().remove(curValor.getId());
|
|
|
|
|
getSessionBean1().getRiscosHash().put(curValor.getId(), curValor);
|
|
|
|
|
//gridPlano = (HtmlPanelGrid) gridLayout.findComponent("form1:gridPlano");
|
|
|
|
|
gridArea = (HtmlPanelGrid) gridPlano.findComponent("form1:gridArea");
|
|
|
|
|
if(gridArea.getChildren() != null)
|
|
|
|
|
curValor = fillValorFields( curValor );
|
|
|
|
|
getSessionBean1().getRiscosHash().remove( curValor.getId() );
|
|
|
|
|
getSessionBean1().getRiscosHash().put( curValor.getId(), curValor );
|
|
|
|
|
|
|
|
|
|
gridArea = ( HtmlPanelGrid ) gridPlano.findComponent( "form1:gridArea" );
|
|
|
|
|
if ( gridArea.getChildren() != null )
|
|
|
|
|
{
|
|
|
|
|
gridArea.getChildren().clear();
|
|
|
|
|
}
|
|
|
|
|
Pagina pagina = (Pagina) e.getSource();
|
|
|
|
|
Pagina pagina = ( Pagina ) e.getSource();
|
|
|
|
|
Pagination pagination = getSessionBean1().getPagination();
|
|
|
|
|
// Valor v = pagination.getValor(pagina);
|
|
|
|
|
// v = getSessionBean1().getValoresHash().get(v.getId());
|
|
|
|
|
Risco r = pagination.getValor(pagina);
|
|
|
|
|
r = getSessionBean1().getRiscosHash().get(r.getId());
|
|
|
|
|
|
|
|
|
|
//Risco r = getSessionBean1().getRiscosHash().get(v.getRisco_id());
|
|
|
|
|
/////////Risco r = getSessionBean1().getRiscosHash().get(v.getRisco_id());
|
|
|
|
|
//Risco r = pagination.getRisco(pagina);
|
|
|
|
|
|
|
|
|
|
Risco r = pagination.getValor( pagina );
|
|
|
|
|
r = getSessionBean1().getRiscosHash().get( r.getId() );
|
|
|
|
|
|
|
|
|
|
Area a = getSessionBean1().getAreasHash().get( r.getArea_id() );
|
|
|
|
|
showArea(a);
|
|
|
|
|
showRisco(r);
|
|
|
|
|
showValor(r);
|
|
|
|
|
showResponsavel(r);
|
|
|
|
|
showArea( a );
|
|
|
|
|
showRisco( r );
|
|
|
|
|
showValor( r );
|
|
|
|
|
showResponsavel( r );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String butCancelar_action() {
|
|
|
|
|
|