Commit b4cf95a2a4b337891d3537fcd9cdb718ee3e4fa0

Authored by Lucas D'Avila
1 parent 6617bc2c
Exists in master

Adicionado email, ao cadastro de funcionário, para ser utilizado na recuperação de senha

ieducar/intranet/include/pessoa/clsFuncionario.inc.php
@@ -101,7 +101,7 @@ class clsFuncionario extends clsPessoaFisica @@ -101,7 +101,7 @@ class clsFuncionario extends clsPessoaFisica
101 */ 101 */
102 var $_campo_order_by; 102 var $_campo_order_by;
103 103
104 - function clsFuncionario($int_idpes = false, $str_matricula = false, $int_cpf = false, $int_ref_cod_setor = false, $str_senha = false, $data_troca_senha = false, $tempo_expira_senha = false, $data_reativa_conta = false, $tempo_expira_conta = false, $ref_cod_funcionario_vinculo = false, $ramal = false, $matricula_permanente = false, $banido = false) 104 + function clsFuncionario($int_idpes = false, $str_matricula = false, $int_cpf = false, $int_ref_cod_setor = false, $str_senha = false, $data_troca_senha = false, $tempo_expira_senha = false, $data_reativa_conta = false, $tempo_expira_conta = false, $ref_cod_funcionario_vinculo = false, $ramal = false, $matricula_permanente = false, $banido = false, $email = null)
105 { 105 {
106 $this->idpes = $int_idpes; 106 $this->idpes = $int_idpes;
107 $this->matricula = $str_matricula; 107 $this->matricula = $str_matricula;
@@ -116,6 +116,7 @@ class clsFuncionario extends clsPessoaFisica @@ -116,6 +116,7 @@ class clsFuncionario extends clsPessoaFisica
116 $this->ramal = $ramal; 116 $this->ramal = $ramal;
117 $this->matricula_permanente = $matricula_permanente; 117 $this->matricula_permanente = $matricula_permanente;
118 $this->proibido = $banido; 118 $this->proibido = $banido;
  119 + $this->email = $email;
119 $this->_campos_lista = " f.ref_cod_pessoa_fj, 120 $this->_campos_lista = " f.ref_cod_pessoa_fj,
120 f.matricula, 121 f.matricula,
121 f.senha, 122 f.senha,
@@ -132,7 +133,8 @@ class clsFuncionario extends clsPessoaFisica @@ -132,7 +133,8 @@ class clsFuncionario extends clsPessoaFisica
132 f.ref_ref_cod_pessoa_fj, 133 f.ref_ref_cod_pessoa_fj,
133 f.proibido, 134 f.proibido,
134 f.nome, 135 f.nome,
135 - f.ref_cod_setor_new 136 + f.ref_cod_setor_new,
  137 + f.email
136 "; 138 ";
137 } 139 }
138 140
@@ -157,7 +159,7 @@ class clsFuncionario extends clsPessoaFisica @@ -157,7 +159,7 @@ class clsFuncionario extends clsPessoaFisica
157 } 159 }
158 } 160 }
159 161
160 - function lista($str_matricula=false, $str_nome=false, $int_ativo=false, $int_secretaria=false, $int_departamento=false, $int_setor=false, $int_vinculo=false, $int_inicio_limit=false, $int_qtd_registros=false, $str_ramal = false, $matricula_is_not_null = false, $int_idpes = false ) 162 + function lista($str_matricula=false, $str_nome=false, $int_ativo=false, $int_secretaria=false, $int_departamento=false, $int_setor=false, $int_vinculo=false, $int_inicio_limit=false, $int_qtd_registros=false, $str_ramal = false, $matricula_is_not_null = false, $int_idpes = false, $email = null )
161 { 163 {
162 $sql = " SELECT {$this->_campos_lista} FROM {$this->schema_portal}.v_funcionario f"; 164 $sql = " SELECT {$this->_campos_lista} FROM {$this->schema_portal}.v_funcionario f";
163 $filtros = ""; 165 $filtros = "";
@@ -204,6 +206,12 @@ class clsFuncionario extends clsPessoaFisica @@ -204,6 +206,12 @@ class clsFuncionario extends clsPessoaFisica
204 $filtro_pessoa =true; 206 $filtro_pessoa =true;
205 } 207 }
206 208
  209 + if(is_string($str_email))
  210 + {
  211 + $filtros .= "{$whereAnd} f.email ILIKE '%{$str_email}%'f";
  212 + $whereAnd = " AND ";
  213 + }
  214 +
