Commit 23835d69619d5eef2e61f6f0644797651e8cd2e7

Authored by Eder Soares
Committed by GitHub
2 parents d01959b6 00a459b8
Exists in 2.9 and in 7 other branches 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8

Merge pull request #675 from portabilis/portabilis-patch-2019-11-01

[2.2] Portabilis patch 01/11/2019
app/Extensions/Application.php 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +<?php
  2 +
  3 +namespace App\Extensions;
  4 +
  5 +use EderSoares\Laravel\PlugAndPlay\Foundation\PlugAndPlayPackages;
  6 +use Illuminate\Foundation\Application as LaravelApplication;
  7 +
  8 +class Application extends LaravelApplication
  9 +{
  10 + use PlugAndPlayPackages;
  11 +}
... ...
app/Models/LegacyAddress.php 0 → 100644
... ... @@ -0,0 +1,54 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +class LegacyAddress extends Model
  8 +{
  9 + /**
  10 + * @var string
  11 + */
  12 + protected $table = 'public.logradouro';
  13 +
  14 + /**
  15 + * @var string
  16 + */
  17 + protected $primaryKey = 'idlog';
  18 +
  19 + /**
  20 + * @var array
  21 + */
  22 + protected $fillable = [
  23 + 'idtlog',
  24 + 'nome',
  25 + 'idmun',
  26 + 'geom',
  27 + 'ident_oficial',
  28 + 'idpes_rev',
  29 + 'data_rev',
  30 + 'origem_gravacao',
  31 + 'idpes_cad',
  32 + 'data_cad',
  33 + 'operacao',
  34 + ];
  35 +
  36 + /**
  37 + * @var bool
  38 + */
  39 + public $timestamps = false;
  40 +
  41 + /**
  42 + * @inheritDoc
  43 + */
  44 + protected static function boot()
  45 + {
  46 + parent::boot();
  47 +
  48 + static::creating(function ($model) {
  49 + $model->origem_gravacao = 'M';
  50 + $model->data_cad = now();
  51 + $model->operacao = 'I';
  52 + });
  53 + }
  54 +}
... ...
app/Models/LegacyCity.php 0 → 100644
... ... @@ -0,0 +1,69 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +use Illuminate\Database\Eloquent\Relations\HasMany;
  7 +
  8 +class LegacyCity extends Model
  9 +{
  10 + /**
  11 + * @var string
  12 + */
  13 + protected $table = 'public.municipio';
  14 +
  15 + /**
  16 + * @var string
  17 + */
  18 + protected $primaryKey = 'idmun';
  19 +
  20 + /**
  21 + * @var array
  22 + */
  23 + protected $fillable = [
  24 + 'idmun',
  25 + 'nome',
  26 + 'sigla_uf',
  27 + 'area_km2',
  28 + 'idmreg',
  29 + 'idasmun',
  30 + 'cod_ibge',
  31 + 'geom',
  32 + 'tipo',
  33 + 'idmun_pai',
  34 + 'idpes_rev',
  35 + 'idpes_cad',
  36 + 'data_rev',
  37 + 'data_cad',
  38 + 'origem_gravacao',
  39 + 'operacao',
  40 + 'nome_limpo',
  41 + ];
  42 +
  43 + /**
  44 + * @var bool
  45 + */
  46 + public $timestamps = false;
  47 +
  48 + /**
  49 + * @inheritDoc
  50 + */
  51 + protected static function boot()
  52 + {
  53 + parent::boot();
  54 +
  55 + static::creating(function ($model) {
  56 + $model->origem_gravacao = 'M';
  57 + $model->data_cad = now();
  58 + $model->operacao = 'I';
  59 + });
  60 + }
  61 +
  62 + /**
  63 + * @return HasMany
  64 + */
  65 + public function districts()
  66 + {
  67 + return $this->hasMany(LegacyDistrict::class, 'idmun', 'idmun');
  68 + }
  69 +}
... ...
app/Models/LegacyDistrict.php 0 → 100644
... ... @@ -0,0 +1,57 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +class LegacyDistrict extends Model
  8 +{
  9 + /**
  10 + * @var string
  11 + */
  12 + protected $table = 'public.distrito';
  13 +
  14 + /**
  15 + * @var string
  16 + */
  17 + protected $primaryKey = 'iddis';
  18 +
  19 + /**
  20 + * @var array
  21 + */
  22 + protected $fillable = [
  23 + 'idmun',
  24 + 'geom',
  25 + 'iddis',
  26 + 'nome',
  27 + 'cod_ibge',
  28 + 'idpes_rev',
  29 + 'data_rev',
  30 + 'origem_gravacao',
  31 + 'idpes_cad',
  32 + 'data_cad',
  33 + 'operacao',
  34 + ];
  35 +
  36 + /**
  37 + * @var bool
  38 + */
  39 + public $timestamps = false;
  40 +
  41 + /**
  42 + * @inheritDoc
  43 + */
  44 + protected static function boot()
  45 + {
  46 + parent::boot();
  47 +
  48 + static::creating(function ($model) {
  49 + $district = LegacyDistrict::query()->whereKey($model->idmun)->first();
  50 +
  51 + $model->origem_gravacao = 'M';
  52 + $model->data_cad = now();
  53 + $model->operacao = 'I';
  54 + $model->iddis = $district->getKey();
  55 + });
  56 + }
  57 +}
... ...
app/Models/LegacyExternalAddress.php 0 → 100644
... ... @@ -0,0 +1,65 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +class LegacyExternalAddress extends Model
  8 +{
  9 + /**
  10 + * @var string
  11 + */
  12 + protected $table = 'cadastro.endereco_externo';
  13 +
  14 + /**
  15 + * @var string
  16 + */
  17 + protected $primaryKey = 'idpes';
  18 +
  19 + /**
  20 + * @var array
  21 + */
  22 + protected $fillable = [
  23 + 'idpes',
  24 + 'tipo',
  25 + 'idtlog',
  26 + 'logradouro',
  27 + 'numero',
  28 + 'letra',
  29 + 'complemento',
  30 + 'bairro',
  31 + 'cep',
  32 + 'cidade',
  33 + 'sigla_uf',
  34 + 'reside_desde',
  35 + 'idpes_rev',
  36 + 'data_rev',
  37 + 'origem_gravacao',
  38 + 'idpes_cad',
  39 + 'data_cad',
  40 + 'operacao',
  41 + 'bloco',
  42 + 'andar',
  43 + 'apartamento',
  44 + 'zona_localizacao',
  45 + ];
  46 +
  47 + /**
  48 + * @var bool
  49 + */
  50 + public $timestamps = false;
  51 +
  52 + /**
  53 + * @inheritDoc
  54 + */
  55 + protected static function boot()
  56 + {
  57 + parent::boot();
  58 +
  59 + static::creating(function ($model) {
  60 + $model->data_cad = now();
  61 + $model->origem_gravacao = 'M';
  62 + $model->operacao = 'I';
  63 + });
  64 + }
  65 +}
... ...
app/Models/LegacyIndividual.php
... ... @@ -2,6 +2,7 @@
2 2  
3 3 namespace App\Models;
4 4  
  5 +use Illuminate\Database\Eloquent\Relations\BelongsTo;
5 6 use Prettus\Repository\Contracts\Transformable;
6 7 use Prettus\Repository\Traits\TransformableTrait;
7 8  
... ... @@ -28,11 +29,97 @@ class LegacyIndividual extends EloquentBaseModel implements Transformable
28 29 * @var array
29 30 */
30 31 protected $fillable = [
31   - 'idpes', 'data_cad', 'operacao', 'origem_gravacao',
  32 + 'idpes',
  33 + 'data_nasc',
  34 + 'sexo',
  35 + 'idpes_mae',
  36 + 'idpes_pai',
  37 + 'idpes_responsavel',
  38 + 'idesco',
  39 + 'ideciv',
  40 + 'idpes_con',
  41 + 'data_uniao',
  42 + 'data_obito',
  43 + 'nacionalidade',
  44 + 'idpais_estrangeiro',
  45 + 'data_chegada_brasil',
  46 + 'idmun_nascimento',
  47 + 'ultima_empresa',
  48 + 'idocup',
  49 + 'nome_mae',
  50 + 'nome_pai',
  51 + 'nome_conjuge',
  52 + 'nome_responsavel',
  53 + 'justificativa_provisorio',
  54 + 'idpes_rev',
  55 + 'data_rev',
  56 + 'origem_gravacao',
  57 + 'idpes_cad',
  58 + 'data_cad',
  59 + 'operacao',
  60 + 'ref_cod_sistema',
  61 + 'cpf',
  62 + 'ref_cod_religiao',
  63 + 'nis_pis_pasep',
  64 + 'sus',
  65 + 'ocupacao',
  66 + 'empresa',
  67 + 'pessoa_contato',
  68 + 'renda_mensal',
  69 + 'data_admissao',
  70 + 'ddd_telefone_empresa',
  71 + 'telefone_empresa',
  72 + 'falecido',
  73 + 'ativo',
  74 + 'ref_usuario_exc',
  75 + 'data_exclusao',
  76 + 'zona_localizacao_censo',
  77 + 'tipo_trabalho',
  78 + 'local_trabalho',
  79 + 'horario_inicial_trabalho',
  80 + 'horario_final_trabalho',
  81 + 'nome_social',
  82 + 'pais_residencia',
  83 + 'localizacao_diferenciada',
32 84 ];
33 85  
34 86 /**
35 87 * @var bool
36 88 */
37 89 public $timestamps = false;
  90 +
  91 + /**
  92 + * @inheritDoc
  93 + */
  94 + protected static function boot()
  95 + {
  96 + parent::boot();
  97 +
  98 + static::creating(function ($model) {
  99 + $model->data_cad = now();
  100 + $model->origem_gravacao = 'M';
  101 + $model->operacao = 'I';
  102 + });
  103 + }
  104 +
  105 + /**
  106 + * @return BelongsTo
  107 + */
  108 + public function person()
  109 + {
  110 + return $this->belongsTo(LegacyPerson::class, 'idpes', 'idpes');
  111 + }
  112 +
  113 + /**
  114 + * @param string $cpf
  115 + *
  116 + * @return $this
  117 + */
  118 + public static function findByCpf($cpf)
  119 + {
  120 + $cpf = preg_replace('/[^0-9]/', '', $cpf);
  121 + $cpf = intval($cpf);
  122 +
  123 + return static::query()->where('cpf', $cpf)->first();
  124 + }
