DIR LOJA so veem analises concluidas do mesmo estabelecimento

git-svn-id: https://svn.coded.pt/svn/SIPRP@1604 bb69d46d-e84e-40c8-a05a-06db0d633741
lxbfYeaa
Diogo Neves 15 years ago
parent 1ced522775
commit fee9d0d7d3

@ -87,7 +87,9 @@ public class Acesso extends AbstractPageBean {
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
public void init() {
@Override
public void init()
{
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
@ -117,7 +119,10 @@ public class Acesso extends AbstractPageBean {
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.</p>
*/
public void preprocess() {
@Override
public void preprocess()
{
}
/**
@ -128,7 +133,9 @@ public class Acesso extends AbstractPageBean {
* this method to allocate resources that will be required for rendering
* this page.</p>
*/
public void prerender() {
@Override
public void prerender()
{
Utilizador u = getSessionBean1().getCurrentUser();
//String nomeUnicode = Utils.textToUnicode(u.getNome());
//System.out.println("NOME UNICODE : " + nomeUnicode);
@ -155,8 +162,10 @@ public class Acesso extends AbstractPageBean {
* acquired during execution of an event handler).</p>
*
*/
public void destroy() {
@Override
public void destroy()
{
}
/**

@ -75,7 +75,6 @@ import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.validator.EmailValidator;
import pagestate.AnaliseAcidenteTrabalhoState;
import pdf.Pdf;
import pdf.PdfGenerator;
import utils.Utils;
@ -6784,7 +6783,9 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
public void init() {
@Override
public void init()
{
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
@ -6879,6 +6880,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.</p>
*/
@Override
public void preprocess() {
}
@ -6890,6 +6892,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
* this method to allocate resources that will be required for rendering
* this page.</p>
*/
@Override
public void prerender() {
txtMsg.setText(getSessionBean1().getMsg());
getSessionBean1().setMsg("");
@ -6904,6 +6907,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
*/
@Override
public void destroy() {
}
@ -7588,7 +7592,10 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
java.util.Date ddate = new java.util.Date(a.getData_nascimento().getTime());
txtDataNascimento.setText(utils.Utils.dateToYYYYMMDD(ddate));
}
catch(Exception ex){};
catch(Exception ex)
{
}
txtBI.setText(a.getBilhete_identidade());
txtMorada.setText(a.getMorada());
String cod_postal1 = "";

@ -945,7 +945,9 @@ public class FormGestor extends AbstractPageBean {
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
public void init() {
@Override
public void init()
{
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
@ -984,7 +986,10 @@ public class FormGestor extends AbstractPageBean {
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.</p>
*/
public void preprocess() {
@Override
public void preprocess()
{
}
/**
@ -995,7 +1000,9 @@ public class FormGestor extends AbstractPageBean {
* this method to allocate resources that will be required for rendering
* this page.</p>
*/
public void prerender() {
@Override
public void prerender()
{
System.out.println("=== FORM_GESTOR ===");
Utilizador curUser = getSessionBean1().getCurrentUser();
lblUser.setText( curUser.getLogin() );
@ -1014,78 +1021,73 @@ public class FormGestor extends AbstractPageBean {
}
}
HttpServletRequest request = (HttpServletRequest) getExternalContext().getRequest();
String referer = request.getRequestURI();
String pageFrom = Utils.getPageFrom(referer);
if(!pageFrom.matches("FormGestor.jsp"))
if ( ! pageFrom.matches( "FormGestor.jsp" ) )
{
try
{
AnalisesDataProvider adp = AnalisesDataProvider.getInstance();
Integer estabelecimento_id = null;
//lblActivos.setRendered(true);
table1.setRendered(true);
AnalisesDataProvider adp = AnalisesDataProvider.getInstance();
Integer estabelecimento_id = null;
table1.setRendered( true );
ArrayList seguimentoList = null;
//if(curUser.getGestor_geral().matches("y") || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA)
if(curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR)
{
estabelecimento_id = curUser.getEstabelecimento_gestor();
if(estabelecimento_id.intValue() == 0)
{
seguimentoList = adp.getAnalisesSeguimentoGestorList(null);
}
else
{
seguimentoList = adp.getAnalisesSeguimentoGestorList(curUser.getEstabelecimento_id());
}
}
else if(curUser.getGestor_geral().matches("y") || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA)
if ( curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_GESTOR )
{
seguimentoList = adp.getAnalisesSeguimentoGestorList(null);
estabelecimento_id = curUser.getEstabelecimento_gestor();
if ( estabelecimento_id.intValue() == 0 )
{
seguimentoList = adp.getAnalisesSeguimentoGestorList( null );
}
else
{
seguimentoList = adp.getAnalisesSeguimentoGestorList( curUser.getEstabelecimento_id() );
}
}
else if(curUser.getGestor_geral().matches("n") || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA)
else if ( curUser.getGestor_geral().matches("y") || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA )
{
seguimentoList = adp.getAnalisesSeguimentoGestorList(curUser.getEstabelecimento_id());
seguimentoList = adp.getAnalisesSeguimentoGestorList( null );
}
getSessionBean1().getAnalisesSeguimentoDataProvider().setList(seguimentoList);
else if ( curUser.getGestor_geral().matches("n") || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA )
{
seguimentoList = adp.getAnalisesSeguimentoGestorList( curUser.getEstabelecimento_id() );
}
getSessionBean1().getAnalisesSeguimentoDataProvider().setList( seguimentoList );
}
catch(Exception ex)
catch ( Exception ex )
{
//lblActivos.setRendered(false);
table1.setRendered(false);
table1.setRendered( false );
ErrorLogger.logException( ex );
}
try
{
AnalisesDataProvider adp = AnalisesDataProvider.getInstance();
//lblActivos.setRendered(true);
table2.setRendered(true);
ArrayList concluidasList = null;
if(getSessionBean1().getCurrentUser().getGestor_geral().matches("y") || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA || curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA)
{
concluidasList = adp.getAnalisesConcluidasList(null);
}
else
{
concluidasList = adp.getAnalisesConcluidasList(getSessionBean1().getCurrentUser().getEstabelecimento_id());
}
getSessionBean1().getAnalisesConcluidasDataProvider().setList(concluidasList);
}
catch(Exception ex)
{
//lblActivos.setRendered(false);
table2.setRendered(false);
ErrorLogger.logException( ex );
}
fillAnoDropDown();
}
try
{
AnalisesDataProvider adp = AnalisesDataProvider.getInstance();
table2.setRendered( true );
ArrayList concluidasList = null;
if ( getSessionBean1().getCurrentUser().getGestor_geral().matches("y")
|| curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_NACIONAL_SEGURANCA
/*|| curUser.getTipo().intValue() == Global.TIPO_UTILIZADOR_DIRECTOR_LOJA*/ )
{
concluidasList = adp.getAnalisesConcluidasList( null );
}
else
{
concluidasList = adp.getAnalisesConcluidasList( getSessionBean1().getCurrentUser().getEstabelecimento_id() );
}
getSessionBean1().getAnalisesConcluidasDataProvider().setList( concluidasList );
}
catch ( Exception ex )
{
table2.setRendered( false );
ErrorLogger.logException( ex );
}
fillAnoDropDown();
}
}
/**
@ -1096,7 +1098,10 @@ public class FormGestor extends AbstractPageBean {
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
*/
public void destroy() {
@Override
public void destroy()
{
}
/**

@ -23,15 +23,11 @@ import com.sun.rave.web.ui.component.TextField;
import com.sun.rave.web.ui.model.Option;
import db.providers.AnalisesDataProvider;
import db.providers.UtilizadoresDataProvider;
import java.sql.Connection;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.faces.FacesException;
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.context.ExternalContext;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import utils.Utils;
/**
@ -265,7 +261,9 @@ public class Login extends AbstractPageBean
* values submitted with this request. Instead, they represent the
* property values that were saved for this view when it was rendered.</p>
*/
public void init() {
@Override
public void init()
{
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
@ -296,7 +294,9 @@ public class Login extends AbstractPageBean
* is processing a form submit. Customize this method to allocate
* resources that will be required in your event handlers.</p>
*/
public void preprocess() {
@Override
public void preprocess()
{
}
/**
@ -307,8 +307,9 @@ public class Login extends AbstractPageBean
* this method to allocate resources that will be required for rendering
* this page.</p>
*/
public void prerender() {
@Override
public void prerender()
{
txtMsg.setText(getSessionBean1().getMsg());
getSessionBean1().setMsg("");
}
@ -321,7 +322,10 @@ public class Login extends AbstractPageBean
* <code>preprocess()</code>, or <code>prerender()</code> methods (or
* acquired during execution of an event handler).</p>
*/
public void destroy() {
@Override
public void destroy()
{
}
/**

Loading…
Cancel
Save