Commit bcbadc016b9b63046851091c510e4d79e57a0b8a

Authored by Lucas Schmoeller da Silva
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
ieducar/lib/Portabilis/Validator.php
@@ -106,6 +106,7 @@ class Portabilis_Validator { @@ -106,6 +106,7 @@ class Portabilis_Validator {
106 106
107 107
108 public function validatesValueInSetOf(&$value, $setExpectedValues, $name, $raiseExceptionOnFail = false, $msg = ''){ 108 public function validatesValueInSetOf(&$value, $setExpectedValues, $name, $raiseExceptionOnFail = false, $msg = ''){
  109 + /*** REVER
109 if (! empty($setExpectedValues) && ! in_array($value, $setExpectedValues)){ 110 if (! empty($setExpectedValues) && ! in_array($value, $setExpectedValues)){
110 $msg = empty($msg) ? "Valor recebido na variavel '$name' é invalido" : $msg; 111 $msg = empty($msg) ? "Valor recebido na variavel '$name' é invalido" : $msg;
111 $this->messenger->append($msg); 112 $this->messenger->append($msg);
@@ -114,7 +115,7 @@ class Portabilis_Validator { @@ -114,7 +115,7 @@ class Portabilis_Validator {
114 throw new CoreExt_Exception($msg); 115 throw new CoreExt_Exception($msg);
115 116
116 return false; 117 return false;
117 - } 118 + }*/
118 119
119 return true; 120 return true;
120 } 121 }
ieducar/modules/Avaliacao/Views/DiarioApiController.php
@@ -62,8 +62,9 @@ class DiarioApiController extends ApiCoreController @@ -62,8 +62,9 @@ class DiarioApiController extends ApiCoreController
62 // post nota validations 62 // post nota validations
63 63
64 protected function validatesValueOfAttValueIsInOpcoesNotas() { 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,6 +111,7 @@ function validatesPresenseOfValueInRequiredFields(additionalFields, exceptFields
111 111
112 112
113 function validatesIfValueIsInSet(value, targetId, set) { 113 function validatesIfValueIsInSet(value, targetId, set) {
  114 +/*** REVER
114 if (objectUtils.length(set) > 0 && set[value] == undefined) { 115 if (objectUtils.length(set) > 0 && set[value] == undefined) {
115 var s = []; 116 var s = [];
116 117
@@ -122,9 +123,13 @@ function validatesIfValueIsInSet(value, targetId, set) { @@ -122,9 +123,13 @@ function validatesIfValueIsInSet(value, targetId, set) {
122 messageUtils.error('Informe um valor que pertença ao conjunto: ' + s.join(', '), targetId); 123 messageUtils.error('Informe um valor que pertença ao conjunto: ' + s.join(', '), targetId);
123 124
124 return false; 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
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 usado pelo metodos loadJavascript e loadStylesheet do helper Portabilis_View_Helper_Application */ 4 usado pelo metodos loadJavascript e loadStylesheet do helper Portabilis_View_Helper_Application */
5 5
6 class Portabilis_Assets_Version { 6 class Portabilis_Assets_Version {
7 - const VERSION = '2'; 7 + const VERSION = '3';
8 } 8 }
9 9
10 ?> 10 ?>
ieducar/modules/TabelaArredondamento/Model/Tabela.php
@@ -112,11 +112,11 @@ class TabelaArredondamento_Model_Tabela extends CoreExt_Entity @@ -112,11 +112,11 @@ class TabelaArredondamento_Model_Tabela extends CoreExt_Entity
112 */ 112 */
113 public function round($value) 113 public function round($value)
114 { 114 {
115 - if (0 > $value || 10 < $value) { 115 + /*if (0 > $value || 10 < $value) {
116 require_once 'CoreExt/Exception/InvalidArgumentException.php'; 116 require_once 'CoreExt/Exception/InvalidArgumentException.php';
117 throw new CoreExt_Exception_InvalidArgumentException('O valor para ' 117 throw new CoreExt_Exception_InvalidArgumentException('O valor para '
118 . 'arredondamento deve estar entre 0 e 10.'); 118 . 'arredondamento deve estar entre 0 e 10.');
119 - } 119 + }*/
120 120
121 /* Inicializa o retorno com o valor recebido (limitando a para uma casa decimal), 121 /* Inicializa o retorno com o valor recebido (limitando a para uma casa decimal),
122 o qual será retornado caso não tenha sido definido opcoes na tabela de arredondamento, 122 o qual será retornado caso não tenha sido definido opcoes na tabela de arredondamento,