207 $limite = ""; 215 $limite = "";
208 if($int_inicio_limit !== false && $int_qtd_registros !== false) 216 if($int_inicio_limit !== false && $int_qtd_registros !== false)
209 { 217 {
@@ -284,7 +292,7 @@ class clsFuncionario extends clsPessoaFisica @@ -284,7 +292,7 @@ class clsFuncionario extends clsPessoaFisica
284 292
285 $tupla = parent::detalhe(); 293 $tupla = parent::detalhe();
286 $db = new clsBanco(); 294 $db = new clsBanco();
287 - $db->Consulta("SELECT ref_cod_pessoa_fj, matricula, senha, ativo, ref_sec, ramal, sequencial, opcao_menu, ref_cod_setor, ref_cod_funcionario_vinculo, tempo_expira_senha, tempo_expira_conta, data_troca_senha, data_reativa_conta, ref_ref_cod_pessoa_fj, proibido, ref_cod_setor_new, matricula_permanente FROM funcionario WHERE ref_cod_pessoa_fj = '{$this->idpes}'"); 295 + $db->Consulta("SELECT ref_cod_pessoa_fj, matricula, senha, ativo, ref_sec, ramal, sequencial, opcao_menu, ref_cod_setor, ref_cod_funcionario_vinculo, tempo_expira_senha, tempo_expira_conta, data_troca_senha, data_reativa_conta, ref_ref_cod_pessoa_fj, proibido, ref_cod_setor_new, matricula_permanente, email FROM funcionario WHERE ref_cod_pessoa_fj = '{$this->idpes}'");
288 if($db->ProximoRegistro()) 296 if($db->ProximoRegistro())
289 { 297 {
290 $tupla = $db->Tupla(); 298 $tupla = $db->Tupla();
@@ -438,4 +446,4 @@ class clsFuncionario extends clsPessoaFisica @@ -438,4 +446,4 @@ class clsFuncionario extends clsPessoaFisica
438 $this->_campos_lista = $this->_todos_campos; 446 $this->_campos_lista = $this->_todos_campos;
439 } 447 }
440 } 448 }
441 -?>  
442 \ No newline at end of file 449 \ No newline at end of file
  450 +?>
