Commit b66038617e7c95095a57d1f264addeb3a85644b3
Exists in
master
Merge branch 'master' into 'master'
Adicionando coluna matrícula interna no cadastro de funcionários; Referente a issue #17 See merge request !15
Showing
5 changed files
with
42 additions
and
5 deletions
Show diff stats
ieducar/intranet/funcionario_cad.php
| ... | ... | @@ -57,6 +57,7 @@ class indice extends clsCadastro |
| 57 | 57 | var $super; |
| 58 | 58 | var $proibido; |
| 59 | 59 | var $matricula_permanente; |
| 60 | + var $matricula_interna; | |
| 60 | 61 | |
| 61 | 62 | //senha carregada do banco (controle de criptografia) |
| 62 | 63 | var $confere_senha; |
| ... | ... | @@ -190,6 +191,7 @@ class indice extends clsCadastro |
| 190 | 191 | $this->campoTexto("matricula", "Matrícula", $this->matricula, 12, 12, true); |
| 191 | 192 | $this->campoSenha("_senha", "Senha", $this->_senha, true); |
| 192 | 193 | $this->campoEmail("email", "E-mail usuário", $this->email, 50, 50, false, false, false, 'Utilizado para redefinir a senha, caso o usúario esqueça<br />Este campo pode ser gravado em branco, neste caso será solicitado um e-mail ao usuário, após entrar no sistema.'); |
| 194 | + $this->campoTexto('matricula_interna', 'Matrícula interna', $this->matricula_interna, 30, 30, false, false, false , 'Utilizado somente para registro, caso a instituição deseje que a matrícula interna desses funcionários sejam registradas no sistema.'); | |
| 193 | 195 | |
| 194 | 196 | $obj_setor = new clsSetor(); |
| 195 | 197 | $lst_setor = $obj_setor->lista(null, null, null, null, null, null, null, null, null, 1, 0); |
| ... | ... | @@ -465,7 +467,8 @@ class indice extends clsCadastro |
| 465 | 467 | if (! $this->validatesPassword($this->matricula, $this->_senha)) |
| 466 | 468 | return false; |
| 467 | 469 | |
| 468 | - $obj_funcionario = new clsPortalFuncionario($this->ref_pessoa, $this->matricula, md5($this->_senha), $this->ativo, null, $this->ramal, null, null, null, null, null, null, null, null, $this->ref_cod_funcionario_vinculo, $this->tempo_expira_senha, $this->tempo_expira_conta, "NOW()", "NOW()", $this->pessoa_logada, empty($this->proibido) ? 0 : 1, $this->ref_cod_setor_new, null, empty($this->matricula_permanente)? 0 : 1, 1, $this->email); | |
| 470 | + $obj_funcionario = new clsPortalFuncionario($this->ref_pessoa, $this->matricula, md5($this->_senha), $this->ativo, null, $this->ramal, null, null, null, null, null, null, null, null, $this->ref_cod_funcionario_vinculo, $this->tempo_expira_senha, $this->tempo_expira_conta, "NOW()", "NOW()", $this->pessoa_logada, empty($this->proibido) ? 0 : 1, $this->ref_cod_setor_new, null, empty($this->matricula_permanente)? 0 : 1, 1, $this->email, $this->matricula_interna); | |
| 471 | + | |
| 469 | 472 | if( $obj_funcionario->cadastra() ) |
| 470 | 473 | { |
| 471 | 474 | if($this->cadastrarTabelas()) |
| ... | ... | @@ -512,7 +515,7 @@ class indice extends clsCadastro |
| 512 | 515 | $this->_senha = md5($this->_senha); |
| 513 | 516 | } |
| 514 | 517 | |
| 515 | - $obj_funcionario = new clsPortalFuncionario($this->ref_pessoa, $this->matricula, $this->_senha, $this->ativo, null, $this->ramal, null, null, null, null, null, null, null, null, $this->ref_cod_funcionario_vinculo, $this->tempo_expira_senha, $this->tempo_expira_conta, "NOW()", "NOW()", $this->pessoa_logada, empty($this->proibido) ? 0 : 1, $this->ref_cod_setor_new, null, empty($this->matricula_permanente) ? 0 : 1, null, $this->email); | |
| 518 | + $obj_funcionario = new clsPortalFuncionario($this->ref_pessoa, $this->matricula, $this->_senha, $this->ativo, null, $this->ramal, null, null, null, null, null, null, null, null, $this->ref_cod_funcionario_vinculo, $this->tempo_expira_senha, $this->tempo_expira_conta, "NOW()", "NOW()", $this->pessoa_logada, empty($this->proibido) ? 0 : 1, $this->ref_cod_setor_new, null, empty($this->matricula_permanente) ? 0 : 1, null, $this->email, $this->matricula_interna); | |
| 516 | 519 | if( $obj_funcionario->edita() ) |
| 517 | 520 | { |
| 518 | 521 | $obj_menu_funcionario = new clsPortalMenuFuncionario($this->ref_pessoa); | ... | ... |
ieducar/intranet/funcionario_det.php
| ... | ... | @@ -138,6 +138,9 @@ class indice extends clsDetalhe |
| 138 | 138 | //$this->addDetalhe( array("E-mail", $det_pessoa["email"]) ); |
| 139 | 139 | $this->addDetalhe( array("E-mail usuário", $det_funcionario["email"]) ); |
| 140 | 140 | |
| 141 | + if (!empty($det_funcionario['matricula_interna'])) | |
| 142 | + $this->addDetalhe( array('Matrícula interna', $det_funcionario['matricula_interna'])); | |
| 143 | + | |
| 141 | 144 | $obj_fisica = new clsFisica($cod_pessoa); |
| 142 | 145 | $det_fisica = $obj_fisica->detalhe(); |
| 143 | 146 | ... | ... |
ieducar/intranet/include/pessoa/clsFuncionario.inc.php
| ... | ... | @@ -292,7 +292,7 @@ class clsFuncionario extends clsPessoaFisica |
| 292 | 292 | |
| 293 | 293 | $tupla = parent::detalhe(); |
| 294 | 294 | $db = new clsBanco(); |
| 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}'"); | |
| 295 | + $db->Consulta("SELECT ref_cod_pessoa_fj, matricula, matricula_interna, 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}'"); | |
| 296 | 296 | if($db->ProximoRegistro()) |
| 297 | 297 | { |
| 298 | 298 | $tupla = $db->Tupla(); | ... | ... |
ieducar/intranet/include/portal/clsPortalFuncionario.inc.php
| ... | ... | @@ -58,6 +58,7 @@ class clsPortalFuncionario |
| 58 | 58 | var $ref_cod_setor_new; |
| 59 | 59 | var $matricula_new; |
| 60 | 60 | var $matricula_permanente; |
| 61 | + var $matricula_interna; | |
| 61 | 62 | var $tipo_menu; |
| 62 | 63 | |
| 63 | 64 | // propriedades padrao |
| ... | ... | @@ -150,13 +151,13 @@ class clsPortalFuncionario |
| 150 | 151 | * |
| 151 | 152 | * @return object |
| 152 | 153 | */ |
| 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 | + 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, $matricula_interna = null) | |
| 154 | 155 | { |
| 155 | 156 | $db = new clsBanco(); |
| 156 | 157 | $this->_schema = "portal."; |
| 157 | 158 | $this->_tabela = "{$this->_schema}funcionario"; |
| 158 | 159 | |
| 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 | + $this->_campos_lista = $this->_todos_campos = "ref_cod_pessoa_fj, matricula, matricula_interna, 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 | 161 | |
| 161 | 162 | if( is_numeric( $ref_ref_cod_pessoa_fj ) ) |
| 162 | 163 | { |
| ... | ... | @@ -405,6 +406,9 @@ class clsPortalFuncionario |
| 405 | 406 | if(is_string($email)) |
| 406 | 407 | $this->email = $email; |
| 407 | 408 | |
| 409 | + if (is_string($matricula_interna)) | |
| 410 | + $this->matricula_interna = $matricula_interna; | |
| 411 | + | |
| 408 | 412 | } |
| 409 | 413 | |
| 410 | 414 | /** |
| ... | ... | @@ -434,6 +438,12 @@ class clsPortalFuncionario |
| 434 | 438 | $valores .= "{$gruda}'{$this->matricula}'"; |
| 435 | 439 | $gruda = ", "; |
| 436 | 440 | } |
| 441 | + if( is_string( $this->matricula_interna ) ) | |
| 442 | + { | |
| 443 | + $campos .= "{$gruda}matricula_interna"; | |
| 444 | + $valores .= "{$gruda}'{$this->matricula_interna}'"; | |
| 445 | + $gruda = ", "; | |
| 446 | + } | |
| 437 | 447 | if( is_string( $this->senha ) ) |
| 438 | 448 | { |
| 439 | 449 | $campos .= "{$gruda}senha"; |
| ... | ... | @@ -606,6 +616,11 @@ class clsPortalFuncionario |
| 606 | 616 | $set .= "{$gruda}senha = '{$this->senha}'"; |
| 607 | 617 | $gruda = ", "; |
| 608 | 618 | } |
| 619 | + if( is_string( $this->matricula_interna ) ) | |
| 620 | + { | |
| 621 | + $set .= "{$gruda}matricula_interna = '{$this->matricula_interna}'"; | |
| 622 | + $gruda = ", "; | |
| 623 | + } | |
| 609 | 624 | if( is_numeric( $this->ativo ) ) |
| 610 | 625 | { |
| 611 | 626 | $set .= "{$gruda}ativo = '{$this->ativo}'"; | ... | ... |
ieducar/misc/database/migrations/20161024012004_add_column_matricula_interna.php
0 → 100644
| ... | ... | @@ -0,0 +1,16 @@ |
| 1 | +<?php | |
| 2 | + | |
| 3 | +use Phinx\Migration\AbstractMigration; | |
| 4 | + | |
| 5 | +class AddColumnMatriculaInterna extends AbstractMigration | |
| 6 | +{ | |
| 7 | + public function up() | |
| 8 | + { | |
| 9 | + $this->execute("ALTER TABLE portal.funcionario ADD COLUMN matricula_interna character varying(30);"); | |
| 10 | + } | |
| 11 | + | |
| 12 | + public function down() | |
| 13 | + { | |
| 14 | + $this->execute("ALTER TABLE portal.funcionario DROP COLUMN matricula_interna;"); | |
| 15 | + } | |
| 16 | +} | ... | ... |