- '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,50 +165,50 @@ 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 );
// ResultSet rs = st.executeQuery(sql); // Statement st = createStatement();
// if(rs.isBeforeFirst()) // ResultSet rs = st.executeQuery( sql );
// { // if ( rs.isBeforeFirst() )
// rs.first(); // {
// do // rs.first();
// { // do
// Utilizador u = new Utilizador(); // {
// u.setId(new Integer(rs.getInt("id"))); // Utilizador u = new Utilizador();
// u.setLogin(rs.getString("login")); // u.setId( new Integer( rs.getInt( "id" ) ) );
// u.setPassword(rs.getString("password")); // u.setLogin( rs.getString( "login" ) );
// u.setData_password(rs.getDate("data_password")); // u.setPassword( rs.getString( "password" ) );
// u.setEmail(rs.getString("email")); // u.setData_password( rs.getDate( "data_password" ) );
// u.setEmpresa_id(new Integer(rs.getInt("empresa_id"))); // u.setEmail( rs.getString( "email" ) );
// u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id"))); // u.setEmpresa_id( new Integer( rs.getInt( "empresa_id" ) ) );
// u.setAdministrador(rs.getString("administrador")); // u.setEstabelecimento_id( new Integer( rs.getInt( "estabelecimento_id" ) ) );
// u.setTipo(new Integer(rs.getInt("tipo"))); // u.setAdministrador( rs.getString( "administrador" ) );
// u.setNumero_cedula(rs.getString("numero_cedula")); // u.setTipo( new Integer( rs.getInt( "tipo" ) ) );
// u.setCap(rs.getString("cap")); // u.setNumero_cedula( rs.getString( "numero_cedula" ) );
// u.setNome(rs.getString("nome")); // u.setCap( rs.getString( "cap" ) );
// u.setMedico_id(new Integer(rs.getInt("medico_id"))); // u.setNome( rs.getString( "nome" ) );
// u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id"))); // u.setMedico_id( new Integer( rs.getInt( "medico_id" ) ) );
// u.setActivo(rs.getString("activo")); // u.setFuncionario_hst_id( new Integer( rs.getInt( "funcionario_hst_id" ) ) );
// u.setResponsavel_loja(rs.getString("responsavel_loja")); // u.setActivo( rs.getString( "activo" ) );
// list.add(u); // u.setResponsavel_loja( rs.getString( "responsavel_loja" ) );
// }while(rs.next()); // list.add( u );
// } // }
// 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;
} }

@ -101,9 +101,10 @@
<webuijsf:hyperlink actionExpression="#{ListaPlanos.goEditarPlano_action}" id="lnkLojaActivo" text="#{currentRow.value['nome_estabelecimento']}"/> <webuijsf:hyperlink actionExpression="#{ListaPlanos.goEditarPlano_action}" id="lnkLojaActivo" text="#{currentRow.value['nome_estabelecimento']}"/>
</webuijsf:tableColumn> </webuijsf:tableColumn>
<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