38 125 }
... ...
app/Models/LegacyMaritalStatus.php 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +class LegacyMaritalStatus extends Model
  8 +{
  9 + /**
  10 + * @var string
  11 + */
  12 + protected $table = 'cadastro.estado_civil';
  13 +
  14 + /**
  15 + * @var string
  16 + */
  17 + protected $primaryKey = 'ideciv';
  18 +
  19 + /**
  20 + * @var array
  21 + */
  22 + protected $fillable = [
  23 + 'descricao',
  24 + ];
  25 +
  26 + /**
  27 + * @var bool
  28 + */
  29 + public $timestamps = false;
  30 +}
... ...
app/Models/LegacyNeighborhood.php 0 → 100644
... ... @@ -0,0 +1,56 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +class LegacyNeighborhood extends Model
  8 +{
  9 + /**
  10 + * @var string
  11 + */
  12 + protected $table = 'public.bairro';
  13 +
  14 + /**
  15 + * @var string
  16 + */
  17 + protected $primaryKey = 'idbai';
  18 +
  19 + /**
  20 + * @var array
  21 + */
  22 + protected $fillable = [
  23 + 'idmun',
  24 + 'geom',
  25 + 'idbai',
  26 + 'nome',
  27 + 'idpes_rev',
  28 + 'data_rev',
  29 + 'origem_gravacao',
  30 + 'idpes_cad',
  31 + 'data_cad',
  32 + 'operacao',
  33 + 'zona_localizacao',
  34 + 'iddis',
  35 + 'idsetorbai',
  36 + ];
  37 +
  38 + /**
  39 + * @var bool
  40 + */
  41 + public $timestamps = false;
  42 +
  43 + /**
  44 + * @inheritDoc
  45 + */
  46 + protected static function boot()
  47 + {
  48 + parent::boot();
  49 +
  50 + static::creating(function ($model) {
  51 + $model->origem_gravacao = 'M';
  52 + $model->data_cad = now();
  53 + $model->operacao = 'I';
  54 + });
  55 + }
  56 +}
... ...
app/Models/LegacyPerson.php
... ... @@ -35,6 +35,21 @@ class LegacyPerson extends EloquentBaseModel implements Transformable
35 35 public $timestamps = false;
36 36  
37 37 /**
  38 + * @inheritDoc
  39 + */
  40 + protected static function boot()
  41 + {
  42 + parent::boot();
  43 +
  44 + static::creating(function ($model) {
  45 + $model->data_cad = now();
  46 + $model->situacao = 'I';
  47 + $model->origem_gravacao = 'M';
  48 + $model->operacao = 'I';
  49 + });
  50 + }
  51 +
  52 + /**
38 53 * @return string
39 54 */
40 55 public function getNameAttribute()
... ...
app/Models/LegacyPersonAddress.php 0 → 100644
... ... @@ -0,0 +1,62 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +class LegacyPersonAddress extends Model
  8 +{
  9 + /**
  10 + * @var string
  11 + */
  12 + protected $table = 'cadastro.endereco_pessoa';
  13 +
  14 + /**
  15 + * @var string
  16 + */
  17 + protected $primaryKey = 'idpes';
  18 +
  19 + /**
  20 + * @var array
  21 + */
  22 + protected $fillable = [
  23 + 'idpes',
  24 + 'tipo',
  25 + 'cep',
  26 + 'idlog',
  27 + 'numero',
  28 + 'letra',
  29 + 'complemento',
  30 + 'reside_desde',
  31 + 'idbai',
  32 + 'idpes_rev',
  33 + 'data_rev',
  34 + 'origem_gravacao',
  35 + 'idpes_cad',
  36 + 'data_cad',
  37 + 'operacao',
  38 + 'bloco',
  39 + 'andar',
  40 + 'apartamento',
  41 + 'observacoes',
  42 + ];
  43 +
  44 + /**
  45 + * @var bool
  46 + */
  47 + public $timestamps = false;
  48 +
  49 + /**
  50 + * @inheritDoc
  51 + */
  52 + protected static function boot()
  53 + {
  54 + parent::boot();
  55 +
  56 + static::creating(function ($model) {
  57 + $model->origem_gravacao = 'M';
  58 + $model->data_cad = now();
  59 + $model->operacao = 'I';
  60 + });
  61 + }
  62 +}
... ...
app/Models/LegacyPhone.php 0 → 100644
... ... @@ -0,0 +1,53 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +class LegacyPhone extends Model
  8 +{
  9 + /**
  10 + * @var string
  11 + */
  12 + protected $table = 'cadastro.fone_pessoa';
  13 +
  14 + /**
  15 + * @var string
  16 + */
  17 + protected $primaryKey = 'idpes';
  18 +
  19 + /**
  20 + * @var array
  21 + */
  22 + protected $fillable = [
  23 + 'idpes',
  24 + 'tipo',
  25 + 'ddd',
  26 + 'fone',
  27 + 'idpes_rev',
  28 + 'data_rev',
  29 + 'origem_gravacao',
  30 + 'idpes_cad',
  31 + 'data_cad',
  32 + 'operacao',
  33 + ];
  34 +
  35 + /**
  36 + * @var bool
  37 + */
  38 + public $timestamps = false;
  39 +
  40 + /**
  41 + * @inheritDoc
  42 + */
  43 + protected static function boot()
  44 + {
  45 + parent::boot();
  46 +
  47 + static::creating(function ($model) {
  48 + $model->origem_gravacao = 'M';
  49 + $model->data_cad = now();
  50 + $model->operacao = 'I';
  51 + });
  52 + }
  53 +}
... ...
app/Models/LegacyPostalCodeAddress.php 0 → 100644
... ... @@ -0,0 +1,53 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +class LegacyPostalCodeAddress extends Model
  8 +{
  9 + /**
  10 + * @var string
  11 + */
  12 + protected $table = 'urbano.cep_logradouro';
  13 +
  14 + /**
  15 + * @var string
  16 + */
  17 + protected $primaryKey = 'idlog';
  18 +
  19 + /**
  20 + * @var array
  21 + */
  22 + protected $fillable = [
  23 + 'cep',
  24 + 'idlog',
  25 + 'nroini',
  26 + 'nrofin',
  27 + 'idpes_rev',
  28 + 'data_rev',
  29 + 'origem_gravacao',
  30 + 'idpes_cad',
  31 + 'data_cad',
  32 + 'operacao',
  33 + ];
  34 +
  35 + /**
  36 + * @var bool
  37 + */
  38 + public $timestamps = false;
  39 +
  40 + /**
  41 + * @inheritDoc
  42 + */
  43 + protected static function boot()
  44 + {
  45 + parent::boot();
  46 +
  47 + static::creating(function ($model) {
  48 + $model->origem_gravacao = 'M';
  49 + $model->data_cad = now();
  50 + $model->operacao = 'I';
  51 + });
  52 + }
  53 +}
... ...
app/Models/LegacyPostalCodeAddressNeighborhood.php 0 → 100644
... ... @@ -0,0 +1,52 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +class LegacyPostalCodeAddressNeighborhood extends Model
  8 +{
  9 + /**
  10 + * @var string
  11 + */
  12 + protected $table = 'urbano.cep_logradouro_bairro';
  13 +
  14 + /**
  15 + * @var string
  16 + */
  17 + protected $primaryKey = 'idlog';
  18 +
  19 + /**
  20 + * @var array
  21 + */
  22 + protected $fillable = [
  23 + 'idlog',
  24 + 'cep',
  25 + 'idbai',
  26 + 'idpes_rev',
  27 + 'data_rev',
  28 + 'origem_gravacao',
  29 + 'idpes_cad',
  30 + 'data_cad',
  31 + 'operacao',
  32 + ];
  33 +
  34 + /**
  35 + * @var bool
  36 + */
  37 + public $timestamps = false;
  38 +
  39 + /**
  40 + * @inheritDoc
  41 + */
  42 + protected static function boot()
  43 + {
  44 + parent::boot();
  45 +
  46 + static::creating(function ($model) {
  47 + $model->origem_gravacao = 'M';
  48 + $model->data_cad = now();
  49 + $model->operacao = 'I';
  50 + });
  51 + }
  52 +}
