Commit 441a287f8433b2fa0b408524262bf1ecc193fc0a
1 parent
338c2a50
Exists in
2.9
and in
7 other branches
Substitui configuração por parâmetro da instituição
Showing
4 changed files
with
72 additions
and
36 deletions
Show diff stats
database/migrations/2019_10_14_172720_create_setting_order_student_by_enrollment_sequential.php
... | ... | @@ -1,34 +0,0 @@ |
1 | -<?php | |
2 | - | |
3 | -use App\Setting; | |
4 | -use Illuminate\Support\Facades\Schema; | |
5 | -use Illuminate\Database\Schema\Blueprint; | |
6 | -use Illuminate\Database\Migrations\Migration; | |
7 | - | |
8 | -class CreateSettingOrderStudentByEnrollmentSequential extends Migration | |
9 | -{ | |
10 | - /** | |
11 | - * Run the migrations. | |
12 | - * | |
13 | - * @return void | |
14 | - */ | |
15 | - public function up() | |
16 | - { | |
17 | - Setting::create([ | |
18 | - 'key' => 'legacy.report.order_student_by_enrollment_sequential', | |
19 | - 'value' => '0', | |
20 | - 'type' => 'string', | |
21 | - 'description' => 'Indica se os alunos serão ordenados pelo campo sequencial_fechamento de matricula_turma' | |
22 | - ]); | |
23 | - } | |
24 | - | |
25 | - /** | |
26 | - * Reverse the migrations. | |
27 | - * | |
28 | - * @return void | |
29 | - */ | |
30 | - public function down() | |
31 | - { | |
32 | - Setting::where('key', 'legacy.report.order_student_by_enrollment_sequential')->delete(); | |
33 | - } | |
34 | -} |
database/migrations/2019_10_24_083313_cria_parametro_ordena_alunos_por_sequencial_enturmacao.php
0 → 100644
... | ... | @@ -0,0 +1,32 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Support\Facades\Schema; | |
4 | +use Illuminate\Database\Schema\Blueprint; | |
5 | +use Illuminate\Database\Migrations\Migration; | |
6 | + | |
7 | +class CriaParametroOrdenaAlunosPorSequencialEnturmacao extends Migration | |
8 | +{ | |
9 | + /** | |
10 | + * Run the migrations. | |
11 | + * | |
12 | + * @return void | |
13 | + */ | |
14 | + public function up() | |
15 | + { | |
16 | + Schema::table('pmieducar.instituicao', function (Blueprint $table) { | |
17 | + $table->boolean('ordenar_alunos_sequencial_enturmacao')->default(false); | |
18 | + }); | |
19 | + } | |
20 | + | |
21 | + /** | |
22 | + * Reverse the migrations. | |
23 | + * | |
24 | + * @return void | |
25 | + */ | |
26 | + public function down() | |
27 | + { | |
28 | + Schema::table('pmieducar.instituicao', function (Blueprint $table) { | |
29 | + $table->dropColumn('ordenar_alunos_sequencial_enturmacao'); | |
30 | + }); | |
31 | + } | |
32 | +} | ... | ... |
ieducar/intranet/educar_instituicao_cad.php
... | ... | @@ -73,6 +73,7 @@ class indice extends clsCadastro |
73 | 73 | public $exibir_apenas_professores_alocados; |
74 | 74 | public $bloquear_vinculo_professor_sem_alocacao_escola; |
75 | 75 | public $permitir_matricula_fora_periodo_letivo; |
76 | + public $ordenar_alunos_sequencial_enturmacao; | |
76 | 77 | |
77 | 78 | public function Inicializar() |
78 | 79 | { |
... | ... | @@ -123,6 +124,7 @@ class indice extends clsCadastro |
123 | 124 | $this->exibir_apenas_professores_alocados = dbBool($this->exibir_apenas_professores_alocados); |
124 | 125 | $this->bloquear_vinculo_professor_sem_alocacao_escola = dbBool($this->bloquear_vinculo_professor_sem_alocacao_escola); |
125 | 126 | $this->permitir_matricula_fora_periodo_letivo = dbBool($this->permitir_matricula_fora_periodo_letivo); |
127 | + $this->ordenar_alunos_sequencial_enturmacao = dbBool($this->ordenar_alunos_sequencial_enturmacao); | |
126 | 128 | |
127 | 129 | return $retorno; |
128 | 130 | } |
... | ... | @@ -328,6 +330,16 @@ class indice extends clsCadastro |
328 | 330 | false |
329 | 331 | ); |
330 | 332 | |
333 | + $this->campoCheck( | |
334 | + 'ordenar_alunos_sequencial_enturmacao', | |
335 | + 'Mostrar alunos em relatórios de acordo com a ordenação definida manualmente na turma', | |
336 | + $this->ordenar_alunos_sequencial_enturmacao, | |
337 | + null, | |
338 | + false, | |
339 | + false, | |
340 | + false | |
341 | + ); | |
342 | + | |
331 | 343 | $scripts = ['/modules/Cadastro/Assets/Javascripts/Instituicao.js']; |
332 | 344 | Portabilis_View_Helper_Application::loadJavascript($this, $scripts); |
333 | 345 | $styles = array ('/modules/Cadastro/Assets/Stylesheets/Instituicao.css'); |
... | ... | @@ -373,6 +385,7 @@ class indice extends clsCadastro |
373 | 385 | $obj->exibir_apenas_professores_alocados = !is_null($this->exibir_apenas_professores_alocados); |
374 | 386 | $obj->bloquear_vinculo_professor_sem_alocacao_escola = !is_null($this->bloquear_vinculo_professor_sem_alocacao_escola); |
375 | 387 | $obj->permitir_matricula_fora_periodo_letivo = !is_null($this->permitir_matricula_fora_periodo_letivo); |
388 | + $obj->ordenar_alunos_sequencial_enturmacao = !is_null($this->ordenar_alunos_sequencial_enturmacao); | |
376 | 389 | |
377 | 390 | $detalheAntigo = $obj->detalhe(); |
378 | 391 | ... | ... |
ieducar/intranet/include/pmieducar/clsPmieducarInstituicao.inc.php
... | ... | @@ -51,6 +51,7 @@ class clsPmieducarInstituicao extends Model |
51 | 51 | public $exibir_apenas_professores_alocados; |
52 | 52 | public $bloquear_vinculo_professor_sem_alocacao_escola; |
53 | 53 | public $permitir_matricula_fora_periodo_letivo; |
54 | + public $ordenar_alunos_sequencial_enturmacao; | |
54 | 55 | |
55 | 56 | public function __construct( |
56 | 57 | $cod_instituicao = null, |
... | ... | @@ -81,7 +82,8 @@ class clsPmieducarInstituicao extends Model |
81 | 82 | $exigir_lancamentos_anteriores = null, |
82 | 83 | $exibir_apenas_professores_alocados = null, |
83 | 84 | $bloquear_vinculo_professor_sem_alocacao_escola = null, |
84 | - $permitir_matricula_fora_periodo_letivo = null | |
85 | + $permitir_matricula_fora_periodo_letivo = null, | |
86 | + $ordenar_alunos_sequencial_enturmacao = null | |
85 | 87 | ) { |
86 | 88 | $db = new clsBanco(); |
87 | 89 | $this->_schema = 'pmieducar.'; |
... | ... | @@ -136,7 +138,8 @@ class clsPmieducarInstituicao extends Model |
136 | 138 | exigir_lancamentos_anteriores, |
137 | 139 | exibir_apenas_professores_alocados, |
138 | 140 | bloquear_vinculo_professor_sem_alocacao_escola, |
139 | - permitir_matricula_fora_periodo_letivo | |
141 | + permitir_matricula_fora_periodo_letivo, | |
142 | + ordenar_alunos_sequencial_enturmacao | |
140 | 143 | '; |
141 | 144 | |
142 | 145 | if (is_numeric($ref_usuario_cad)) { |
... | ... | @@ -249,6 +252,10 @@ class clsPmieducarInstituicao extends Model |
249 | 252 | if (is_bool($permitir_matricula_fora_periodo_letivo)) { |
250 | 253 | $this->permitir_matricula_fora_periodo_letivo = $permitir_matricula_fora_periodo_letivo; |
251 | 254 | } |
255 | + | |
256 | + if (is_bool($ordenar_alunos_sequencial_enturmacao)) { | |
257 | + $this->ordenar_alunos_sequencial_enturmacao = $ordenar_alunos_sequencial_enturmacao; | |
258 | + } | |
252 | 259 | } |
253 | 260 | |
254 | 261 | public function canRegister() |
... | ... | @@ -635,6 +642,16 @@ class clsPmieducarInstituicao extends Model |
635 | 642 | $gruda = ', '; |
636 | 643 | } |
637 | 644 | |
645 | + if (dbBool($this->ordenar_alunos_sequencial_enturmacao)) { | |
646 | + $campos .= "{$gruda}ordenar_alunos_sequencial_enturmacao"; | |
647 | + $valores .= "{$gruda} true "; | |
648 | + $gruda = ', '; | |
649 | + } else { | |
650 | + $campos .= "{$gruda}ordenar_alunos_sequencial_enturmacao"; | |
651 | + $valores .= "{$gruda} false "; | |
652 | + $gruda = ', '; | |
653 | + } | |
654 | + | |
638 | 655 | if (is_string($this->orgao_regional) and !empty($this->orgao_regional)) { |
639 | 656 | $campos .= "{$gruda}orgao_regional"; |
640 | 657 | $valores .= "{$gruda}'{$this->orgao_regional}'"; |
... | ... | @@ -994,6 +1011,14 @@ class clsPmieducarInstituicao extends Model |
994 | 1011 | $gruda = ', '; |
995 | 1012 | } |
996 | 1013 | |
1014 | + if (dbBool($this->ordenar_alunos_sequencial_enturmacao)) { | |
1015 | + $set .= "{$gruda}ordenar_alunos_sequencial_enturmacao = true "; | |
1016 | + $gruda = ', '; | |
1017 | + } else { | |
1018 | + $set .= "{$gruda}ordenar_alunos_sequencial_enturmacao = false "; | |
1019 | + $gruda = ', '; | |
1020 | + } | |
1021 | + | |
997 | 1022 | if ($set) { |
998 | 1023 | $db->Consulta("UPDATE {$this->_tabela} SET $set WHERE cod_instituicao = '{$this->cod_instituicao}'"); |
999 | 1024 | ... | ... |