- 'desactivar plano' revised. (should appear only to HS and Dir Siprp);

- EditarPlano: textareas estavam a por a pagina demasiado grande. 100 columns cabe em 800x600;
- passagens de fase verificadas: estao a funcionar - os emails sao enviados (desde que os emails sejam validos ...)


git-svn-id: https://svn.coded.pt/svn/SIPRP@1634 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Diogo Neves 15 years ago
parent 5a92e1c8b7
commit f4f9a5ef56

@ -136,24 +136,28 @@ public class UtilizadoresDataProvider extends GenericDataProvider
throws Exception throws Exception
{ {
List< Utilizador > list = new LinkedList< Utilizador >(); List< Utilizador > list = new LinkedList< Utilizador >();
int type = tipo.intValue(); int type = tipo.intValue();
Expression where = new Field( UtilizadoresData.ACTIVO_FULL ).isEqual( "y" ).and( Expression where = new Field( UtilizadoresData.ACTIVO_FULL ).isEqual( "y" );
new Field( UtilizadoresData.APAGADO_FULL ).isEqual( "n" ) ).and( where = where.and( new Field( UtilizadoresData.APAGADO_FULL ).isEqual( "n" ) );
new Field( UtilizadoresData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimento_id ) where = where.and( new Field( UtilizadoresData.TIPO_FULL ).isEqual( type ) );
); if ( type == Global.RESPONSAVEL_SEGURANCA || type == Global.DIRECTOR_LOJA )
{
where = where.and( new Field( UtilizadoresData.ESTABELECIMENTO_ID_FULL ).isEqual( estabelecimento_id ) );
}
if ( type == Global.RESPONSAVEL_SEGURANCA && "y".equals( responsavel_loja ) ) if ( type == Global.RESPONSAVEL_SEGURANCA && "y".equals( responsavel_loja ) )
{ {
where = where.and( new Field( UtilizadoresData.RESPONSAVEL_LOJA_FULL ).isEqual( "y" ) ); where = where.and( new Field( UtilizadoresData.RESPONSAVEL_LOJA_FULL ).isEqual( "y" ) );
} }
if ( type == Global.DIRECTOR_LOJA || type == Global.RESPONSAVEL_SEGURANCA || type == Global.DIRECTOR_NACIONAL_SEGURANCA || type == Global.TECNICO_HS ) if ( type == Global.DIRECTOR_LOJA || type == Global.TECNICO_HS || type == Global.DIRECTOR_NACIONAL_SEGURANCA
|| ( type == Global.RESPONSAVEL_SEGURANCA && "y".equals( responsavel_loja ) ) )
{ {
System.out.println( "UtilizadoresDataProvider . getUtilizadoresListByTipo() : " + where.toString() ); System.out.println( "\nUtilizadoresDataProvider . getUtilizadoresListByTipo( " + tipo + ", " + responsavel_loja + ", " + estabelecimento_id + " ) : " );
System.out.println( "\tSQL : SELECT * FROM utilizadores WHERE " + where.toString() );
List< UtilizadoresData > listData = getProvider().listLoad( UtilizadoresData.class, where, new String[] { UtilizadoresData.NOME }, null ); List< UtilizadoresData > listData = getProvider().listLoad(
UtilizadoresData.class, where, new String[] { UtilizadoresData.NOME }, null );
for ( UtilizadoresData userData : listData ) for ( UtilizadoresData userData : listData )
{ {
list.add( copyFrom( userData ) ); list.add( copyFrom( userData ) );
@ -161,24 +165,23 @@ public class UtilizadoresDataProvider extends GenericDataProvider
} }
// Statement st = createStatement();
// String sql = ""; // String sql = "";
// String estabelecimento_constraint = ""; // String estabelecimento_constraint = "";
// if(tipo.intValue() == Global.DIRECTOR_LOJA || tipo.intValue() == Global.RESPONSAVEL_SEGURANCA || tipo.intValue() == Global.DIRECTOR_NACIONAL_SEGURANCA) // if ( type == Global.DIRECTOR_LOJA || type == Global.RESPONSAVEL_SEGURANCA || type == Global.DIRECTOR_NACIONAL_SEGURANCA )
// { // {
// estabelecimento_constraint = " AND estabelecimento_id = " + estabelecimento_id; // estabelecimento_constraint = " AND estabelecimento_id = " + estabelecimento_id;
// } // }
// if(tipo.intValue() == Global.RESPONSAVEL_SEGURANCA && responsavel_loja.matches("y")) // if ( type == Global.RESPONSAVEL_SEGURANCA && responsavel_loja.matches( "y" ) )
// { // {
// sql = "SELECT * FROM utilizadores WHERE activo = 'y' AND apagado = 'n' AND responsavel_loja = 'y' AND tipo = " + tipo + estabelecimento_constraint; // sql = "SELECT * FROM utilizadores WHERE activo = 'y' AND apagado = 'n' AND tipo = " + tipo + estabelecimento_constraint + " AND responsavel_loja = 'y'";
// } // }
// else if(tipo.intValue() == Global.DIRECTOR_LOJA || tipo.intValue() == Global.TECNICO_HS || tipo.intValue() == Global.DIRECTOR_NACIONAL_SEGURANCA) // else if ( type == Global.DIRECTOR_LOJA || type == Global.TECNICO_HS || type == Global.DIRECTOR_NACIONAL_SEGURANCA )
// { // {
// sql = "SELECT * FROM utilizadores WHERE activo = 'y' AND apagado = 'n' AND tipo = " + tipo + estabelecimento_constraint; // sql = "SELECT * FROM utilizadores WHERE activo = 'y' AND apagado = 'n' AND tipo = " + tipo + estabelecimento_constraint;
// } // }
// //
// System.out.println( "UTILIZADORES LIST BY TIPO SQL : " + sql ); // System.out.println( "UTILIZADORES LIST BY TIPO SQL : " + sql );
// Statement st = createStatement();
// ResultSet rs = st.executeQuery( sql ); // ResultSet rs = st.executeQuery( sql );
// if ( rs.isBeforeFirst() ) // if ( rs.isBeforeFirst() )
// { // {
@ -203,7 +206,8 @@ public class UtilizadoresDataProvider extends GenericDataProvider
// u.setActivo( rs.getString( "activo" ) ); // u.setActivo( rs.getString( "activo" ) );
// u.setResponsavel_loja( rs.getString( "responsavel_loja" ) ); // u.setResponsavel_loja( rs.getString( "responsavel_loja" ) );
// list.add( u ); // list.add( u );
// }while(rs.next()); // }
// while ( rs.next() );
// } // }
return list; return list;

@ -5,6 +5,8 @@
package global; package global;
import com.sun.webui.jsf.component.TextArea;
/** /**
* *
* @author lluis * @author lluis
@ -58,4 +60,7 @@ public class Global
public static final int ESTADO_MEDIDA_IMPLEMENTADA = 1; public static final int ESTADO_MEDIDA_IMPLEMENTADA = 1;
public static final int ESTADO_MEDIDA_NAO_IMPLEMENTADA = 2; public static final int ESTADO_MEDIDA_NAO_IMPLEMENTADA = 2;
public static final int ESTADO_MEDIDA_EM_IMPLEMENTACAO = 3; public static final int ESTADO_MEDIDA_EM_IMPLEMENTACAO = 3;
public static final int MAX_TEXTAREA_CHARS = 100;
} }

@ -3,7 +3,6 @@
* *
* Created on Aug 26, 2008, 3:10:59 PM * Created on Aug 26, 2008, 3:10:59 PM
*/ */
package planosactuacao; package planosactuacao;
import com.evolute.utils.error.ErrorLogger; import com.evolute.utils.error.ErrorLogger;
@ -73,19 +72,17 @@ public class EditarPlano extends AbstractPageBean
* This method is automatically generated, so any user-specified code inserted * This method is automatically generated, so any user-specified code inserted
* here is subject to being replaced.</p> * here is subject to being replaced.</p>
*/ */
private void _init() throws Exception { private void _init() throws Exception
{
} }
// </editor-fold> // </editor-fold>
// PlanosDataProvider pdp = new PlanosDataProvider(); // PlanosDataProvider pdp = new PlanosDataProvider();
HtmlPanelGrid grid; HtmlPanelGrid grid;
PanelGroup pg; PanelGroup pg;
StaticText st; StaticText st;
private HtmlPanelGrid gridLayout = new HtmlPanelGrid(); private HtmlPanelGrid gridLayout = new HtmlPanelGrid();
//Plano actuacao //Plano actuacao
PlanoActuacao plano; PlanoActuacao plano;
//HtmlPanelGrid gridPlano = new HtmlPanelGrid(); //HtmlPanelGrid gridPlano = new HtmlPanelGrid();
HtmlPanelGrid gridArea; HtmlPanelGrid gridArea;
HtmlPanelGrid gridRisco; HtmlPanelGrid gridRisco;
@ -93,11 +90,9 @@ public class EditarPlano extends AbstractPageBean
HtmlPanelGrid gridMedida; HtmlPanelGrid gridMedida;
HtmlPanelGrid gridPosto; HtmlPanelGrid gridPosto;
HtmlPanelGrid gridResponsavel; HtmlPanelGrid gridResponsavel;
int risco_id = 0; int risco_id = 0;
int medida_id = 0; int medida_id = 0;
int posto_id = 0; int posto_id = 0;
//page components //page components
TextField txtResponsavelExecucao; TextField txtResponsavelExecucao;
TextField txtPor; TextField txtPor;
@ -108,200 +103,241 @@ public class EditarPlano extends AbstractPageBean
TextArea txtParecerDl; TextArea txtParecerDl;
TextArea txtVerificacaoSiprp; TextArea txtVerificacaoSiprp;
public HtmlPanelGrid getGridLayout()
public HtmlPanelGrid getGridLayout() { {
return gridLayout; return gridLayout;
} }
public void setGridLayout(HtmlPanelGrid hpg) { public void setGridLayout( HtmlPanelGrid hpg )
{
this.gridLayout = hpg; this.gridLayout = hpg;
} }
private Button butGravarPlano = new Button(); private Button butGravarPlano = new Button();
public Button getButGravarPlano() { public Button getButGravarPlano()
{
return butGravarPlano; return butGravarPlano;
} }
public void setButGravarPlano(Button b) { public void setButGravarPlano( Button b )
{
this.butGravarPlano = b; this.butGravarPlano = b;
} }
private Button butGravarRisco = new Button(); private Button butGravarRisco = new Button();
public Button getButGravarRisco() { public Button getButGravarRisco()
{
return butGravarRisco; return butGravarRisco;
} }
public void setButGravarRisco(Button b) { public void setButGravarRisco( Button b )
{
this.butGravarRisco = b; this.butGravarRisco = b;
} }
private Button butEnviar = new Button(); private Button butEnviar = new Button();
public Button getButEnviar() { public Button getButEnviar()
{
return butEnviar; return butEnviar;
} }
public void setButEnviar(Button b) { public void setButEnviar( Button b )
{
this.butEnviar = b; this.butEnviar = b;
} }
private Button butLimparDados = new Button(); private Button butLimparDados = new Button();
public Button getButLimparDados() { public Button getButLimparDados()
{
return butLimparDados; return butLimparDados;
} }
public void setButLimparDados(Button b) { public void setButLimparDados( Button b )
{
this.butLimparDados = b; this.butLimparDados = b;
} }
private Button butCancelar = new Button(); private Button butCancelar = new Button();
public Button getButCancelar() { public Button getButCancelar()
{
return butCancelar; return butCancelar;
} }
public void setButCancelar(Button b) { public void setButCancelar( Button b )
{
this.butCancelar = b; this.butCancelar = b;
} }
private StaticText lblMsg = new StaticText(); private StaticText lblMsg = new StaticText();
public StaticText getLblMsg() { public StaticText getLblMsg()
{
return lblMsg; return lblMsg;
} }
public void setLblMsg(StaticText st) { public void setLblMsg( StaticText st )
{
this.lblMsg = st; this.lblMsg = st;
} }
private HtmlPanelGrid gridValidar = new HtmlPanelGrid(); private HtmlPanelGrid gridValidar = new HtmlPanelGrid();
public HtmlPanelGrid getGridValidar() { public HtmlPanelGrid getGridValidar()
{
return gridValidar; return gridValidar;
} }
public void setGridValidar(HtmlPanelGrid hpg) { public void setGridValidar( HtmlPanelGrid hpg )
{
this.gridValidar = hpg; this.gridValidar = hpg;
} }
private Checkbox chkValidacao = new Checkbox(); private Checkbox chkValidacao = new Checkbox();
public Checkbox getChkValidacao() { public Checkbox getChkValidacao()
{
return chkValidacao; return chkValidacao;
} }
public void setChkValidacao(Checkbox c) { public void setChkValidacao( Checkbox c )
{
this.chkValidacao = c; this.chkValidacao = c;
} }
private Checkbox chkDesactivar = new Checkbox(); private Checkbox chkDesactivar = new Checkbox();
public Checkbox getChkDesactivar() { public Checkbox getChkDesactivar()
{
return chkDesactivar; return chkDesactivar;
} }
public void setChkDesactivar( Checkbox c ) { public void setChkDesactivar( Checkbox c )
{
this.chkDesactivar = c; this.chkDesactivar = c;
} }
private HtmlInputHidden hidValidacao = new HtmlInputHidden(); private HtmlInputHidden hidValidacao = new HtmlInputHidden();
public HtmlInputHidden getHidValidacao() { public HtmlInputHidden getHidValidacao()
{
return hidValidacao; return hidValidacao;
} }
public void setHidValidacao(HtmlInputHidden hih) { public void setHidValidacao( HtmlInputHidden hih )
{
this.hidValidacao = hih; this.hidValidacao = hih;
} }
private PanelGroup grpPagination = new PanelGroup(); private PanelGroup grpPagination = new PanelGroup();
public PanelGroup getGrpPagination() { public PanelGroup getGrpPagination()
{
return grpPagination; return grpPagination;
} }
public void setGrpPagination(PanelGroup pg) { public void setGrpPagination( PanelGroup pg )
{
this.grpPagination = pg; this.grpPagination = pg;
} }
private HtmlPanelGrid gridPagination = new HtmlPanelGrid(); private HtmlPanelGrid gridPagination = new HtmlPanelGrid();
public HtmlPanelGrid getGridPagination() { public HtmlPanelGrid getGridPagination()
{
return gridPagination; return gridPagination;
} }
public void setGridPagination(HtmlPanelGrid hpg) { public void setGridPagination( HtmlPanelGrid hpg )
{
this.gridPagination = hpg; this.gridPagination = hpg;
} }
private Button butEnviarCorrecao = new Button(); private Button butEnviarCorrecao = new Button();
public Button getButEnviarCorrecao() { public Button getButEnviarCorrecao()
{
return butEnviarCorrecao; return butEnviarCorrecao;
} }
public void setButEnviarCorrecao(Button b) { public void setButEnviarCorrecao( Button b )
{
this.butEnviarCorrecao = b; this.butEnviarCorrecao = b;
} }
private StaticText lblObs = new StaticText(); private StaticText lblObs = new StaticText();
public StaticText getLblObs() { public StaticText getLblObs()
{
return lblObs; return lblObs;
} }
public void setLblObs(StaticText st) { public void setLblObs( StaticText st )
{
this.lblObs = st; this.lblObs = st;
} }
private HtmlPanelGrid gridPlano2 = new HtmlPanelGrid(); private HtmlPanelGrid gridPlano2 = new HtmlPanelGrid();
public HtmlPanelGrid getgridPlano2() { public HtmlPanelGrid getgridPlano2()
{
return gridPlano2; return gridPlano2;
} }
public void setgridPlano2(HtmlPanelGrid hpg) { public void setgridPlano2( HtmlPanelGrid hpg )
{
this.gridPlano2 = hpg; this.gridPlano2 = hpg;
} }
private HtmlPanelGrid gridPlano = new HtmlPanelGrid(); private HtmlPanelGrid gridPlano = new HtmlPanelGrid();
public HtmlPanelGrid getGridPlano() { public HtmlPanelGrid getGridPlano()
{
return gridPlano; return gridPlano;
} }
public void setGridPlano(HtmlPanelGrid hpg) { public void setGridPlano( HtmlPanelGrid hpg )
{
this.gridPlano = hpg; this.gridPlano = hpg;
} }
private HtmlPanelGrid gridValidacoes = new HtmlPanelGrid(); private HtmlPanelGrid gridValidacoes = new HtmlPanelGrid();
public HtmlPanelGrid getGridValidacoes() { public HtmlPanelGrid getGridValidacoes()
{
return gridValidacoes; return gridValidacoes;
} }
public void setGridValidacoes(HtmlPanelGrid hpg) { public void setGridValidacoes( HtmlPanelGrid hpg )
{
this.gridValidacoes = hpg; this.gridValidacoes = hpg;
} }
private HtmlPanelGrid gridValidar2 = new HtmlPanelGrid(); private HtmlPanelGrid gridValidar2 = new HtmlPanelGrid();
public HtmlPanelGrid getGridValidar2() { public HtmlPanelGrid getGridValidar2()
{
return gridValidar2; return gridValidar2;
} }
public void setGridValidar2(HtmlPanelGrid hpg) { public void setGridValidar2( HtmlPanelGrid hpg )
{
this.gridValidar2 = hpg; this.gridValidar2 = hpg;
} }
private HtmlPanelGrid gridObservacoes = new HtmlPanelGrid(); private HtmlPanelGrid gridObservacoes = new HtmlPanelGrid();
public HtmlPanelGrid getGridObservacoes() { public HtmlPanelGrid getGridObservacoes()
{
return gridObservacoes; return gridObservacoes;
} }
public void setGridObservacoes(HtmlPanelGrid hpg) { public void setGridObservacoes( HtmlPanelGrid hpg )
{
this.gridObservacoes = hpg; this.gridObservacoes = hpg;
} }
private StaticText stNomeEmpresa = new StaticText(); private StaticText stNomeEmpresa = new StaticText();
public StaticText getStNomeEmpresa() { public StaticText getStNomeEmpresa()
{
return stNomeEmpresa; return stNomeEmpresa;
} }
public void setStNomeEmpresa(StaticText st) { public void setStNomeEmpresa( StaticText st )
{
this.stNomeEmpresa = st; this.stNomeEmpresa = st;
} }
/** /**
* <p>Construct a new Page bean instance.</p> * <p>Construct a new Page bean instance.</p>
*/ */
public EditarPlano() { public EditarPlano()
{
} }
/** /**
@ -361,7 +397,6 @@ public class EditarPlano extends AbstractPageBean
@Override @Override
public void preprocess() public void preprocess()
{ {
} }
/** /**
@ -435,7 +470,8 @@ public class EditarPlano extends AbstractPageBean
* acquired during execution of an event handler).</p> * acquired during execution of an event handler).</p>
*/ */
@Override @Override
public void destroy() { public void destroy()
{
} }
/** /**
@ -443,7 +479,8 @@ public class EditarPlano extends AbstractPageBean
* *
* @return reference to the scoped data bean * @return reference to the scoped data bean
*/ */
protected RequestBean1 getRequestBean1() { protected RequestBean1 getRequestBean1()
{
return ( RequestBean1 ) getBean( "RequestBean1" ); return ( RequestBean1 ) getBean( "RequestBean1" );
} }
@ -452,7 +489,8 @@ public class EditarPlano extends AbstractPageBean
* *
* @return reference to the scoped data bean * @return reference to the scoped data bean
*/ */
protected SessionBean1 getSessionBean1() { protected SessionBean1 getSessionBean1()
{
return ( SessionBean1 ) getBean( "SessionBean1" ); return ( SessionBean1 ) getBean( "SessionBean1" );
} }
@ -581,7 +619,7 @@ public class EditarPlano extends AbstractPageBean
pg.getChildren().add( st ); pg.getChildren().add( st );
TextArea txtObservacoesDl = new TextArea(); TextArea txtObservacoesDl = new TextArea();
txtObservacoesDl.setId( "txtObservacoesDl" ); txtObservacoesDl.setId( "txtObservacoesDl" );
txtObservacoesDl.setColumns( 200 ); txtObservacoesDl.setColumns( Global.MAX_TEXTAREA_CHARS );
txtObservacoesDl.setText( p.getObservacoes_dl() ); txtObservacoesDl.setText( p.getObservacoes_dl() );
pg.getChildren().add( txtObservacoesDl ); pg.getChildren().add( txtObservacoesDl );
@ -653,7 +691,7 @@ public class EditarPlano extends AbstractPageBean
pg.getChildren().add( st ); pg.getChildren().add( st );
TextArea txtObservacoesDns = new TextArea(); TextArea txtObservacoesDns = new TextArea();
txtObservacoesDns.setId( "txtObservacoesDns" ); txtObservacoesDns.setId( "txtObservacoesDns" );
txtObservacoesDns.setColumns( 200 ); txtObservacoesDns.setColumns( Global.MAX_TEXTAREA_CHARS );
txtObservacoesDns.setText( p.getObservacoes_dns() ); txtObservacoesDns.setText( p.getObservacoes_dns() );
pg.getChildren().add( txtObservacoesDns ); pg.getChildren().add( txtObservacoesDns );
if ( p.getValidacao_dns().booleanValue() == true ) if ( p.getValidacao_dns().booleanValue() == true )
@ -752,8 +790,7 @@ public class EditarPlano extends AbstractPageBean
showPreviousValidacoes( p ); showPreviousValidacoes( p );
Utilizador currentUser = getSessionBean1().getCurrentUser(); Utilizador currentUser = getSessionBean1().getCurrentUser();
if ( currentUser.getTipo().intValue() == Global.TECNICO_HS if ( currentUser.getTipo().intValue() == Global.TECNICO_HS || currentUser.getTipo().intValue() == Global.DIRECTOR_SIPRP )
|| currentUser.getTipo().intValue() == Global.DIRECTOR_SIPRP )
{ {
chkDesactivar.setId( "chkDesactivarPlano" ); chkDesactivar.setId( "chkDesactivarPlano" );
chkDesactivar.setLabel( "Desactivar Plano" ); chkDesactivar.setLabel( "Desactivar Plano" );
@ -1034,7 +1071,7 @@ public class EditarPlano extends AbstractPageBean
st = new StaticText(); st = new StaticText();
st.setEscape( false ); st.setEscape( false );
st.setStyleClass( "label" ); st.setStyleClass( "label" );
st.setText( "POR:" ); st.setText( (u.getTipo().intValue() == Global.RESPONSAVEL_SEGURANCA ? "<br/>" : "") + "POR:" );
pg.getChildren().add( st ); pg.getChildren().add( st );
if ( u.getTipo().intValue() == Global.RESPONSAVEL_SEGURANCA ) if ( u.getTipo().intValue() == Global.RESPONSAVEL_SEGURANCA )
@ -1065,7 +1102,7 @@ public class EditarPlano extends AbstractPageBean
{ {
txtRecursos = new TextArea(); txtRecursos = new TextArea();
txtRecursos.setId( "txtRecursos" ); txtRecursos.setId( "txtRecursos" );
txtRecursos.setColumns( 200 ); txtRecursos.setColumns( Global.MAX_TEXTAREA_CHARS );
txtRecursos.setText( r.getRecursos_necessarios() ); txtRecursos.setText( r.getRecursos_necessarios() );
gridResponsavel.getChildren().add( txtRecursos ); gridResponsavel.getChildren().add( txtRecursos );
} }
@ -1183,7 +1220,7 @@ public class EditarPlano extends AbstractPageBean
txtParecerDl = new TextArea(); txtParecerDl = new TextArea();
txtParecerDl.setId( "txtParecerDl" ); txtParecerDl.setId( "txtParecerDl" );
txtParecerDl.setColumns(200); txtParecerDl.setColumns( Global.MAX_TEXTAREA_CHARS );
txtParecerDl.setText( r.getParecer_dl() ); txtParecerDl.setText( r.getParecer_dl() );
gridResponsavel.getChildren().add( txtParecerDl ); gridResponsavel.getChildren().add( txtParecerDl );
} }
@ -1222,7 +1259,7 @@ public class EditarPlano extends AbstractPageBean
txtParecerDns = new TextArea(); txtParecerDns = new TextArea();
txtParecerDns.setId( "txtParecerDns" ); txtParecerDns.setId( "txtParecerDns" );
txtParecerDns.setColumns( 200 ); txtParecerDns.setColumns( Global.MAX_TEXTAREA_CHARS );
txtParecerDns.setText( r.getParecer_dns() ); txtParecerDns.setText( r.getParecer_dns() );
gridResponsavel.getChildren().add( txtParecerDns ); gridResponsavel.getChildren().add( txtParecerDns );
} }
@ -1261,7 +1298,7 @@ public class EditarPlano extends AbstractPageBean
txtVerificacaoSiprp = new TextArea(); txtVerificacaoSiprp = new TextArea();
txtVerificacaoSiprp.setId( "txtVerificacaoSiprp" ); txtVerificacaoSiprp.setId( "txtVerificacaoSiprp" );
txtVerificacaoSiprp.setColumns( 200 ); txtVerificacaoSiprp.setColumns( Global.MAX_TEXTAREA_CHARS );
txtVerificacaoSiprp.setText( r.getVerificacao_siprp() ); txtVerificacaoSiprp.setText( r.getVerificacao_siprp() );
gridResponsavel.getChildren().add( txtVerificacaoSiprp ); gridResponsavel.getChildren().add( txtVerificacaoSiprp );
} }
@ -1306,7 +1343,6 @@ public class EditarPlano extends AbstractPageBean
break; break;
} }
} }
private static final int MAX_PAGES_PER_LINE = 20; private static final int MAX_PAGES_PER_LINE = 20;
private void setPagination( PAGINATION_ENUM type ) private void setPagination( PAGINATION_ENUM type )
@ -1462,8 +1498,7 @@ public class EditarPlano extends AbstractPageBean
} }
Utilizador currentUser = getSessionBean1().getCurrentUser(); Utilizador currentUser = getSessionBean1().getCurrentUser();
if ( currentUser.getTipo().intValue() == Global.TECNICO_HS if ( currentUser.getTipo().intValue() == Global.TECNICO_HS || currentUser.getTipo().intValue() == Global.DIRECTOR_SIPRP )
|| currentUser.getTipo().intValue() == Global.DIRECTOR_SIPRP )
{ {
Checkbox chkD = ( Checkbox ) gridPlano.findComponent( "form1:chkDesactivarPlano" ); Checkbox chkD = ( Checkbox ) gridPlano.findComponent( "form1:chkDesactivarPlano" );
if ( chkD != null ) if ( chkD != null )
@ -1674,8 +1709,6 @@ public class EditarPlano extends AbstractPageBean
// //
// } // }
// } // }
// private Valor fillValorFields(Valor v) // private Valor fillValorFields(Valor v)
private Risco fillValorFields( Risco r ) private Risco fillValorFields( Risco r )
{ {
@ -2055,20 +2088,16 @@ public class EditarPlano extends AbstractPageBean
return res; return res;
} }
private void processEnviar( PlanoActuacao p ) throws Exception private void processEnviar( PlanoActuacao p ) throws Exception
{ {
// PlanosDataProvider pdp = new PlanosDataProvider();
p.setObs_correcao( "" ); p.setObs_correcao( "" );
PlanosDataProvider pdp = PlanosDataProvider.getInstance(); PlanosDataProvider pdp = PlanosDataProvider.getInstance();
pdp.updatePlano( p ); pdp.updatePlano( p );
enviarMail( p ); enviarMail( p );
} }
public void enviarMail( PlanoActuacao p ) public void enviarMail( PlanoActuacao p )
{ {
// UtilizadoresDataProvider udp = new UtilizadoresDataProvider();
Mail mail = new Mail(); Mail mail = new Mail();
String assunto = ""; String assunto = "";
String mail_text = ""; String mail_text = "";
@ -2144,7 +2173,7 @@ public class EditarPlano extends AbstractPageBean
break; break;
} }
if(fase < Global.FASE_CONCLUIDO) // nao envia para ninguem na fase Concluido if ( fase < Global.FASE_CONCLUIDO )
{ {
String responsavel_loja = "n"; String responsavel_loja = "n";
if ( tipo_utilizador == Global.RESPONSAVEL_SEGURANCA ) if ( tipo_utilizador == Global.RESPONSAVEL_SEGURANCA )
@ -2159,16 +2188,16 @@ public class EditarPlano extends AbstractPageBean
while ( iter.hasNext() ) while ( iter.hasNext() )
{ {
Utilizador u = ( Utilizador ) iter.next(); Utilizador u = ( Utilizador ) iter.next();
System.out.println("USER MAIL NEXT FASE : " + u.getLogin() + " ; " + u.getEmail()); System.out.println( "\nUSER MAIL NEXT FASE : " + u.getLogin() + " ; " + u.getEmail() );
try try
{ {
mail.send( u.getEmail(), Mail.ENDERECO_ENVIO, assunto, mail_text ); mail.send( u.getEmail(), Mail.ENDERECO_ENVIO, assunto, mail_text );
System.out.println("EMAIL ENVIADO !!"); System.out.println( "\tEMAIL ENVIADO !!" );
} }
catch ( Exception ex1 ) catch ( Exception ex1 )
{ {
ErrorLogger.logException( ex1 ); ErrorLogger.logException( ex1 );
System.out.println("MAIL ERROR : " + ex1.getMessage()); System.out.println( "\tMAIL ERROR : " + ex1.getMessage() );
} }
} }
@ -2198,16 +2227,16 @@ public class EditarPlano extends AbstractPageBean
while ( iter.hasNext() ) while ( iter.hasNext() )
{ {
Utilizador u = ( Utilizador ) iter.next(); Utilizador u = ( Utilizador ) iter.next();
System.out.println("USER MAIL NEXT FASE : " + u.getLogin() + " ; " + u.getEmail()); System.out.println( "\nUSER MAIL NEXT FASE : " + u.getLogin() + " ; " + u.getEmail() );
try try
{ {
mail.send( u.getEmail(), Mail.ENDERECO_ENVIO, assunto, mail_text ); mail.send( u.getEmail(), Mail.ENDERECO_ENVIO, assunto, mail_text );
System.out.println("EMAIL ENVIADO !!"); System.out.println( "\tEMAIL ENVIADO !!" );
} }
catch ( Exception ex1 ) catch ( Exception ex1 )
{ {
ErrorLogger.logException( ex1 ); ErrorLogger.logException( ex1 );
System.out.println("MAIL ERROR : " + ex1.getMessage()); System.out.println( "\tMAIL ERROR : " + ex1.getMessage() );
} }
} }
@ -2219,28 +2248,10 @@ public class EditarPlano extends AbstractPageBean
} }
} }
// catch(Exception ex)
// {
// //ErrorLogger.logException( ex );
// }
// Mail mail = new Mail();
// try
// {
// mail.send("lluis@evolute.pt", Mail.ENDERECO_ENVIO, assunto, mail_text);
// System.out.println("EMAIL ENVIADO !!");
// }
// catch(Exception ex)
// {
// ErrorLogger.logException( ex );
// System.out.println("ERRO NO ENVIO DO EMAIL !!");
// }
// }
} }
public void chkValidacao_processValueChange(ValueChangeEvent event) { public void chkValidacao_processValueChange( ValueChangeEvent event )
{
// if(chkValidacao.getSelected() != null) // if(chkValidacao.getSelected() != null)
// { // {
// Boolean selected = (Boolean) chkValidacao.getSelected(); // Boolean selected = (Boolean) chkValidacao.getSelected();
@ -2267,7 +2278,6 @@ public class EditarPlano extends AbstractPageBean
} }
private void getRiscosByPlano( PlanoActuacao p ) private void getRiscosByPlano( PlanoActuacao p )
{ {
HashMap areasHash = new HashMap(); HashMap areasHash = new HashMap();
@ -2394,6 +2404,5 @@ public class EditarPlano extends AbstractPageBean
System.out.println( "BUT ENVIAR CORRECAO" ); System.out.println( "BUT ENVIAR CORRECAO" );
return "enviar_correcao"; return "enviar_correcao";
} }
} }

