Commit bcbadc016b9b63046851091c510e4d79e57a0b8a
1 parent
5c8a5265
Exists in
master
Alterado lançamento de notas
Foi alterado para permitir notas numéricas com qualquer variação decimal no lançamento de notas; portabilis/ieducar#39
Showing
5 changed files
with
16 additions
and
9 deletions
Show diff stats
ieducar/lib/Portabilis/Validator.php
| ... | ... | @@ -106,6 +106,7 @@ class Portabilis_Validator { |
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | public function validatesValueInSetOf(&$value, $setExpectedValues, $name, $raiseExceptionOnFail = false, $msg = ''){ |
| 109 | + /*** REVER | |
| 109 | 110 | if (! empty($setExpectedValues) && ! in_array($value, $setExpectedValues)){ |
| 110 | 111 | $msg = empty($msg) ? "Valor recebido na variavel '$name' é invalido" : $msg; |
| 111 | 112 | $this->messenger->append($msg); |
| ... | ... | @@ -114,7 +115,7 @@ class Portabilis_Validator { |
| 114 | 115 | throw new CoreExt_Exception($msg); |
| 115 | 116 | |
| 116 | 117 | return false; |
| 117 | - } | |
| 118 | + }*/ | |
| 118 | 119 | |
| 119 | 120 | return true; |
| 120 | 121 | } | ... | ... |
ieducar/modules/Avaliacao/Views/DiarioApiController.php
| ... | ... | @@ -62,8 +62,9 @@ class DiarioApiController extends ApiCoreController |
| 62 | 62 | // post nota validations |
| 63 | 63 | |
| 64 | 64 | protected function validatesValueOfAttValueIsInOpcoesNotas() { |
| 65 | - $expectedValues = array_keys($this->getOpcoesNotas()); | |
| 66 | - return $this->validator->validatesValueInSetOf($this->getRequest()->att_value, $expectedValues, 'att_value'); | |
| 65 | + //$expectedValues = array_keys($this->getOpcoesNotas()); | |
| 66 | + //return $this->validator->validatesValueInSetOf($this->getRequest()->att_value, $expectedValues, 'att_value'); | |
| 67 | + return true; | |
| 67 | 68 | } |
| 68 | 69 | |
| 69 | 70 | ... | ... |
ieducar/modules/Portabilis/Assets/Javascripts/Validator.js
| ... | ... | @@ -111,6 +111,7 @@ function validatesPresenseOfValueInRequiredFields(additionalFields, exceptFields |
| 111 | 111 | |
| 112 | 112 | |
| 113 | 113 | function validatesIfValueIsInSet(value, targetId, set) { |
| 114 | +/*** REVER | |
| 114 | 115 | if (objectUtils.length(set) > 0 && set[value] == undefined) { |
| 115 | 116 | var s = []; |
| 116 | 117 | |
| ... | ... | @@ -122,9 +123,13 @@ function validatesIfValueIsInSet(value, targetId, set) { |
| 122 | 123 | messageUtils.error('Informe um valor que pertença ao conjunto: ' + s.join(', '), targetId); |
| 123 | 124 | |
| 124 | 125 | return false; |
| 125 | - } | |
| 126 | - | |
| 127 | - return true; | |
| 126 | + }*/ | |
| 127 | + | |
| 128 | + if (value<0 || value>10){ | |
| 129 | + messageUtils.error('Informe um valor entre 0 à 10', targetId); | |
| 130 | + return false; | |
| 131 | + }else | |
| 132 | + return true; | |
| 128 | 133 | } |
| 129 | 134 | |
| 130 | 135 | ... | ... |
ieducar/modules/Portabilis/Assets/Version.php
ieducar/modules/TabelaArredondamento/Model/Tabela.php
| ... | ... | @@ -112,11 +112,11 @@ class TabelaArredondamento_Model_Tabela extends CoreExt_Entity |
| 112 | 112 | */ |
| 113 | 113 | public function round($value) |
| 114 | 114 | { |
| 115 | - if (0 > $value || 10 < $value) { | |
| 115 | + /*if (0 > $value || 10 < $value) { | |
| 116 | 116 | require_once 'CoreExt/Exception/InvalidArgumentException.php'; |
| 117 | 117 | throw new CoreExt_Exception_InvalidArgumentException('O valor para ' |
| 118 | 118 | . 'arredondamento deve estar entre 0 e 10.'); |
| 119 | - } | |
| 119 | + }*/ | |
| 120 | 120 | |
| 121 | 121 | /* Inicializa o retorno com o valor recebido (limitando a para uma casa decimal), |
| 122 | 122 | o qual será retornado caso não tenha sido definido opcoes na tabela de arredondamento, | ... | ... |