Skip to content

Commit

Permalink
Merge branch '2.6' into 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbarros authored Feb 2, 2022
2 parents 44aea4b + fb867b3 commit 20f74cd
Show file tree
Hide file tree
Showing 36 changed files with 4,867 additions and 4,121 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
with:
php-version: '7.4'
- uses: actions/checkout@v2
- name: Utiliza versão 2.1.14 do Composer
run: composer self-update 2.1.14
- name: Install Dependencies
run: composer new-install
- name: Unit tests
Expand Down
29 changes: 19 additions & 10 deletions app/Models/LegacyRegistration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@
/**
* LegacyRegistration
*
* @property integer $id
* @property boolean $isTransferred
* @property boolean $isAbandoned
* @property boolean $isCanceled
* @property LegacyStudentAbsence $studentAbsence
* @property LegacyStudentScore $studentScore
* @property LegacyStudentDescriptive $studentDescriptive
* @property LegacyCourse $course
* @property Collection $enrollments
* @property integer $id
* @property boolean $isTransferred
* @property boolean $isAbandoned
* @property boolean $isCanceled
* @property boolean $bloquear_troca_de_situacao
* @property boolean $dependencia
* @property integer $cod_matricula
* @property integer $ano
* @property LegacyStudentAbsence $studentAbsence
* @property LegacyStudentScore $studentScore
* @property LegacyCourse $course
* @property Collection $enrollments
*/
class LegacyRegistration extends Model
{
Expand Down Expand Up @@ -50,7 +53,8 @@ class LegacyRegistration extends Model
'ativo',
'aprovado',
'data_matricula',
'ultima_matricula'
'ultima_matricula',
'bloquear_troca_de_situacao'
];

/**
Expand All @@ -73,6 +77,11 @@ public function getIdAttribute()
return $this->cod_matricula;
}

public function isLockedToChangeStatus(): bool
{
return $this->bloquear_troca_de_situacao;
}

/**
* @return boolean
*/
Expand Down
6 changes: 6 additions & 0 deletions app/Models/LegacyStageType.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class LegacyStageType extends Model
'data_cadastro',
'ref_cod_instituicao',
'num_etapas',
'descricao'
];

/**
Expand Down Expand Up @@ -73,4 +74,9 @@ public static function alreadyExists($name, $stagesNumber, $id = null)
})
->exists();
}

public function getDescricaoAttribute()
{
return str_replace(["\r\n", "\r", "\n"], '<br />', $this->attributes['descricao']);
}
}
4 changes: 2 additions & 2 deletions app/Services/SchoolHistory/SchoolHistoryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public function getLevelByName($levelName)
private function getUsedSpaceByTemplate($templateName)
{
$usedSpaceByTemplate = [
'portabilis_historico_escolar_9anos' => 359,
'portabilis_historico_escolar_9anos' => 345,
'portabilis_historico_escolar' => 395,
'portabilis_historico_escolar_series_anos' => 323,
'portabilis_historico_escolar_series_anos' => 290,
];

if ((int) config('legacy.report.header.alternativo')) {
Expand Down
19 changes: 4 additions & 15 deletions app/Support/Database/SettingCategoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,12 @@

trait SettingCategoryTrait
{
public $settingsCattegories;

public function __construct()
{
$this->getAllSettingsCategories();
}

private function getAllSettingsCategories()
{
$this->settingsCattegories = SettingCategory::query()->get();
}

private function getSettingCategoryIdByName($name): int
private function getSettingCategoryIdByName(string $name): int
{
$id = $this->settingsCattegories->first()->id;
$settingsCattegories = SettingCategory::query()->get();
$id = $settingsCattegories->first()->id;

foreach ($this->settingsCattegories as $settingCategory) {
foreach ($settingsCattegories as $settingCategory) {
if ($settingCategory->name === $name) {
$id = $settingCategory->id;
}
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
"optimize-autoloader": true,
"allow-plugins": {
"dex/composer-plug-and-play": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
Loading

0 comments on commit 20f74cd

Please sign in to comment.