@ -3,7 +3,6 @@
* *
* Created on Aug 29, 2008, 2:57:16 PM * Created on Aug 29, 2008, 2:57:16 PM
*/ */
package planosactuacao; package planosactuacao;
import com.evolute.utils.date.DateUtils; import com.evolute.utils.date.DateUtils;
@ -53,56 +52,64 @@ public class ListaPlanos extends AbstractPageBean
* This method is automatically generated, so any user-specified code inserted * This method is automatically generated, so any user-specified code inserted
* here is subject to being replaced.</p> * here is subject to being replaced.</p>
*/ */
private void _init() throws Exception { private void _init() throws Exception
{
} }
private Table table1 = new Table(); private Table table1 = new Table();
public Table getTable1() { public Table getTable1()
{
return table1; return table1;
} }
public void setTable1(Table t) { public void setTable1( Table t )
{
this.table1 = t; this.table1 = t;
} }
private TableRowGroup tableRowGroup1 = new TableRowGroup(); private TableRowGroup tableRowGroup1 = new TableRowGroup();
public TableRowGroup getTableRowGroup1() { public TableRowGroup getTableRowGroup1()
{
return tableRowGroup1; return tableRowGroup1;
} }
public void setTableRowGroup1(TableRowGroup trg) { public void setTableRowGroup1( TableRowGroup trg )
{
this.tableRowGroup1 = trg; this.tableRowGroup1 = trg;
} }
private TableRowGroup tableRowGroup2 = new TableRowGroup(); private TableRowGroup tableRowGroup2 = new TableRowGroup();
public TableRowGroup getTableRowGroup2() { public TableRowGroup getTableRowGroup2()
{
return tableRowGroup2; return tableRowGroup2;
} }
public void setTableRowGroup2(TableRowGroup trg) { public void setTableRowGroup2( TableRowGroup trg )
{
this.tableRowGroup2 = trg; this.tableRowGroup2 = trg;
} }
private TableRowGroup tableRowGroup3 = new TableRowGroup(); private TableRowGroup tableRowGroup3 = new TableRowGroup();
public TableRowGroup getTableRowGroup3() { public TableRowGroup getTableRowGroup3()
{
return tableRowGroup3; return tableRowGroup3;
} }
public void setTableRowGroup3(TableRowGroup trg) { public void setTableRowGroup3( TableRowGroup trg )
{
this.tableRowGroup3 = trg; this.tableRowGroup3 = trg;
} }
private HtmlPanelGrid gridActual = new HtmlPanelGrid(); private HtmlPanelGrid gridActual = new HtmlPanelGrid();
public HtmlPanelGrid getGridActual() { public HtmlPanelGrid getGridActual()
{
return gridActual; return gridActual;
} }
public void setGridActual(HtmlPanelGrid hpg) { public void setGridActual( HtmlPanelGrid hpg )
{
this.gridActual = hpg; this.gridActual = hpg;
} }
private TableColumn tableColumn55 = new TableColumn(); private TableColumn tableColumn55 = new TableColumn();
public TableColumn getTableColumn55() public TableColumn getTableColumn55()
@ -114,18 +121,17 @@ public class ListaPlanos extends AbstractPageBean
{ {
this.tableColumn55 = c; this.tableColumn55 = c;
} }
private Button buttonDesactivar = new Button(); private Button buttonDesactivar = new Button();
public Button getButtonDesactivar() { public Button getButtonDesactivar()
{
return buttonDesactivar; return buttonDesactivar;
} }
public void setButtonDesactivar( Button b ) { public void setButtonDesactivar( Button b )
{
this.buttonDesactivar = b; this.buttonDesactivar = b;
} }
private TableColumn tableColumn56 = new TableColumn(); private TableColumn tableColumn56 = new TableColumn();
public TableColumn getTableColumn56() public TableColumn getTableColumn56()
@ -137,199 +143,223 @@ public class ListaPlanos extends AbstractPageBean
{ {
this.tableColumn56 = c; this.tableColumn56 = c;
} }
private Button buttonDesactivarSeguimento = new Button(); private Button buttonDesactivarSeguimento = new Button();
public Button getButtonDesactivarSeguimento() { public Button getButtonDesactivarSeguimento()
{
return buttonDesactivarSeguimento; return buttonDesactivarSeguimento;
} }
public void setButtonDesactivarSeguimento( Button b ) { public void setButtonDesactivarSeguimento( Button b )
{
this.buttonDesactivarSeguimento = b; this.buttonDesactivarSeguimento = b;
} }
private HtmlPanelGrid gridPanelFilterActual = new HtmlPanelGrid(); private HtmlPanelGrid gridPanelFilterActual = new HtmlPanelGrid();
public HtmlPanelGrid getGridPanelFilterActual() public HtmlPanelGrid getGridPanelFilterActual()
{ {
return this.gridPanelFilterActual; return this.gridPanelFilterActual;
} }
public void setGridPanelFilterActual( HtmlPanelGrid pg ) public void setGridPanelFilterActual( HtmlPanelGrid pg )
{ {
this.gridPanelFilterActual = pg; this.gridPanelFilterActual = pg;
} }
private PanelGroup groupPanelFilterActual = new PanelGroup(); private PanelGroup groupPanelFilterActual = new PanelGroup();
public PanelGroup getGroupPanelFilterActual() public PanelGroup getGroupPanelFilterActual()
{ {
return this.groupPanelFilterActual; return this.groupPanelFilterActual;
} }
public void setGroupPanelFilterActual( PanelGroup pg ) public void setGroupPanelFilterActual( PanelGroup pg )
{ {
this.groupPanelFilterActual = pg; this.groupPanelFilterActual = pg;
} }
private TextField textFilterNameActual = new TextField(); private TextField textFilterNameActual = new TextField();
public TextField getTextFilterNameActual() public TextField getTextFilterNameActual()
{ {
return this.textFilterNameActual; return this.textFilterNameActual;
} }
public void setTextFilterNameActual( TextField tf ) public void setTextFilterNameActual( TextField tf )
{ {
this.textFilterNameActual = tf; this.textFilterNameActual = tf;
} }
private TextField textFilterEstabelecimentoActual = new TextField(); private TextField textFilterEstabelecimentoActual = new TextField();
public TextField getTextFilterEstabelecimentoActual() { public TextField getTextFilterEstabelecimentoActual()
{
return textFilterEstabelecimentoActual; return textFilterEstabelecimentoActual;
} }
public void setTextFilterEstabelecimentoActual(TextField textFilterEstabelecimentoActual) {
public void setTextFilterEstabelecimentoActual( TextField textFilterEstabelecimentoActual )
{
this.textFilterEstabelecimentoActual = textFilterEstabelecimentoActual; this.textFilterEstabelecimentoActual = textFilterEstabelecimentoActual;
} }
private com.sun.webui.jsf.component.Calendar calFilterDateActual = new com.sun.webui.jsf.component.Calendar(); private com.sun.webui.jsf.component.Calendar calFilterDateActual = new com.sun.webui.jsf.component.Calendar();
public com.sun.webui.jsf.component.Calendar getCalFilterDateActual() {
public com.sun.webui.jsf.component.Calendar getCalFilterDateActual()
{
return calFilterDateActual; return calFilterDateActual;
} }
public void setCalFilterDateActual(com.sun.webui.jsf.component.Calendar calFilterDateActual) {
public void setCalFilterDateActual( com.sun.webui.jsf.component.Calendar calFilterDateActual )
{
this.calFilterDateActual = calFilterDateActual; this.calFilterDateActual = calFilterDateActual;
} }
private Button buttonFilterActual = new Button(); private Button buttonFilterActual = new Button();
public Button getButtonFilterActual() public Button getButtonFilterActual()
{ {
return this.buttonFilterActual; return this.buttonFilterActual;
} }
public void setButtonFilterActual( Button b ) public void setButtonFilterActual( Button b )
{ {
this.buttonFilterActual = b; this.buttonFilterActual = b;
} }
private HtmlPanelGrid gridPanelFilterSeg = new HtmlPanelGrid(); private HtmlPanelGrid gridPanelFilterSeg = new HtmlPanelGrid();
public HtmlPanelGrid getGridPanelFilterSeg() public HtmlPanelGrid getGridPanelFilterSeg()
{ {
return this.gridPanelFilterSeg; return this.gridPanelFilterSeg;
} }
public void setGridPanelFilterSeg( HtmlPanelGrid pg ) public void setGridPanelFilterSeg( HtmlPanelGrid pg )
{ {
this.gridPanelFilterSeg = pg; this.gridPanelFilterSeg = pg;
} }
private PanelGroup groupPanelFilterSeg = new PanelGroup(); private PanelGroup groupPanelFilterSeg = new PanelGroup();
public PanelGroup getGroupPanelFilterSeg() public PanelGroup getGroupPanelFilterSeg()
{ {
return this.groupPanelFilterSeg; return this.groupPanelFilterSeg;
} }
public void setGroupPanelFilterSeg( PanelGroup pg ) public void setGroupPanelFilterSeg( PanelGroup pg )
{ {
this.groupPanelFilterSeg = pg; this.groupPanelFilterSeg = pg;
} }
private TextField textFilterNameSeg = new TextField(); private TextField textFilterNameSeg = new TextField();
public TextField getTextFilterNameSeg() public TextField getTextFilterNameSeg()
{ {
return this.textFilterNameSeg; return this.textFilterNameSeg;
} }
public void setTextFilterNameSeg( TextField tf ) public void setTextFilterNameSeg( TextField tf )
{ {
this.textFilterNameSeg = tf; this.textFilterNameSeg = tf;
} }
private TextField textFilterEstabelecimentoSeg = new TextField(); private TextField textFilterEstabelecimentoSeg = new TextField();
public TextField getTextFilterEstabelecimentoSeg() { public TextField getTextFilterEstabelecimentoSeg()
{
return textFilterEstabelecimentoSeg; return textFilterEstabelecimentoSeg;
} }
public void setTextFilterEstabelecimentoSeg(TextField textFilterEstabelecimentoSeg) {
public void setTextFilterEstabelecimentoSeg( TextField textFilterEstabelecimentoSeg )
{
this.textFilterEstabelecimentoSeg = textFilterEstabelecimentoSeg; this.textFilterEstabelecimentoSeg = textFilterEstabelecimentoSeg;
} }
private com.sun.webui.jsf.component.Calendar calFilterDateSeg = new com.sun.webui.jsf.component.Calendar(); private com.sun.webui.jsf.component.Calendar calFilterDateSeg = new com.sun.webui.jsf.component.Calendar();
public com.sun.webui.jsf.component.Calendar getCalFilterDateSeg() {
public com.sun.webui.jsf.component.Calendar getCalFilterDateSeg()
{
return calFilterDateSeg; return calFilterDateSeg;
} }
public void setCalFilterDateSeg(com.sun.webui.jsf.component.Calendar calFilterDateSeg) {
public void setCalFilterDateSeg( com.sun.webui.jsf.component.Calendar calFilterDateSeg )
{
this.calFilterDateSeg = calFilterDateSeg; this.calFilterDateSeg = calFilterDateSeg;
} }
private Button buttonFilterSeg = new Button(); private Button buttonFilterSeg = new Button();
public Button getButtonFilterSeg() public Button getButtonFilterSeg()
{ {
return this.buttonFilterSeg; return this.buttonFilterSeg;
} }
public void setButtonFilterSeg( Button b ) public void setButtonFilterSeg( Button b )
{ {
this.buttonFilterSeg = b; this.buttonFilterSeg = b;
} }
private HtmlPanelGrid gridPanelFilterConc = new HtmlPanelGrid(); private HtmlPanelGrid gridPanelFilterConc = new HtmlPanelGrid();
public HtmlPanelGrid getGridPanelFilterConc() public HtmlPanelGrid getGridPanelFilterConc()
{ {
return this.gridPanelFilterConc; return this.gridPanelFilterConc;
} }
public void setGridPanelFilterConc( HtmlPanelGrid pg ) public void setGridPanelFilterConc( HtmlPanelGrid pg )
{ {
this.gridPanelFilterConc = pg; this.gridPanelFilterConc = pg;
} }
private PanelGroup groupPanelFilterConc = new PanelGroup(); private PanelGroup groupPanelFilterConc = new PanelGroup();
public PanelGroup getGroupPanelFilterConc() public PanelGroup getGroupPanelFilterConc()
{ {
return this.groupPanelFilterConc; return this.groupPanelFilterConc;
} }
public void setGroupPanelFilterConc( PanelGroup pg ) public void setGroupPanelFilterConc( PanelGroup pg )
{ {
this.groupPanelFilterConc = pg; this.groupPanelFilterConc = pg;
} }
private TextField textFilterNameConc = new TextField(); private TextField textFilterNameConc = new TextField();
public TextField getTextFilterNameConc() public TextField getTextFilterNameConc()
{ {
return this.textFilterNameConc; return this.textFilterNameConc;
} }
public void setTextFilterNameConc( TextField tf ) public void setTextFilterNameConc( TextField tf )
{ {
this.textFilterNameConc = tf; this.textFilterNameConc = tf;
} }
private TextField textFilterEstabelecimentoConc = new TextField(); private TextField textFilterEstabelecimentoConc = new TextField();
public TextField getTextFilterEstabelecimentoConc() { public TextField getTextFilterEstabelecimentoConc()
{
return textFilterEstabelecimentoConc; return textFilterEstabelecimentoConc;
} }
public void setTextFilterEstabelecimentoConc(TextField textFilterEstabelecimentoConc) {
public void setTextFilterEstabelecimentoConc( TextField textFilterEstabelecimentoConc )
{
this.textFilterEstabelecimentoConc = textFilterEstabelecimentoConc; this.textFilterEstabelecimentoConc = textFilterEstabelecimentoConc;
} }
private com.sun.webui.jsf.component.Calendar calFilterDateConc = new com.sun.webui.jsf.component.Calendar(); private com.sun.webui.jsf.component.Calendar calFilterDateConc = new com.sun.webui.jsf.component.Calendar();
public com.sun.webui.jsf.component.Calendar getCalFilterDateConc() {
public com.sun.webui.jsf.component.Calendar getCalFilterDateConc()
{
return calFilterDateConc; return calFilterDateConc;
} }
public void setCalFilterDateConc(com.sun.webui.jsf.component.Calendar calFilterDateConc) {
public void setCalFilterDateConc( com.sun.webui.jsf.component.Calendar calFilterDateConc )
{
this.calFilterDateConc = calFilterDateConc; this.calFilterDateConc = calFilterDateConc;
} }
private Button buttonFilterConc = new Button(); private Button buttonFilterConc = new Button();
public Button getButtonFilterConc() public Button getButtonFilterConc()
{ {
return this.buttonFilterConc; return this.buttonFilterConc;
} }
public void setButtonFilterConc( Button b ) public void setButtonFilterConc( Button b )
{ {
this.buttonFilterConc = b; this.buttonFilterConc = b;
} }
private static final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" ); private static final DateFormat D_F = new SimpleDateFormat( "yyyy-MM-dd" );
// </editor-fold> // </editor-fold>
/** /**
* <p>Construct a new Page bean instance.</p> * <p>Construct a new Page bean instance.</p>
*/ */
public ListaPlanos() { public ListaPlanos()
{
} }
/** /**
@ -345,7 +375,8 @@ public class ListaPlanos extends AbstractPageBean
* property values that were saved for this view when it was rendered.</p> * property values that were saved for this view when it was rendered.</p>
*/ */
@Override @Override
public void init() { public void init()
{
// Perform initializations inherited from our superclass // Perform initializations inherited from our superclass
super.init(); super.init();
// Perform application initialization that must complete // Perform application initialization that must complete
@ -355,9 +386,12 @@ public class ListaPlanos extends AbstractPageBean
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization"> // <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components // Initialize automatically managed components
// *Note* - this logic should NOT be modified // *Note* - this logic should NOT be modified
try { try
{
_init(); _init();
} catch (Exception e) { }
catch ( Exception e )
{
ErrorLogger.logException( e ); ErrorLogger.logException( e );
log( "ListaPlanos Initialization Failure", e ); log( "ListaPlanos Initialization Failure", e );
throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e ); throw e instanceof FacesException ? ( FacesException ) e : new FacesException( e );
@ -377,7 +411,8 @@ public class ListaPlanos extends AbstractPageBean
* resources that will be required in your event handlers.</p> * resources that will be required in your event handlers.</p>
*/ */
@Override @Override
public void preprocess() { public void preprocess()
{
} }
/** /**
@ -399,6 +434,8 @@ public class ListaPlanos extends AbstractPageBean
FacesContext fc = getFacesContext(); FacesContext fc = getFacesContext();
String estab_gestor = JSFUtils.getRequestParameter( fc, "estab_gestor" ); String estab_gestor = JSFUtils.getRequestParameter( fc, "estab_gestor" );
boolean renderOrNot = false;
if ( u != null ) if ( u != null )
{ {
if ( u.getTipo() != null && u.getTipo().intValue() == Global.GESTOR ) if ( u.getTipo() != null && u.getTipo().intValue() == Global.GESTOR )
@ -408,7 +445,8 @@ public class ListaPlanos extends AbstractPageBean
Integer estabelecimento_gestor = new Integer( Integer.parseInt( estab_gestor ) ); Integer estabelecimento_gestor = new Integer( Integer.parseInt( estab_gestor ) );
System.out.println( "ESTABELECIMENTO GESTOR : " + estabelecimento_gestor.intValue() ); System.out.println( "ESTABELECIMENTO GESTOR : " + estabelecimento_gestor.intValue() );
u.setEstabelecimento_gestor( estabelecimento_gestor ); u.setEstabelecimento_gestor( estabelecimento_gestor );
} catch (Exception ex2) }
catch ( Exception ex2 )
{ {
ErrorLogger.logException( ex2 ); ErrorLogger.logException( ex2 );
} }
@ -430,13 +468,11 @@ public class ListaPlanos extends AbstractPageBean
} }
//Column para desactivar plano - mostra se o utilizador for DIRECTOR SIPRP //Column para desactivar plano - mostra se o utilizador for DIRECTOR SIPRP
int uType = u.getTipo().intValue(); if ( u.getTipo() != null )
boolean renderOrNot = uType == Global.DIRECTOR_SIPRP || uType == Global.TECNICO_HS; {
tableColumn55.setRendered(renderOrNot); int uType = u.getTipo();
buttonDesactivar.setRendered(renderOrNot); renderOrNot = uType == Global.DIRECTOR_SIPRP || uType == Global.TECNICO_HS;
}
tableColumn56.setRendered(renderOrNot);
buttonDesactivarSeguimento.setRendered(renderOrNot);
initialize(); initialize();
} }
@ -445,6 +481,10 @@ public class ListaPlanos extends AbstractPageBean
getSessionBean1().setMsg( "Utilizador inv&aacute;lido." ); getSessionBean1().setMsg( "Utilizador inv&aacute;lido." );
} }
tableColumn55.setRendered( renderOrNot );
buttonDesactivar.setRendered( renderOrNot );
tableColumn56.setRendered( renderOrNot );
buttonDesactivarSeguimento.setRendered( renderOrNot );
} }
/** /**
@ -456,7 +496,8 @@ public class ListaPlanos extends AbstractPageBean
* acquired during execution of an event handler).</p> * acquired during execution of an event handler).</p>
*/ */
@Override @Override
public void destroy() { public void destroy()
{
} }
/** /**
@ -464,7 +505,8 @@ public class ListaPlanos extends AbstractPageBean
* *
* @return reference to the scoped data bean * @return reference to the scoped data bean
*/ */
protected RequestBean1 getRequestBean1() { protected RequestBean1 getRequestBean1()
{
return ( RequestBean1 ) getBean( "RequestBean1" ); return ( RequestBean1 ) getBean( "RequestBean1" );
} }
@ -473,7 +515,8 @@ public class ListaPlanos extends AbstractPageBean
* *
* @return reference to the scoped data bean * @return reference to the scoped data bean
*/ */
protected ApplicationBean1 getApplicationBean1() { protected ApplicationBean1 getApplicationBean1()
{
return ( ApplicationBean1 ) getBean( "ApplicationBean1" ); return ( ApplicationBean1 ) getBean( "ApplicationBean1" );
} }
@ -482,11 +525,13 @@ public class ListaPlanos extends AbstractPageBean
* *
* @return reference to the scoped data bean * @return reference to the scoped data bean
*/ */
protected SessionBean1 getSessionBean1() { protected SessionBean1 getSessionBean1()
{
return ( SessionBean1 ) getBean( "SessionBean1" ); return ( SessionBean1 ) getBean( "SessionBean1" );
} }
public String hyperlink1_action() { public String hyperlink1_action()
{
// TODO: Process the action. Return value is a navigation // TODO: Process the action. Return value is a navigation
// case name where null will return to the same page. // case name where null will return to the same page.
return "editar_plano"; return "editar_plano";
@ -530,8 +575,8 @@ public class ListaPlanos extends AbstractPageBean
} }
} }
public String goEditarPlano_action()
public String goEditarPlano_action() { {
// TODO: Process the action. Return value is a navigation // TODO: Process the action. Return value is a navigation
// case name where null will return to the same page. // case name where null will return to the same page.
PlanoActuacao p = getTableActivosRowData(); PlanoActuacao p = getTableActivosRowData();
@ -544,13 +589,15 @@ public class ListaPlanos extends AbstractPageBean
return "editar_plano"; return "editar_plano";
} }
public String goVerPlanoFromSeguimento_action(){ public String goVerPlanoFromSeguimento_action()
{
PlanoActuacao p = getTableSeguimentoRowData(); PlanoActuacao p = getTableSeguimentoRowData();
getSessionBean1().setPlanoActuacao( p ); getSessionBean1().setPlanoActuacao( p );
return "ver_plano"; return "ver_plano";
} }
public String goVerPlanoFromConcluidos_action(){ public String goVerPlanoFromConcluidos_action()
{
PlanoActuacao p = getTableConcluidosRowData(); PlanoActuacao p = getTableConcluidosRowData();
getSessionBean1().setPlanoActuacao( p ); getSessionBean1().setPlanoActuacao( p );
return "ver_plano"; return "ver_plano";
@ -584,7 +631,6 @@ public class ListaPlanos extends AbstractPageBean
return null; return null;
} }
//*** IMPRIMIR PLANO COM RISCOS PATRIMONIAIS ***// //*** IMPRIMIR PLANO COM RISCOS PATRIMONIAIS ***//
public String goImprimirPlanoPatrimoniais_action() public String goImprimirPlanoPatrimoniais_action()
{ {
@ -613,8 +659,6 @@ public class ListaPlanos extends AbstractPageBean
return null; return null;
} }
private void createPdf( Integer pID ) private void createPdf( Integer pID )
{ {
createPdf( pID, false ); createPdf( pID, false );
@ -662,16 +706,15 @@ public class ListaPlanos extends AbstractPageBean
System.out.println( "SHOW PDF done." ); System.out.println( "SHOW PDF done." );
} }
private void initialize() private void initialize()
{ {
Utilizador u = getSessionBean1().getCurrentUser(); Utilizador u = getSessionBean1().getCurrentUser();
Integer estabelecimento_id = null; // Integer estabelecimento_id = null;
if(u.getTipo().intValue() != Global.TECNICO_HS) // if ( u.getTipo().intValue() != Global.TECNICO_HS )
{ // {
estabelecimento_id = u.getEstabelecimento_id(); // estabelecimento_id = u.getEstabelecimento_id();
} // }
System.out.println( "INITIALIZE:" ); System.out.println( "INITIALIZE:" );
@ -701,7 +744,6 @@ public class ListaPlanos extends AbstractPageBean
return DateUtils.getTimePassed( start, end ); return DateUtils.getTimePassed( start, end );
} }
private PlanoActuacao getTableActivosRowData() private PlanoActuacao getTableActivosRowData()
{ {
RowKey rk = tableRowGroup1.getRowKey(); RowKey rk = tableRowGroup1.getRowKey();
@ -735,11 +777,8 @@ public class ListaPlanos extends AbstractPageBean
private void checkPlanosDelayed() private void checkPlanosDelayed()
{ {
} }
// private void showPlano(PlanoActuacao p) // private void showPlano(PlanoActuacao p)
// { // {
// System.out.println("PLANO : " + p.getData_visita_str() + " | " + p.getFase_nome() + " | " + p.getNome_estabelecimento()); // System.out.println("PLANO : " + p.getData_visita_str() + " | " + p.getFase_nome() + " | " + p.getNome_estabelecimento());
@ -791,15 +830,12 @@ public class ListaPlanos extends AbstractPageBean
// System.out.println(" " + p.getDescricao()); // System.out.println(" " + p.getDescricao());
// } // }
// } // }
public List<PlanoActuacao> searchPlanosActivos( Utilizador u, String nome, String estabelecimento, String dataVisita ) public List<PlanoActuacao> searchPlanosActivos( Utilizador u, String nome, String estabelecimento, String dataVisita )
{ {
List<PlanoActuacao> list = new ArrayList<PlanoActuacao>(); List<PlanoActuacao> list = new ArrayList<PlanoActuacao>();
try try
{ {
if ( u.getTipo().intValue() != Global.DIRECTOR_SIPRP if ( u.getTipo().intValue() != Global.DIRECTOR_SIPRP && u.getTipo().intValue() != Global.GESTOR && u.getTipo().intValue() != Global.DIRECTOR_GERAL_RH )
&& u.getTipo().intValue() != Global.GESTOR
&& u.getTipo().intValue() != Global.DIRECTOR_GERAL_RH )
{ {
PlanosDataProvider pdp = PlanosDataProvider.getInstance(); PlanosDataProvider pdp = PlanosDataProvider.getInstance();
list = pdp.searchPlanosActivos( u, nome, estabelecimento, dataVisita ); list = pdp.searchPlanosActivos( u, nome, estabelecimento, dataVisita );
@ -895,8 +931,6 @@ public class ListaPlanos extends AbstractPageBean
// return list; // return list;
} }
public String buttonFilterActual_action() public String buttonFilterActual_action()
{ {
String nome = null; String nome = null;
@ -969,7 +1003,6 @@ public class ListaPlanos extends AbstractPageBean
return null; return null;
} }
public String buttonFilterConc_action() public String buttonFilterConc_action()
{ {
String nome = null; String nome = null;
@ -1005,6 +1038,5 @@ public class ListaPlanos extends AbstractPageBean
return null; return null;
} }
} }

@ -103,7 +103,8 @@
<webuijsf:tableColumn headerText="" id="tableColumn55" binding="#{ListaPlanos.tableColumn55}"> <webuijsf:tableColumn headerText="" id="tableColumn55" binding="#{ListaPlanos.tableColumn55}">
<webuijsf:button id="btnDesactivar" text="Desactivar Plano" onClick="return alertOnDeactivate();" <webuijsf:button id="btnDesactivar" text="Desactivar Plano" onClick="return alertOnDeactivate();"
actionExpression="#{ListaPlanos.goDesactivarPlano_action}" binding="#{ListaPlanos.buttonDesactivar}" /> actionExpression="#{ListaPlanos.goDesactivarPlano_action}" binding="#{ListaPlanos.buttonDesactivar}"
/>
</webuijsf:tableColumn> </webuijsf:tableColumn>
</webuijsf:tableRowGroup> </webuijsf:tableRowGroup>

Loading…
Cancel
Save