Skip to content

Commit

Permalink
Merge pull request #698 from portabilis/portabilis-patch-2019-02-09
Browse files Browse the repository at this point in the history
[2.2] Portabilis patch 09/02/2019
  • Loading branch information
edersoares authored Feb 10, 2020
2 parents f1e3134 + 16050c7 commit b8beefb
Show file tree
Hide file tree
Showing 59 changed files with 1,044 additions and 1,828 deletions.
29 changes: 29 additions & 0 deletions .sourcelevel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This configuration was used SourceLevel to review the portabilis/i-educar-portabilis repository
# on 44050ca4916a346cb01216fec3231836d3523cbe.
# You can make this the default configuration for future reviews by moving this
# file to your repository as `.sourcelevel.yml` and pushing it to GitHub, and tweak
# it as you wish - To know more on how to change this file to better review your
# repository you can go to https://docs.sourcelevel.io/configuration and see the configuration
# details.
---
pull_requests:
comments: false
engines:
phan:
enabled: false
fixme:
enabled: false
phpmd:
enabled: false
eslint:
enabled: false
csslint:
enabled: false
scss-lint:
enabled: false
remark-lint:
enabled: true
exclude_paths:
- config
- public
- tests
29 changes: 29 additions & 0 deletions app/Http/Controllers/EnrollmentHistoryController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php


namespace App\Http\Controllers;


use App\Models\LegacyRegistration;

class EnrollmentHistoryController extends Controller
{
/**
* Show the profile for the given user.
*
* @param int $id
* @return View
*/
public function show($id)
{
$this->breadcrumb('Histórico de enturmações da matrícula', [
url('intranet/educar_index.php') => 'Escola',
]);

$this->menu(578);

$registration = LegacyRegistration::find($id);

return view('enrollments.enrollmentHistory', ['registration' => $registration]);
}
}
1 change: 0 additions & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class Kernel extends HttpKernel
],

'api' => [
'throttle:60,1',
'bindings',
\Barryvdh\Cors\HandleCors::class
],
Expand Down
16 changes: 16 additions & 0 deletions app/Models/LegacyDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,20 @@ class LegacyDocument extends Model
* @var bool
*/
public $timestamps = false;

/**
* The "booting" method of the model.
*
* @return void
*/
protected static function boot()
{
parent::boot();

static::creating(function ($model) {
$model->origem_gravacao = 'M';
$model->operacao = 'I';
$model->data_cad = now()->format('Y-m-d');
});
}
}
33 changes: 33 additions & 0 deletions app/Models/LegacyEnrollment.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,37 @@ public function schoolClass()
{
return $this->belongsTo(LegacySchoolClass::class, 'ref_cod_turma');
}


/**
* Retorna o turno do aluno.
*
* Relação com turma_turno.
*
* @return bool | string
*/
public function period()
{
return $this->belongsTo(LegacyPeriod::class, 'turno_id')->withDefault();
}

/**
* Relação com servidor.
*
* @return BelongsTo
*/
public function createdBy()
{
return $this->belongsTo(Employee::class, 'ref_usuario_cad');
}

/**
* Relação com servidor.
*
* @return BelongsTo
*/
public function updatedBy()
{
return $this->belongsTo(Employee::class, 'ref_usuario_exc');
}
}
65 changes: 0 additions & 65 deletions app/Models/LegacyExternalAddress.php

This file was deleted.

16 changes: 13 additions & 3 deletions app/Models/LegacyIndividual.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Prettus\Repository\Contracts\Transformable;
use Prettus\Repository\Traits\TransformableTrait;

Expand Down Expand Up @@ -92,7 +94,7 @@ class LegacyIndividual extends EloquentBaseModel implements Transformable
public $timestamps = false;

/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
* @return BelongsToMany
*/
public function race()
{
Expand All @@ -105,7 +107,7 @@ public function race()
}

/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
* @return BelongsToMany
*/
public function deficiency()
{
Expand All @@ -118,13 +120,21 @@ public function deficiency()
}

/**
* @return \Illuminate\Database\Eloquent\Relations\HasOne
* @return HasOne
*/
public function person()
{
return $this->hasOne(LegacyPerson::class, 'idpes', 'idpes');
}

/**
* @return HasOne
*/
public function document()
{
return $this->hasOne(LegacyDocument::class, 'idpes');
}

/**
* @inheritDoc
*/
Expand Down
8 changes: 5 additions & 3 deletions app/Models/LegacyPerson.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\HasOne;
use Prettus\Repository\Contracts\Transformable;
use Prettus\Repository\Traits\TransformableTrait;

Expand Down Expand Up @@ -59,23 +61,23 @@ public function getNameAttribute()
}

/**
* @return \Illuminate\Database\Eloquent\Relations\HasOne
* @return HasOne
*/
public function address()
{
return $this->hasOne(LegacyPersonAddress::class, 'idpes', 'idpes');
}

/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
* @return HasMany
*/
public function phone()
{
return $this->hasMany(LegacyPhone::class, 'idpes', 'idpes');
}

/**
* @return \Illuminate\Database\Eloquent\Relations\HasOne
* @return HasOne
*/
public function individual()
{
Expand Down
8 changes: 8 additions & 0 deletions app/Models/LegacyRegistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,12 @@ public function getEvaluationRule()

return $evaluationRuleGradeYear->evaluationRule;
}

/**
* @return string
*/
public function getStatusDescriptionAttribute()
{
return (new RegistrationStatus)->getDescriptiveValues()[(int) $this->aprovado];
}
}
49 changes: 49 additions & 0 deletions app/Models/LegacySchoolSingleQueueCandidate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class LegacySchoolSingleQueueCandidate extends Model
{
/**
* @var string
*/
protected $table = 'pmieducar.escola_candidato_fila_unica';

/**
* @var string
*/
protected $primaryKey = 'ref_cod_candidato_fila_unica';

/**
* @var array
*/
protected $fillable = [
'ref_cod_escola',
'ref_cod_candidato_fila_unica',
'sequencial',
];

/**
* @var bool
*/
public $timestamps = false;

/**
* @return BelongsTo
*/
public function candidate()
{
return $this->belongsTo(LegacySingleQueueCandidate::class, 'ref_cod_candidato_fila_unica');
}

/**
* @return BelongsTo
*/
public function school()
{
return $this->belongsTo(LegacySchool::class, 'ref_cod_escola');
}
}
Loading

0 comments on commit b8beefb

Please sign in to comment.