Commit fa78499b246a429b7fd63d06237e798ed08ef29e
1 parent
23f4a702
Exists in
master
Melhorado listagem, detalhe e implementado novo cadastro de alunos
Showing
6 changed files
with
735 additions
and
348 deletions
Show diff stats
ieducar/intranet/educar_aluno_det.php
... | ... | @@ -37,6 +37,8 @@ require_once 'App/Model/ZonaLocalizacao.php'; |
37 | 37 | require_once 'Educacenso/Model/AlunoDataMapper.php'; |
38 | 38 | require_once 'Transporte/Model/AlunoDataMapper.php'; |
39 | 39 | |
40 | +require_once 'Portabilis/View/Helper/Application.php'; | |
41 | + | |
40 | 42 | /** |
41 | 43 | * clsIndexBase class. |
42 | 44 | * |
... | ... | @@ -93,6 +95,11 @@ class indice extends clsDetalhe |
93 | 95 | $this->pessoa_logada = $_SESSION['id_pessoa']; |
94 | 96 | session_write_close(); |
95 | 97 | |
98 | + // Verificação de permissão para cadastro. | |
99 | + $this->obj_permissao = new clsPermissoes(); | |
100 | + | |
101 | + $this->nivel_usuario = $this->obj_permissao->nivel_acesso($this->pessoa_logada); | |
102 | + | |
96 | 103 | $this->titulo = 'Aluno - Detalhe'; |
97 | 104 | $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet'); |
98 | 105 | |
... | ... | @@ -128,7 +135,7 @@ class indice extends clsDetalhe |
128 | 135 | $det_raca = $obj_raca->detalhe(); |
129 | 136 | } |
130 | 137 | |
131 | - $registro['nome_aluno'] = $det_pessoa_fj['nome']; | |
138 | + $registro['nome_aluno'] = strtoupper($det_pessoa_fj['nome']); | |
132 | 139 | $registro['cpf'] = int2IdFederal($det_fisica['cpf']); |
133 | 140 | $registro['data_nasc'] = dataToBrasil($det_fisica['data_nasc']); |
134 | 141 | $registro['sexo'] = $det_fisica['sexo'] == 'F' ? 'Feminino' : 'Masculino'; |
... | ... | @@ -161,8 +168,8 @@ class indice extends clsDetalhe |
161 | 168 | $this->idpes_pai = $det_fisica['idpes_pai']; |
162 | 169 | $this->idpes_mae = $det_fisica['idpes_mae']; |
163 | 170 | |
164 | - $this->nm_pai = $detalhe_aluno['nm_pai']; | |
165 | - $this->nm_mae = $detalhe_aluno['nm_mae']; | |
171 | + $this->nm_pai = $registro['nm_pai']; | |
172 | + $this->nm_mae = $registro['nm_mae']; | |
166 | 173 | |
167 | 174 | if ($this->idpes_pai) { |
168 | 175 | $obj_pessoa_pai = new clsPessoaFj($this->idpes_pai); |
... | ... | @@ -343,6 +350,31 @@ class indice extends clsDetalhe |
343 | 350 | $this->addDetalhe(array('Código Aluno', $registro['cod_aluno'])); |
344 | 351 | } |
345 | 352 | |
353 | + // código inep | |
354 | + | |
355 | + $alunoMapper = new Educacenso_Model_AlunoDataMapper(); | |
356 | + $alunoInep = NULL; | |
357 | + try { | |
358 | + $alunoInep = $alunoMapper->find(array('aluno' => $this->cod_aluno)); | |
359 | + $this->addDetalhe(array('Código inep', $alunoInep->alunoInep)); | |
360 | + } | |
361 | + catch(Exception $e) { | |
362 | + } | |
363 | + | |
364 | + // código estado | |
365 | + | |
366 | + $this->addDetalhe(array('Código estado', $registro['aluno_estado_id'])); | |
367 | + | |
368 | + if ($registro['caminho_foto']) { | |
369 | + $this->addDetalhe(array( | |
370 | + 'Foto', | |
371 | + sprintf( | |
372 | + '<img src="arquivos/educar/aluno/small/%s" border="0">', | |
373 | + $registro['caminho_foto'] | |
374 | + ) | |
375 | + )); | |
376 | + } | |
377 | + | |
346 | 378 | if ($registro['nome_aluno']) { |
347 | 379 | $this->addDetalhe(array('Nome Aluno', $registro['nome_aluno'])); |
348 | 380 | } |
... | ... | @@ -602,16 +634,6 @@ class indice extends clsDetalhe |
602 | 634 | $this->addDetalhe(array('Seção', $registro['secao_tit_eleitor'])); |
603 | 635 | } |
604 | 636 | |
605 | - if ($registro['caminho_foto']) { | |
606 | - $this->addDetalhe(array( | |
607 | - 'Foto', | |
608 | - sprintf( | |
609 | - '<img src="arquivos/educar/aluno/small/%s" border="0">', | |
610 | - $registro['caminho_foto'] | |
611 | - ) | |
612 | - )); | |
613 | - } | |
614 | - | |
615 | 637 | // Transporte escolar. |
616 | 638 | $transporteMapper = new Transporte_Model_AlunoDataMapper(); |
617 | 639 | $transporteAluno = NULL; |
... | ... | @@ -626,260 +648,34 @@ class indice extends clsDetalhe |
626 | 648 | $this->addDetalhe(array('Responsável transporte', $transporteAluno->responsavel)); |
627 | 649 | } |
628 | 650 | |
629 | - // Adiciona uma aba com dados do Inep/Educacenso caso aluno tenha código Inep. | |
630 | - if (isset($this->cod_aluno)) { | |
631 | - $alunoMapper = new Educacenso_Model_AlunoDataMapper(); | |
632 | - | |
633 | - $alunoInep = NULL; | |
634 | - try { | |
635 | - $alunoInep = $alunoMapper->find(array('aluno' => $this->cod_aluno)); | |
636 | - } | |
637 | - catch(Exception $e) { | |
638 | - } | |
639 | - | |
640 | - if ($alunoInep) { | |
641 | - $this->addDetalhe(array('Código do aluno no Educacenso/Inep', $alunoInep->alunoInep)); | |
642 | - | |
643 | - if (isset($alunoInep->nomeInep)) { | |
644 | - $this->addDetalhe(array('Nome do aluno no Educacenso/Inep', $alunoInep->nomeInep)); | |
645 | - } | |
646 | - } | |
647 | - } | |
648 | - | |
649 | - $this->addDetalhe(array('Matrícula', $this->montaTabelaMatricula())); | |
650 | - | |
651 | - // Verificação de permissão para cadastro. | |
652 | - $obj_permissao = new clsPermissoes(); | |
653 | - if ($obj_permissao->permissao_cadastra(578, $this->pessoa_logada, 7)) { | |
654 | - $this->url_novo = 'educar_aluno_cad.php'; | |
655 | - $this->url_editar = 'educar_aluno_cad.php?cod_aluno=' . $registro['cod_aluno']; | |
651 | + if ($this->obj_permissao->permissao_cadastra(578, $this->pessoa_logada, 7)) { | |
652 | + $this->url_novo = '/module/Cadastro/aluno'; | |
653 | + $this->url_editar = '/module/Cadastro/aluno?id=' . $registro['cod_aluno']; | |
656 | 654 | |
657 | - $this->array_botao = array('Matrícula', 'Atualizar Histórico', 'Ficha do Aluno'); | |
655 | + $this->array_botao = array('Nova matrícula', 'Atualizar Histórico'); | |
658 | 656 | $this->array_botao_url_script = array( |
659 | - sprintf('go("educar_matricula_lst.php?ref_cod_aluno=%d");', $registro['cod_aluno']), | |
660 | - sprintf('go("educar_historico_escolar_lst.php?ref_cod_aluno=%d");', $registro['cod_aluno']), | |
661 | - sprintf('showExpansivelImprimir(400, 200, "educar_relatorio_aluno_dados.php?ref_cod_aluno=%d", [], "Relatório i-Educar")', $registro['cod_aluno']) | |
657 | + sprintf('go("educar_matricula_cad.php?ref_cod_aluno=%d");', $registro['cod_aluno']), | |
658 | + sprintf('go("educar_historico_escolar_lst.php?ref_cod_aluno=%d");', $registro['cod_aluno']) | |
662 | 659 | ); |
663 | 660 | } |
664 | 661 | |
665 | 662 | $this->url_cancelar = 'educar_aluno_lst.php'; |
666 | 663 | $this->largura = '100%'; |
667 | - } | |
668 | - | |
669 | - function montaTabelaMatricula() | |
670 | - { | |
671 | - $sql = sprintf('SELECT | |
672 | - cod_matricula | |
673 | - FROM | |
674 | - pmieducar.matricula | |
675 | - WHERE | |
676 | - ref_cod_aluno = %d | |
677 | - AND ativo = 1 | |
678 | - ORDER BY | |
679 | - cod_matricula DESC', $this->cod_aluno); | |
680 | - | |
681 | - $db = new clsBanco(); | |
682 | - $db->Consulta($sql); | |
683 | - | |
684 | - if ($db->Num_Linhas()) { | |
685 | - while ($db->ProximoRegistro()) { | |
686 | - list($ref_cod_matricula) = $db->Tupla(); | |
687 | - | |
688 | - if (is_numeric($ref_cod_matricula)) { | |
689 | - $obj_matricula = new clsPmieducarMatricula(); | |
690 | - $obj_matricula->setOrderby('ano ASC'); | |
691 | - $lst_matricula = $obj_matricula->lista($ref_cod_matricula); | |
692 | - | |
693 | - if ($lst_matricula) { | |
694 | - $registro = array_shift($lst_matricula); | |
695 | - } | |
696 | - | |
697 | - $table .= sprintf( | |
698 | - '<table class="tableDetalhe"> | |
699 | - <tr class="formdktd"> | |
700 | - <td colspan="2"><strong>Matrícula - Ano %d</strong></td> | |
701 | - </tr>', | |
702 | - $registro['ano'] | |
703 | - ); | |
704 | - | |
705 | - $obj_ref_cod_curso = new clsPmieducarCurso($registro['ref_cod_curso']); | |
706 | - $det_ref_cod_curso = $obj_ref_cod_curso->detalhe(); | |
707 | - $nm_curso = $det_ref_cod_curso['nm_curso']; | |
708 | 664 | |
709 | - $obj_serie = new clsPmieducarSerie($registro['ref_ref_cod_serie']); | |
710 | - $det_serie = $obj_serie->detalhe(); | |
711 | - $nm_serie = $det_serie['nm_serie']; | |
665 | + $this->addDetalhe("<input type='hidden' id='escola_id' name='aluno_id' value='{$registro['ref_cod_escola']}' />"); | |
666 | + $this->addDetalhe("<input type='hidden' id='aluno_id' name='aluno_id' value='{$registro['cod_aluno']}' />"); | |
712 | 667 | |
713 | - $obj_cod_instituicao = new clsPmieducarInstituicao($registro['ref_cod_instituicao']); | |
714 | - $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe(); | |
715 | - $nm_instituicao = $obj_cod_instituicao_det['nm_instituicao']; | |
716 | - | |
717 | - $obj_ref_cod_escola = new clsPmieducarEscola($registro['ref_ref_cod_escola']); | |
718 | - $det_ref_cod_escola = $obj_ref_cod_escola->detalhe(); | |
719 | - $nm_escola = $det_ref_cod_escola['nome']; | |
720 | - | |
721 | - $obj_mat_turma = new clsPmieducarMatriculaTurma(); | |
722 | - $det_mat_turma = $obj_mat_turma->lista($ref_cod_matricula, NULL, NULL, | |
723 | - NULL, NULL, NULL, NULL, NULL, 1); | |
724 | - | |
725 | - if ($det_mat_turma) { | |
726 | - $det_mat_turma = array_shift($det_mat_turma); | |
727 | - | |
728 | - $obj_turma = new clsPmieducarTurma($det_mat_turma['ref_cod_turma']); | |
729 | - $det_turma = $obj_turma->detalhe(); | |
730 | - $nm_turma = $det_turma['nm_turma']; | |
731 | - } | |
732 | - else { | |
733 | - $nm_turma = ''; | |
734 | - } | |
735 | - | |
736 | - $transferencias = array(); | |
737 | - | |
738 | - if ($registro['aprovado'] == 1) { | |
739 | - $aprovado = 'Aprovado'; | |
740 | - } | |
741 | - elseif ($registro['aprovado'] == 2) { | |
742 | - $aprovado = 'Reprovado'; | |
743 | - } | |
744 | - elseif ($registro['aprovado'] == 3) { | |
745 | - $aprovado = 'Em Andamento'; | |
746 | - } | |
747 | - elseif ($registro['aprovado'] == 4) { | |
748 | - if (is_numeric($registro['cod_matricula'])) { | |
749 | - $aprovado = 'Transferido'; | |
750 | - | |
751 | - $sql = sprintf('SELECT | |
752 | - ref_cod_matricula_entrada, | |
753 | - ref_cod_matricula_saida, | |
754 | - to_char(data_transferencia, \'DD/MM/YYYY\') AS dt_transferencia | |
755 | - FROM | |
756 | - pmieducar.transferencia_solicitacao | |
757 | - WHERE | |
758 | - (ref_cod_matricula_entrada = %d | |
759 | - OR ref_cod_matricula_saida = %d) | |
760 | - AND ativo = 1', | |
761 | - $registro['cod_matricula'], $registro['cod_matricula'] | |
762 | - ); | |
763 | - | |
764 | - $db2 = new clsBanco(); | |
765 | - $db2->Consulta($sql); | |
766 | - | |
767 | - if ($db2->Num_Linhas()) { | |
768 | - while ($db2->ProximoRegistro()) { | |
769 | - list($ref_cod_matricula_entrada, $ref_cod_matricula_saida, | |
770 | - $dt_transferencia) = $db2->Tupla(); | |
771 | - | |
772 | - if ($ref_cod_matricula_saida == $registro['cod_matricula']) { | |
773 | - $transferencias[] = array( | |
774 | - 'data_trans' => $dt_transferencia, | |
775 | - 'desc' => 'Data Transferência Saída' | |
776 | - ); | |
777 | - } | |
778 | - elseif ($ref_cod_matricula_entrada == $registro['cod_matricula']) { | |
779 | - $transferencias[] = array( | |
780 | - 'data_trans' => $dt_transferencia, | |
781 | - 'desc' => 'Data Transferência Admissão' | |
782 | - ); | |
783 | - } | |
784 | - } | |
785 | - } | |
786 | - } | |
787 | - } | |
788 | - elseif ($registro['aprovado'] == 5) { | |
789 | - $aprovado = 'Reclassificado'; | |
790 | - } | |
791 | - elseif ($registro['aprovado'] == 6) { | |
792 | - $aprovado = 'Abandono'; | |
793 | - } | |
794 | - elseif ($registro['aprovado'] == 7) { | |
795 | - $aprovado = 'Em Exame'; | |
796 | - } | |
668 | + // js | |
797 | 669 | |
798 | - $formando = $registro['formando'] == 0 ? 'Não' : 'Sim'; | |
670 | + Portabilis_View_Helper_Application::loadJQueryLib($this); | |
799 | 671 | |
800 | - $table .= sprintf( | |
801 | - '<tr class="formlttd"><td>Número da Matrícula</td><td>%s</td></tr>', | |
802 | - $registro['cod_matricula'] | |
803 | - ); | |
804 | - | |
805 | - $table .= sprintf( | |
806 | - '<tr class="formmdtd"><td>Instituição</td><td>%s</td></tr>', | |
807 | - $nm_instituicao | |
808 | - ); | |
809 | - | |
810 | - $table .= sprintf( | |
811 | - '<tr class="formlttd"><td>Escola</td><td>%s</td></tr>', | |
812 | - $nm_escola | |
813 | - ); | |
814 | - | |
815 | - $table .= sprintf( | |
816 | - '<tr class="formmdtd"><td>Série</td><td>%s</td></tr>', | |
817 | - $nm_serie | |
818 | - ); | |
819 | - | |
820 | - $table .= sprintf( | |
821 | - '<tr class="formlttd"><td>Turma</td><td>%s</td></tr>', | |
822 | - $nm_turma | |
823 | - ); | |
824 | - | |
825 | - $table .= sprintf( | |
826 | - '<tr class="formmdtd"><td>Situação</td><td>%s</td></tr>', | |
827 | - $aprovado | |
828 | - ); | |
829 | - | |
830 | - $class = 'formmdtd'; | |
831 | - | |
832 | - if (is_array($transferencias)) { | |
833 | - asort($transferencias); | |
834 | - | |
835 | - foreach ($transferencias as $trans) { | |
836 | - $table .= sprintf( | |
837 | - '<tr class="%s"><td>%s</td><td>%s</td></tr>', | |
838 | - $class, $trans['desc'], $trans['data_trans'] | |
839 | - ); | |
840 | - | |
841 | - $class = $class == 'formmdtd' ? 'formlttd' : 'formmdtd'; | |
842 | - } | |
843 | - } | |
844 | - | |
845 | - if ($registro['aprovado'] < 4) { | |
846 | - if (is_numeric($registro["cod_matricula"])) { | |
847 | - $sql = sprintf('SELECT | |
848 | - to_char(data_transferencia, \'DD/MM/YYYY\') | |
849 | - FROM | |
850 | - pmieducar.transferencia_solicitacao | |
851 | - WHERE | |
852 | - ref_cod_matricula_entrada = %d | |
853 | - AND ativo = 1', $registro['cod_matricula']); | |
854 | - | |
855 | - $db2 = new clsBanco(); | |
856 | - $data_transferencia = $db2->CampoUnico($sql); | |
857 | - | |
858 | - if ($data_transferencia) { | |
859 | - $table .= sprintf(' | |
860 | - <tr class="%s"> | |
861 | - <td>Data Transferência Admissão</td> | |
862 | - <td>%s</td> | |
863 | - </tr>', | |
864 | - $class, $data_transferencia); | |
865 | - | |
866 | - $class = $class == 'formmdtd' ? 'formlttd' : 'formmdtd'; | |
867 | - } | |
868 | - } | |
869 | - } | |
870 | - | |
871 | - $table .= sprintf('<tr class="%s"><td>Formando</td><td>%s</td></tr>', | |
872 | - $class == 'formmdtd' ? 'formlttd' : 'formmdtd', $formando); | |
873 | - | |
874 | - $table .= '</table>'; | |
875 | - } | |
876 | - } | |
877 | - } | |
878 | - else { | |
879 | - return '<strong>O aluno não está matriculado em nenhuma escola</strong>'; | |
880 | - } | |
672 | + $scripts = array( | |
673 | + '/modules/Portabilis/Assets/Javascripts/Utils.js', | |
674 | + '/modules/Portabilis/Assets/Javascripts/ClientApi.js', | |
675 | + '/modules/Cadastro/Assets/Javascripts/AlunoShow.js' | |
676 | + ); | |
881 | 677 | |
882 | - return $table; | |
678 | + Portabilis_View_Helper_Application::loadJavascript($this, $scripts); | |
883 | 679 | } |
884 | 680 | } |
885 | 681 | |
... | ... | @@ -893,4 +689,4 @@ $miolo = new indice(); |
893 | 689 | $pagina->addForm($miolo); |
894 | 690 | |
895 | 691 | // Gera o HTML |
896 | -$pagina->MakeAll(); | |
897 | 692 | \ No newline at end of file |
693 | +$pagina->MakeAll(); | ... | ... |
ieducar/intranet/educar_aluno_lst.php
... | ... | @@ -24,10 +24,11 @@ |
24 | 24 | * 02111-1307, USA. * |
25 | 25 | * * |
26 | 26 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
27 | -require_once ("include/clsBase.inc.php"); | |
28 | -require_once ("include/clsListagem.inc.php"); | |
29 | -require_once ("include/clsBanco.inc.php"); | |
30 | -require_once( "include/pmieducar/geral.inc.php" ); | |
27 | +require_once 'include/clsBase.inc.php'; | |
28 | +require_once 'include/clsListagem.inc.php'; | |
29 | +require_once 'include/clsBanco.inc.php'; | |
30 | +require_once 'include/pmieducar/geral.inc.php'; | |
31 | +require_once 'Educacenso/Model/AlunoDataMapper.php'; | |
31 | 32 | |
32 | 33 | class clsIndexBase extends clsBase |
33 | 34 | { |
... | ... | @@ -85,11 +86,11 @@ class indice extends clsListagem |
85 | 86 | var $inativado; |
86 | 87 | var $nome_responsavel; |
87 | 88 | var $cpf_responsavel; |
88 | - | |
89 | + | |
89 | 90 | var $nome_pai; |
90 | 91 | var $nome_mae; |
91 | 92 | var $data_nascimento; |
92 | - | |
93 | + | |
93 | 94 | function Gerar() |
94 | 95 | { |
95 | 96 | @session_start(); |
... | ... | @@ -104,13 +105,12 @@ class indice extends clsListagem |
104 | 105 | $this->addBanner( "imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet" ); |
105 | 106 | |
106 | 107 | $this->campoNumero("cod_aluno","Código Aluno",$this->cod_aluno,20,255,false); |
107 | - $this->campoTexto("nome_aluno","Nome do aluno",$this->nome_aluno,50,255,false); | |
108 | -// if ($this->pessoa_logada == 184580) { | |
109 | - $this->campoData("data_nascimento", "Data de Nascimento", $this->data_nascimento); | |
110 | - $this->campoTexto("nome_pai", "Nome do Pai", $this->nome_pai, 50, 255); | |
111 | - $this->campoTexto("nome_mae", "Nome da Mãe", $this->nome_mae, 50, 255); | |
112 | - $this->campoTexto("nome_responsavel", "Nome do Responsável", $this->nome_responsavel, 50, 255); | |
113 | -// } | |
108 | + $this->campoNumero("cod_inep","Código INEP",$this->cod_inep,20,255,false); | |
109 | + $this->campoTexto("nome_aluno","Nome do aluno", $this->nome_aluno,50,255,false); | |
110 | + $this->campoData("data_nascimento", "Data de Nascimento", $this->data_nascimento); | |
111 | + $this->campoTexto("nome_pai", "Nome do Pai", $this->nome_pai, 50, 255); | |
112 | + $this->campoTexto("nome_mae", "Nome da Mãe", $this->nome_mae, 50, 255); | |
113 | + $this->campoTexto("nome_responsavel", "Nome do Responsável", $this->nome_responsavel, 50, 255); | |
114 | 114 | |
115 | 115 | $obj_permissoes = new clsPermissoes(); |
116 | 116 | $cod_escola = $obj_permissoes->getEscola( $this->pessoa_logada ); |
... | ... | @@ -131,7 +131,9 @@ class indice extends clsListagem |
131 | 131 | |
132 | 132 | $this->addCabecalhos( array( |
133 | 133 | "Código Aluno", |
134 | + "Código INEP", | |
134 | 135 | "Nome do Aluno", |
136 | + "Nome da Mãe", | |
135 | 137 | "Nome do Responsável", |
136 | 138 | "CPF Responsável", |
137 | 139 | ) ); |
... | ... | @@ -141,85 +143,40 @@ class indice extends clsListagem |
141 | 143 | $this->offset = ( $_GET["pagina_{$this->nome}"] ) ? $_GET["pagina_{$this->nome}"]*$this->limite-$this->limite: 0; |
142 | 144 | |
143 | 145 | $obj_aluno = new clsPmieducarAluno(); |
144 | -// $obj_aluno->setOrderby( "cod_aluno DESC" ); | |
145 | 146 | $obj_aluno->setLimite( $this->limite, $this->offset ); |
146 | 147 | |
147 | - /*$lista = $obj_aluno->lista( | |
148 | - $this->cod_aluno, | |
149 | - null, | |
150 | - null, | |
151 | - null, | |
152 | - null, | |
153 | - null, | |
154 | - null, | |
155 | - null, | |
156 | - null, | |
157 | - null, | |
158 | - 1, | |
159 | - null, | |
160 | - $this->nome_aluno, | |
161 | - $this->nome_responsavel, | |
162 | - idFederal2int($this->cpf_responsavel), | |
163 | - null, | |
164 | - $this->nome_pai, | |
165 | - $this->nome_mae, | |
166 | - $ref_cod_escola | |
167 | - );*/ | |
168 | -// if ($this->pessoa_logada == 184580) { | |
169 | - $lista = $obj_aluno->lista2( | |
170 | - $this->cod_aluno, | |
171 | - null, | |
172 | - null, | |
173 | - null, | |
174 | - null, | |
175 | - null, | |
176 | - null, | |
177 | - null, | |
178 | - null, | |
179 | - null, | |
180 | - 1, | |
181 | - null, | |
182 | - $this->nome_aluno, | |
183 | - null, | |
184 | - idFederal2int($this->cpf_responsavel), | |
185 | - null, | |
186 | - null, | |
187 | - null, | |
188 | - $ref_cod_escola, | |
189 | - null, | |
190 | - $this->data_nascimento, | |
191 | - $this->nome_pai, | |
192 | - $this->nome_mae, | |
193 | - $this->nome_responsavel | |
194 | - ); | |
195 | - /*} else { | |
196 | - $lista = $obj_aluno->lista( | |
197 | - $this->cod_aluno, | |
198 | - null, | |
199 | - null, | |
200 | - null, | |
201 | - null, | |
202 | - null, | |
203 | - null, | |
204 | - null, | |
205 | - null, | |
206 | - null, | |
207 | - 1, | |
208 | - null, | |
209 | - $this->nome_aluno, | |
210 | - null, | |
211 | - idFederal2int($this->cpf_responsavel), | |
212 | - null, | |
213 | - null, | |
214 | - null, | |
215 | - $ref_cod_escola | |
216 | - ); | |
217 | - }*/ | |
218 | - | |
148 | + $lista = $obj_aluno->lista2( | |
149 | + $this->cod_aluno, | |
150 | + null, | |
151 | + null, | |
152 | + null, | |
153 | + null, | |
154 | + null, | |
155 | + null, | |
156 | + null, | |
157 | + null, | |
158 | + null, | |
159 | + 1, | |
160 | + null, | |
161 | + $this->nome_aluno, | |
162 | + null, | |
163 | + idFederal2int($this->cpf_responsavel), | |
164 | + null, | |
165 | + null, | |
166 | + null, | |
167 | + $ref_cod_escola, | |
168 | + null, | |
169 | + $this->data_nascimento, | |
170 | + $this->nome_pai, | |
171 | + $this->nome_mae, | |
172 | + $this->nome_responsavel, | |
173 | + $this->cod_inep | |
174 | + ); | |
175 | + | |
219 | 176 | $total = $obj_aluno->_total; |
220 | 177 | |
221 | 178 | // monta a lista |
222 | - if( is_array( $lista ) && count( $lista ) ) | |
179 | + if( is_array( $lista ) && count( $lista ) ) | |
223 | 180 | { |
224 | 181 | foreach ( $lista AS $registro ) |
225 | 182 | { |
... | ... | @@ -304,27 +261,47 @@ class indice extends clsListagem |
304 | 261 | } |
305 | 262 | } |
306 | 263 | |
264 | + $inepMapper = new Educacenso_Model_AlunoDataMapper(); | |
265 | + $alunoInep = NULL; | |
266 | + | |
267 | + try { | |
268 | + $alunoInep = $inepMapper->find(array('cod_aluno' => $registro["cod_aluno"])); | |
269 | + } | |
270 | + catch(Exception $e) { | |
271 | + } | |
272 | + | |
273 | + if (empty($alunoInep->alunoInep)){ | |
274 | + $registro['cod_inep'] = '-'; | |
275 | + } else { | |
276 | + $registro['cod_inep'] = $alunoInep->alunoInep; | |
277 | + } | |
278 | + | |
279 | + $registro["nome_aluno"] = strtoupper($registro["nome_aluno"]); | |
280 | + $registro["nm_mae"] = strtoupper($registro["nm_mae"]); | |
281 | + $registro["nome_responsavel"] = strtoupper($registro["nome_responsavel"]); | |
307 | 282 | |
308 | 283 | $this->addLinhas( array( |
309 | 284 | "<a href=\"educar_aluno_det.php?cod_aluno={$registro["cod_aluno"]}\">{$registro["cod_aluno"]}</a>", |
285 | + "<a href=\"educar_aluno_det.php?cod_aluno={$registro["cod_aluno"]}\">{$registro["cod_inep"]}</a>", | |
310 | 286 | "<a href=\"educar_aluno_det.php?cod_aluno={$registro["cod_aluno"]}\">{$registro["nome_aluno"]}</a>", |
287 | + "<a href=\"educar_aluno_det.php?cod_aluno={$registro["cod_aluno"]}\">{$registro["nm_mae"]}</a>", | |
311 | 288 | "<a href=\"educar_aluno_det.php?cod_aluno={$registro["cod_aluno"]}\">{$registro["nome_responsavel"]}</a>", |
312 | 289 | "<a href=\"educar_aluno_det.php?cod_aluno={$registro["cod_aluno"]}\">{$registro["cpf_responsavel"]}</a>" |
313 | 290 | ) ); |
314 | 291 | } |
315 | 292 | } |
316 | - | |
293 | + | |
317 | 294 | $this->addPaginador2( "educar_aluno_lst.php", $total, $_GET, $this->nome, $this->limite ); |
318 | 295 | |
319 | 296 | |
320 | 297 | //** Verificacao de permissao para cadastro |
321 | 298 | if($obj_permissoes->permissao_cadastra(578, $this->pessoa_logada,7)) |
322 | 299 | { |
323 | - $this->acao = "go(\"educar_aluno_cad.php\")"; | |
300 | + $this->acao = "go(\"/module/Cadastro/aluno\")"; | |
324 | 301 | $this->nome_acao = "Novo"; |
325 | 302 | |
326 | - $this->array_botao = array("Ficha do Aluno (em branco)"); | |
327 | - $this->array_botao_script = array( "showExpansivelImprimir(400, 200, \"educar_relatorio_aluno_dados.php\",\"\", \"Relatório i-Educar\" )" ); | |
303 | + /*$this->array_botao = array("Ficha do Aluno (em branco)"); | |
304 | + $this->array_botao_script = array( "showExpansivelImprimir(400, 200, \"educar_relatorio_aluno_dados.php\",\"\", \"Relatório i-Educar\" )" );*/ | |
328 | 305 | } |
329 | 306 | //** |
330 | 307 | $this->largura = "100%"; |
... | ... | @@ -338,4 +315,4 @@ $miolo = new indice(); |
338 | 315 | $pagina->addForm( $miolo ); |
339 | 316 | // gera o html |
340 | 317 | $pagina->MakeAll(); |
341 | -?> | |
342 | 318 | \ No newline at end of file |
319 | +?> | ... | ... |
... | ... | @@ -0,0 +1,254 @@ |
1 | +// before page is ready | |
2 | + | |
3 | +var $idField = $j('#id'); | |
4 | +var $nomeField = $j('#pessoa_nome'); | |
5 | + | |
6 | +var $resourceNotice = $j('<span>').html('') | |
7 | + .addClass('error resource-notice') | |
8 | + .hide() | |
9 | + .width($nomeField.outerWidth() - 12) | |
10 | + .insertBefore($idField.parent()); | |
11 | + | |
12 | +var $pessoaNotice = $resourceNotice.clone() | |
13 | + .appendTo($nomeField.parent()); | |
14 | + | |
15 | +// ajax | |
16 | + | |
17 | +resourceOptions.handlePost = function(dataResponse) { | |
18 | + $nomeField.attr('disabled', 'disabled'); | |
19 | + $j('.pessoa-links .cadastrar-pessoa').hide(); | |
20 | + | |
21 | + if (! dataResponse.any_error_msg) | |
22 | + window.setTimeout(function() { document.location = '/intranet/educar_aluno_det.php?cod_aluno=' + resource.id(); }, 500); | |
23 | +} | |
24 | + | |
25 | +resourceOptions.handlePut = function(dataResponse) { | |
26 | + if (! dataResponse.any_error_msg) | |
27 | + window.setTimeout(function() { document.location = '/intranet/educar_aluno_det.php?cod_aluno=' + resource.id(); }, 500); | |
28 | +} | |
29 | + | |
30 | +resourceOptions.handleGet = function(dataResponse) { | |
31 | + handleMessages(dataResponse.msgs); | |
32 | + $resourceNotice.hide(); | |
33 | + | |
34 | + if (dataResponse.id && ! dataResponse.ativo) { | |
35 | + $submitButton.attr('disabled', 'disabled').hide(); | |
36 | + $deleteButton.attr('disabled', 'disabled').hide(); | |
37 | + | |
38 | + var msg = "Este cadastro foi desativado em <b>"+ dataResponse.destroyed_at + | |
39 | + " </b><br/>pelo usuário <b>" + dataResponse.destroyed_by + "</b>, "; | |
40 | + | |
41 | + $resourceNotice.html(stringUtils.toUtf8(msg)).slideDown('fast'); | |
42 | + | |
43 | + $j('<a>').addClass('decorated') | |
44 | + .attr('href', '#') | |
45 | + .click(resourceOptions.enable) | |
46 | + .html('reativar cadastro.') | |
47 | + .appendTo($resourceNotice); | |
48 | + } | |
49 | + else | |
50 | + $deleteButton.removeAttr('disabled').show(); | |
51 | + | |
52 | + if (dataResponse.pessoa_id) | |
53 | + getPersonDetails(dataResponse.pessoa_id); | |
54 | + | |
55 | + $idField.val(dataResponse.id); | |
56 | + $j('#aluno_inep_id').val(dataResponse.aluno_inep_id); | |
57 | + $j('#aluno_estado_id').val(dataResponse.aluno_estado_id); | |
58 | + $j('#tipo_responsavel').val(dataResponse.tipo_responsavel).change(); | |
59 | + $j('#religiao_id').val(dataResponse.religiao_id); | |
60 | + $j('#beneficio_id').val(dataResponse.beneficio_id); | |
61 | + $j('#tipo_transporte').val(dataResponse.tipo_transporte); | |
62 | + $j('#alfabetizado').attr('checked', dataResponse.alfabetizado); | |
63 | +}; | |
64 | + | |
65 | +var handleGetPersonDetails = function(dataResponse) { | |
66 | + handleMessages(dataResponse.msgs); | |
67 | + $pessoaNotice.hide(); | |
68 | + | |
69 | + var alunoId = dataResponse.aluno_id; | |
70 | + | |
71 | + if (alunoId && alunoId != resource.id()) { | |
72 | + $submitButton.attr('disabled', 'disabled').hide(); | |
73 | + | |
74 | + $pessoaNotice.html(stringUtils.toUtf8('Esta pessoa já possui o aluno código '+ alunoId +' cadastrado, ' )) | |
75 | + .slideDown('fast'); | |
76 | + | |
77 | + $j('<a>').addClass('decorated') | |
78 | + .attr('href', resource.url(alunoId)) | |
79 | + .attr('target', '_blank') | |
80 | + .html('acessar cadastro.') | |
81 | + .appendTo($pessoaNotice); | |
82 | + } | |
83 | + | |
84 | + else { | |
85 | + $j('.pessoa-links .editar-pessoa').attr('href', '/intranet/atendidos_cad.php?cod_pessoa_fj=' + dataResponse.id) | |
86 | + .show(); | |
87 | + | |
88 | + $submitButton.removeAttr('disabled').show(); | |
89 | + } | |
90 | + | |
91 | + $j('#pessoa_id').val(dataResponse.id); | |
92 | + $nomeField.val(dataResponse.id + ' - ' + dataResponse.nome); | |
93 | + | |
94 | + var nomePai = dataResponse.nome_pai; | |
95 | + var nomeMae = dataResponse.nome_mae; | |
96 | + var nomeResponsavel = dataResponse.nome_responsavel; | |
97 | + | |
98 | + if (dataResponse.pai_id) | |
99 | + nomePai = dataResponse.pai_id + ' - ' + nomePai; | |
100 | + | |
101 | + if (dataResponse.mae_id) | |
102 | + nomeMae = dataResponse.mae_id + ' - ' + nomeMae; | |
103 | + | |
104 | + if (dataResponse.responsavel_id) | |
105 | + nomeResponsavel = dataResponse.responsavel_id + ' - ' + nomeResponsavel; | |
106 | + | |
107 | + //$j('#rg').val(dataResponse.rg); | |
108 | + //$j('#cpf').val(dataResponse.cpf); | |
109 | + | |
110 | + $j('#pai').val(nomePai); | |
111 | + $j('#mae').val(nomeMae); | |
112 | + $j('#responsavel_nome').val(nomeResponsavel); | |
113 | + $j('#responsavel_id').val(dataResponse.responsavel_id); | |
114 | + | |
115 | + // deficiencias | |
116 | + | |
117 | + $deficiencias = $j('#deficiencias'); | |
118 | + | |
119 | + $j.each(dataResponse.deficiencias, function(id, nome) { | |
120 | + $deficiencias.children("[value=" + id + "]").attr('selected', ''); | |
121 | + }); | |
122 | + | |
123 | + $deficiencias.trigger('liszt:updated'); | |
124 | + | |
125 | + // # TODO show aluno photo | |
126 | + //$j('#aluno_foto').val(dataResponse.url_foto); | |
127 | +} | |
128 | + | |
129 | +var getPersonDetails = function(personId) { | |
130 | + var additionalVars = { | |
131 | + id : personId | |
132 | + }; | |
133 | + | |
134 | + var options = { | |
135 | + url : getResourceUrlBuilder.buildUrl('/module/Api/pessoa', 'pessoa', additionalVars), | |
136 | + dataType : 'json', | |
137 | + data : {}, | |
138 | + success : handleGetPersonDetails | |
139 | + }; | |
140 | + | |
141 | + getResource(options); | |
142 | +} | |
143 | + | |
144 | +var updatePersonDetails = function() { | |
145 | + if ($j('#pessoa_nome').val() && $j('#pessoa_id').val()) | |
146 | + getPersonDetails($j('#pessoa_id').val()); | |
147 | + else | |
148 | + clearPersonDetails(); | |
149 | +} | |
150 | + | |
151 | +var clearPersonDetails = function() { | |
152 | + $j('#pessoa_id').val(''); | |
153 | + $j('#pai').val(''); | |
154 | + $j('#mae').val(''); | |
155 | + $j('.pessoa-links .editar-pessoa').hide(); | |
156 | +} | |
157 | + | |
158 | +// simple search options | |
159 | + | |
160 | +var simpleSearchPessoaOptions = { | |
161 | + autocompleteOptions : { close : updatePersonDetails /*, change : updatePersonDetails*/ } | |
162 | +}; | |
163 | + | |
164 | + | |
165 | +// children callbacks | |
166 | + | |
167 | +function afterChangePessoa(targetWindow, pessoaId) { | |
168 | + targetWindow.close(); | |
169 | + | |
170 | + // timeout para usuario perceber mudança | |
171 | + window.setTimeout(function() { | |
172 | + messageUtils.success('Pessoa alterada com sucesso', $nomeField); | |
173 | + | |
174 | + $j('#pessoa_id').val(pessoaId); | |
175 | + getPersonDetails(pessoaId); | |
176 | + | |
177 | + window.setTimeout(function() { $nomeField.removeClass('success'); }, 10000); | |
178 | + $nomeField.focus(); | |
179 | + | |
180 | + }, 500); | |
181 | +} | |
182 | + | |
183 | + | |
184 | +// when page is ready | |
185 | + | |
186 | +(function($) { | |
187 | + $(document).ready(function() { | |
188 | + | |
189 | + // pessoa | |
190 | + | |
191 | + var $pessoaActionBar = $j('<span>').html('') | |
192 | + .addClass('pessoa-links') | |
193 | + .width($nomeField.outerWidth() - 12) | |
194 | + .appendTo($nomeField.parent()); | |
195 | + | |
196 | + $j('<a>').hide() | |
197 | + .addClass('cadastrar-pessoa decorated') | |
198 | + .attr('href', '/intranet/atendidos_cad.php') | |
199 | + .attr('target', '_blank') | |
200 | + .html('Cadastrar pessoa') | |
201 | + .appendTo($pessoaActionBar); | |
202 | + | |
203 | + $j('<a>').hide() | |
204 | + .addClass('editar-pessoa decorated') | |
205 | + .attr('href', '#') | |
206 | + .attr('target', '_blank') | |
207 | + .html('Editar pessoa') | |
208 | + .appendTo($pessoaActionBar); | |
209 | + | |
210 | + if (resource.isNew()) { | |
211 | + $nomeField.focus(); | |
212 | + $j('.pessoa-links .cadastrar-pessoa').show(); | |
213 | + } | |
214 | + else | |
215 | + $nomeField.attr('disabled', 'disabled'); | |
216 | + | |
217 | + // responsavel | |
218 | + | |
219 | + var checkTipoResponsavel = function(){ | |
220 | + if ($j('#tipo_responsavel').val() == 'outra_pessoa') | |
221 | + $j('#responsavel_nome').show(); | |
222 | + else | |
223 | + $j('#responsavel_nome').hide(); | |
224 | + } | |
225 | + | |
226 | + checkTipoResponsavel(); | |
227 | + $j('#tipo_responsavel').change(checkTipoResponsavel); | |
228 | + | |
229 | + | |
230 | + // back to old version | |
231 | + | |
232 | + var backToOldVersion = function() { | |
233 | + var $this = $j(this); | |
234 | + var url = '/intranet/educar_aluno_cad.php'; | |
235 | + | |
236 | + if(resource.id()) | |
237 | + url += '?cod_aluno=' + resource.id(); | |
238 | + | |
239 | + $this.attr('href', url); | |
240 | + } | |
241 | + | |
242 | + $j('<p>').addClass('back-to-old-version right-top-notice notice') | |
243 | + .html(stringUtils.toUtf8('Você está acessando o <b>novo cadastro de alunos</b>,<br />')) | |
244 | + .appendTo($j('#id').closest('td')); | |
245 | + | |
246 | + $j('<a>').attr('href', '#') | |
247 | + .attr('target', '_blank') | |
248 | + .click(backToOldVersion) | |
249 | + .addClass('decorated') | |
250 | + .html(stringUtils.toUtf8('acessar versão antiga.')) | |
251 | + .appendTo($j('.back-to-old-version')); | |
252 | + | |
253 | + }); // ready | |
254 | +})(jQuery); | |
0 | 255 | \ No newline at end of file | ... | ... |
ieducar/modules/Cadastro/Assets/Javascripts/AlunoShow.js
0 → 100644
... | ... | @@ -0,0 +1,128 @@ |
1 | +function fixupTabelaMatriculas() { | |
2 | + var $parentTd = $j('.botaolistagem[value=" Voltar "]').closest('tr').next().children().first(); | |
3 | + $parentTd.empty().removeAttr('bgcolor').removeAttr('style'); | |
4 | + | |
5 | + $j('<p>').html(stringUtils.toUtf8('<strong>Matrículas:</strong>')).appendTo($parentTd); | |
6 | + | |
7 | + var $table = $j('<table>').attr('id', 'matriculas').addClass('styled horizontal-expand').hide(); | |
8 | + var $tr = $j('<tr>'); | |
9 | + | |
10 | + $j('<th>').html('').appendTo($tr); | |
11 | + $j('<th>').html('Ano').appendTo($tr); | |
12 | + $j('<th>').html(stringUtils.toUtf8('Situação')).appendTo($tr); | |
13 | + $j('<th>').html('Turma').appendTo($tr); | |
14 | + $j('<th>').html(stringUtils.toUtf8('Série')).appendTo($tr); | |
15 | + $j('<th>').html('Curso').appendTo($tr); | |
16 | + $j('<th>').html('Escola').appendTo($tr); | |
17 | + $j('<th>').html('Entrada').appendTo($tr); | |
18 | + $j('<th>').html(stringUtils.toUtf8('Saída')).appendTo($tr); | |
19 | + | |
20 | + $tr.appendTo($table); | |
21 | + $table.appendTo($parentTd); | |
22 | +} | |
23 | + | |
24 | +fixupTabelaMatriculas(); | |
25 | + | |
26 | + | |
27 | +// api client | |
28 | + | |
29 | +var handleGetMatriculas = function(dataResponse) { | |
30 | + try{ | |
31 | + handleMessages(dataResponse.msgs); | |
32 | + | |
33 | + var $matriculasTable = $j('#matriculas'); | |
34 | + var transferenciaEmAberto = false; | |
35 | + | |
36 | + $j.each(dataResponse.matriculas, function(index, matricula) { | |
37 | + var $tr = $j('<tr>'); | |
38 | + | |
39 | + if (matricula.user_can_access) { | |
40 | + var linkToMatricula = $j('<a>').attr('href', 'educar_matricula_det.php?cod_matricula=' + matricula.id) | |
41 | + .html('Visualizar') | |
42 | + .addClass('decorated'); | |
43 | + | |
44 | + } | |
45 | + else | |
46 | + var linkToMatricula = ''; | |
47 | + | |
48 | + $j('<td>').html(linkToMatricula).appendTo($tr).addClass('center'); | |
49 | + $j('<td>').html(matricula.ano).appendTo($tr); | |
50 | + $j('<td>').html(matricula.situacao).appendTo($tr); | |
51 | + $j('<td>').html(matricula.turma_nome).appendTo($tr); | |
52 | + $j('<td>').html(matricula.serie_nome).appendTo($tr); | |
53 | + $j('<td>').html(matricula.curso_nome).appendTo($tr); | |
54 | + $j('<td>').html(matricula.escola_nome).appendTo($tr); | |
55 | + $j('<td>').html(matricula.data_entrada).appendTo($tr); | |
56 | + $j('<td>').html(matricula.data_saida).appendTo($tr); | |
57 | + | |
58 | + if (matricula.transferencia_em_aberto) { | |
59 | + transferenciaEmAberto = true; | |
60 | + $tr.addClass('notice'); | |
61 | + } | |
62 | + | |
63 | + $tr.appendTo($matriculasTable); | |
64 | + }); | |
65 | + | |
66 | + | |
67 | + if(dataResponse.matriculas.length < 1) { | |
68 | + var $p = $j('<p>').html(stringUtils.toUtf8('Aluno sem matrículas, ')).addClass('notice simple-block'); | |
69 | + | |
70 | + $j('<a>').attr('href', 'educar_matricula_cad.php?ref_cod_aluno=' + $j('#aluno_id').val()) | |
71 | + .html('matricular aluno.') | |
72 | + .addClass('decorated') | |
73 | + .appendTo($p); | |
74 | + | |
75 | + $p.appendTo($matriculasTable.parent()); | |
76 | + } | |
77 | + else if (transferenciaEmAberto) { | |
78 | + var $p = $j('<p>').html(stringUtils.toUtf8('* Matrícula com solicitação de transferência interna em aberto, ')) | |
79 | + .addClass('notice simple-block'); | |
80 | + | |
81 | + $j('<a>').attr('href', 'educar_matricula_cad.php?ref_cod_aluno=' + $j('#aluno_id').val()) | |
82 | + .html('matricular aluno.') | |
83 | + .addClass('decorated') | |
84 | + .appendTo($p); | |
85 | + | |
86 | + $p.appendTo($matriculasTable.parent()); | |
87 | + } | |
88 | + | |
89 | + $matriculasTable.fadeIn('slow'); | |
90 | + $j('body').animate({scrollTop: $j('#matriculas').offset().top }, 900); | |
91 | + | |
92 | + $matriculasTable.find('tr:even').addClass('even'); | |
93 | + } | |
94 | + catch(error) { | |
95 | + alert('Erro ao carregar matriculas, detalhes:\n\n' + error); | |
96 | + | |
97 | + safeLog('Error details:'); | |
98 | + safeLog(error); | |
99 | + | |
100 | + safeLog('dataResponse details:'); | |
101 | + safeLog(dataResponse); | |
102 | + | |
103 | + throw error; | |
104 | + } | |
105 | +} | |
106 | + | |
107 | +var getMatriculas = function() { | |
108 | + var data = { | |
109 | + aluno_id : $j('#aluno_id').val() | |
110 | + }; | |
111 | + | |
112 | + var options = { | |
113 | + url : getResourceUrlBuilder.buildUrl('/module/Api/aluno', 'matriculas'), | |
114 | + dataType : 'json', | |
115 | + data : data, | |
116 | + success : handleGetMatriculas | |
117 | + }; | |
118 | + | |
119 | + getResource(options); | |
120 | +} | |
121 | + | |
122 | +// when page is ready | |
123 | + | |
124 | +$j(document).ready(function() { | |
125 | + | |
126 | + getMatriculas(); | |
127 | + | |
128 | +}); // ready | |
0 | 129 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,223 @@ |
1 | +<?php | |
2 | +#error_reporting(E_ALL); | |
3 | +#ini_set("display_errors", 1); | |
4 | + | |
5 | +/** | |
6 | + * i-Educar - Sistema de gestão escolar | |
7 | + * | |
8 | + * Copyright (C) 2006 Prefeitura Municipal de Itajaí | |
9 | + * <ctima@itajai.sc.gov.br> | |
10 | + * | |
11 | + * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo | |
12 | + * sob os termos da Licença Pública Geral GNU conforme publicada pela Free | |
13 | + * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) | |
14 | + * qualquer versão posterior. | |
15 | + * | |
16 | + * Este programa é distribuído na expectativa de que seja útil, porém, SEM | |
17 | + * NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU | |
18 | + * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral | |
19 | + * do GNU para mais detalhes. | |
20 | + * | |
21 | + * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto | |
22 | + * com este programa; se não, escreva para a Free Software Foundation, Inc., no | |
23 | + * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
24 | + * | |
25 | + * @author Lucas D'Avila <lucasdavila@portabilis.com.br> | |
26 | + * @category i-Educar | |
27 | + * @license @@license@@ | |
28 | + * @package Avaliacao | |
29 | + * @subpackage Modules | |
30 | + * @since Arquivo disponível desde a versão ? | |
31 | + * @version $Id$ | |
32 | + */ | |
33 | + | |
34 | +require_once 'lib/Portabilis/Controller/Page/EditController.php'; | |
35 | +require_once 'Usuario/Model/FuncionarioDataMapper.php'; | |
36 | + | |
37 | +class AlunoController extends Portabilis_Controller_Page_EditController | |
38 | +{ | |
39 | + protected $_dataMapper = 'Usuario_Model_FuncionarioDataMapper'; | |
40 | + protected $_titulo = 'Cadastro de aluno'; | |
41 | + | |
42 | + protected $_nivelAcessoOption = App_Model_NivelAcesso::SOMENTE_ESCOLA; | |
43 | + protected $_processoAp = 578; | |
44 | + protected $_deleteOption = true; | |
45 | + | |
46 | + protected $_formMap = array( | |
47 | + 'pessoa' => array( | |
48 | + 'label' => 'Pessoa', | |
49 | + 'help' => '', | |
50 | + ), | |
51 | + | |
52 | + 'rg' => array( | |
53 | + 'label' => 'Documento de identidade (rg)', | |
54 | + 'help' => '', | |
55 | + ), | |
56 | + | |
57 | + 'cpf' => array( | |
58 | + 'label' => 'CPF', | |
59 | + 'help' => '', | |
60 | + ), | |
61 | + | |
62 | + 'pai' => array( | |
63 | + 'label' => 'Pai', | |
64 | + 'help' => '', | |
65 | + ), | |
66 | + | |
67 | + 'mae' => array( | |
68 | + 'label' => 'Mãe', | |
69 | + 'help' => '', | |
70 | + ), | |
71 | + | |
72 | + 'responsavel' => array( | |
73 | + 'label' => 'Responsável', | |
74 | + 'help' => '', | |
75 | + ), | |
76 | + | |
77 | + 'alfabetizado' => array( | |
78 | + 'label' => 'Alfabetizado', | |
79 | + 'help' => '', | |
80 | + ), | |
81 | + | |
82 | + 'transporte' => array( | |
83 | + 'label' => 'Transporte público', | |
84 | + 'help' => '', | |
85 | + ), | |
86 | + | |
87 | + 'id' => array( | |
88 | + 'label' => 'Código aluno', | |
89 | + 'help' => '', | |
90 | + ), | |
91 | + | |
92 | + 'aluno_inep_id' => array( | |
93 | + 'label' => 'Código inep', | |
94 | + 'help' => '', | |
95 | + ), | |
96 | + | |
97 | + 'aluno_estado_id' => array( | |
98 | + 'label' => 'Código rede estadual', | |
99 | + 'help' => '', | |
100 | + ), | |
101 | + | |
102 | + 'deficiencias' => array( | |
103 | + 'label' => 'Deficiências / habilidades especiais', | |
104 | + 'help' => '', | |
105 | + ) | |
106 | + ); | |
107 | + | |
108 | + | |
109 | + protected function _preConstruct() | |
110 | + { | |
111 | + } | |
112 | + | |
113 | + | |
114 | + protected function _initNovo() { | |
115 | + return false; | |
116 | + } | |
117 | + | |
118 | + | |
119 | + protected function _initEditar() { | |
120 | + return false; | |
121 | + } | |
122 | + | |
123 | + | |
124 | + public function Gerar() | |
125 | + { | |
126 | + $this->url_cancelar = '/intranet/educar_aluno_lst.php'; | |
127 | + | |
128 | + // código rede de ensino municipal | |
129 | + $options = array('label' => $this->_getLabel('id'), 'disabled' => true, | |
130 | + 'required' => false, 'size' => 25); | |
131 | + $this->inputsHelper()->text('id', $options); | |
132 | + | |
133 | + | |
134 | + // código aluno inep | |
135 | + $options = array('label' => $this->_getLabel('aluno_inep_id'), 'required' => false, 'size' => 25); | |
136 | + $this->inputsHelper()->text('aluno_inep_id', $options); | |
137 | + | |
138 | + // código aluno rede estadual | |
139 | + $options = array('label' => $this->_getLabel('aluno_estado_id'), 'required' => false, 'size' => 25); | |
140 | + $this->inputsHelper()->text('aluno_estado_id', $options); | |
141 | + | |
142 | + // nome | |
143 | + $options = array('label' => $this->_getLabel('pessoa'), 'size' => 68); | |
144 | + $this->inputsHelper()->simpleSearchPessoa('nome', $options); | |
145 | + | |
146 | + // rg | |
147 | + //$options = array('label' => $this->_getLabel('rg'), 'disabled' => true, 'required' => false); | |
148 | + //$this->inputsHelper()->text('aluno', 'rg', $options); | |
149 | + | |
150 | + // cpf | |
151 | + //$options = array('label' => $this->_getLabel('cpf'), 'disabled' => true, 'required' => false); | |
152 | + //$this->inputsHelper()->text('aluno', 'cpf', $options); | |
153 | + | |
154 | + // pai | |
155 | + $options = array('label' => $this->_getLabel('pai'), 'disabled' => true, 'required' => false, 'size' => 68); | |
156 | + $this->inputsHelper()->text('pai', $options); | |
157 | + | |
158 | + | |
159 | + // mãe | |
160 | + $options = array('label' => $this->_getLabel('mae'), 'disabled' => true, 'required' => false, 'size' => 68); | |
161 | + $this->inputsHelper()->text('mae', $options); | |
162 | + | |
163 | + | |
164 | + // responsável | |
165 | + | |
166 | + // tipo | |
167 | + $tiposResponsavel = array(null => 'Selecione', | |
168 | + 'pai' => 'Pai', | |
169 | + 'mae' => 'Mãe', | |
170 | + 'outra_pessoa' => 'Outra pessoa'); | |
171 | + | |
172 | + $options = array('label' => $this->_getLabel('responsavel'), | |
173 | + 'resources' => $tiposResponsavel, | |
174 | + 'required' => true, | |
175 | + 'inline' => true); | |
176 | + | |
177 | + $this->inputsHelper()->select('tipo_responsavel', $options); | |
178 | + | |
179 | + | |
180 | + // nome | |
181 | + $helperOptions = array('objectName' => 'responsavel'); | |
182 | + $options = array('label' => '', 'size' => 50, 'required' => true); | |
183 | + | |
184 | + $this->inputsHelper()->simpleSearchPessoa('nome', $options, $helperOptions); | |
185 | + | |
186 | + | |
187 | + // transporte publico | |
188 | + $tiposTransporte = array(null => 'Selecione', | |
189 | + 'nenhum' => 'Não utiliza', | |
190 | + 'municipal' => 'Municipal', | |
191 | + 'estadual' => 'Estadual'); | |
192 | + | |
193 | + $options = array('label' => $this->_getLabel('transporte'), | |
194 | + 'resources' => $tiposTransporte, | |
195 | + 'required' => true); | |
196 | + | |
197 | + $this->inputsHelper()->select('tipo_transporte', $options); | |
198 | + | |
199 | + | |
200 | + // religião | |
201 | + $this->inputsHelper()->religiao(array('required' => false)); | |
202 | + | |
203 | + // beneficio | |
204 | + $this->inputsHelper()->beneficio(array('required' => false)); | |
205 | + | |
206 | + | |
207 | + // Deficiências / habilidades especiais | |
208 | + $helperOptions = array('objectName' => 'deficiencias'); | |
209 | + $options = array('label' => $this->_getLabel('deficiencias'), 'size' => 50, 'required' => false, | |
210 | + 'options' => array('value' => null)); | |
211 | + | |
212 | + $this->inputsHelper()->multipleSearchDeficiencias('', $options, $helperOptions); | |
213 | + | |
214 | + | |
215 | + // alfabetizado | |
216 | + $options = array('label' => $this->_getLabel('alfabetizado'), 'value' => 'checked'); | |
217 | + $this->inputsHelper()->checkbox('alfabetizado', $options); | |
218 | + | |
219 | + | |
220 | + $this->loadResourceAssets($this->getDispatcher()); | |
221 | + } | |
222 | +} | |
223 | +?> | |
0 | 224 | \ No newline at end of file | ... | ... |