... ...
app/Models/LegacySchool.php
... ... @@ -92,4 +92,17 @@ class LegacySchool extends Model
92 92 {
93 93 return DB::selectOne('SELECT relatorio.get_nome_escola(:escola) AS nome', ['escola' => $this->id])->nome;
94 94 }
  95 +
  96 + /**
  97 + * @return BelongsToMany
  98 + */
  99 + public function grades()
  100 + {
  101 + return $this->belongsToMany(
  102 + LegacyLevel::class,
  103 + 'pmieducar.escola_serie',
  104 + 'ref_cod_escola',
  105 + 'ref_cod_serie'
  106 + )->withPivot('ativo', 'anos_letivos');
  107 + }
95 108 }
... ...
app/Models/LegacyStudent.php
... ... @@ -21,7 +21,7 @@ class LegacyStudent extends Model
21 21 * @var array
22 22 */
23 23 protected $fillable = [
24   - 'ref_idpes', 'data_cadastro',
  24 + 'ref_idpes', 'data_cadastro', 'tipo_responsavel',
25 25 ];
26 26  
27 27 /**
... ... @@ -30,6 +30,26 @@ class LegacyStudent extends Model
30 30 public $timestamps = false;
31 31  
32 32 /**
  33 + * @inheritDoc
  34 + */
  35 + protected static function boot()
  36 + {
  37 + parent::boot();
  38 +
  39 + static::creating(function ($model) {
  40 + $model->data_cadastro = now();
  41 + });
  42 + }
  43 +
  44 + /**
  45 + * @return BelongsTo
  46 + */
  47 + public function individual()
  48 + {
  49 + return $this->belongsTo(LegacyIndividual::class, 'ref_idpes');
  50 + }
  51 +
  52 + /**
33 53 * @return BelongsTo
34 54 */
35 55 public function person()
... ...
app/Models/LegacyVacancyReservationCandidate.php 0 → 100644
... ... @@ -0,0 +1,59 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +class LegacyVacancyReservationCandidate extends Model
  8 +{
  9 + /**
  10 + * @var string
  11 + */
  12 + protected $table = 'pmieducar.candidato_reserva_vaga';
  13 +
  14 + /**
  15 + * @var string
  16 + */
  17 + protected $primaryKey = 'cod_candidato_reserva_vaga';
  18 +
  19 + /**
  20 + * @var array
  21 + */
  22 + protected $fillable = [
  23 + 'ano_letivo',
  24 + 'data_solicitacao',
  25 + 'ref_cod_aluno',
  26 + 'ref_cod_serie',
  27 + 'ref_cod_turno',
  28 + 'ref_cod_pessoa_cad',
  29 + 'data_cad',
  30 + 'data_update',
  31 + 'ref_cod_matricula',
  32 + 'situacao',
  33 + 'data_situacao',
  34 + 'motivo',
  35 + 'ref_cod_escola',
  36 + 'quantidade_membros',
  37 + 'mae_fez_pre_natal',
  38 + 'membros_trabalham',
  39 + 'hora_solicitacao',
  40 + ];
  41 +
  42 + /**
  43 + * @var bool
  44 + */
  45 + public $timestamps = false;
  46 +
  47 + /**
  48 + * @inheritDoc
  49 + */
  50 + protected static function boot()
  51 + {
  52 + parent::boot();
  53 +
  54 + static::creating(function ($model) {
  55 + $model->data_situacao = now()->format('Y-m-d');
  56 + $model->hora_solicitacao = now()->format('H:i:s');
  57 + });
  58 + }
  59 +}
... ...
app/Process.php
... ... @@ -15,9 +15,11 @@ class Process
15 15  
16 16 const CONSULTAS = 9998890;
17 17  
  18 + const REGISTRATIONS = 578;
18 19 const ENROLLMENT_HISTORY = 1001;
19 20 const ATTENDED_CANDIDATE = 1002;
20 21 const BACK_TO_QUEUE = 1003;
  22 + const RECLASSIFY_REGISTRATION = 1004;
21 23 const UNDO_STUDENT_UNIFICATION = 2001;
22 24 const EXEMPTION_LIST = 2002;
23 25 }
... ...
app/Services/iDiarioService.php
... ... @@ -55,10 +55,14 @@ class iDiarioService
55 55 *
56 56 * @return bool
57 57 */
58   - public function getStepActivityByUnit(int $unitId, int $step): bool
  58 + public function getStepActivityByUnit(int $unitId, int $year, int $step): bool
