|
|
|
|
@ -33,7 +33,8 @@ import mail.Mail;
|
|
|
|
|
*
|
|
|
|
|
* @author lluis
|
|
|
|
|
*/
|
|
|
|
|
public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
public class EnviarCorrecao extends AbstractPageBean
|
|
|
|
|
{
|
|
|
|
|
// <editor-fold defaultstate="collapsed" desc="Managed Component Definition">
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -41,51 +42,68 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
* This method is automatically generated, so any user-specified code inserted
|
|
|
|
|
* here is subject to being replaced.</p>
|
|
|
|
|
*/
|
|
|
|
|
private void _init() throws Exception {
|
|
|
|
|
private void _init() throws Exception
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private StaticText lblMsg = new StaticText();
|
|
|
|
|
|
|
|
|
|
public StaticText getLblMsg() {
|
|
|
|
|
public StaticText getLblMsg()
|
|
|
|
|
{
|
|
|
|
|
return lblMsg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setLblMsg(StaticText st) {
|
|
|
|
|
public void setLblMsg(StaticText st)
|
|
|
|
|
{
|
|
|
|
|
this.lblMsg = st;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private TextArea txtObservacoes = new TextArea();
|
|
|
|
|
|
|
|
|
|
public TextArea getTxtObservacoes() {
|
|
|
|
|
public TextArea getTxtObservacoes()
|
|
|
|
|
{
|
|
|
|
|
return txtObservacoes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setTxtObservacoes(TextArea ta) {
|
|
|
|
|
public void setTxtObservacoes(TextArea ta)
|
|
|
|
|
{
|
|
|
|
|
this.txtObservacoes = ta;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private DropDown drpIrPara = new DropDown();
|
|
|
|
|
|
|
|
|
|
public DropDown getDrpIrPara() {
|
|
|
|
|
public DropDown getDrpIrPara()
|
|
|
|
|
{
|
|
|
|
|
return drpIrPara;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setDrpIrPara(DropDown dd) {
|
|
|
|
|
public void setDrpIrPara(DropDown dd)
|
|
|
|
|
{
|
|
|
|
|
this.drpIrPara = dd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Button butCancelar = new Button();
|
|
|
|
|
|
|
|
|
|
public Button getButCancelar() {
|
|
|
|
|
public Button getButCancelar()
|
|
|
|
|
{
|
|
|
|
|
return butCancelar;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setButCancelar(Button b) {
|
|
|
|
|
public void setButCancelar(Button b)
|
|
|
|
|
{
|
|
|
|
|
this.butCancelar = b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Button butEnviar = new Button();
|
|
|
|
|
|
|
|
|
|
public Button getButEnviar() {
|
|
|
|
|
public Button getButEnviar()
|
|
|
|
|
{
|
|
|
|
|
return butEnviar;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setButEnviar(Button b) {
|
|
|
|
|
public void setButEnviar(Button b)
|
|
|
|
|
{
|
|
|
|
|
this.butEnviar = b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -94,7 +112,9 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
/**
|
|
|
|
|
* <p>Construct a new Page bean instance.</p>
|
|
|
|
|
*/
|
|
|
|
|
public EnviarCorrecao() {
|
|
|
|
|
public EnviarCorrecao()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -110,7 +130,8 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
* property values that were saved for this view when it was rendered.</p>
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public void init() {
|
|
|
|
|
public void init()
|
|
|
|
|
{
|
|
|
|
|
// Perform initializations inherited from our superclass
|
|
|
|
|
super.init();
|
|
|
|
|
// Perform application initialization that must complete
|
|
|
|
|
@ -120,9 +141,12 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
|
|
|
|
|
// Initialize automatically managed components
|
|
|
|
|
// *Note* - this logic should NOT be modified
|
|
|
|
|
try {
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
_init();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
ErrorLogger.logException( e );
|
|
|
|
|
log("EnviarCorrecao Initialization Failure", e);
|
|
|
|
|
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
|
|
|
|
|
@ -142,7 +166,9 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
* resources that will be required in your event handlers.</p>
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public void preprocess() {
|
|
|
|
|
public void preprocess()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -154,7 +180,8 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
* this page.</p>
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public void prerender() {
|
|
|
|
|
public void prerender()
|
|
|
|
|
{
|
|
|
|
|
initialize();
|
|
|
|
|
lblMsg.setText(getSessionBean1().getMsg());
|
|
|
|
|
getSessionBean1().setMsg("");
|
|
|
|
|
@ -169,7 +196,9 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
* acquired during execution of an event handler).</p>
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public void destroy() {
|
|
|
|
|
public void destroy()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -177,7 +206,8 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
*
|
|
|
|
|
* @return reference to the scoped data bean
|
|
|
|
|
*/
|
|
|
|
|
protected SessionBean1 getSessionBean1() {
|
|
|
|
|
protected SessionBean1 getSessionBean1()
|
|
|
|
|
{
|
|
|
|
|
return (SessionBean1) getBean("SessionBean1");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -186,7 +216,8 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
*
|
|
|
|
|
* @return reference to the scoped data bean
|
|
|
|
|
*/
|
|
|
|
|
protected ApplicationBean1 getApplicationBean1() {
|
|
|
|
|
protected ApplicationBean1 getApplicationBean1()
|
|
|
|
|
{
|
|
|
|
|
return (ApplicationBean1) getBean("ApplicationBean1");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -195,11 +226,14 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
*
|
|
|
|
|
* @return reference to the scoped data bean
|
|
|
|
|
*/
|
|
|
|
|
protected RequestBean1 getRequestBean1() {
|
|
|
|
|
protected RequestBean1 getRequestBean1()
|
|
|
|
|
{
|
|
|
|
|
return (RequestBean1) getBean("RequestBean1");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void drpIrPara_processValueChange(ValueChangeEvent event) {
|
|
|
|
|
public void drpIrPara_processValueChange(ValueChangeEvent event)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void initialize()
|
|
|
|
|
@ -226,7 +260,7 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String butCancelar_action()
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
return "editar_plano";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -235,35 +269,35 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
Utilizador u = getSessionBean1().getCurrentUser();
|
|
|
|
|
// PlanosDataProvider pdp = new PlanosDataProvider();
|
|
|
|
|
PlanoActuacao p = getSessionBean1().getPlanoActuacao();
|
|
|
|
|
p.setFase_anterior(p.getFase());
|
|
|
|
|
p.setFase_anterior( p.getFase() );
|
|
|
|
|
int dns_next_fase = 0;
|
|
|
|
|
int fase = 0;
|
|
|
|
|
Integer irPara = (Integer)drpIrPara.getSelected();
|
|
|
|
|
Integer irPara = ( Integer ) drpIrPara.getSelected();
|
|
|
|
|
fase = irPara.intValue();
|
|
|
|
|
if(u.getTipo().intValue() == Global.DIRECTOR_LOJA)
|
|
|
|
|
if ( u.getTipo().intValue() == Global.DIRECTOR_LOJA )
|
|
|
|
|
{
|
|
|
|
|
p.setValidacao_director_loja(new Boolean(false));
|
|
|
|
|
p.setValidacao_director_loja( new Boolean( false ) );
|
|
|
|
|
}
|
|
|
|
|
else if(u.getTipo().intValue() == Global.DIRECTOR_NACIONAL_SEGURANCA)
|
|
|
|
|
else if ( u.getTipo().intValue() == Global.DIRECTOR_NACIONAL_SEGURANCA )
|
|
|
|
|
{
|
|
|
|
|
p.setValidacao_dns(new Boolean(false));
|
|
|
|
|
p.setValidacao_dns( new Boolean( false ) );
|
|
|
|
|
}
|
|
|
|
|
p.setCorrecao("y");
|
|
|
|
|
p.setFase_antes_correcao(p.getFase());
|
|
|
|
|
p.setFase(new Integer(fase));
|
|
|
|
|
p.setCorrecao( "y" );
|
|
|
|
|
p.setFase_antes_correcao( p.getFase() );
|
|
|
|
|
p.setFase( new Integer( fase ) );
|
|
|
|
|
String observacoes = "";
|
|
|
|
|
if(txtObservacoes.getText() != null)
|
|
|
|
|
if ( txtObservacoes.getText() != null )
|
|
|
|
|
{
|
|
|
|
|
if(u.getTipo().intValue() == Global.DIRECTOR_LOJA)
|
|
|
|
|
if ( u.getTipo().intValue() == Global.DIRECTOR_LOJA )
|
|
|
|
|
{
|
|
|
|
|
observacoes = "Observações do Director de Loja: ";
|
|
|
|
|
}
|
|
|
|
|
else if(u.getTipo().intValue() == Global.DIRECTOR_NACIONAL_SEGURANCA)
|
|
|
|
|
else if ( u.getTipo().intValue() == Global.DIRECTOR_NACIONAL_SEGURANCA )
|
|
|
|
|
{
|
|
|
|
|
observacoes = "Observações do Director Nacional de Segurança: ";
|
|
|
|
|
}
|
|
|
|
|
observacoes += (String)txtObservacoes.getText();
|
|
|
|
|
p.setObs_correcao(observacoes);
|
|
|
|
|
observacoes += ( String ) txtObservacoes.getText();
|
|
|
|
|
p.setObs_correcao( observacoes );
|
|
|
|
|
}
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
@ -272,10 +306,10 @@ public class EnviarCorrecao extends AbstractPageBean {
|
|
|
|
|
enviarMail( p );
|
|
|
|
|
return "lista_planos";
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
catch ( Exception ex )
|
|
|
|
|
{
|
|
|
|
|
ErrorLogger.logException( ex );
|
|
|
|
|
getSessionBean1().setMsg("Erro no envio do plano para a fase " + Global.FASES_TEXTO[fase-1]);
|
|
|
|
|
getSessionBean1().setMsg( "Erro no envio do plano para a fase " + Global.FASES_TEXTO[ fase - 1 ] );
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|