Commit d7a4d467790b4b87faea1440eccc0f477e8354b4
1 parent
62e4607a
Exists in
master
Alterado cadastro de turmas
Removido obrigatoriedade do campo Dia Semana; portabilis/ieducar#38
Showing
1 changed file
with
18 additions
and
23 deletions
Show diff stats
ieducar/intranet/educar_turma_cad.php
@@ -684,7 +684,7 @@ class indice extends clsCadastro | @@ -684,7 +684,7 @@ class indice extends clsCadastro | ||
684 | $this->turma_modulo = unserialize(urldecode($this->turma_modulo)); | 684 | $this->turma_modulo = unserialize(urldecode($this->turma_modulo)); |
685 | $this->turma_dia_semana = unserialize(urldecode($this->turma_dia_semana)); | 685 | $this->turma_dia_semana = unserialize(urldecode($this->turma_dia_semana)); |
686 | 686 | ||
687 | - if ($this->turma_modulo && $this->turma_dia_semana) { | 687 | + if ($this->turma_modulo) { |
688 | $obj = new clsPmieducarTurma(NULL, NULL, $this->pessoa_logada, | 688 | $obj = new clsPmieducarTurma(NULL, NULL, $this->pessoa_logada, |
689 | $this->ref_ref_cod_serie, $this->ref_cod_escola, | 689 | $this->ref_ref_cod_serie, $this->ref_cod_escola, |
690 | $this->ref_cod_infra_predio_comodo, $this->nm_turma, $this->sgl_turma, | 690 | $this->ref_cod_infra_predio_comodo, $this->nm_turma, $this->sgl_turma, |
@@ -715,19 +715,20 @@ class indice extends clsCadastro | @@ -715,19 +715,20 @@ class indice extends clsCadastro | ||
715 | return FALSE; | 715 | return FALSE; |
716 | } | 716 | } |
717 | } | 717 | } |
718 | - | ||
719 | - // Cadastra dia semana | ||
720 | - foreach ($this->turma_dia_semana as $campo) { | ||
721 | - $obj = new clsPmieducarTurmaDiaSemana($campo["dia_semana_"], | ||
722 | - $cadastrou, $campo["hora_inicial_"], $campo["hora_final_"]); | ||
723 | - | ||
724 | - $cadastrou2 = $obj->cadastra(); | ||
725 | - | ||
726 | - if (!$cadastrou2) { | ||
727 | - $this->mensagem = 'Cadastro não realizado.'; | ||
728 | - echo "<!--\nErro ao cadastrar clsPmieducarTurmaDiaSemana\nvalores obrigatórios\nis_numeric( $cadastrou ) && is_numeric( {$campo["dia_semana_"]} ) && is_string( {$campo["hora_inicial_"]} ) && is_string( {$campo["hora_final_"]} )\n-->"; | ||
729 | - | ||
730 | - return FALSE; | 718 | + if ($this->turma_dia_semana){ |
719 | + // Cadastra dia semana | ||
720 | + foreach ($this->turma_dia_semana as $campo) { | ||
721 | + $obj = new clsPmieducarTurmaDiaSemana($campo["dia_semana_"], | ||
722 | + $cadastrou, $campo["hora_inicial_"], $campo["hora_final_"]); | ||
723 | + | ||
724 | + $cadastrou2 = $obj->cadastra(); | ||
725 | + | ||
726 | + if (!$cadastrou2) { | ||
727 | + $this->mensagem = 'Cadastro não realizado.'; | ||
728 | + echo "<!--\nErro ao cadastrar clsPmieducarTurmaDiaSemana\nvalores obrigatórios\nis_numeric( $cadastrou ) && is_numeric( {$campo["dia_semana_"]} ) && is_string( {$campo["hora_inicial_"]} ) && is_string( {$campo["hora_final_"]} )\n-->"; | ||
729 | + | ||
730 | + return FALSE; | ||
731 | + } | ||
731 | } | 732 | } |
732 | } | 733 | } |
733 | 734 | ||
@@ -742,7 +743,7 @@ class indice extends clsCadastro | @@ -742,7 +743,7 @@ class indice extends clsCadastro | ||
742 | return FALSE; | 743 | return FALSE; |
743 | } | 744 | } |
744 | 745 | ||
745 | - echo '<script type="text/javascript">alert(stringUtils.toUtf8("É necessário adicionar pelo menos 1 módulo e 1 dia da semana!"))</script>'; | 746 | + echo '<script type="text/javascript">alert(stringUtils.toUtf8("É necessário adicionar pelo menos 1 módulo!"))</script>'; |
746 | $this->mensagem = Portabilis_String_utils::toLatin1("Cadastro não realizado."); | 747 | $this->mensagem = Portabilis_String_utils::toLatin1("Cadastro não realizado."); |
747 | 748 | ||
748 | return FALSE; | 749 | return FALSE; |
@@ -809,7 +810,7 @@ class indice extends clsCadastro | @@ -809,7 +810,7 @@ class indice extends clsCadastro | ||
809 | $this->turma_modulo = unserialize(urldecode($this->turma_modulo)); | 810 | $this->turma_modulo = unserialize(urldecode($this->turma_modulo)); |
810 | $this->turma_dia_semana = unserialize(urldecode($this->turma_dia_semana)); | 811 | $this->turma_dia_semana = unserialize(urldecode($this->turma_dia_semana)); |
811 | 812 | ||
812 | - if ($this->turma_modulo && $this->turma_dia_semana) { | 813 | + if ($this->turma_modulo) { |
813 | $obj = new clsPmieducarTurma($this->cod_turma, $this->pessoa_logada, NULL, | 814 | $obj = new clsPmieducarTurma($this->cod_turma, $this->pessoa_logada, NULL, |
814 | $this->ref_ref_cod_serie, $this->ref_cod_escola, | 815 | $this->ref_ref_cod_serie, $this->ref_cod_escola, |
815 | $this->ref_cod_infra_predio_comodo, $this->nm_turma, $this->sgl_turma, | 816 | $this->ref_cod_infra_predio_comodo, $this->nm_turma, $this->sgl_turma, |
@@ -876,7 +877,7 @@ class indice extends clsCadastro | @@ -876,7 +877,7 @@ class indice extends clsCadastro | ||
876 | } | 877 | } |
877 | } | 878 | } |
878 | else { | 879 | else { |
879 | - echo '<script type="text/javascript">alert(stringUtils.toUtf8("É necessário adicionar pelo menos 1 módulo e 1 dia da semana!"))</script>'; | 880 | + echo '<script type="text/javascript">alert(stringUtils.toUtf8("É necessário adicionar pelo menos 1 módulo!"))</script>'; |
880 | $this->mensagem = Portabilis_String_utils::toLatin1('Edição não realizada.'); | 881 | $this->mensagem = Portabilis_String_utils::toLatin1('Edição não realizada.'); |
881 | 882 | ||
882 | return FALSE; | 883 | return FALSE; |
@@ -1694,12 +1695,6 @@ function valida_xml(xml) | @@ -1694,12 +1695,6 @@ function valida_xml(xml) | ||
1694 | document.getElementById('ref_cod_modulo').focus(); | 1695 | document.getElementById('ref_cod_modulo').focus(); |
1695 | return false; | 1696 | return false; |
1696 | } | 1697 | } |
1697 | - | ||
1698 | - if (qtdDiaSemana == 1) { | ||
1699 | - alert(stringUtils.toUtf8("ATENÇÂO! \n É necessário incluir um 'Dia da Semana'!")); | ||
1700 | - document.getElementById('dia_semana').focus(); | ||
1701 | - return false; | ||
1702 | - } | ||
1703 | } | 1698 | } |
1704 | 1699 | ||
1705 | if (document.getElementById('padrao_ano_escolar') == 1) { | 1700 | if (document.getElementById('padrao_ano_escolar') == 1) { |