59 59 {
60 60 try {
61   - $response = $this->get('/api/v2/step_activity', ['unity_id' => $unitId, 'step_number' => $step]);
  61 + $response = $this->get('/api/v2/step_activity', [
  62 + 'unity_id' => $unitId,
  63 + 'year' => $year,
  64 + 'step_number' => $step
  65 + ]);
62 66 $body = trim((string)$response->getBody());
63 67  
64 68 if ($body === 'true') {
... ... @@ -77,10 +81,14 @@ class iDiarioService
77 81 *
78 82 * @return bool
79 83 */
80   - public function getStepActivityByClassroom(int $classroomId, int $step): bool
  84 + public function getStepActivityByClassroom(int $classroomId, int $year, int $step): bool
81 85 {
82 86 try {
83   - $response = $this->get('/api/v2/step_activity', ['classroom_id' => $classroomId, 'step_number' => $step]);
  87 + $response = $this->get('/api/v2/step_activity', [
  88 + 'classroom_id' => $classroomId,
  89 + 'year' => $year,
  90 + 'step_number' => $step
  91 + ]);
84 92 $body = trim((string)$response->getBody());
85 93  
86 94 if ($body === 'true') {
... ...
bootstrap/app.php
... ... @@ -11,7 +11,7 @@
11 11 |
12 12 */
13 13  
14   -$app = new Illuminate\Foundation\Application(
  14 +$app = new App\Extensions\Application(
15 15 $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
16 16 );
17 17  
... ...
composer.json
... ... @@ -3,7 +3,7 @@
3 3 "description": "Software livre de gestão escolar",
4 4 "type": "project",
5 5 "license": "GPL-2.0-or-later",
6   - "version": "2.2.11",
  6 + "version": "2.2.12",
7 7 "keywords": [
8 8 "Portabilis",
9 9 "i-Educar"
... ... @@ -18,20 +18,21 @@
18 18 "composer/semver": "^1.4",
19 19 "cossou/jasperphp": "^2.7",
20 20 "doctrine/dbal": "^2.9",
  21 + "edersoares/laravel-plug-and-play": "^1.0",
21 22 "fideloper/proxy": "^4.0",
22 23 "google/recaptcha": "^1.2",
23 24 "guzzlehttp/guzzle": "^6.3",
24 25 "honeybadger-io/honeybadger-laravel": "^1.4",
25 26 "laravel/framework": "5.8.*",
26 27 "laravel/tinker": "^1.0",
  28 + "league/flysystem-aws-s3-v3": "~1.0",
  29 + "league/flysystem-cached-adapter": "~1.0",
27 30 "maatwebsite/excel": "^3.1",
28 31 "phpoffice/phpspreadsheet": "^1.6",
29 32 "predis/predis": "^1.1",
30 33 "prettus/l5-repository": "^2.6",
31 34 "swiftmailer/swiftmailer": "^6.1",
32   - "tooleks/laravel-asset-version": "^1.0",
33   - "league/flysystem-aws-s3-v3": "~1.0",
34   - "league/flysystem-cached-adapter": "~1.0"
  35 + "tooleks/laravel-asset-version": "^1.0"
35 36 },
36 37 "require-dev": {
37 38 "barryvdh/laravel-debugbar": "^3.2",
... ... @@ -81,6 +82,11 @@
81 82 "laravel/telescope",
82 83 "barryvdh/laravel-debugbar"
83 84 ]
  85 + },
  86 + "merge-plugin": {
  87 + "include": [
  88 + "packages/*/*/composer.json"
  89 + ]
84 90 }
85 91 },
86 92 "scripts": {
... ...
composer.lock
... ... @@ -4,20 +4,20 @@
4 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 5 "This file is @generated automatically"
6 6 ],
7   - "content-hash": "67141df1d8ac1c6225bdf16215518566",
  7 + "content-hash": "d6cb1d689a9141f98c1f92269dbfc7b9",
8 8 "packages": [
9 9 {
10 10 "name": "aws/aws-sdk-php",
11   - "version": "3.112.28",
  11 + "version": "3.112.34",
12 12 "source": {
13 13 "type": "git",
14 14 "url": "https://github.com/aws/aws-sdk-php.git",
15   - "reference": "dabae6df3fd53b470da8806d641d05dbb66859da"
  15 + "reference": "5918919b64550f7436a01738ea49e56703c83799"
16 16 },
17 17 "dist": {
18 18 "type": "zip",
19   - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/dabae6df3fd53b470da8806d641d05dbb66859da",
20   - "reference": "dabae6df3fd53b470da8806d641d05dbb66859da",
  19 + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5918919b64550f7436a01738ea49e56703c83799",
  20 + "reference": "5918919b64550f7436a01738ea49e56703c83799",
21 21 "shasum": ""
22 22 },
23 23 "require": {
... ... @@ -87,7 +87,7 @@
87 87 "s3",
88 88 "sdk"
89 89 ],
90   - "time": "2019-10-24T18:14:24+00:00"
  90 + "time": "2019-11-01T18:08:35+00:00"
91 91 },
92 92 {
93 93 "name": "cocur/slugify",
... ... @@ -292,16 +292,16 @@
292 292 },
293 293 {
294 294 "name": "doctrine/cache",
295   - "version": "v1.8.0",
  295 + "version": "v1.8.1",
296 296 "source": {
297 297 "type": "git",
298 298 "url": "https://github.com/doctrine/cache.git",
299   - "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57"
  299 + "reference": "d4374ae95b36062d02ef310100ed33d78738d76c"
300 300 },
301 301 "dist": {
302 302 "type": "zip",
303   - "url": "https://api.github.com/repos/doctrine/cache/zipball/d768d58baee9a4862ca783840eca1b9add7a7f57",
304   - "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57",
  303 + "url": "https://api.github.com/repos/doctrine/cache/zipball/d4374ae95b36062d02ef310100ed33d78738d76c",
  304 + "reference": "d4374ae95b36062d02ef310100ed33d78738d76c",
305 305 "shasum": ""
306 306 },
307 307 "require": {
... ... @@ -337,6 +337,10 @@
337 337 ],
338 338 "authors": [
339 339 {
  340 + "name": "Guilherme Blanco",
  341 + "email": "guilhermeblanco@gmail.com"
  342 + },
  343 + {
340 344 "name": "Roman Borschel",
341 345 "email": "roman@code-factory.org"
342 346 },
... ... @@ -345,10 +349,6 @@
345 349 "email": "kontakt@beberlei.de"
346 350 },
347 351 {
348   - "name": "Guilherme Blanco",
349   - "email": "guilhermeblanco@gmail.com"
350   - },
351   - {
352 352 "name": "Jonathan Wage",
353 353 "email": "jonwage@gmail.com"
354 354 },
... ... @@ -363,7 +363,7 @@
363 363 "cache",
364 364 "caching"
365 365 ],
366   - "time": "2018-08-21T18:01:43+00:00"
  366 + "time": "2019-10-28T09:31:32+00:00"
367 367 },
368 368 {
369 369 "name": "doctrine/dbal",
... ... @@ -705,6 +705,57 @@
705 705 "time": "2019-03-31T00:38:28+00:00"
706 706 },
707 707 {
  708 + "name": "edersoares/laravel-plug-and-play",
  709 + "version": "1.0.0",
  710 + "source": {
  711 + "type": "git",
  712 + "url": "https://github.com/edersoares/laravel-plug-and-play.git",
  713 + "reference": "80e07938a0cc06e4dbf79a7cd0d533109cd31c70"
  714 + },
  715 + "dist": {
  716 + "type": "zip",
  717 + "url": "https://api.github.com/repos/edersoares/laravel-plug-and-play/zipball/80e07938a0cc06e4dbf79a7cd0d533109cd31c70",
  718 + "reference": "80e07938a0cc06e4dbf79a7cd0d533109cd31c70",
  719 + "shasum": ""
  720 + },
  721 + "require": {
  722 + "composer-plugin-api": "^1.1",
  723 + "ext-json": "*",
  724 + "laravel/framework": "~5.5|~6",
  725 + "php": ">=7.0.0",
  726 + "wikimedia/composer-merge-plugin": "^1.4"
  727 + },
  728 + "type": "composer-plugin",
  729 + "extra": {
  730 + "branch-alias": [],
  731 + "class": "Wikimedia\\Composer\\MergePlugin",
  732 + "laravel": {
  733 + "providers": [
  734 + "EderSoares\\Laravel\\PlugAndPlay\\PlugAndPlayServiceProvider"
  735 + ]
  736 + }
  737 + },
  738 + "autoload": {
  739 + "psr-4": {
  740 + "EderSoares\\Laravel\\PlugAndPlay\\": "src/"
  741 + }
  742 + },
  743 + "notification-url": "https://packagist.org/downloads/",
  744 + "license": [
  745 + "MIT"
  746 + ],
  747 + "authors": [
  748 + {
  749 + "name": "Eder Soares",
  750 + "email": "edersoares@me.com",
  751 + "homepage": "https://edersoares.me",
  752 + "role": "Developer"
  753 + }
  754 + ],
  755 + "description": "Plug and play packages in Laravel",
  756 + "time": "2019-10-22T02:54:46+00:00"
  757 + },
  758 + {
708 759 "name": "egulias/email-validator",
709 760 "version": "2.1.11",
710 761 "source": {
... ... @@ -2133,16 +2184,16 @@
2133 2184 },
2134 2185 {
2135 2186 "name": "nikic/php-parser",
2136   - "version": "v4.2.4",
  2187 + "version": "v4.2.5",
2137 2188 "source": {
2138 2189 "type": "git",
2139 2190 "url": "https://github.com/nikic/PHP-Parser.git",
2140   - "reference": "97e59c7a16464196a8b9c77c47df68e4a39a45c4"
  2191 + "reference": "b76bbc3c51f22c570648de48e8c2d941ed5e2cf2"
2141 2192 },
2142 2193 "dist": {
2143 2194 "type": "zip",
2144   - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/97e59c7a16464196a8b9c77c47df68e4a39a45c4",
2145   - "reference": "97e59c7a16464196a8b9c77c47df68e4a39a45c4",
  2195 + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/b76bbc3c51f22c570648de48e8c2d941ed5e2cf2",
  2196 + "reference": "b76bbc3c51f22c570648de48e8c2d941ed5e2cf2",
2146 2197 "shasum": ""
2147 2198 },
2148 2199 "require": {
... ... @@ -2150,6 +2201,7 @@
2150 2201 "php": ">=7.0"
2151 2202 },
2152 2203 "require-dev": {
  2204 + "ircmaxell/php-yacc": "0.0.4",
2153 2205 "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0"
2154 2206 },
2155 2207 "bin": [
... ... @@ -2180,7 +2232,7 @@
2180 2232 "parser",
2181 2233 "php"
2182 2234 ],
2183   - "time": "2019-09-01T07:51:21+00:00"
  2235 + "time": "2019-10-25T18:33:07+00:00"
2184 2236 },
2185 2237 {
2186 2238 "name": "opis/closure",
... ... @@ -2736,16 +2788,16 @@
2736 2788 },
2737 2789 {
2738 2790 "name": "psr/log",
2739   - "version": "1.1.1",
  2791 + "version": "1.1.2",
2740 2792 "source": {
2741 2793 "type": "git",
2742 2794 "url": "https://github.com/php-fig/log.git",
2743   - "reference": "bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2"
  2795 + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801"
2744 2796 },
2745 2797 "dist": {
2746 2798 "type": "zip",
2747   - "url": "https://api.github.com/repos/php-fig/log/zipball/bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2",
2748   - "reference": "bf73deb2b3b896a9d9c75f3f0d88185d2faa27e2",
  2799 + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801",
  2800 + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801",
2749 2801 "shasum": ""
2750 2802 },
2751 2803 "require": {
... ... @@ -2779,7 +2831,7 @@
2779 2831 "psr",
2780 2832 "psr-3"
2781 2833 ],
2782   - "time": "2019-10-25T08:06:51+00:00"
  2834 + "time": "2019-11-01T11:05:21+00:00"
2783 2835 },
2784 2836 {
2785 2837 "name": "psr/simple-cache",
... ... @@ -3139,16 +3191,16 @@
3139 3191 },
3140 3192 {
3141 3193 "name": "symfony/console",
3142   - "version": "v4.3.5",
  3194 + "version": "v4.3.6",
3143 3195 "source": {
3144 3196 "type": "git",
3145 3197 "url": "https://github.com/symfony/console.git",
3146   - "reference": "929ddf360d401b958f611d44e726094ab46a7369"
  3198 + "reference": "136c4bd62ea871d00843d1bc0316de4c4a84bb78"
3147 3199 },
3148 3200 "dist": {
3149 3201 "type": "zip",
3150   - "url": "https://api.github.com/repos/symfony/console/zipball/929ddf360d401b958f611d44e726094ab46a7369",
3151   - "reference": "929ddf360d401b958f611d44e726094ab46a7369",
  3202 + "url": "https://api.github.com/repos/symfony/console/zipball/136c4bd62ea871d00843d1bc0316de4c4a84bb78",
  3203 + "reference": "136c4bd62ea871d00843d1bc0316de4c4a84bb78",
3152 3204 "shasum": ""
3153 3205 },
3154 3206 "require": {
... ... @@ -3210,11 +3262,11 @@
3210 3262 ],
3211 3263 "description": "Symfony Console Component",
3212 3264 "homepage": "https://symfony.com",
3213   - "time": "2019-10-07T12:36:49+00:00"
  3265 + "time": "2019-10-30T12:58:49+00:00"
3214 3266 },
3215 3267 {
3216 3268 "name": "symfony/css-selector",
3217   - "version": "v4.3.5",
  3269 + "version": "v4.3.6",
3218 3270 "source": {
3219 3271 "type": "git",
3220 3272 "url": "https://github.com/symfony/css-selector.git",
... ... @@ -3267,16 +3319,16 @@
3267 3319 },
3268 3320 {
3269 3321 "name": "symfony/debug",
3270   - "version": "v4.3.5",
  3322 + "version": "v4.3.6",
3271 3323 "source": {
3272 3324 "type": "git",
3273 3325 "url": "https://github.com/symfony/debug.git",
3274   - "reference": "cc5c1efd0edfcfd10b354750594a46b3dd2afbbe"
  3326 + "reference": "5ea9c3e01989a86ceaa0283f21234b12deadf5e2"
3275 3327 },
3276 3328 "dist": {
3277 3329 "type": "zip",
3278   - "url": "https://api.github.com/repos/symfony/debug/zipball/cc5c1efd0edfcfd10b354750594a46b3dd2afbbe",
3279   - "reference": "cc5c1efd0edfcfd10b354750594a46b3dd2afbbe",
  3330 + "url": "https://api.github.com/repos/symfony/debug/zipball/5ea9c3e01989a86ceaa0283f21234b12deadf5e2",
  3331 + "reference": "5ea9c3e01989a86ceaa0283f21234b12deadf5e2",
3280 3332 "shasum": ""
3281 3333 },
3282 3334 "require": {
... ... @@ -3319,11 +3371,11 @@
3319 3371 ],
3320 3372 "description": "Symfony Debug Component",
3321 3373 "homepage": "https://symfony.com",
3322   - "time": "2019-09-19T15:51:53+00:00"
  3374 + "time": "2019-10-28T17:07:32+00:00"
3323 3375 },
3324 3376 {
3325 3377 "name": "symfony/event-dispatcher",
3326   - "version": "v4.3.5",
  3378 + "version": "v4.3.6",
3327 3379 "source": {
3328 3380 "type": "git",
3329 3381 "url": "https://github.com/symfony/event-dispatcher.git",
... ... @@ -3451,16 +3503,16 @@
3451 3503 },
3452 3504 {
3453 3505 "name": "symfony/finder",
3454   - "version": "v4.3.5",
  3506 + "version": "v4.3.6",
3455 3507 "source": {
3456 3508 "type": "git",
3457 3509 "url": "https://github.com/symfony/finder.git",
3458   - "reference": "5e575faa95548d0586f6bedaeabec259714e44d1"
  3510 + "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f"
3459 3511 },
3460 3512 "dist": {
3461 3513 "type": "zip",
3462   - "url": "https://api.github.com/repos/symfony/finder/zipball/5e575faa95548d0586f6bedaeabec259714e44d1",
3463   - "reference": "5e575faa95548d0586f6bedaeabec259714e44d1",
  3514 + "url": "https://api.github.com/repos/symfony/finder/zipball/72a068f77e317ae77c0a0495236ad292cfb5ce6f",
  3515 + "reference": "72a068f77e317ae77c0a0495236ad292cfb5ce6f",
3464 3516 "shasum": ""
3465 3517 },
3466 3518 "require": {
... ... @@ -3496,20 +3548,20 @@
3496 3548 ],
3497 3549 "description": "Symfony Finder Component",
3498 3550 "homepage": "https://symfony.com",
3499   - "time": "2019-09-16T11:29:48+00:00"
  3551 + "time": "2019-10-30T12:53:54+00:00"
3500 3552 },
3501 3553 {
3502 3554 "name": "symfony/http-foundation",
3503   - "version": "v4.3.5",
  3555 + "version": "v4.3.6",
3504 3556 "source": {
3505 3557 "type": "git",
3506 3558 "url": "https://github.com/symfony/http-foundation.git",
3507   - "reference": "76590ced16d4674780863471bae10452b79210a5"
  3559 + "reference": "38f63e471cda9d37ac06e76d14c5ea2ec5887051"
3508 3560 },
3509 3561 "dist": {
3510 3562 "type": "zip",
3511   - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/76590ced16d4674780863471bae10452b79210a5",
3512   - "reference": "76590ced16d4674780863471bae10452b79210a5",
  3563 + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/38f63e471cda9d37ac06e76d14c5ea2ec5887051",
  3564 + "reference": "38f63e471cda9d37ac06e76d14c5ea2ec5887051",
3513 3565 "shasum": ""
3514 3566 },
3515 3567 "require": {
... ... @@ -3551,20 +3603,20 @@
3551 3603 ],
3552 3604 "description": "Symfony HttpFoundation Component",
3553 3605 "homepage": "https://symfony.com",
3554   - "time": "2019-10-04T19:48:13+00:00"
  3606 + "time": "2019-10-30T12:58:49+00:00"
3555 3607 },
3556 3608 {
3557 3609 "name": "symfony/http-kernel",
3558   - "version": "v4.3.5",
  3610 + "version": "v4.3.6",
3559 3611 "source": {
3560 3612 "type": "git",
3561 3613 "url": "https://github.com/symfony/http-kernel.git",
3562   - "reference": "5f08141850932e8019c01d8988bf3ed6367d2991"
  3614 + "reference": "56acfda9e734e8715b3b0e6859cdb4f5b28757bf"
3563 3615 },
3564 3616 "dist": {
3565 3617 "type": "zip",
3566   - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/5f08141850932e8019c01d8988bf3ed6367d2991",
3567   - "reference": "5f08141850932e8019c01d8988bf3ed6367d2991",
  3618 + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/56acfda9e734e8715b3b0e6859cdb4f5b28757bf",
  3619 + "reference": "56acfda9e734e8715b3b0e6859cdb4f5b28757bf",
3568 3620 "shasum": ""
3569 3621 },
3570 3622 "require": {
... ... @@ -3643,20 +3695,20 @@
3643 3695 ],
3644 3696 "description": "Symfony HttpKernel Component",
3645 3697 "homepage": "https://symfony.com",
3646   - "time": "2019-10-07T15:06:41+00:00"
  3698 + "time": "2019-11-01T10:00:03+00:00"
3647 3699 },
3648 3700 {
3649 3701 "name": "symfony/mime",
3650   - "version": "v4.3.5",
  3702 + "version": "v4.3.6",
3651 3703 "source": {
3652 3704 "type": "git",
3653 3705 "url": "https://github.com/symfony/mime.git",
3654   - "reference": "32f71570547b91879fdbd9cf50317d556ae86916"
  3706 + "reference": "3c0e197529da6e59b217615ba8ee7604df88b551"
3655 3707 },
3656 3708 "dist": {
3657 3709 "type": "zip",
3658   - "url": "https://api.github.com/repos/symfony/mime/zipball/32f71570547b91879fdbd9cf50317d556ae86916",
3659   - "reference": "32f71570547b91879fdbd9cf50317d556ae86916",
  3710 + "url": "https://api.github.com/repos/symfony/mime/zipball/3c0e197529da6e59b217615ba8ee7604df88b551",
  3711 + "reference": "3c0e197529da6e59b217615ba8ee7604df88b551",
3660 3712 "shasum": ""
3661 3713 },
3662 3714 "require": {
... ... @@ -3702,7 +3754,7 @@
3702 3754 "mime",
3703 3755 "mime-type"
3704 3756 ],
3705   - "time": "2019-09-19T17:00:15+00:00"
  3757 + "time": "2019-10-30T12:58:49+00:00"
3706 3758 },
3707 3759 {
3708 3760 "name": "symfony/polyfill-ctype",
... ... @@ -4057,16 +4109,16 @@
4057 4109 },
4058 4110 {
4059 4111 "name": "symfony/process",
4060   - "version": "v4.3.5",
  4112 + "version": "v4.3.6",
4061 4113 "source": {
4062 4114 "type": "git",
4063 4115 "url": "https://github.com/symfony/process.git",
4064   - "reference": "50556892f3cc47d4200bfd1075314139c4c9ff4b"
  4116 + "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0"
4065 4117 },
4066 4118 "dist": {
4067 4119 "type": "zip",
4068   - "url": "https://api.github.com/repos/symfony/process/zipball/50556892f3cc47d4200bfd1075314139c4c9ff4b",
4069   - "reference": "50556892f3cc47d4200bfd1075314139c4c9ff4b",
  4120 + "url": "https://api.github.com/repos/symfony/process/zipball/3b2e0cb029afbb0395034509291f21191d1a4db0",
  4121 + "reference": "3b2e0cb029afbb0395034509291f21191d1a4db0",
4070 4122 "shasum": ""
4071 4123 },
4072 4124 "require": {
... ... @@ -4102,20 +4154,20 @@
4102 4154 ],
4103 4155 "description": "Symfony Process Component",
4104 4156 "homepage": "https://symfony.com",
4105   - "time": "2019-09-26T21:17:10+00:00"
  4157 + "time": "2019-10-28T17:07:32+00:00"
4106 4158 },
4107 4159 {
4108 4160 "name": "symfony/routing",
4109   - "version": "v4.3.5",
  4161 + "version": "v4.3.6",
4110 4162 "source": {
4111 4163 "type": "git",
4112 4164 "url": "https://github.com/symfony/routing.git",
4113   - "reference": "3b174ef04fe66696524efad1e5f7a6c663d822ea"
  4165 + "reference": "63a9920cc86fcc745e5ea254e362f02b615290b9"
4114 4166 },
4115 4167 "dist": {
4116 4168 "type": "zip",
4117   - "url": "https://api.github.com/repos/symfony/routing/zipball/3b174ef04fe66696524efad1e5f7a6c663d822ea",
4118   - "reference": "3b174ef04fe66696524efad1e5f7a6c663d822ea",
  4169 + "url": "https://api.github.com/repos/symfony/routing/zipball/63a9920cc86fcc745e5ea254e362f02b615290b9",
  4170 + "reference": "63a9920cc86fcc745e5ea254e362f02b615290b9",
4119 4171 "shasum": ""
4120 4172 },
4121 4173 "require": {
... ... @@ -4178,7 +4230,7 @@
4178 4230 "uri",
4179 4231 "url"
4180 4232 ],
4181   - "time": "2019-10-04T20:57:10+00:00"
  4233 + "time": "2019-10-30T12:58:49+00:00"
4182 4234 },
4183 4235 {
4184 4236 "name": "symfony/service-contracts",
... ... @@ -4240,16 +4292,16 @@
4240 4292 },
4241 4293 {
4242 4294 "name": "symfony/translation",
4243   - "version": "v4.3.5",
  4295 + "version": "v4.3.6",
4244 4296 "source": {
4245 4297 "type": "git",
4246 4298 "url": "https://github.com/symfony/translation.git",
4247   - "reference": "fe6193b066c457c144333c06aaa869a2d42a167f"
  4299 + "reference": "a3aa590ce944afb3434d7a55f81b00927144d5ec"
4248 4300 },
4249 4301 "dist": {
4250 4302 "type": "zip",
4251   - "url": "https://api.github.com/repos/symfony/translation/zipball/fe6193b066c457c144333c06aaa869a2d42a167f",
4252   - "reference": "fe6193b066c457c144333c06aaa869a2d42a167f",
  4303 + "url": "https://api.github.com/repos/symfony/translation/zipball/a3aa590ce944afb3434d7a55f81b00927144d5ec",
  4304 + "reference": "a3aa590ce944afb3434d7a55f81b00927144d5ec",
4253 4305 "shasum": ""
4254 4306 },
4255 4307 "require": {
... ... @@ -4312,7 +4364,7 @@
4312 4364 ],
4313 4365 "description": "Symfony Translation Component",
4314 4366 "homepage": "https://symfony.com",
4315   - "time": "2019-09-27T14:37:39+00:00"
  4367 + "time": "2019-10-30T12:53:54+00:00"
4316 4368 },
4317 4369 {
4318 4370 "name": "symfony/translation-contracts",
... ... @@ -4373,16 +4425,16 @@
4373 4425 },
4374 4426 {
4375 4427 "name": "symfony/var-dumper",
4376   - "version": "v4.3.5",
  4428 + "version": "v4.3.6",
4377 4429 "source": {
4378 4430 "type": "git",
4379 4431 "url": "https://github.com/symfony/var-dumper.git",
4380   - "reference": "bde8957fc415fdc6964f33916a3755737744ff05"
  4432 + "reference": "ea4940845535c85ff5c505e13b3205b0076d07bf"
4381 4433 },
4382 4434 "dist": {
4383 4435 "type": "zip",
4384   - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/bde8957fc415fdc6964f33916a3755737744ff05",
4385   - "reference": "bde8957fc415fdc6964f33916a3755737744ff05",
  4436 + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ea4940845535c85ff5c505e13b3205b0076d07bf",
  4437 + "reference": "ea4940845535c85ff5c505e13b3205b0076d07bf",
4386 4438 "shasum": ""
4387 4439 },
4388 4440 "require": {
... ... @@ -4445,7 +4497,7 @@
4445 4497 "debug",
4446 4498 "dump"
4447 4499 ],
4448   - "time": "2019-10-04T19:48:13+00:00"
  4500 + "time": "2019-10-13T12:02:04+00:00"
4449 4501 },
4450 4502 {
4451 4503 "name": "tijsverkoyen/css-to-inline-styles",
... ... @@ -4603,6 +4655,55 @@
4603 4655 "environment"
4604 4656 ],
4605 4657 "time": "2019-09-10T21:37:39+00:00"
  4658 + },
  4659 + {
  4660 + "name": "wikimedia/composer-merge-plugin",
  4661 + "version": "v1.4.1",
  4662 + "source": {
  4663 + "type": "git",
  4664 + "url": "https://github.com/wikimedia/composer-merge-plugin.git",
  4665 + "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100"
  4666 + },
  4667 + "dist": {
  4668 + "type": "zip",
  4669 + "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/81c6ac72a24a67383419c7eb9aa2b3437f2ab100",
  4670 + "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100",
  4671 + "shasum": ""
  4672 + },
  4673 + "require": {
  4674 + "composer-plugin-api": "^1.0",
  4675 + "php": ">=5.3.2"
  4676 + },
  4677 + "require-dev": {
  4678 + "composer/composer": "~1.0.0",
  4679 + "jakub-onderka/php-parallel-lint": "~0.8",
  4680 + "phpunit/phpunit": "~4.8|~5.0",
  4681 + "squizlabs/php_codesniffer": "~2.1.0"
  4682 + },
  4683 + "type": "composer-plugin",
  4684 + "extra": {
  4685 + "branch-alias": {
  4686 + "dev-master": "1.3.x-dev"
  4687 + },
  4688 + "class": "Wikimedia\\Composer\\MergePlugin"
  4689 + },
  4690 + "autoload": {
  4691 + "psr-4": {
  4692 + "Wikimedia\\Composer\\": "src/"
  4693 + }
  4694 + },
  4695 + "notification-url": "https://packagist.org/downloads/",
  4696 + "license": [
  4697 + "MIT"
  4698 + ],
  4699 + "authors": [
  4700 + {
  4701 + "name": "Bryan Davis",
  4702 + "email": "bd808@wikimedia.org"
  4703 + }
  4704 + ],
  4705 + "description": "Composer plugin to merge multiple composer.json files",
  4706 + "time": "2017-04-25T02:31:25+00:00"
4606 4707 }
4607 4708 ],
4608 4709 "packages-dev": [
... ... @@ -5213,20 +5314,21 @@
5213 5314 },
5214 5315 {
5215 5316 "name": "laravel/dusk",
5216   - "version": "v5.5.2",
  5317 + "version": "v5.6.0",
5217 5318 "source": {
5218 5319 "type": "git",
5219 5320 "url": "https://github.com/laravel/dusk.git",
5220   - "reference": "aed755282a13a9b36d26854a0105d519aa22fec9"
  5321 + "reference": "db4f8d75b7c9acf88ef1712e9ccf51c15540934d"
5221 5322 },
5222 5323 "dist": {
5223 5324 "type": "zip",
5224   - "url": "https://api.github.com/repos/laravel/dusk/zipball/aed755282a13a9b36d26854a0105d519aa22fec9",
5225   - "reference": "aed755282a13a9b36d26854a0105d519aa22fec9",
  5325 + "url": "https://api.github.com/repos/laravel/dusk/zipball/db4f8d75b7c9acf88ef1712e9ccf51c15540934d",
  5326 + "reference": "db4f8d75b7c9acf88ef1712e9ccf51c15540934d",
5226 5327 "shasum": ""
5227 5328 },
5228 5329 "require": {
5229 5330 "ext-json": "*",
  5331 + "ext-pcntl": "*",
5230 5332 "ext-zip": "*",
5231 5333 "facebook/webdriver": "^1.7",
5232 5334 "illuminate/console": "~5.7.0|~5.8.0|^6.0|^7.0",
... ... @@ -5274,7 +5376,7 @@
5274 5376 "testing",
5275 5377 "webdriver"
5276 5378 ],
5277   - "time": "2019-09-24T20:30:07+00:00"
  5379 + "time": "2019-10-29T15:58:57+00:00"
5278 5380 },
5279 5381 {
5280 5382 "name": "laravel/telescope",
... ... @@ -6245,16 +6347,16 @@
6245 6347 },
6246 6348 {
6247 6349 "name": "phpunit/phpunit",
6248   - "version": "7.5.16",
  6350 + "version": "7.5.17",
6249 6351 "source": {
6250 6352 "type": "git",
6251 6353 "url": "https://github.com/sebastianbergmann/phpunit.git",
6252   - "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661"
  6354 + "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a"
6253 6355 },
6254 6356 "dist": {
6255 6357 "type": "zip",
6256   - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/316afa6888d2562e04aeb67ea7f2017a0eb41661",
6257   - "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661",
  6358 + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4c92a15296e58191a4cd74cff3b34fc8e374174a",
  6359 + "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a",
6258 6360 "shasum": ""
6259 6361 },
6260 6362 "require": {
... ... @@ -6325,7 +6427,7 @@
6325 6427 "testing",
6326 6428 "xunit"
6327 6429 ],
6328   - "time": "2019-09-14T09:08:39+00:00"
  6430 + "time": "2019-10-28T10:37:36+00:00"
6329 6431 },
6330 6432 {
6331 6433 "name": "sebastian/code-unit-reverse-lookup",
... ... @@ -6895,7 +6997,7 @@
6895 6997 },
6896 6998 {
6897 6999 "name": "symfony/filesystem",
6898   - "version": "v4.3.5",
  7000 + "version": "v4.3.6",
6899 7001 "source": {
6900 7002 "type": "git",
6901 7003 "url": "https://github.com/symfony/filesystem.git",
... ... @@ -6945,16 +7047,16 @@
6945 7047 },
6946 7048 {
6947 7049 "name": "symfony/options-resolver",
6948   - "version": "v4.3.5",
  7050 + "version": "v4.3.6",
6949 7051 "source": {
6950 7052 "type": "git",
6951 7053 "url": "https://github.com/symfony/options-resolver.git",
6952   - "reference": "81c2e120522a42f623233968244baebd6b36cb6a"
  7054 + "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4"
6953 7055 },
6954 7056 "dist": {
6955 7057 "type": "zip",
6956   - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/81c2e120522a42f623233968244baebd6b36cb6a",
6957   - "reference": "81c2e120522a42f623233968244baebd6b36cb6a",
  7058 + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/f46c7fc8e207bd8a2188f54f8738f232533765a4",
  7059 + "reference": "f46c7fc8e207bd8a2188f54f8738f232533765a4",
6958 7060 "shasum": ""
6959 7061 },
6960 7062 "require": {
... ... @@ -6995,7 +7097,7 @@
6995 7097 "configuration",
6996 7098 "options"
6997 7099 ],
6998   - "time": "2019-08-08T09:29:19+00:00"
  7100 + "time": "2019-10-28T20:59:01+00:00"
6999 7101 },
7000 7102 {
7001 7103 "name": "symfony/polyfill-php70",
... ... @@ -7058,7 +7160,7 @@
7058 7160 },
7059 7161 {
7060 7162 "name": "symfony/stopwatch",
7061   - "version": "v4.3.5",
  7163 + "version": "v4.3.6",
7062 7164 "source": {
7063 7165 "type": "git",
7064 7166 "url": "https://github.com/symfony/stopwatch.git",
... ...
database/migrations/2019_10_17_095937_create_menu_reclassify_registration.php 0 → 100644
... ... @@ -0,0 +1,34 @@
  1 +<?php
  2 +
  3 +use App\Menu;
  4 +use App\Process;
  5 +use Illuminate\Support\Facades\Schema;
  6 +use Illuminate\Database\Schema\Blueprint;
  7 +use Illuminate\Database\Migrations\Migration;
  8 +
  9 +class CreateMenuReclassifyRegistration extends Migration
  10 +{
  11 + /**
  12 + * Run the migrations.
  13 + *
  14 + * @return void
  15 + */
  16 + public function up()
  17 + {
  18 + Menu::query()->create([
  19 + 'parent_id' => Menu::query()->where('old', Process::MENU_SCHOOL)->firstOrFail()->getKey(),
  20 + 'title' => 'Reclassificar matrícula',
  21 + 'process' => Process::RECLASSIFY_REGISTRATION,
  22 + ]);
  23 + }
  24 +
  25 + /**
  26 + * Reverse the migrations.
  27 + *
  28 + * @return void
  29 + */
  30 + public function down()
  31 + {
  32 + Menu::query()->where('process', Process::RECLASSIFY_REGISTRATION)->delete();
  33 + }
  34 +}
... ...
database/migrations/2019_10_17_102129_add_reclassify_menu_to_user_types_with_registrations.php 0 → 100644
... ... @@ -0,0 +1,57 @@
  1 +<?php
  2 +
  3 +use Illuminate\Support\Facades\Schema;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Database\Migrations\Migration;
  6 +use App\Process;
  7 +
  8 +class AddReclassifyMenuToUserTypesWithRegistrations extends Migration
  9 +{
  10 + /**
  11 + * Run the migrations.
  12 + *
  13 + * @return void
  14 + */
  15 + public function up()
  16 + {
  17 + DB::insert('
  18 + INSERT INTO pmieducar.menu_tipo_usuario (ref_cod_tipo_usuario, menu_id, cadastra, visualiza, exclui)
  19 + SELECT
  20 + ref_cod_tipo_usuario,
  21 + (
  22 + SELECT id
  23 + FROM menus
  24 + WHERE process = ?
  25 + ) as menu_id,
  26 + cadastra,
  27 + visualiza,
  28 + exclui
  29 + FROM pmieducar.menu_tipo_usuario
  30 + where menu_id = (
  31 + SELECT id
  32 + FROM menus
  33 + WHERE process = ?
  34 + )
  35 +
  36 + ', [
  37 + Process::RECLASSIFY_REGISTRATION,
  38 + Process::REGISTRATIONS,
  39 + ]);
  40 + }
  41 +
  42 + /**
  43 + * Reverse the migrations.
  44 + *
  45 + * @return void
  46 + */
  47 + public function down()
  48 + {
  49 + DB::table('pmieducar.menu_tipo_usuario')
  50 + ->whereRaw('menu_id = (
  51 + SELECT id
  52 + FROM menus
  53 + WHERE process = ?
  54 + )', [Process::RECLASSIFY_REGISTRATION])
  55 + ->delete();
  56 + }
  57 +}
... ...
ieducar/intranet/educar_ano_letivo_modulo_cad.php
... ... @@ -697,7 +697,7 @@ class indice extends clsCadastro
697 697 $iDiarioService = app(iDiarioService::class);
698 698  
699 699 foreach ($etapas as $etapa) {
700   - if ($iDiarioService->getStepActivityByUnit($escolaId, $etapa)) {
  700 + if ($iDiarioService->getStepActivityByUnit($escolaId, $ano, $etapa)) {
701 701 throw new RuntimeException('Não foi possível remover uma das etapas pois existem notas ou faltas lançadas no diário online.');
702 702 }
703 703 }
... ...
ieducar/intranet/educar_calendario_ano_letivo_lst.php
... ... @@ -17,7 +17,6 @@ class clsIndexBase extends clsBase
17 17 function Formular()
18 18 {
19 19 $this->SetTitulo($this->_instituicao . ' i-Educar - Calendários');
20   - $this->addScript('calendario');
21 20 $this->processoAp = 620;
22 21 }
23 22 }
... ... @@ -471,6 +470,12 @@ class indice extends clsListagem
471 470  
472 471 $retorno .= '</tbody> </table>';
473 472  
  473 + $scripts = [
  474 + '/intranet/scripts/calendario.js'
  475 + ];
  476 +
  477 + Portabilis_View_Helper_Application::loadJavascript($this, $scripts);
  478 +
474 479 return $retorno;
475 480 }
476 481 }
... ...
ieducar/intranet/educar_matricula_det.php
... ... @@ -317,7 +317,7 @@ class indice extends clsDetalhe
317 317 $this->array_botao[] = 'Falecido';
318 318 $this->array_botao_url_script[] = "go(\"educar_falecido_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}\");";
319 319  
320   - if ($registro['ref_ref_cod_serie']) {
  320 + if ($registro['ref_ref_cod_serie'] && $this->permissaoReclassificar()) {
321 321 $this->array_botao[] = 'Reclassificar';
322 322 $this->array_botao_url_script[] = "go(\"educar_matricula_reclassificar_cad.php?ref_cod_matricula={$registro['cod_matricula']}&ref_cod_aluno={$registro['ref_cod_aluno']}\")";
323 323 }
... ... @@ -430,6 +430,13 @@ class indice extends clsDetalhe
430 430 return $acesso->permissao_excluir(627, $this->pessoa_logada, 7, null, true);
431 431 }
432 432  
  433 + public function permissaoReclassificar()
  434 + {
  435 + $acesso = new clsPermissoes();
  436 +
  437 + return $acesso->permissao_cadastra(Process::RECLASSIFY_REGISTRATION, $this->pessoa_logada, 7, null, true);
  438 + }
  439 +
433 440 public function canCancelTransferencia($matriculaId)
434 441 {
435 442 $sql = "SELECT transferencia_solicitacao.cod_transferencia_solicitacao
... ...
ieducar/intranet/educar_matricula_reclassificar_cad.php
... ... @@ -11,12 +11,14 @@ require_once &#39;modules/Avaliacao/Model/NotaAlunoDataMapper.php&#39;;
11 11 require_once 'modules/Avaliacao/Model/NotaComponenteMediaDataMapper.php';
12 12 require_once 'lib/App/Model/MatriculaSituacao.php';
13 13  
  14 +use App\Process;
  15 +
14 16 class clsIndexBase extends clsBase
15 17 {
16 18 function Formular()
17 19 {
18 20 $this->SetTitulo( "{$this->_instituicao} i-Educar - Reclassificar Matr&iacute;cula" );
19   - $this->processoAp = "578";
  21 + $this->processoAp = Process::RECLASSIFY_REGISTRATION;
20 22 }
21 23 }
22 24  
... ... @@ -60,7 +62,7 @@ class indice extends clsCadastro
60 62 $this->ref_cod_aluno=$_GET["ref_cod_aluno"];
61 63  
62 64 $obj_permissoes = new clsPermissoes();
63   - $obj_permissoes->permissao_cadastra( 578, $this->pessoa_logada, 7, "educar_matricula_lst.php?ref_cod_aluno={$this->ref_cod_aluno}" );
  65 + $obj_permissoes->permissao_cadastra( Process::RECLASSIFY_REGISTRATION, $this->pessoa_logada, 7, "educar_matricula_lst.php?ref_cod_aluno={$this->ref_cod_aluno}" );
64 66  
65 67 $obj_matricula = new clsPmieducarMatricula($this->cod_matricula);
66 68 $det_matricula = $obj_matricula->detalhe();
... ... @@ -138,7 +140,7 @@ class indice extends clsCadastro
138 140 {
139 141  
140 142 $obj_permissoes = new clsPermissoes();
141   - $obj_permissoes->permissao_cadastra( 578, $this->pessoa_logada, 7, "educar_matricula_lst.php?ref_cod_aluno={$this->ref_cod_aluno}" );
  143 + $obj_permissoes->permissao_cadastra(Process::RECLASSIFY_REGISTRATION, $this->pessoa_logada, 7, "educar_matricula_lst.php?ref_cod_aluno={$this->ref_cod_aluno}" );
142 144  
143 145 $this->data_cancel = Portabilis_Date_Utils::brToPgSQL($this->data_cancel);
144 146  
... ...
ieducar/intranet/educar_turma_cad.php
... ... @@ -228,6 +228,7 @@ class indice extends clsCadastro
228 228  
229 229 $this->campoOculto('obrigar_campos_censo', (int)$obrigarCamposCenso);
230 230 $this->campoOculto('cod_turma', $this->cod_turma);
  231 + $this->campoOculto('ano_letivo_', $this->ano);
231 232 $this->campoOculto('dependencia_administrativa', $this->dependencia_administrativa);
232 233 $this->campoOculto('modalidade_curso', $this->modalidade_curso);
233 234 $this->campoOculto('retorno', $this->retorno);
... ... @@ -1304,6 +1305,7 @@ class indice extends clsCadastro
1304 1305 protected function validaModulos()
1305 1306 {
1306 1307 $turmaId = $this->cod_turma;
  1308 + $anoTurma = $this->ano_letivo_;
1307 1309 $etapasCount = count($this->data_inicio);
1308 1310 $etapasCountAntigo = (int) Portabilis_Utils_Database::selectField(
1309 1311 'SELECT COUNT(*) AS count FROM pmieducar.turma_modulo WHERE ref_cod_turma = $1',
... ... @@ -1360,7 +1362,7 @@ class indice extends clsCadastro
1360 1362 $iDiarioService = app(iDiarioService::class);
1361 1363  
1362 1364 foreach ($etapas as $etapa) {
1363   - if ($iDiarioService->getStepActivityByClassroom($turmaId, $etapa)) {
  1365 + if ($iDiarioService->getStepActivityByClassroom($turmaId, $anoTurma, $etapa)) {
1364 1366 throw new RuntimeException('Não foi possível remover uma das etapas pois existem notas ou faltas lançadas no diário online.');
1365 1367 }
1366 1368 }
... ...
ieducar/intranet/scripts/calendario.js
... ... @@ -65,18 +65,6 @@ function updateMessagePosition()
65 65 last.style.top = (findPosY(last_td) + 2) + 'px';
66 66 }
67 67  
68   -if (document.createStyleSheet) {
69   - document.createStyleSheet('styles/calendario.css');
70   -}
71   -else {
72   - var objHead = document.getElementsByTagName('head');
73   - var objCSS = objHead[0].appendChild(document.createElement('link'));
74   -
75   - objCSS.rel = 'stylesheet';
76   - objCSS.href = 'styles/calendario.css';
77   - objCSS.type = 'text/css';
78   -}
79   -
80 68 var cX = 0;
81 69 var cY = 0;
82 70  
... ...
ieducar/intranet/styles/custom.css
... ... @@ -492,6 +492,11 @@ table.calendar .dayLastMonth, .day{
492 492  
493 493 table.calendar .day{
494 494 background-color: #e9f0f8 !;
  495 + cursor: pointer;
  496 +}
  497 +
  498 +table.calendar .day:hover{
  499 + opacity: .7;
495 500 }
496 501  
497 502 table.calendar .anotacao{
... ...
ieducar/lib/Portabilis/Report/ReportsRenderServerFactory.php
1 1 <?php
2 2  
3   -use Carbon\Carbon;
4 3 use GuzzleHttp\Client;
5 4 use GuzzleHttp\Exception\GuzzleException;
  5 +use Illuminate\Support\Facades\Log;
6 6  
7 7 require_once 'lib/Portabilis/Report/ReportFactory.php';
8 8  
... ... @@ -45,6 +45,25 @@ class Portabilis_Report_ReportsRenderServerFactory extends Portabilis_Report_Rep
45 45 private $timezone;
46 46  
47 47 /**
  48 + * Loga erros da requisição ao servidor de relatórios.
  49 + *
  50 + * @param array $payload
  51 + * @param string $response
  52 + *
  53 + * @return void
  54 + */
  55 + protected function log($payload, $response)
  56 + {
  57 + $log = json_encode([
  58 + 'url' => $this->url,
  59 + 'payload' => $payload,
  60 + 'response' => $response,
  61 + ]);
  62 +
  63 + Log::error($log);
  64 + }
  65 +
  66 + /**
48 67 * @inheritdoc
49 68 */
50 69 public function setSettings($config)
... ... @@ -69,10 +88,10 @@ class Portabilis_Report_ReportsRenderServerFactory extends Portabilis_Report_Rep
69 88 * @param Portabilis_Report_ReportCore $report
70 89 * @param array $options
71 90 *
72   - * @return string
73   - *
74 91 * @throws GuzzleException
75 92 * @throws Exception
  93 + *
  94 + * @return string
76 95 */
77 96 public function dumps($report, $options = [])
78 97 {
... ... @@ -111,7 +130,7 @@ class Portabilis_Report_ReportsRenderServerFactory extends Portabilis_Report_Rep
111 130 $data = $report->getJsonData();
112 131 $data = $report->modify($data);
113 132  
114   - $response = $client->request('POST', $this->url, [
  133 + $payload = [
115 134 'json' => [
116 135 'report' => $templateName,
117 136 'url' => $url,
... ... @@ -122,15 +141,21 @@ class Portabilis_Report_ReportsRenderServerFactory extends Portabilis_Report_Rep
122 141 'Accept' => 'application/json',
123 142 'Authorization' => 'Token ' . $this->token,
124 143 ]
125   - ]);
  144 + ];
  145 +
  146 + $response = $client->request('POST', $this->url, $payload);
126 147  
127 148 $json = json_decode($response->getBody()->getContents(), true);
128 149  
129 150 if (is_null($json)) {
  151 + $this->log($payload, $response->getBody()->getContents());
  152 +
130 153 throw new Exception('Não foi possível analisar a resposta do serviço.');
131 154 }
132 155  
133 156 if ($json['success'] == false) {
  157 + $this->log($payload, $response->getBody()->getContents());
  158 +
134 159 throw new Exception($json['error'] ?? $json['message']);
135 160 }
136 161  
... ...
ieducar/modules/Api/Views/DiarioController.php
... ... @@ -231,7 +231,12 @@ class DiarioController extends ApiCoreController
231 231  
232 232 $valorNota = $serviceBoletim->calculateStageScore($etapa, $notaOriginal, $notaRecuperacao);
233 233  
234   - if ($etapa == 'Rc' && $notaOriginal > $regra->notaMaximaExameFinal) {
  234 + $notaValidacao = $notaOriginal;
  235 + if (is_numeric($valorNota)) {
  236 + $notaValidacao = $valorNota;
  237 + }
  238 +
  239 + if ($etapa == 'Rc' && $notaValidacao > $regra->notaMaximaExameFinal) {
235 240 $this->messenger->append("A nota {$valorNota} está acima da configurada para nota máxima para exame que é {$regra->notaMaximaExameFinal}.", 'error');
236 241 $this->appendResponse('error', [
237 242 'code' => Error::EXAM_SCORE_GREATER_THAN_MAX_ALLOWED,
... ... @@ -241,7 +246,7 @@ class DiarioController extends ApiCoreController
241 246 return false;
242 247 }
243 248  
244   - if ($etapa != 'Rc' && $notaOriginal > $regra->notaMaximaGeral) {
  249 + if ($etapa != 'Rc' && $notaValidacao > $regra->notaMaximaGeral) {
245 250 $this->messenger->append("A nota {$valorNota} está acima da configurada para nota máxima geral que é {$regra->notaMaximaGeral}.", 'error');
246 251 $this->appendResponse('error', [
247 252 'code' => Error::SCORE_GREATER_THAN_MAX_ALLOWED,
... ... @@ -251,7 +256,7 @@ class DiarioController extends ApiCoreController
251 256 return false;
252 257 }
253 258  
254   - if ($notaOriginal < $regra->notaMinimaGeral) {
  259 + if ($notaValidacao < $regra->notaMinimaGeral) {
255 260 $this->messenger->append("A nota {$valorNota} está abaixo da configurada para nota mínima geral que é {$regra->notaMinimaGeral}.", 'error');
256 261 $this->appendResponse('error', [
257 262 'code' => Error::SCORE_LESSER_THAN_MIN_ALLOWED,
... ...
packages/.gitignore 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +*
  2 +!.gitignore
0 3 \ No newline at end of file
... ...