Commit 08e3ecc3f1c34e209ef1d5a8de6682df72ecf2e0
1 parent
50339999
Exists in
2.8
and in
2 other branches
Inclui os campos de falta mínima e máxima nas regras de avaliação
Showing
8 changed files
with
66 additions
and
5 deletions
Show diff stats
config/assets.php
database/migrations/2021_06_26_094053_add_fields_max_min_abesences.php
0 → 100644
... | ... | @@ -0,0 +1,24 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Database\Schema\Blueprint; | |
5 | +use Illuminate\Support\Facades\Schema; | |
6 | + | |
7 | +class AddFieldsMaxMinAbesences extends Migration | |
8 | +{ | |
9 | + public function up() | |
10 | + { | |
11 | + Schema::table('modules.regra_avaliacao', function (Blueprint $table) { | |
12 | + $table->integer('falta_minima_geral')->default(0); | |
13 | + $table->integer('falta_maxima_geral')->default(100); | |
14 | + }); | |
15 | + } | |
16 | + | |
17 | + public function down() | |
18 | + { | |
19 | + Schema::table('modules.regra_avaliacao', function (Blueprint $table) { | |
20 | + $table->dropColumn('falta_minima_geral'); | |
21 | + $table->dropColumn('falta_maxima_geral'); | |
22 | + }); | |
23 | + } | |
24 | +} | ... | ... |
ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js
... | ... | @@ -518,13 +518,12 @@ function postNotaRecuperacaoEspecifica($notaRecuperacaoEspecificaElement) { |
518 | 518 | |
519 | 519 | function postFalta($faltaFieldElement) { |
520 | 520 | $faltaFieldElement.val($faltaFieldElement.val().replace(',', '.')); |
521 | - | |
521 | + var regra = $faltaFieldElement.closest('tr').data('regra'); | |
522 | 522 | //falta é persistida como inteiro |
523 | 523 | if ($j.isNumeric($faltaFieldElement.val())) |
524 | 524 | $faltaFieldElement.val(parseInt($faltaFieldElement.val()).toString()); |
525 | - | |
526 | 525 | if (validatesIfValueIsNumeric($faltaFieldElement.val(), $faltaFieldElement.attr('id')) && |
527 | - validatesIfNumericValueIsInRange($faltaFieldElement.val(), $faltaFieldElement.attr('id'), 0, 8766)) { | |
526 | + validatesIfNumericValueIsInRange($faltaFieldElement.val(), $faltaFieldElement.attr('id'), regra.falta_minima_geral, regra.falta_maxima_geral)) { | |
528 | 527 | |
529 | 528 | beforeChangeResource($faltaFieldElement); |
530 | 529 | |
... | ... | @@ -548,7 +547,7 @@ function postFalta($faltaFieldElement) { |
548 | 547 | } else { |
549 | 548 | $j('#' + $faltaFieldElement.attr('id')).addClass('error'); |
550 | 549 | |
551 | - var regra = $element.closest('tr').data('regra'); | |
550 | + regra = $element.closest('tr').data('regra'); | |
552 | 551 | |
553 | 552 | // se presenca geral, muda o valor em todas faltas da mesma matricula |
554 | 553 | if (regra.tipo_presenca == 'geral') { | ... | ... |
ieducar/modules/Avaliacao/Views/DiarioApiController.php
... | ... | @@ -1641,6 +1641,8 @@ class DiarioApiController extends ApiCoreController |
1641 | 1641 | 'nome' => $evaluationRule->nome, |
1642 | 1642 | 'nota_maxima_geral' => $evaluationRule->nota_maxima_geral, |
1643 | 1643 | 'nota_minima_geral' => $evaluationRule->nota_minima_geral, |
1644 | + 'falta_maxima_geral' => $evaluationRule->falta_maxima_geral, | |
1645 | + 'falta_minima_geral' => $evaluationRule->falta_minima_geral, | |
1644 | 1646 | 'nota_maxima_exame_final' => $evaluationRule->nota_maxima_exame_final, |
1645 | 1647 | 'qtd_casas_decimais' => $evaluationRule->qtd_casas_decimais, |
1646 | 1648 | 'regra_diferenciada_id' => $evaluationRule->regra_diferenciada_id, | ... | ... |
ieducar/modules/RegraAvaliacao/Model/Regra.php
... | ... | @@ -20,6 +20,8 @@ class RegraAvaliacao_Model_Regra extends CoreExt_Entity |
20 | 20 | 'mediaRecuperacaoParalela' => null, |
21 | 21 | 'notaMaximaGeral' => null, |
22 | 22 | 'notaMinimaGeral' => null, |
23 | + 'faltaMaximaGeral' => null, | |
24 | + 'faltaMinimaGeral' => null, | |
23 | 25 | 'notaMaximaExameFinal' => null, |
24 | 26 | 'qtdCasasDecimais' => null, |
25 | 27 | 'notaGeralPorEtapa' => null, |
... | ... | @@ -42,6 +44,8 @@ class RegraAvaliacao_Model_Regra extends CoreExt_Entity |
42 | 44 | 'tipoRecuperacaoParalela' => 'numeric', |
43 | 45 | 'notaMaximaGeral' => 'numeric', |
44 | 46 | 'notaMinimaGeral' => 'numeric', |
47 | + 'faltaMaximaGeral' => 'numeric', | |
48 | + 'faltaMinimaGeral' => 'numeric', | |
45 | 49 | 'notaMaximaExameFinal' => 'numeric', |
46 | 50 | 'qtdCasasDecimais' => 'numeric', |
47 | 51 | 'qtdDisciplinasDependencia' => 'numeric', | ... | ... |
ieducar/modules/RegraAvaliacao/Model/RegraDataMapper.php
... | ... | @@ -28,6 +28,8 @@ class RegraAvaliacao_Model_RegraDataMapper extends CoreExt_DataMapper |
28 | 28 | 'calculaMediaRecParalela' => 'calcula_media_rec_paralela', |
29 | 29 | 'notaMaximaGeral' => 'nota_maxima_geral', |
30 | 30 | 'notaMinimaGeral' => 'nota_minima_geral', |
31 | + 'faltaMaximaGeral' => 'falta_maxima_geral', | |
32 | + 'faltaMinimaGeral' => 'falta_minima_geral', | |
31 | 33 | 'notaMaximaExameFinal' => 'nota_maxima_exame_final', |
32 | 34 | 'qtdCasasDecimais' => 'qtd_casas_decimais', |
33 | 35 | 'notaGeralPorEtapa' => 'nota_geral_por_etapa', | ... | ... |
ieducar/modules/RegraAvaliacao/Views/EditController.php
... | ... | @@ -108,6 +108,14 @@ class EditController extends Core_Controller_Page_EditController |
108 | 108 | 'label' => 'Nota mínima geral', |
109 | 109 | 'help' => 'Informe o valor mínimo para notas no geral' |
110 | 110 | ], |
111 | + 'faltaMaximaGeral' => [ | |
112 | + 'label' => 'Falta máxima geral', | |
113 | + 'help' => 'Informe o valor máximo para faltas no geral' | |
114 | + ], | |
115 | + 'faltaMinimaGeral' => [ | |
116 | + 'label' => 'Falta mínima geral', | |
117 | + 'help' => 'Informe o valor mínimo para faltas no geral' | |
118 | + ], | |
111 | 119 | 'notaMaximaExameFinal' => [ |
112 | 120 | 'label' => 'Nota máxima exame final', |
113 | 121 | 'help' => 'Informe o valor máximo para nota do exame final' |
... | ... | @@ -588,6 +596,26 @@ class EditController extends Core_Controller_Page_EditController |
588 | 596 | ); |
589 | 597 | |
590 | 598 | $this->campoNumero( |
599 | + 'faltaMaximaGeral', | |
600 | + $this->_getLabel('faltaMaximaGeral'), | |
601 | + $this->getEntity()->faltaMaximaGeral, | |
602 | + 4, | |
603 | + 4, | |
604 | + true, | |
605 | + $this->_getHelp('faltaMaximaGeral') | |
606 | + ); | |
607 | + | |
608 | + $this->campoNumero( | |
609 | + 'faltaMinimaGeral', | |
610 | + $this->_getLabel('faltaMinimaGeral'), | |
611 | + $this->getEntity()->faltaMinimaGeral, | |
612 | + 4, | |
613 | + 4, | |
614 | + true, | |
615 | + $this->_getHelp('faltaMinimaGeral') | |
616 | + ); | |
617 | + | |
618 | + $this->campoNumero( | |
591 | 619 | 'notaMaximaExameFinal', |
592 | 620 | $this->_getLabel('notaMaximaExameFinal'), |
593 | 621 | $this->getEntity()->notaMaximaExameFinal, | ... | ... |
ieducar/modules/RegraAvaliacao/Views/ViewController.php
... | ... | @@ -36,6 +36,8 @@ class ViewController extends Core_Controller_Page_ViewController |
36 | 36 | 'Recuperação paralela' => 'tipoRecuperacaoParalela', |
37 | 37 | 'Nota máxima' => 'notaMaximaGeral', |
38 | 38 | 'Nota mínima' => 'notaMinimaGeral', |
39 | + 'Falta máxima' => 'faltaMaximaGeral', | |
40 | + 'Falta mínima' => 'faltaMinimaGeral', | |
39 | 41 | 'Nota máxima para exame final' => 'notaMaximaExameFinal', |
40 | 42 | 'Número máximo de casas decimais' => 'qtdCasasDecimais', |
41 | 43 | ]; | ... | ... |