ieducar/intranet/include/portal/clsPortalFuncionario.inc.php
@@ -150,13 +150,13 @@ class clsPortalFuncionario @@ -150,13 +150,13 @@ class clsPortalFuncionario
150 * 150 *
151 * @return object 151 * @return object
152 */ 152 */
153 - function clsPortalFuncionario( $ref_cod_pessoa_fj = null, $matricula = null, $senha = null, $ativo = null, $ref_sec = null, $ramal = null, $sequencial = null, $opcao_menu = null, $ref_cod_administracao_secretaria = null, $ref_ref_cod_administracao_secretaria = null, $ref_cod_departamento = null, $ref_ref_ref_cod_administracao_secretaria = null, $ref_ref_cod_departamento = null, $ref_cod_setor = null, $ref_cod_funcionario_vinculo = null, $tempo_expira_senha = null, $tempo_expira_conta = null, $data_troca_senha = null, $data_reativa_conta = null, $ref_ref_cod_pessoa_fj = null, $proibido = null, $ref_cod_setor_new = null, $matricula_new = null, $matricula_permanente = null, $tipo_menu = null ) 153 + function clsPortalFuncionario( $ref_cod_pessoa_fj = null, $matricula = null, $senha = null, $ativo = null, $ref_sec = null, $ramal = null, $sequencial = null, $opcao_menu = null, $ref_cod_administracao_secretaria = null, $ref_ref_cod_administracao_secretaria = null, $ref_cod_departamento = null, $ref_ref_ref_cod_administracao_secretaria = null, $ref_ref_cod_departamento = null, $ref_cod_setor = null, $ref_cod_funcionario_vinculo = null, $tempo_expira_senha = null, $tempo_expira_conta = null, $data_troca_senha = null, $data_reativa_conta = null, $ref_ref_cod_pessoa_fj = null, $proibido = null, $ref_cod_setor_new = null, $matricula_new = null, $matricula_permanente = null, $tipo_menu = null, $email = null )
154 { 154 {
155 $db = new clsBanco(); 155 $db = new clsBanco();
156 $this->_schema = "portal."; 156 $this->_schema = "portal.";
157 $this->_tabela = "{$this->_schema}funcionario"; 157 $this->_tabela = "{$this->_schema}funcionario";
158 158
159 - $this->_campos_lista = $this->_todos_campos = "ref_cod_pessoa_fj, matricula, senha, ativo, ref_sec, ramal, sequencial, opcao_menu, ref_cod_setor, ref_cod_funcionario_vinculo, tempo_expira_senha, tempo_expira_conta, data_troca_senha, data_reativa_conta, ref_ref_cod_pessoa_fj, proibido, ref_cod_setor_new, matricula_new, matricula_permanente, tipo_menu"; 159 + $this->_campos_lista = $this->_todos_campos = "ref_cod_pessoa_fj, matricula, senha, ativo, ref_sec, ramal, sequencial, opcao_menu, ref_cod_setor, ref_cod_funcionario_vinculo, tempo_expira_senha, tempo_expira_conta, data_troca_senha, data_reativa_conta, ref_ref_cod_pessoa_fj, proibido, ref_cod_setor_new, matricula_new, matricula_permanente, tipo_menu, email";
160 160
161 if( is_numeric( $ref_ref_cod_pessoa_fj ) ) 161 if( is_numeric( $ref_ref_cod_pessoa_fj ) )
162 { 162 {
@@ -402,6 +402,9 @@ class clsPortalFuncionario @@ -402,6 +402,9 @@ class clsPortalFuncionario
402 $this->tipo_menu = $tipo_menu; 402 $this->tipo_menu = $tipo_menu;
403 } 403 }
404 404
  405 + if(is_string($email))
  406 + $this->email = $email;
  407 +
405 } 408 }
406 409
407 /** 410 /**
@@ -567,6 +570,12 @@ class clsPortalFuncionario @@ -567,6 +570,12 @@ class clsPortalFuncionario
567 $gruda = ", "; 570 $gruda = ", ";
568 } 571 }
569 572
  573 + if(is_string($this->email))
  574 + {
  575 + $campos .= "{$gruda}email";
  576 + $valores .= "{$gruda}'{$this->email}'";
  577 + $gruda = ", ";
  578 + }
570 579
571 $db->Consulta( "INSERT INTO {$this->_tabela} ( $campos ) VALUES( $valores )" ); 580 $db->Consulta( "INSERT INTO {$this->_tabela} ( $campos ) VALUES( $valores )" );
572 return true;//$db->InsertId( "{$this->_tabela}_ref_cod_pessoa_fj_seq"); 581 return true;//$db->InsertId( "{$this->_tabela}_ref_cod_pessoa_fj_seq");
@@ -708,6 +717,11 @@ class clsPortalFuncionario @@ -708,6 +717,11 @@ class clsPortalFuncionario
708 $gruda = ", "; 717 $gruda = ", ";
709 } 718 }
710 719
  720 + if(is_string($this->email))
  721 + {
  722 + $set .= "{$gruda}email = '{$this->email}'";
  723 + $gruda = ", ";
  724 + }
711 725
712 if( $set ) 726 if( $set )
713 { 727 {
@@ -1076,4 +1090,4 @@ class clsPortalFuncionario @@ -1076,4 +1090,4 @@ class clsPortalFuncionario
1076 } 1090 }
1077 1091
1078 } 1092 }
1079 -?>  
1080 \ No newline at end of file 1093 \ No newline at end of file
  1094 +?>