Commit 7fae329bf5c4198a7ca9ebf326fdf97f2227872f
Exists in
2.9
and in
5 other branches
Merge branch 'master' into issue-7747
Showing
80 changed files
with
2398 additions
and
601 deletions
Show diff stats
.gitignore
app/Http/Controllers/Educacenso/ImportController.php
... | ... | @@ -4,22 +4,26 @@ namespace App\Http\Controllers\Educacenso; |
4 | 4 | |
5 | 5 | use App\Exceptions\Educacenso\ImportException; |
6 | 6 | use App\Http\Controllers\Controller; |
7 | +use App\Http\Requests\EducacensoImportRequest; | |
7 | 8 | use App\Models\EducacensoImport; |
8 | 9 | use App\Process; |
9 | 10 | use App\Services\Educacenso\HandleFileService; |
10 | 11 | use App\Services\Educacenso\ImportServiceFactory; |
12 | +use DateTime; | |
11 | 13 | use Illuminate\Http\Request; |
12 | 14 | use Illuminate\Support\Facades\Auth; |
13 | 15 | use Illuminate\View\View; |
14 | 16 | |
15 | 17 | class ImportController extends Controller |
16 | 18 | { |
17 | - public function import(Request $request) | |
19 | + public function import(EducacensoImportRequest $request) | |
18 | 20 | { |
19 | 21 | $file = $request->file('arquivo'); |
20 | 22 | |
21 | 23 | try { |
22 | - $yearImportService = ImportServiceFactory::createImportService($request->get('ano')); | |
24 | + $yearImportService = ImportServiceFactory::createImportService( | |
25 | + $request->get('ano'), | |
26 | + DateTime::createFromFormat('d/m/Y', $request->get('data_entrada_matricula'))); | |
23 | 27 | |
24 | 28 | $importFileService = new HandleFileService($yearImportService, Auth::user()); |
25 | 29 | ... | ... |
app/Http/Controllers/SettingController.php
... | ... | @@ -4,6 +4,7 @@ namespace App\Http\Controllers; |
4 | 4 | |
5 | 5 | use App\Process; |
6 | 6 | use App\Setting; |
7 | +use App\SettingCategory; | |
7 | 8 | use Illuminate\Http\Request; |
8 | 9 | use Illuminate\View\View; |
9 | 10 | |
... | ... | @@ -25,15 +26,9 @@ class SettingController extends Controller |
25 | 26 | return redirect('/intranet/educar_configuracoes_index.php'); |
26 | 27 | } |
27 | 28 | |
28 | - $fields = $this->getSettingsFields(); | |
29 | - return view('settings.index', ['fields' => $fields]); | |
30 | - } | |
29 | + $categories = SettingCategory::whereHas('settings')->orderBy('id', 'desc')->get(); | |
31 | 30 | |
32 | - private function getSettingsFields() | |
33 | - { | |
34 | - return Setting::query() | |
35 | - ->OrderBy('key') | |
36 | - ->get(); | |
31 | + return view('settings.index', ['categories' => $categories]); | |
37 | 32 | } |
38 | 33 | |
39 | 34 | public function saveInputs(Request $request) | ... | ... |
app/Http/Controllers/UpdateSchoolClassReportCardController.php
... | ... | @@ -20,6 +20,10 @@ class UpdateSchoolClassReportCardController extends Controller |
20 | 20 | */ |
21 | 21 | public function index(Request $request) |
22 | 22 | { |
23 | + if (!$request->user()->isAdmin() && !$request->user()->isInstitutional()) { | |
24 | + return redirect('/'); | |
25 | + } | |
26 | + | |
23 | 27 | $this->breadcrumb('Atualização de boletins em lote', [ |
24 | 28 | url('intranet/educar_configuracoes_index.php') => 'Configurações', |
25 | 29 | ]); |
... | ... | @@ -59,11 +63,14 @@ class UpdateSchoolClassReportCardController extends Controller |
59 | 63 | $result[$key] = [ |
60 | 64 | 'id' => $schoolClass->getKey(), |
61 | 65 | 'name' => $schoolClass->name, |
62 | - 'old_report' => $schoolClass->tipo_boletim, | |
63 | - 'new_report' => $request->get('new_report_card'), | |
64 | 66 | ]; |
65 | 67 | |
66 | - $schoolClass->tipo_boletim = $request->get('new_report_card'); | |
68 | + if ($request->get('new_report_card')) { | |
69 | + $result[$key]['old_report'] = $schoolClass->tipo_boletim; | |
70 | + $result[$key]['new_report'] = $request->get('new_report_card'); | |
71 | + | |
72 | + $schoolClass->tipo_boletim = $request->get('new_report_card'); | |
73 | + } | |
67 | 74 | |
68 | 75 | if ($request->get('new_alternative_report_card')) { |
69 | 76 | $result[$key]['old_alternative_report'] = $schoolClass->tipo_boletim_diferenciado; | ... | ... |
... | ... | @@ -0,0 +1,36 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace App\Http\Requests; | |
4 | + | |
5 | +use App\Rules\EducacensoImportRegistrationDate; | |
6 | +use Illuminate\Foundation\Http\FormRequest; | |
7 | + | |
8 | +class EducacensoImportRequest extends FormRequest | |
9 | +{ | |
10 | + /** | |
11 | + * Get the validation rules that apply to the request. | |
12 | + * | |
13 | + * @return array | |
14 | + */ | |
15 | + public function rules() | |
16 | + { | |
17 | + return [ | |
18 | + 'data_entrada_matricula' => [ | |
19 | + 'required', | |
20 | + new EducacensoImportRegistrationDate($this->get('ano')), | |
21 | + 'date_format:d/m/Y' | |
22 | + ], | |
23 | + 'arquivo' => 'required', | |
24 | + ]; | |
25 | + } | |
26 | + | |
27 | + /** | |
28 | + * @return array | |
29 | + */ | |
30 | + public function messages() | |
31 | + { | |
32 | + return [ | |
33 | + 'data_entrada_matricula.required' => 'O campo: Data de entrada das matrículas é obrigatório.', | |
34 | + ]; | |
35 | + } | |
36 | +} | ... | ... |
app/Http/Requests/UpdateSchoolClassReportCardRequest.php
... | ... | @@ -20,7 +20,8 @@ class UpdateSchoolClassReportCardRequest extends FormRequest |
20 | 20 | 'date_format:Y', |
21 | 21 | ], |
22 | 22 | 'ref_cod_instituicao' => 'required', |
23 | - 'new_report_card' => 'required', | |
23 | + 'new_report_card' => 'required_without:new_alternative_report_card', | |
24 | + 'new_alternative_report_card' => 'required_without:new_report_card', | |
24 | 25 | ]; |
25 | 26 | } |
26 | 27 | |
... | ... | @@ -33,7 +34,8 @@ class UpdateSchoolClassReportCardRequest extends FormRequest |
33 | 34 | 'ano.required' => 'O ano é obrigatório.', |
34 | 35 | 'ano.date_format' => 'O campo Ano deve ser um ano válido.', |
35 | 36 | 'ref_cod_instituicao.required' => 'A instituição é obrigatória.', |
36 | - 'new_report_card.required' => 'O novo tipo de boletim é obrigatório.', | |
37 | + 'new_report_card.required_without' => 'O novo tipo de boletim é obrigatório.', | |
38 | + 'new_alternative_report_card.required_without' => 'O novo tipo de boletim diferenciado é obrigatório.', | |
37 | 39 | ]; |
38 | 40 | } |
39 | 41 | } | ... | ... |
app/Jobs/EducacensoImportJob.php
... | ... | @@ -4,6 +4,7 @@ namespace App\Jobs; |
4 | 4 | |
5 | 5 | use App\Models\EducacensoImport as EducacensoImportModel; |
6 | 6 | use App\Services\Educacenso\ImportServiceFactory; |
7 | +use DateTime; | |
7 | 8 | use Illuminate\Bus\Queueable; |
8 | 9 | use Illuminate\Queue\SerializesModels; |
9 | 10 | use Illuminate\Queue\InteractsWithQueue; |
... | ... | @@ -30,6 +31,11 @@ class EducacensoImportJob implements ShouldQueue |
30 | 31 | */ |
31 | 32 | private $databaseConnection; |
32 | 33 | |
34 | + /** | |
35 | + * @var DateTime | |
36 | + */ | |
37 | + private $registrationDate; | |
38 | + | |
33 | 39 | public $timeout = 600; |
34 | 40 | |
35 | 41 | /** |
... | ... | @@ -38,12 +44,14 @@ class EducacensoImportJob implements ShouldQueue |
38 | 44 | * @param EducacensoImportModel $educacensoImport |
39 | 45 | * @param $importArray |
40 | 46 | * @param string $databaseConnection |
47 | + * @param DateTime $registrationDate | |
41 | 48 | */ |
42 | - public function __construct(EducacensoImportModel $educacensoImport, $importArray, $databaseConnection) | |
49 | + public function __construct(EducacensoImportModel $educacensoImport, $importArray, $databaseConnection, $registrationDate) | |
43 | 50 | { |
44 | 51 | $this->educacensoImport = $educacensoImport; |
45 | 52 | $this->importArray = $importArray; |
46 | 53 | $this->databaseConnection = $databaseConnection; |
54 | + $this->registrationDate = $registrationDate; | |
47 | 55 | } |
48 | 56 | |
49 | 57 | /** |
... | ... | @@ -58,7 +66,7 @@ class EducacensoImportJob implements ShouldQueue |
58 | 66 | DB::beginTransaction(); |
59 | 67 | |
60 | 68 | try { |
61 | - $importService = ImportServiceFactory::createImportService($this->educacensoImport->year); | |
69 | + $importService = ImportServiceFactory::createImportService($this->educacensoImport->year, $this->registrationDate); | |
62 | 70 | $importService->import($this->importArray, $this->educacensoImport->user); |
63 | 71 | $importService->adaptData(); |
64 | 72 | } catch (Throwable $e) { | ... | ... |
app/Models/EducacensoImport.php
... | ... | @@ -9,7 +9,11 @@ class EducacensoImport extends Model |
9 | 9 | { |
10 | 10 | protected $table = 'educacenso_imports'; |
11 | 11 | |
12 | - protected $fillable = ['year', 'school', 'user_id', 'finished']; | |
12 | + protected $fillable = ['year', 'school', 'user_id', 'finished', 'registration_date']; | |
13 | + | |
14 | + protected $dates = [ | |
15 | + 'registration_date', | |
16 | + ]; | |
13 | 17 | |
14 | 18 | /** |
15 | 19 | * @return BelongsTo | ... | ... |
app/Models/LegacyIndividual.php
app/Models/LegacySchool.php
... | ... | @@ -138,7 +138,7 @@ class LegacySchool extends Model |
138 | 138 | 'pmieducar.escola_serie', |
139 | 139 | 'ref_cod_escola', |
140 | 140 | 'ref_cod_serie' |
141 | - )->withPivot('ativo', 'anos_letivos'); | |
141 | + )->withPivot('ativo', 'anos_letivos', 'bloquear_enturmacao_sem_vagas'); | |
142 | 142 | } |
143 | 143 | |
144 | 144 | /** | ... | ... |
app/Models/LegacyStudent.php
... | ... | @@ -77,4 +77,14 @@ class LegacyStudent extends Model |
77 | 77 | 'idpes' |
78 | 78 | ); |
79 | 79 | } |
80 | + | |
81 | + public function getInepNumberAttribute() | |
82 | + { | |
83 | + return $this->inep ? $this->inep->number : null; | |
84 | + } | |
85 | + | |
86 | + public function inep() | |
87 | + { | |
88 | + return $this->hasOne(StudentInep::class, 'cod_aluno', 'cod_aluno'); | |
89 | + } | |
80 | 90 | } | ... | ... |
app/Providers/AppServiceProvider.php
... | ... | @@ -11,8 +11,8 @@ use Exception; |
11 | 11 | use iEducar\Modules\ErrorTracking\HoneyBadgerTracker; |
12 | 12 | use iEducar\Modules\ErrorTracking\Tracker; |
13 | 13 | use iEducar\Support\Navigation\Breadcrumb; |
14 | +use Illuminate\Database\Eloquent\Builder; | |
14 | 15 | use Illuminate\Database\Eloquent\Collection; |
15 | -use Illuminate\Database\Query\Builder; | |
16 | 16 | use Illuminate\Pagination\Paginator; |
17 | 17 | use Illuminate\Support\Facades\Auth; |
18 | 18 | use Illuminate\Support\Facades\Cache; |
... | ... | @@ -104,6 +104,38 @@ class AppServiceProvider extends ServiceProvider |
104 | 104 | Builder::macro('whereUnaccent', function ($column, $value) { |
105 | 105 | $this->whereRaw('unaccent(' . $column . ') ilike unaccent(\'%\' || ? || \'%\')', [$value]); |
106 | 106 | }); |
107 | + | |
108 | + Builder::macro('search', function ($columns, $value, $type = 'both') { | |
109 | + if (is_string($columns)) { | |
110 | + $columns = [$columns]; | |
111 | + } | |
112 | + | |
113 | + $operator = $this->getConnection()->getDriverName() === 'pgsql' ? 'ilike' : 'like'; | |
114 | + | |
115 | + $search = "%{$value}%"; | |
116 | + | |
117 | + if ($type == 'left') { | |
118 | + $search = "%{$value}"; | |
119 | + } | |
120 | + | |
121 | + if ($type == 'right') { | |
122 | + $search = "{$value}%"; | |
123 | + } | |
124 | + | |
125 | + return $this->where(function ($builder) use ($columns, $operator, $search) { | |
126 | + foreach ($columns as $column) { | |
127 | + if (Str::contains($column, '.')) { | |
128 | + [$relation, $column] = explode('.', $column); | |
129 | + | |
130 | + $builder->orWhereHas($relation, function ($builder) use ($column, $operator, $search) { | |
131 | + $builder->where($column, $operator, $search); | |
132 | + }); | |
133 | + } else { | |
134 | + $builder->orWhere($column, $operator, $search); | |
135 | + } | |
136 | + } | |
137 | + }); | |
138 | + }); | |
107 | 139 | } |
108 | 140 | |
109 | 141 | /** | ... | ... |
... | ... | @@ -0,0 +1,40 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace App\Rules; | |
4 | + | |
5 | +use Illuminate\Contracts\Validation\Rule; | |
6 | + | |
7 | +class EducacensoImportRegistrationDate implements Rule | |
8 | +{ | |
9 | + public $selectedYear; | |
10 | + | |
11 | + public function __construct($selectedYear) | |
12 | + { | |
13 | + $this->selectedYear = $selectedYear; | |
14 | + } | |
15 | + | |
16 | + /** | |
17 | + * Verifica se o ano da data de entrada da matrícula é | |
18 | + * menor ou igual ao ano selecionado no filtro | |
19 | + * | |
20 | + * @param string $attribute | |
21 | + * @param mixed $value | |
22 | + * @return bool | |
23 | + */ | |
24 | + public function passes($attribute, $value) | |
25 | + { | |
26 | + $registrationYear = \DateTime::createFromFormat('d/m/Y', $value)->format('Y'); | |
27 | + | |
28 | + return $registrationYear <= $this->selectedYear; | |
29 | + } | |
30 | + | |
31 | + /** | |
32 | + * Get the validation error message. | |
33 | + * | |
34 | + * @return string | |
35 | + */ | |
36 | + public function message() | |
37 | + { | |
38 | + return 'O ano da data de entrada das matrículas não pode ser maior que o ano selecionado'; | |
39 | + } | |
40 | +} | ... | ... |
app/Services/Educacenso/HandleFileService.php
... | ... | @@ -67,12 +67,13 @@ class HandleFileService |
67 | 67 | $import->year = $this->yearImportService->getYear(); |
68 | 68 | $import->school = utf8_encode($this->yearImportService->getSchoolNameByFile($school)); |
69 | 69 | $import->user_id = $this->user->id; |
70 | + $import->registration_date = $this->yearImportService->registrationDate; | |
70 | 71 | $import->finished = false; |
71 | 72 | $import->save(); |
72 | 73 | |
73 | 74 | $school = array_map('utf8_encode', $school); |
74 | 75 | |
75 | - $this->jobs[] = new EducacensoImportJob($import, $school, DB::getDefaultConnection()); | |
76 | + $this->jobs[] = new EducacensoImportJob($import, $school, DB::getDefaultConnection(), $this->yearImportService->registrationDate); | |
76 | 77 | } |
77 | 78 | |
78 | 79 | private function dispatchJobs() | ... | ... |
app/Services/Educacenso/ImportService.php
... | ... | @@ -4,6 +4,7 @@ namespace App\Services\Educacenso; |
4 | 4 | |
5 | 5 | use App\Models\Educacenso\RegistroEducacenso; |
6 | 6 | use App\User; |
7 | +use DateTime; | |
7 | 8 | use Illuminate\Http\UploadedFile; |
8 | 9 | |
9 | 10 | abstract class ImportService |
... | ... | @@ -11,6 +12,11 @@ abstract class ImportService |
11 | 12 | const DELIMITER = '|'; |
12 | 13 | |
13 | 14 | /** |
15 | + * @var DateTime | |
16 | + */ | |
17 | + public $registrationDate; | |
18 | + | |
19 | + /** | |
14 | 20 | * Faz a importação dos dados a partir da string do arquivo do censo |
15 | 21 | * |
16 | 22 | * @param array $importString |
... | ... | @@ -44,7 +50,11 @@ abstract class ImportService |
44 | 50 | |
45 | 51 | $model = $class::getModel($arrayColumns); |
46 | 52 | |
47 | - $class->import($model, $this->getYear(), $user); | |
53 | + if ($lineId == 60) { | |
54 | + $class->registrationDate = $this->registrationDate; | |
55 | + } | |
56 | + | |
57 | + $class->import($model, $this->getYear(), $user, $this->registrationDate); | |
48 | 58 | } |
49 | 59 | |
50 | 60 | /** | ... | ... |
app/Services/Educacenso/ImportServiceFactory.php
... | ... | @@ -5,6 +5,7 @@ namespace App\Services\Educacenso; |
5 | 5 | use App\Exceptions\Educacenso\NotImplementedYear; |
6 | 6 | use App\Services\Educacenso\Version2019\ImportService as ImportService2019; |
7 | 7 | use App\Services\Educacenso\Version2020\ImportService as ImportService2020; |
8 | +use DateTime; | |
8 | 9 | |
9 | 10 | class ImportServiceFactory |
10 | 11 | { |
... | ... | @@ -12,13 +13,18 @@ class ImportServiceFactory |
12 | 13 | * Intancia um service de importação |
13 | 14 | * |
14 | 15 | * @param $year |
16 | + * @param DateTime $registrationDate | |
15 | 17 | * @return ImportService |
16 | 18 | */ |
17 | - public static function createImportService($year) | |
19 | + public static function createImportService($year, $registrationDate) | |
18 | 20 | { |
21 | + /** @var ImportService $class */ | |
19 | 22 | $class = self::getClassByYear($year); |
20 | 23 | |
21 | - return new $class(); | |
24 | + $class = new $class(); | |
25 | + $class->registrationDate = $registrationDate; | |
26 | + | |
27 | + return $class; | |
22 | 28 | } |
23 | 29 | |
24 | 30 | /** | ... | ... |
app/Services/Educacenso/Version2019/Registro20Import.php
... | ... | @@ -450,9 +450,9 @@ class Registro20Import implements RegistroImportInterface |
450 | 450 | 4 => 'Biologia', |
451 | 451 | 5 => 'Ciências', |
452 | 452 | 6 => 'Língua/Literatura portuguesa', |
453 | - 7 => 'Língua/Literatura extrangeira - Inglês', | |
454 | - 8 => 'Língua/Literatura extrangeira - Espanhol', | |
455 | - 9 => 'Língua/Literatura extrangeira - Outra', | |
453 | + 7 => 'Língua/Literatura estrangeira - Inglês', | |
454 | + 8 => 'Língua/Literatura estrangeira - Espanhol', | |
455 | + 9 => 'Língua/Literatura estrangeira - Outra', | |
456 | 456 | 10 => 'Artes (educação artística, teatro, dança, música, artes plásticas e outras)', |
457 | 457 | 11 => 'Educação física', |
458 | 458 | 12 => 'História', |
... | ... | @@ -466,7 +466,7 @@ class Registro20Import implements RegistroImportInterface |
466 | 466 | 27 => 'Língua indígena', |
467 | 467 | 28 => 'Estudos sociais', |
468 | 468 | 29 => 'Sociologia', |
469 | - 30 => 'Língua/Literatura extrangeira - Francês', | |
469 | + 30 => 'Língua/Literatura estrangeira - Francês', | |
470 | 470 | 31 => 'Língua Portuguesa como Segunda Língua', |
471 | 471 | 32 => 'Estágio Curricular Supervisionado', |
472 | 472 | 99 => 'Outras disciplinas' | ... | ... |
app/Services/Educacenso/Version2019/Registro60Import.php
... | ... | @@ -16,6 +16,7 @@ use App\Models\StudentInep; |
16 | 16 | use App\Services\Educacenso\RegistroImportInterface; |
17 | 17 | use App\User; |
18 | 18 | use App_Model_MatriculaSituacao; |
19 | +use DateTime; | |
19 | 20 | use iEducar\Modules\Educacenso\Model\TipoAtendimentoAluno; |
20 | 21 | use iEducar\Modules\Educacenso\Model\VeiculoTransporteEscolar; |
21 | 22 | |
... | ... | @@ -43,6 +44,11 @@ class Registro60Import implements RegistroImportInterface |
43 | 44 | private $institution; |
44 | 45 | |
45 | 46 | /** |
47 | + * @var DateTime | |
48 | + */ | |
49 | + public $registrationDate; | |
50 | + | |
51 | + /** | |
46 | 52 | * Faz a importação dos dados a partir da linha do arquivo |
47 | 53 | * |
48 | 54 | * @param RegistroEducacenso $model |
... | ... | @@ -81,7 +87,7 @@ class Registro60Import implements RegistroImportInterface |
81 | 87 | if (empty($this->model->inepTurma)) { |
82 | 88 | return null; |
83 | 89 | } |
84 | - | |
90 | + | |
85 | 91 | return SchoolClassInep::where('cod_turma_inep', $this->model->inepTurma)->first()->schoolClass ?? null; |
86 | 92 | } |
87 | 93 | |
... | ... | @@ -124,7 +130,7 @@ class Registro60Import implements RegistroImportInterface |
124 | 130 | 'aprovado' => App_Model_MatriculaSituacao::APROVADO, |
125 | 131 | 'ref_cod_curso' => $schoolClass->course->getKey(), |
126 | 132 | 'ref_ref_cod_escola' => $schoolClass->school->getKey(), |
127 | - 'data_matricula' => now(), | |
133 | + 'data_matricula' => $this->registrationDate, | |
128 | 134 | 'data_cadastro' => now(), |
129 | 135 | 'ultima_matricula' => 1, |
130 | 136 | ] |
... | ... | @@ -138,7 +144,7 @@ class Registro60Import implements RegistroImportInterface |
138 | 144 | */ |
139 | 145 | private function getOrCreateEnrollment(LegacySchoolClass $schoolClass, LegacyRegistration $registration) |
140 | 146 | { |
141 | - $maxSequencial = LegacyEnrollment::where('ref_cod_matricula', $registration->getKey())->max('sequencial') ?: 1; | |
147 | + $maxSequencial = LegacyEnrollment::where('ref_cod_matricula', $registration->getKey())->max('sequencial') ?: 0; | |
142 | 148 | |
143 | 149 | return LegacyEnrollment::firstOrCreate( |
144 | 150 | [ |
... | ... | @@ -147,11 +153,11 @@ class Registro60Import implements RegistroImportInterface |
147 | 153 | ], |
148 | 154 | [ |
149 | 155 | 'data_cadastro' => now(), |
150 | - 'data_enturmacao' => now(), | |
156 | + 'data_enturmacao' => $this->registrationDate, | |
151 | 157 | 'ativo' => 1, |
152 | 158 | 'etapa_educacenso' => $this->model->etapaAluno, |
153 | 159 | 'tipo_atendimento' => $this->getArrayTipoAtendimento(), |
154 | - 'sequencial' => $maxSequencial, | |
160 | + 'sequencial' => $maxSequencial + 1, | |
155 | 161 | 'ref_usuario_cad' => $this->user->getKey(), |
156 | 162 | ] |
157 | 163 | ); | ... | ... |
app/Setting.php
... | ... | @@ -15,7 +15,7 @@ class Setting extends Model |
15 | 15 | * @var array |
16 | 16 | */ |
17 | 17 | protected $fillable = [ |
18 | - 'key', 'value', 'type', 'description', | |
18 | + 'key', 'value', 'type', 'description', 'setting_category_id', 'hint' | |
19 | 19 | ]; |
20 | 20 | |
21 | 21 | /** |
... | ... | @@ -45,4 +45,9 @@ class Setting extends Model |
45 | 45 | |
46 | 46 | return $value; |
47 | 47 | } |
48 | + | |
49 | + public function category() | |
50 | + { | |
51 | + return $this->belongsTo(SettingCategory::class, 'setting_category_id'); | |
52 | + } | |
48 | 53 | } | ... | ... |
... | ... | @@ -0,0 +1,22 @@ |
1 | +<?php | |
2 | + | |
3 | +namespace App; | |
4 | + | |
5 | +use Illuminate\Database\Eloquent\Model; | |
6 | + | |
7 | +class SettingCategory extends Model | |
8 | +{ | |
9 | + protected $table = 'public.settings_categories'; | |
10 | + | |
11 | + /** | |
12 | + * @var array | |
13 | + */ | |
14 | + protected $fillable = [ | |
15 | + 'name' | |
16 | + ]; | |
17 | + | |
18 | + public function settings() | |
19 | + { | |
20 | + return $this->hasMany(Setting::class, 'setting_category_id'); | |
21 | + } | |
22 | +} | ... | ... |
app/Support/View/SettingView.php
... | ... | @@ -10,9 +10,9 @@ use App\Setting; |
10 | 10 | |
11 | 11 | class SettingView |
12 | 12 | { |
13 | - public function makeInput($id, $description, $type, $key, $value) | |
13 | + public function makeInput($id, $description, $type, $key, $value, $enabled, $hint) | |
14 | 14 | { |
15 | - return $this->getInput($type)->getInputView($id, $description, $key, $value); | |
15 | + return $this->getInput($type)->getInputView($id, $description, $key, $value, $enabled, $hint); | |
16 | 16 | } |
17 | 17 | |
18 | 18 | private function getInput($type) | ... | ... |
app/Support/View/Settings/Inputs/BooleanInput.php
... | ... | @@ -4,13 +4,15 @@ namespace App\Support\View\Settings\Inputs; |
4 | 4 | |
5 | 5 | class BooleanInput implements InputInterface |
6 | 6 | { |
7 | - public function getInputView($id, $description, $key, $value) | |
7 | + public function getInputView($id, $description, $key, $value, $enabled, $hint) | |
8 | 8 | { |
9 | 9 | return view('settings.boolean-input', [ |
10 | 10 | 'id' => $id, |
11 | 11 | 'description' => $description, |
12 | 12 | 'key' => $key, |
13 | 13 | 'value' => $value, |
14 | + 'enabled' => $enabled, | |
15 | + 'hint' => $hint, | |
14 | 16 | ]); |
15 | 17 | } |
16 | 18 | } | ... | ... |
app/Support/View/Settings/Inputs/FloatInput.php
... | ... | @@ -4,13 +4,15 @@ namespace App\Support\View\Settings\Inputs; |
4 | 4 | |
5 | 5 | class FloatInput implements InputInterface |
6 | 6 | { |
7 | - public function getInputView($id, $description, $key, $value) | |
7 | + public function getInputView($id, $description, $key, $value, $enabled, $hint) | |
8 | 8 | { |
9 | 9 | return view('settings.float-input', [ |
10 | 10 | 'id' => $id, |
11 | 11 | 'description' => $description, |
12 | 12 | 'key' => $key, |
13 | 13 | 'value' => $value, |
14 | + 'enabled' => $enabled, | |
15 | + 'hint' => $hint, | |
14 | 16 | ]); |
15 | 17 | } |
16 | 18 | } | ... | ... |
app/Support/View/Settings/Inputs/InputInterface.php
app/Support/View/Settings/Inputs/IntegerInput.php
... | ... | @@ -4,13 +4,15 @@ namespace App\Support\View\Settings\Inputs; |
4 | 4 | |
5 | 5 | class IntegerInput implements InputInterface |
6 | 6 | { |
7 | - public function getInputView($id, $description, $key, $value) | |
7 | + public function getInputView($id, $description, $key, $value, $enabled, $hint) | |
8 | 8 | { |
9 | 9 | return view('settings.integer-input', [ |
10 | 10 | 'id' => $id, |
11 | 11 | 'description' => $description, |
12 | 12 | 'key' => $key, |
13 | 13 | 'value' => $value, |
14 | + 'enabled' => $enabled, | |
15 | + 'hint' => $hint, | |
14 | 16 | ]); |
15 | 17 | } |
16 | 18 | } | ... | ... |
app/Support/View/Settings/Inputs/StringInput.php
... | ... | @@ -4,13 +4,15 @@ namespace App\Support\View\Settings\Inputs; |
4 | 4 | |
5 | 5 | class StringInput implements InputInterface |
6 | 6 | { |
7 | - public function getInputView($id, $description, $key, $value) | |
7 | + public function getInputView($id, $description, $key, $value, $enabled, $hint) | |
8 | 8 | { |
9 | 9 | return view('settings.string-input', [ |
10 | 10 | 'id' => $id, |
11 | 11 | 'description' => $description, |
12 | 12 | 'key' => $key, |
13 | 13 | 'value' => $value, |
14 | + 'enabled' => $enabled, | |
15 | + 'hint' => $hint, | |
14 | 16 | ]); |
15 | 17 | } |
16 | 18 | } | ... | ... |
composer.lock
... | ... | @@ -2636,6 +2636,56 @@ |
2636 | 2636 | "time": "2019-10-06T11:29:25+00:00" |
2637 | 2637 | }, |
2638 | 2638 | { |
2639 | + "name": "mll-lab/graphql-php-scalars", | |
2640 | + "version": "v3.1.0", | |
2641 | + "source": { | |
2642 | + "type": "git", | |
2643 | + "url": "https://github.com/mll-lab/graphql-php-scalars.git", | |
2644 | + "reference": "aeaf687abb8890ad0bbadffa795844208488cd44" | |
2645 | + }, | |
2646 | + "dist": { | |
2647 | + "type": "zip", | |
2648 | + "url": "https://api.github.com/repos/mll-lab/graphql-php-scalars/zipball/aeaf687abb8890ad0bbadffa795844208488cd44", | |
2649 | + "reference": "aeaf687abb8890ad0bbadffa795844208488cd44", | |
2650 | + "shasum": "" | |
2651 | + }, | |
2652 | + "require": { | |
2653 | + "egulias/email-validator": "^2.1.17", | |
2654 | + "php": ">=7.2", | |
2655 | + "spatie/regex": "^1.4.1", | |
2656 | + "thecodingmachine/safe": "^1.0.3", | |
2657 | + "webonyx/graphql-php": "^0.13.8 || ^14.0.0" | |
2658 | + }, | |
2659 | + "require-dev": { | |
2660 | + "ext-json": "*", | |
2661 | + "phpstan/phpstan": "^0.12.31", | |
2662 | + "phpunit/phpunit": "^8.5.3", | |
2663 | + "thecodingmachine/phpstan-safe-rule": "^1.0.0" | |
2664 | + }, | |
2665 | + "type": "library", | |
2666 | + "autoload": { | |
2667 | + "psr-4": { | |
2668 | + "MLL\\GraphQLScalars\\": "src" | |
2669 | + } | |
2670 | + }, | |
2671 | + "notification-url": "https://packagist.org/downloads/", | |
2672 | + "license": [ | |
2673 | + "MIT" | |
2674 | + ], | |
2675 | + "authors": [ | |
2676 | + { | |
2677 | + "name": "Benedikt Franke", | |
2678 | + "email": "benedikt@franke.tech" | |
2679 | + } | |
2680 | + ], | |
2681 | + "description": "A collection of custom scalar types for usage with https://github.com/webonyx/graphql-php", | |
2682 | + "keywords": [ | |
2683 | + "graphql", | |
2684 | + "php" | |
2685 | + ], | |
2686 | + "time": "2020-06-25T19:16:23+00:00" | |
2687 | + }, | |
2688 | + { | |
2639 | 2689 | "name": "monolog/monolog", |
2640 | 2690 | "version": "1.25.5", |
2641 | 2691 | "source": { |
... | ... | @@ -2967,6 +3017,120 @@ |
2967 | 3017 | "time": "2020-07-25T13:18:53+00:00" |
2968 | 3018 | }, |
2969 | 3019 | { |
3020 | + "name": "nuwave/lighthouse", | |
3021 | + "version": "v4.16.3", | |
3022 | + "source": { | |
3023 | + "type": "git", | |
3024 | + "url": "https://github.com/nuwave/lighthouse.git", | |
3025 | + "reference": "66158dfe73a7a221ebd635d5fea7325d980a673b" | |
3026 | + }, | |
3027 | + "dist": { | |
3028 | + "type": "zip", | |
3029 | + "url": "https://api.github.com/repos/nuwave/lighthouse/zipball/66158dfe73a7a221ebd635d5fea7325d980a673b", | |
3030 | + "reference": "66158dfe73a7a221ebd635d5fea7325d980a673b", | |
3031 | + "shasum": "" | |
3032 | + }, | |
3033 | + "require": { | |
3034 | + "ext-json": "*", | |
3035 | + "illuminate/auth": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
3036 | + "illuminate/bus": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
3037 | + "illuminate/contracts": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
3038 | + "illuminate/http": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
3039 | + "illuminate/pagination": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
3040 | + "illuminate/queue": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
3041 | + "illuminate/routing": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
3042 | + "illuminate/support": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
3043 | + "illuminate/validation": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
3044 | + "nesbot/carbon": "^1.26.0 || ^2.0", | |
3045 | + "php": ">= 7.1", | |
3046 | + "webonyx/graphql-php": "^0.13.2" | |
3047 | + }, | |
3048 | + "require-dev": { | |
3049 | + "bensampo/laravel-enum": "^1.28.3", | |
3050 | + "ergebnis/composer-normalize": "^2.2.2", | |
3051 | + "haydenpierce/class-finder": "^0.4", | |
3052 | + "laravel/framework": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
3053 | + "laravel/lumen-framework": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
3054 | + "laravel/scout": "^4.0 || ^5.0 || ^6.0 || ^7.0", | |
3055 | + "mll-lab/graphql-php-scalars": "^2.1", | |
3056 | + "mockery/mockery": "^1.0", | |
3057 | + "nunomaduro/larastan": "^0.6.0", | |
3058 | + "orchestra/database": "3.5.* || 3.6.* || 3.7.* || 3.8.* || 3.9.* || ^4.0 || ^5.0", | |
3059 | + "orchestra/testbench": "3.5.* || 3.6.* || 3.7.* || 3.8.* || 3.9.* || ^4.0 || ^5.0", | |
3060 | + "phpbench/phpbench": "^0.17.0", | |
3061 | + "phpstan/phpstan-mockery": "^0.12.5", | |
3062 | + "phpunit/phpunit": "^6.5 || ^7.5 || ^8.4", | |
3063 | + "pusher/pusher-php-server": "^3.2" | |
3064 | + }, | |
3065 | + "suggest": { | |
3066 | + "bensampo/laravel-enum": "Convenient enum definitions that can easily be registered in your Schema", | |
3067 | + "haydenpierce/class-finder": "Required for the artisan command lighthouse:validate-schema", | |
3068 | + "laravel/scout": "Required for the @search directive", | |
3069 | + "mll-lab/graphql-php-scalars": "Useful scalar types, required for @whereConditions", | |
3070 | + "mll-lab/laravel-graphql-playground": "GraphQL IDE for better development workflow - integrated with Laravel" | |
3071 | + }, | |
3072 | + "type": "library", | |
3073 | + "extra": { | |
3074 | + "laravel": { | |
3075 | + "providers": [ | |
3076 | + "Nuwave\\Lighthouse\\LighthouseServiceProvider", | |
3077 | + "Nuwave\\Lighthouse\\OrderBy\\OrderByServiceProvider", | |
3078 | + "Nuwave\\Lighthouse\\SoftDeletes\\SoftDeletesServiceProvider" | |
3079 | + ], | |
3080 | + "aliases": { | |
3081 | + "graphql": "Nuwave\\Lighthouse\\GraphQL" | |
3082 | + } | |
3083 | + } | |
3084 | + }, | |
3085 | + "autoload": { | |
3086 | + "psr-4": { | |
3087 | + "Nuwave\\Lighthouse\\": "src/" | |
3088 | + } | |
3089 | + }, | |
3090 | + "notification-url": "https://packagist.org/downloads/", | |
3091 | + "license": [ | |
3092 | + "MIT" | |
3093 | + ], | |
3094 | + "authors": [ | |
3095 | + { | |
3096 | + "name": "Christopher Moore", | |
3097 | + "email": "chris@nuwavecommerce.com", | |
3098 | + "homepage": "https://www.nuwavecommerce.com" | |
3099 | + }, | |
3100 | + { | |
3101 | + "name": "Benedikt Franke", | |
3102 | + "email": "benedikt@franke.tech", | |
3103 | + "homepage": "https://franke.tech" | |
3104 | + } | |
3105 | + ], | |
3106 | + "description": "A framework for serving GraphQL from Laravel", | |
3107 | + "homepage": "https://lighthouse-php.com", | |
3108 | + "keywords": [ | |
3109 | + "graphql", | |
3110 | + "laravel", | |
3111 | + "laravel-graphql" | |
3112 | + ], | |
3113 | + "funding": [ | |
3114 | + { | |
3115 | + "url": "https://github.com/spawnia", | |
3116 | + "type": "github" | |
3117 | + }, | |
3118 | + { | |
3119 | + "url": "https://issuehunt.io/r/nuwave/lighthouse", | |
3120 | + "type": "issuehunt" | |
3121 | + }, | |
3122 | + { | |
3123 | + "url": "https://www.patreon.com/lighthouse_php", | |
3124 | + "type": "patreon" | |
3125 | + }, | |
3126 | + { | |
3127 | + "url": "https://tidelift.com/funding/github/packagist/nuwave/lighthouse", | |
3128 | + "type": "tidelift" | |
3129 | + } | |
3130 | + ], | |
3131 | + "time": "2020-08-26T16:35:19+00:00" | |
3132 | + }, | |
3133 | + { | |
2970 | 3134 | "name": "opis/closure", |
2971 | 3135 | "version": "3.5.5", |
2972 | 3136 | "source": { |
... | ... | @@ -4101,6 +4265,55 @@ |
4101 | 4265 | "time": "2019-01-31T13:02:04+00:00" |
4102 | 4266 | }, |
4103 | 4267 | { |
4268 | + "name": "spatie/regex", | |
4269 | + "version": "1.4.1", | |
4270 | + "source": { | |
4271 | + "type": "git", | |
4272 | + "url": "https://github.com/spatie/regex.git", | |
4273 | + "reference": "b046f05e07b82cbd1a4bed5d5a2a2139a87ff417" | |
4274 | + }, | |
4275 | + "dist": { | |
4276 | + "type": "zip", | |
4277 | + "url": "https://api.github.com/repos/spatie/regex/zipball/b046f05e07b82cbd1a4bed5d5a2a2139a87ff417", | |
4278 | + "reference": "b046f05e07b82cbd1a4bed5d5a2a2139a87ff417", | |
4279 | + "shasum": "" | |
4280 | + }, | |
4281 | + "require": { | |
4282 | + "php": "^7.0" | |
4283 | + }, | |
4284 | + "require-dev": { | |
4285 | + "phpunit/phpunit": "^6.4" | |
4286 | + }, | |
4287 | + "type": "library", | |
4288 | + "autoload": { | |
4289 | + "psr-4": { | |
4290 | + "Spatie\\Regex\\": "src" | |
4291 | + } | |
4292 | + }, | |
4293 | + "notification-url": "https://packagist.org/downloads/", | |
4294 | + "license": [ | |
4295 | + "MIT" | |
4296 | + ], | |
4297 | + "authors": [ | |
4298 | + { | |
4299 | + "name": "Sebastian De Deyne", | |
4300 | + "email": "sebastian@spatie.be", | |
4301 | + "homepage": "https://spatie.be", | |
4302 | + "role": "Developer" | |
4303 | + } | |
4304 | + ], | |
4305 | + "description": "A sane interface for php's built in preg_* functions", | |
4306 | + "homepage": "https://github.com/spatie/regex", | |
4307 | + "keywords": [ | |
4308 | + "expression", | |
4309 | + "expressions", | |
4310 | + "regex", | |
4311 | + "regular", | |
4312 | + "spatie" | |
4313 | + ], | |
4314 | + "time": "2019-06-19T06:59:15+00:00" | |
4315 | + }, | |
4316 | + { | |
4104 | 4317 | "name": "swiftmailer/swiftmailer", |
4105 | 4318 | "version": "v6.2.3", |
4106 | 4319 | "source": { |
... | ... | @@ -6124,6 +6337,139 @@ |
6124 | 6337 | "time": "2020-08-17T07:31:35+00:00" |
6125 | 6338 | }, |
6126 | 6339 | { |
6340 | + "name": "thecodingmachine/safe", | |
6341 | + "version": "v1.1.3", | |
6342 | + "source": { | |
6343 | + "type": "git", | |
6344 | + "url": "https://github.com/thecodingmachine/safe.git", | |
6345 | + "reference": "9f277171e296a3c8629c04ac93ec95ff0f208ccb" | |
6346 | + }, | |
6347 | + "dist": { | |
6348 | + "type": "zip", | |
6349 | + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/9f277171e296a3c8629c04ac93ec95ff0f208ccb", | |
6350 | + "reference": "9f277171e296a3c8629c04ac93ec95ff0f208ccb", | |
6351 | + "shasum": "" | |
6352 | + }, | |
6353 | + "require": { | |
6354 | + "php": ">=7.2" | |
6355 | + }, | |
6356 | + "require-dev": { | |
6357 | + "phpstan/phpstan": "^0.12", | |
6358 | + "squizlabs/php_codesniffer": "^3.2", | |
6359 | + "thecodingmachine/phpstan-strict-rules": "^0.12" | |
6360 | + }, | |
6361 | + "type": "library", | |
6362 | + "extra": { | |
6363 | + "branch-alias": { | |
6364 | + "dev-master": "0.1-dev" | |
6365 | + } | |
6366 | + }, | |
6367 | + "autoload": { | |
6368 | + "psr-4": { | |
6369 | + "Safe\\": [ | |
6370 | + "lib/", | |
6371 | + "generated/" | |
6372 | + ] | |
6373 | + }, | |
6374 | + "files": [ | |
6375 | + "generated/apache.php", | |
6376 | + "generated/apc.php", | |
6377 | + "generated/apcu.php", | |
6378 | + "generated/array.php", | |
6379 | + "generated/bzip2.php", | |
6380 | + "generated/classobj.php", | |
6381 | + "generated/com.php", | |
6382 | + "generated/cubrid.php", | |
6383 | + "generated/curl.php", | |
6384 | + "generated/datetime.php", | |
6385 | + "generated/dir.php", | |
6386 | + "generated/eio.php", | |
6387 | + "generated/errorfunc.php", | |
6388 | + "generated/exec.php", | |
6389 | + "generated/fileinfo.php", | |
6390 | + "generated/filesystem.php", | |
6391 | + "generated/filter.php", | |
6392 | + "generated/fpm.php", | |
6393 | + "generated/ftp.php", | |
6394 | + "generated/funchand.php", | |
6395 | + "generated/gmp.php", | |
6396 | + "generated/gnupg.php", | |
6397 | + "generated/hash.php", | |
6398 | + "generated/ibase.php", | |
6399 | + "generated/ibmDb2.php", | |
6400 | + "generated/iconv.php", | |
6401 | + "generated/image.php", | |
6402 | + "generated/imap.php", | |
6403 | + "generated/info.php", | |
6404 | + "generated/ingres-ii.php", | |
6405 | + "generated/inotify.php", | |
6406 | + "generated/json.php", | |
6407 | + "generated/ldap.php", | |
6408 | + "generated/libevent.php", | |
6409 | + "generated/libxml.php", | |
6410 | + "generated/lzf.php", | |
6411 | + "generated/mailparse.php", | |
6412 | + "generated/mbstring.php", | |
6413 | + "generated/misc.php", | |
6414 | + "generated/msql.php", | |
6415 | + "generated/mssql.php", | |
6416 | + "generated/mysql.php", | |
6417 | + "generated/mysqli.php", | |
6418 | + "generated/mysqlndMs.php", | |
6419 | + "generated/mysqlndQc.php", | |
6420 | + "generated/network.php", | |
6421 | + "generated/oci8.php", | |
6422 | + "generated/opcache.php", | |
6423 | + "generated/openssl.php", | |
6424 | + "generated/outcontrol.php", | |
6425 | + "generated/password.php", | |
6426 | + "generated/pcntl.php", | |
6427 | + "generated/pcre.php", | |
6428 | + "generated/pdf.php", | |
6429 | + "generated/pgsql.php", | |
6430 | + "generated/posix.php", | |
6431 | + "generated/ps.php", | |
6432 | + "generated/pspell.php", | |
6433 | + "generated/readline.php", | |
6434 | + "generated/rpminfo.php", | |
6435 | + "generated/rrd.php", | |
6436 | + "generated/sem.php", | |
6437 | + "generated/session.php", | |
6438 | + "generated/shmop.php", | |
6439 | + "generated/simplexml.php", | |
6440 | + "generated/sockets.php", | |
6441 | + "generated/sodium.php", | |
6442 | + "generated/solr.php", | |
6443 | + "generated/spl.php", | |
6444 | + "generated/sqlsrv.php", | |
6445 | + "generated/ssdeep.php", | |
6446 | + "generated/ssh2.php", | |
6447 | + "generated/stats.php", | |
6448 | + "generated/stream.php", | |
6449 | + "generated/strings.php", | |
6450 | + "generated/swoole.php", | |
6451 | + "generated/uodbc.php", | |
6452 | + "generated/uopz.php", | |
6453 | + "generated/url.php", | |
6454 | + "generated/var.php", | |
6455 | + "generated/xdiff.php", | |
6456 | + "generated/xml.php", | |
6457 | + "generated/xmlrpc.php", | |
6458 | + "generated/yaml.php", | |
6459 | + "generated/yaz.php", | |
6460 | + "generated/zip.php", | |
6461 | + "generated/zlib.php", | |
6462 | + "lib/special_cases.php" | |
6463 | + ] | |
6464 | + }, | |
6465 | + "notification-url": "https://packagist.org/downloads/", | |
6466 | + "license": [ | |
6467 | + "MIT" | |
6468 | + ], | |
6469 | + "description": "PHP core functions that throw exceptions instead of returning FALSE on error", | |
6470 | + "time": "2020-07-10T09:34:29+00:00" | |
6471 | + }, | |
6472 | + { | |
6127 | 6473 | "name": "tijsverkoyen/css-to-inline-styles", |
6128 | 6474 | "version": "2.2.3", |
6129 | 6475 | "source": { |
... | ... | @@ -6297,6 +6643,64 @@ |
6297 | 6643 | "time": "2020-07-14T19:04:52+00:00" |
6298 | 6644 | }, |
6299 | 6645 | { |
6646 | + "name": "webonyx/graphql-php", | |
6647 | + "version": "v0.13.9", | |
6648 | + "source": { | |
6649 | + "type": "git", | |
6650 | + "url": "https://github.com/webonyx/graphql-php.git", | |
6651 | + "reference": "d9a94fddcad0a35d4bced212b8a44ad1bc59bdf3" | |
6652 | + }, | |
6653 | + "dist": { | |
6654 | + "type": "zip", | |
6655 | + "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/d9a94fddcad0a35d4bced212b8a44ad1bc59bdf3", | |
6656 | + "reference": "d9a94fddcad0a35d4bced212b8a44ad1bc59bdf3", | |
6657 | + "shasum": "" | |
6658 | + }, | |
6659 | + "require": { | |
6660 | + "ext-json": "*", | |
6661 | + "ext-mbstring": "*", | |
6662 | + "php": "^7.1||^8.0" | |
6663 | + }, | |
6664 | + "require-dev": { | |
6665 | + "doctrine/coding-standard": "^6.0", | |
6666 | + "phpbench/phpbench": "^0.14.0", | |
6667 | + "phpstan/phpstan": "^0.11.4", | |
6668 | + "phpstan/phpstan-phpunit": "^0.11.0", | |
6669 | + "phpstan/phpstan-strict-rules": "^0.11.0", | |
6670 | + "phpunit/phpcov": "^5.0", | |
6671 | + "phpunit/phpunit": "^7.2", | |
6672 | + "psr/http-message": "^1.0", | |
6673 | + "react/promise": "2.*" | |
6674 | + }, | |
6675 | + "suggest": { | |
6676 | + "psr/http-message": "To use standard GraphQL server", | |
6677 | + "react/promise": "To leverage async resolving on React PHP platform" | |
6678 | + }, | |
6679 | + "type": "library", | |
6680 | + "autoload": { | |
6681 | + "psr-4": { | |
6682 | + "GraphQL\\": "src/" | |
6683 | + } | |
6684 | + }, | |
6685 | + "notification-url": "https://packagist.org/downloads/", | |
6686 | + "license": [ | |
6687 | + "MIT" | |
6688 | + ], | |
6689 | + "description": "A PHP port of GraphQL reference implementation", | |
6690 | + "homepage": "https://github.com/webonyx/graphql-php", | |
6691 | + "keywords": [ | |
6692 | + "api", | |
6693 | + "graphql" | |
6694 | + ], | |
6695 | + "funding": [ | |
6696 | + { | |
6697 | + "url": "https://opencollective.com/webonyx-graphql-php", | |
6698 | + "type": "open_collective" | |
6699 | + } | |
6700 | + ], | |
6701 | + "time": "2020-07-02T05:49:25+00:00" | |
6702 | + }, | |
6703 | + { | |
6300 | 6704 | "name": "wikimedia/composer-merge-plugin", |
6301 | 6705 | "version": "v1.4.1", |
6302 | 6706 | "source": { |
... | ... | @@ -6469,9 +6873,9 @@ |
6469 | 6873 | "authors": [ |
6470 | 6874 | { |
6471 | 6875 | "name": "Marcel Pociot", |
6876 | + "role": "Developer", | |
6472 | 6877 | "email": "marcel@beyondco.de", |
6473 | - "homepage": "https://beyondco.de", | |
6474 | - "role": "Developer" | |
6878 | + "homepage": "https://beyondco.de" | |
6475 | 6879 | } |
6476 | 6880 | ], |
6477 | 6881 | "description": "Symfony Var-Dump Server for Laravel", |
... | ... | @@ -6935,6 +7339,48 @@ |
6935 | 7339 | "time": "2020-07-09T08:09:16+00:00" |
6936 | 7340 | }, |
6937 | 7341 | { |
7342 | + "name": "haydenpierce/class-finder", | |
7343 | + "version": "0.4.2", | |
7344 | + "source": { | |
7345 | + "type": "git", | |
7346 | + "url": "https://gitlab.com/hpierce1102/ClassFinder.git", | |
7347 | + "reference": "b8393ea73d25010e3e946e317d0e8797c788cb20" | |
7348 | + }, | |
7349 | + "dist": { | |
7350 | + "type": "zip", | |
7351 | + "url": "https://gitlab.com/api/v4/projects/hpierce1102%2FClassFinder/repository/archive.zip?sha=b8393ea73d25010e3e946e317d0e8797c788cb20", | |
7352 | + "reference": "b8393ea73d25010e3e946e317d0e8797c788cb20", | |
7353 | + "shasum": "" | |
7354 | + }, | |
7355 | + "require": { | |
7356 | + "ext-json": "*", | |
7357 | + "php": ">=5.3" | |
7358 | + }, | |
7359 | + "require-dev": { | |
7360 | + "mikey179/vfsstream": "^1.6", | |
7361 | + "phpunit/phpunit": "4.8.36" | |
7362 | + }, | |
7363 | + "type": "library", | |
7364 | + "autoload": { | |
7365 | + "psr-4": { | |
7366 | + "HaydenPierce\\ClassFinder\\": "src/", | |
7367 | + "HaydenPierce\\ClassFinder\\UnitTest\\": "test/unit" | |
7368 | + } | |
7369 | + }, | |
7370 | + "notification-url": "https://packagist.org/downloads/", | |
7371 | + "license": [ | |
7372 | + "MIT" | |
7373 | + ], | |
7374 | + "authors": [ | |
7375 | + { | |
7376 | + "name": "Hayden Pierce", | |
7377 | + "email": "hayden@haydenpierce.com" | |
7378 | + } | |
7379 | + ], | |
7380 | + "description": "A library that can provide of a list of classes in a given namespace", | |
7381 | + "time": "2020-04-20T17:38:50+00:00" | |
7382 | + }, | |
7383 | + { | |
6938 | 7384 | "name": "laravel/dusk", |
6939 | 7385 | "version": "v5.11.0", |
6940 | 7386 | "source": { |
... | ... | @@ -7181,6 +7627,61 @@ |
7181 | 7627 | "time": "2020-05-06T07:06:27+00:00" |
7182 | 7628 | }, |
7183 | 7629 | { |
7630 | + "name": "mll-lab/laravel-graphql-playground", | |
7631 | + "version": "v2.3.0", | |
7632 | + "source": { | |
7633 | + "type": "git", | |
7634 | + "url": "https://github.com/mll-lab/laravel-graphql-playground.git", | |
7635 | + "reference": "81a557cefb65d3bcb2f6e2c8d245e301078e09f6" | |
7636 | + }, | |
7637 | + "dist": { | |
7638 | + "type": "zip", | |
7639 | + "url": "https://api.github.com/repos/mll-lab/laravel-graphql-playground/zipball/81a557cefb65d3bcb2f6e2c8d245e301078e09f6", | |
7640 | + "reference": "81a557cefb65d3bcb2f6e2c8d245e301078e09f6", | |
7641 | + "shasum": "" | |
7642 | + }, | |
7643 | + "require": { | |
7644 | + "illuminate/console": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
7645 | + "illuminate/contracts": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
7646 | + "illuminate/support": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
7647 | + "php": ">=7.1" | |
7648 | + }, | |
7649 | + "require-dev": { | |
7650 | + "laravel/lumen-framework": "5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0", | |
7651 | + "localheinz/composer-normalize": "^1.3" | |
7652 | + }, | |
7653 | + "type": "library", | |
7654 | + "extra": { | |
7655 | + "laravel": { | |
7656 | + "providers": [ | |
7657 | + "MLL\\GraphQLPlayground\\GraphQLPlaygroundServiceProvider" | |
7658 | + ] | |
7659 | + } | |
7660 | + }, | |
7661 | + "autoload": { | |
7662 | + "psr-4": { | |
7663 | + "MLL\\GraphQLPlayground\\": "src/" | |
7664 | + } | |
7665 | + }, | |
7666 | + "notification-url": "https://packagist.org/downloads/", | |
7667 | + "license": [ | |
7668 | + "MIT" | |
7669 | + ], | |
7670 | + "authors": [ | |
7671 | + { | |
7672 | + "name": "Benedikt Franke", | |
7673 | + "email": "benedikt@franke.tech" | |
7674 | + } | |
7675 | + ], | |
7676 | + "description": "Easily integrate GraphQL Playground into your Laravel project", | |
7677 | + "keywords": [ | |
7678 | + "graphql", | |
7679 | + "graphql-playground", | |
7680 | + "laravel" | |
7681 | + ], | |
7682 | + "time": "2020-07-17T08:53:30+00:00" | |
7683 | + }, | |
7684 | + { | |
7184 | 7685 | "name": "mockery/mockery", |
7185 | 7686 | "version": "1.3.2", |
7186 | 7687 | "source": { | ... | ... |
config/assets.php
... | ... | @@ -0,0 +1,375 @@ |
1 | +<?php | |
2 | + | |
3 | +return [ | |
4 | + /* | |
5 | + |-------------------------------------------------------------------------- | |
6 | + | Route Configuration | |
7 | + |-------------------------------------------------------------------------- | |
8 | + | | |
9 | + | Controls the HTTP route that your GraphQL server responds to. | |
10 | + | You may set `route` => false, to disable the default route | |
11 | + | registration and take full control. | |
12 | + | | |
13 | + */ | |
14 | + | |
15 | + 'route' => [ | |
16 | + /* | |
17 | + * The URI the endpoint responds to, e.g. mydomain.com/graphql. | |
18 | + */ | |
19 | + 'uri' => '/graphql', | |
20 | + | |
21 | + /* | |
22 | + * Lighthouse creates a named route for convenient URL generation and redirects. | |
23 | + */ | |
24 | + 'name' => 'graphql', | |
25 | + | |
26 | + /* | |
27 | + * Beware that middleware defined here runs before the GraphQL execution phase, | |
28 | + * make sure to return spec-compliant responses in case an error is thrown. | |
29 | + */ | |
30 | + 'middleware' => [ | |
31 | + 'web', | |
32 | + | |
33 | + \Nuwave\Lighthouse\Support\Http\Middleware\AcceptJson::class, | |
34 | + | |
35 | + // Logs in a user if they are authenticated. In contrast to Laravel's 'auth' | |
36 | + // middleware, this delegates auth and permission checks to the field level. | |
37 | + \Nuwave\Lighthouse\Support\Http\Middleware\AttemptAuthentication::class, | |
38 | + | |
39 | + // Logs every incoming GraphQL query. | |
40 | + // \Nuwave\Lighthouse\Support\Http\Middleware\LogGraphQLQueries::class, | |
41 | + ], | |
42 | + | |
43 | + /* | |
44 | + * The `prefix` and `domain` configuration options are optional. | |
45 | + */ | |
46 | + //'prefix' => '', | |
47 | + //'domain' => '', | |
48 | + ], | |
49 | + | |
50 | + /* | |
51 | + |-------------------------------------------------------------------------- | |
52 | + | Authentication Guard | |
53 | + |-------------------------------------------------------------------------- | |
54 | + | | |
55 | + | The guard to use for authenticating GraphQL requests, if needed. | |
56 | + | This setting is used whenever Lighthouse looks for an authenticated user, for example in directives | |
57 | + | such as `@guard` and when applying the `AttemptAuthentication` middleware. | |
58 | + | TODO this setting will default to 'api' in v5 | |
59 | + | | |
60 | + */ | |
61 | + | |
62 | + 'guard' => null, | |
63 | + | |
64 | + /* | |
65 | + |-------------------------------------------------------------------------- | |
66 | + | Schema Location | |
67 | + |-------------------------------------------------------------------------- | |
68 | + | | |
69 | + | Path to your .graphql schema file. | |
70 | + | Additional schema files may be imported from within that file. | |
71 | + | | |
72 | + */ | |
73 | + | |
74 | + 'schema' => [ | |
75 | + 'register' => base_path('packages/portabilis/pre-matricula/graphql/schema.graphql'), | |
76 | + ], | |
77 | + | |
78 | + /* | |
79 | + |-------------------------------------------------------------------------- | |
80 | + | Schema Cache | |
81 | + |-------------------------------------------------------------------------- | |
82 | + | | |
83 | + | A large part of schema generation consists of parsing and AST manipulation. | |
84 | + | This operation is very expensive, so it is highly recommended to enable | |
85 | + | caching of the final schema to optimize performance of large schemas. | |
86 | + | | |
87 | + */ | |
88 | + | |
89 | + 'cache' => [ | |
90 | + /* | |
91 | + * Setting to true enables schema caching. | |
92 | + */ | |
93 | + 'enable' => env('LIGHTHOUSE_CACHE_ENABLE', env('APP_ENV') !== 'local'), | |
94 | + | |
95 | + /* | |
96 | + * The name of the cache item for the schema cache. | |
97 | + */ | |
98 | + 'key' => env('LIGHTHOUSE_CACHE_KEY', 'lighthouse-schema'), | |
99 | + | |
100 | + /* | |
101 | + * Allows using a specific cache store, uses the app's default if set to null. | |
102 | + */ | |
103 | + 'store' => env('LIGHTHOUSE_CACHE_STORE', null), | |
104 | + | |
105 | + /** | |
106 | + * Duration in seconds the schema should remain cached, null means forever. | |
107 | + */ | |
108 | + 'ttl' => env('LIGHTHOUSE_CACHE_TTL', null), | |
109 | + ], | |
110 | + | |
111 | + /* | |
112 | + |-------------------------------------------------------------------------- | |
113 | + | Namespaces | |
114 | + |-------------------------------------------------------------------------- | |
115 | + | | |
116 | + | These are the default namespaces where Lighthouse looks for classes to | |
117 | + | extend functionality of the schema. You may pass in either a string | |
118 | + | or an array, they are tried in order and the first match is used. | |
119 | + | | |
120 | + */ | |
121 | + | |
122 | + 'namespaces' => [ | |
123 | + 'models' => ['iEducar\\Packages\\PreMatricula\\Models'], | |
124 | + 'queries' => 'iEducar\\Packages\\PreMatricula\\GraphQL\\Queries', | |
125 | + 'mutations' => 'iEducar\\Packages\\PreMatricula\\GraphQL\\Mutations', | |
126 | + 'subscriptions' => 'iEducar\\Packages\\PreMatricula\\GraphQL\\Subscriptions', | |
127 | + 'interfaces' => 'iEducar\\Packages\\PreMatricula\\GraphQL\\Interfaces', | |
128 | + 'unions' => 'iEducar\\Packages\\PreMatricula\\GraphQL\\Unions', | |
129 | + 'scalars' => 'iEducar\\Packages\\PreMatricula\\GraphQL\\Scalars', | |
130 | + 'directives' => ['iEducar\\Packages\\PreMatricula\\GraphQL\\Directives'], | |
131 | + ], | |
132 | + | |
133 | + /* | |
134 | + |-------------------------------------------------------------------------- | |
135 | + | Security | |
136 | + |-------------------------------------------------------------------------- | |
137 | + | | |
138 | + | Control how Lighthouse handles security related query validation. | |
139 | + | Read more at http://webonyx.github.io/graphql-php/security/ | |
140 | + | | |
141 | + */ | |
142 | + | |
143 | + 'security' => [ | |
144 | + 'max_query_complexity' => \GraphQL\Validator\Rules\QueryComplexity::DISABLED, | |
145 | + 'max_query_depth' => \GraphQL\Validator\Rules\QueryDepth::DISABLED, | |
146 | + 'disable_introspection' => \GraphQL\Validator\Rules\DisableIntrospection::DISABLED, | |
147 | + ], | |
148 | + | |
149 | + /* | |
150 | + |-------------------------------------------------------------------------- | |
151 | + | Pagination | |
152 | + |-------------------------------------------------------------------------- | |
153 | + | | |
154 | + | Set defaults for the pagination features within Lighthouse, such as | |
155 | + | the @paginate directive, or paginated relation directives. | |
156 | + | | |
157 | + */ | |
158 | + | |
159 | + 'pagination' => [ | |
160 | + /* | |
161 | + * Allow clients to query paginated lists without specifying the amount of items. | |
162 | + * Setting this to `null` means clients have to explicitly ask for the count. | |
163 | + */ | |
164 | + 'default_count' => 10, | |
165 | + | |
166 | + /* | |
167 | + * Limit the maximum amount of items that clients can request from paginated lists. | |
168 | + * Setting this to `null` means the count is unrestricted. | |
169 | + */ | |
170 | + 'max_count' => null, | |
171 | + ], | |
172 | + | |
173 | + /* | |
174 | + |-------------------------------------------------------------------------- | |
175 | + | Pagination Amount Argument | |
176 | + |-------------------------------------------------------------------------- | |
177 | + | | |
178 | + | Set the name to use for the generated argument on paginated fields | |
179 | + | that controls how many results are returned. | |
180 | + | | |
181 | + | DEPRECATED This setting will be removed in v5. | |
182 | + | | |
183 | + */ | |
184 | + | |
185 | + 'pagination_amount_argument' => 'first', | |
186 | + | |
187 | + /* | |
188 | + |-------------------------------------------------------------------------- | |
189 | + | @orderBy input name | |
190 | + |-------------------------------------------------------------------------- | |
191 | + | | |
192 | + | Set the name to use for the generated argument on the | |
193 | + | OrderByClause used for the @orderBy directive. | |
194 | + | | |
195 | + | DEPRECATED This setting will be removed in v5, Lighthouse will assume | |
196 | + | the value 'column'. Change it soon, as you prepare for the upgrade. | |
197 | + | | |
198 | + */ | |
199 | + | |
200 | + 'orderBy' => 'field', | |
201 | + | |
202 | + /* | |
203 | + |-------------------------------------------------------------------------- | |
204 | + | Debug | |
205 | + |-------------------------------------------------------------------------- | |
206 | + | | |
207 | + | Control the debug level as described in http://webonyx.github.io/graphql-php/error-handling/ | |
208 | + | Debugging is only applied if the global Laravel debug config is set to true. | |
209 | + | | |
210 | + */ | |
211 | + | |
212 | + 'debug' => \GraphQL\Error\Debug::INCLUDE_DEBUG_MESSAGE | \GraphQL\Error\Debug::INCLUDE_TRACE, | |
213 | + | |
214 | + /* | |
215 | + |-------------------------------------------------------------------------- | |
216 | + | Error Handlers | |
217 | + |-------------------------------------------------------------------------- | |
218 | + | | |
219 | + | Register error handlers that receive the Errors that occur during execution | |
220 | + | and handle them. You may use this to log, filter or format the errors. | |
221 | + | The classes must implement \Nuwave\Lighthouse\Execution\ErrorHandler | |
222 | + | | |
223 | + */ | |
224 | + | |
225 | + 'error_handlers' => [ | |
226 | + \Nuwave\Lighthouse\Execution\ExtensionErrorHandler::class, | |
227 | + \Nuwave\Lighthouse\Execution\ReportingErrorHandler::class, | |
228 | + ], | |
229 | + | |
230 | + /* | |
231 | + |-------------------------------------------------------------------------- | |
232 | + | Global ID | |
233 | + |-------------------------------------------------------------------------- | |
234 | + | | |
235 | + | The name that is used for the global id field on the Node interface. | |
236 | + | When creating a Relay compliant server, this must be named "id". | |
237 | + | | |
238 | + */ | |
239 | + | |
240 | + 'global_id_field' => 'id', | |
241 | + | |
242 | + /* | |
243 | + |-------------------------------------------------------------------------- | |
244 | + | Batched Queries | |
245 | + |-------------------------------------------------------------------------- | |
246 | + | | |
247 | + | GraphQL query batching means sending multiple queries to the server in one request, | |
248 | + | You may set this flag to either process or deny batched queries. | |
249 | + | | |
250 | + */ | |
251 | + | |
252 | + 'batched_queries' => true, | |
253 | + | |
254 | + /* | |
255 | + |-------------------------------------------------------------------------- | |
256 | + | Transactional Mutations | |
257 | + |-------------------------------------------------------------------------- | |
258 | + | | |
259 | + | If set to true, mutations such as @create or @update will be | |
260 | + | wrapped in a transaction to ensure atomicity. | |
261 | + | | |
262 | + */ | |
263 | + | |
264 | + 'transactional_mutations' => true, | |
265 | + | |
266 | + /* | |
267 | + |-------------------------------------------------------------------------- | |
268 | + | Mass Assignment Protection | |
269 | + |-------------------------------------------------------------------------- | |
270 | + | | |
271 | + | If set to true, mutations will use forceFill() over fill() when populating | |
272 | + | a model with arguments in mutation directives. Since GraphQL constrains | |
273 | + | allowed inputs by design, mass assignment protection is not needed. | |
274 | + | | |
275 | + | Will default to true in v5. | |
276 | + | | |
277 | + */ | |
278 | + | |
279 | + 'force_fill' => false, | |
280 | + | |
281 | + /* | |
282 | + |-------------------------------------------------------------------------- | |
283 | + | Batchload Relations | |
284 | + |-------------------------------------------------------------------------- | |
285 | + | | |
286 | + | If set to true, relations marked with directives like @hasMany or @belongsTo | |
287 | + | will be optimized by combining the queries through the BatchLoader. | |
288 | + | | |
289 | + */ | |
290 | + | |
291 | + 'batchload_relations' => true, | |
292 | + | |
293 | + /* | |
294 | + |-------------------------------------------------------------------------- | |
295 | + | GraphQL Subscriptions | |
296 | + |-------------------------------------------------------------------------- | |
297 | + | | |
298 | + | Here you can define GraphQL subscription "broadcasters" and "storage" drivers | |
299 | + | as well their required configuration options. | |
300 | + | | |
301 | + */ | |
302 | + | |
303 | + 'subscriptions' => [ | |
304 | + /* | |
305 | + * Determines if broadcasts should be queued by default. | |
306 | + */ | |
307 | + 'queue_broadcasts' => env('LIGHTHOUSE_QUEUE_BROADCASTS', true), | |
308 | + | |
309 | + /* | |
310 | + * Determines the queue to use for broadcasting queue jobs. | |
311 | + */ | |
312 | + 'broadcasts_queue_name' => env('LIGHTHOUSE_BROADCASTS_QUEUE_NAME', null), | |
313 | + | |
314 | + /* | |
315 | + * Default subscription storage. | |
316 | + * | |
317 | + * Any Laravel supported cache driver options are available here. | |
318 | + */ | |
319 | + 'storage' => env('LIGHTHOUSE_SUBSCRIPTION_STORAGE', 'redis'), | |
320 | + | |
321 | + /* | |
322 | + * Default subscription storage time to live in seconds. | |
323 | + * | |
324 | + * Indicates how long a subscription can be active before it's automatically removed from storage. | |
325 | + * Setting this to `null` means the subscriptions are stored forever. This may cause | |
326 | + * stale subscriptions to linger indefinitely in case cleanup fails for any reason. | |
327 | + */ | |
328 | + 'storage_ttl' => env('LIGHTHOUSE_SUBSCRIPTION_STORAGE_TTL', null), | |
329 | + | |
330 | + /* | |
331 | + * Default subscription broadcaster. | |
332 | + */ | |
333 | + 'broadcaster' => env('LIGHTHOUSE_BROADCASTER', 'pusher'), | |
334 | + | |
335 | + /* | |
336 | + * Subscription broadcasting drivers with config options. | |
337 | + */ | |
338 | + 'broadcasters' => [ | |
339 | + 'log' => [ | |
340 | + 'driver' => 'log', | |
341 | + ], | |
342 | + 'pusher' => [ | |
343 | + 'driver' => 'pusher', | |
344 | + 'routes' => \Nuwave\Lighthouse\Subscriptions\SubscriptionRouter::class.'@pusher', | |
345 | + 'connection' => 'pusher', | |
346 | + ], | |
347 | + ], | |
348 | + ], | |
349 | + | |
350 | + /* | |
351 | + |-------------------------------------------------------------------------- | |
352 | + | Defer | |
353 | + |-------------------------------------------------------------------------- | |
354 | + | | |
355 | + | Configuration for the experimental @defer directive support. | |
356 | + | | |
357 | + */ | |
358 | + | |
359 | + 'defer' => [ | |
360 | + /* | |
361 | + * Maximum number of nested fields that can be deferred in one query. | |
362 | + * Once reached, remaining fields will be resolved synchronously. | |
363 | + * 0 means unlimited. | |
364 | + */ | |
365 | + 'max_nested_fields' => 0, | |
366 | + | |
367 | + /* | |
368 | + * Maximum execution time for deferred queries in milliseconds. | |
369 | + * Once reached, remaining fields will be resolved synchronously. | |
370 | + * 0 means unlimited. | |
371 | + */ | |
372 | + 'max_execution_ms' => 0, | |
373 | + ], | |
374 | + | |
375 | +]; | ... | ... |
database/factories/LegacyDisciplineAcademicYearFactory.php
... | ... | @@ -4,6 +4,9 @@ use App\Models\LegacyDiscipline; |
4 | 4 | use App\Models\LegacyDisciplineAcademicYear; |
5 | 5 | use App\Models\LegacySchool; |
6 | 6 | use Faker\Generator as Faker; |
7 | +use Illuminate\Database\Eloquent\Factory; | |
8 | + | |
9 | +/** @var Factory $factory */ | |
7 | 10 | |
8 | 11 | $factory->define(LegacyDisciplineAcademicYear::class, function (Faker $faker) { |
9 | 12 | return [ | ... | ... |
database/factories/LegacyEvaluationRuleGradeYearFactory.php
... | ... | @@ -3,6 +3,9 @@ |
3 | 3 | use App\Models\LegacyEvaluationRule; |
4 | 4 | use App\Models\LegacyLevel; |
5 | 5 | use Faker\Generator as Faker; |
6 | +use Illuminate\Database\Eloquent\Factory; | |
7 | + | |
8 | +/** @var Factory $factory */ | |
6 | 9 | |
7 | 10 | $factory->define(App\Models\LegacyEvaluationRuleGradeYear::class, function (Faker $faker) { |
8 | 11 | return [ | ... | ... |
database/factories/LegacyOrganizationFactory.php
... | ... | @@ -4,6 +4,9 @@ use App\Models\LegacyOrganization; |
4 | 4 | use App\Models\LegacyPerson; |
5 | 5 | use App\Models\LegacyUser; |
6 | 6 | use Faker\Generator as Faker; |
7 | +use Illuminate\Database\Eloquent\Factory; | |
8 | + | |
9 | +/** @var Factory $factory */ | |
7 | 10 | |
8 | 11 | $factory->define(LegacyOrganization::class, function (Faker $faker) { |
9 | 12 | ... | ... |
database/factories/LegacyRoundingTableFactory.php
... | ... | @@ -3,6 +3,9 @@ |
3 | 3 | use App\Models\LegacyRoundingTable; |
4 | 4 | use Faker\Generator as Faker; |
5 | 5 | use App\Models\LegacyInstitution; |
6 | +use Illuminate\Database\Eloquent\Factory; | |
7 | + | |
8 | +/** @var Factory $factory */ | |
6 | 9 | |
7 | 10 | $factory->define(LegacyRoundingTable::class, function (Faker $faker) { |
8 | 11 | return [ | ... | ... |
database/factories/LegacySchoolClassFactory.php
... | ... | @@ -14,7 +14,8 @@ use Illuminate\Database\Eloquent\Factory; |
14 | 14 | $factory->define(LegacySchoolClass::class, function (Faker $faker) { |
15 | 15 | |
16 | 16 | $schoolGrade = factory(LegacySchoolGrade::class)->create(); |
17 | - $evaluationRule = factory(LegacyEvaluationRuleGradeYear::class)->create([ | |
17 | + | |
18 | + factory(LegacyEvaluationRuleGradeYear::class)->create([ | |
18 | 19 | 'serie_id' => $schoolGrade->grade, |
19 | 20 | 'ano_letivo' => now()->year, |
20 | 21 | ]); | ... | ... |
database/factories/LegacySchoolClassTypeFactory.php
1 | 1 | <?php |
2 | 2 | |
3 | +use App\Models\LegacyInstitution; | |
3 | 4 | use App\Models\LegacySchoolClassType; |
4 | 5 | use App\Models\LegacyUser; |
5 | 6 | use Faker\Generator as Faker; |
... | ... | @@ -17,6 +18,7 @@ $factory->define(LegacySchoolClassType::class, function (Faker $faker) { |
17 | 18 | 'nm_tipo' => 'Tipo ' . $name, |
18 | 19 | 'sgl_tipo' => $abbreviation, |
19 | 20 | 'data_cadastro' => now(), |
21 | + 'ref_cod_instituicao' => factory(LegacyInstitution::class)->state('unique')->make(), | |
20 | 22 | ]; |
21 | 23 | }); |
22 | 24 | ... | ... |
database/factories/LegacySchoolCourseFactory.php
... | ... | @@ -5,6 +5,9 @@ use App\Models\LegacySchool; |
5 | 5 | use App\Models\LegacySchoolCourse; |
6 | 6 | use App\Models\LegacyUser; |
7 | 7 | use Faker\Generator as Faker; |
8 | +use Illuminate\Database\Eloquent\Factory; | |
9 | + | |
10 | +/** @var Factory $factory */ | |
8 | 11 | |
9 | 12 | $factory->define(LegacySchoolCourse::class, function (Faker $faker) { |
10 | 13 | return [ | ... | ... |
database/factories/LegacyValueRoundingTableFactory.php
... | ... | @@ -3,6 +3,9 @@ |
3 | 3 | use App\Models\LegacyValueRoundingTable; |
4 | 4 | use Faker\Generator as Faker; |
5 | 5 | use App\Models\LegacyRoundingTable; |
6 | +use Illuminate\Database\Eloquent\Factory; | |
7 | + | |
8 | +/** @var Factory $factory */ | |
6 | 9 | |
7 | 10 | $factory->define(LegacyValueRoundingTable::class, function (Faker $faker) { |
8 | 11 | return [ | ... | ... |
database/factories/PersonHasPlaceFactory.php
database/factories/SchoolInep.php
database/factories/SettingFactory.php
database/migrations/2020_08_03_150015_create_settings_categories_table.php
0 → 100755
... | ... | @@ -0,0 +1,33 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Support\Facades\Schema; | |
4 | +use Illuminate\Database\Schema\Blueprint; | |
5 | +use Illuminate\Database\Migrations\Migration; | |
6 | + | |
7 | +class CreateSettingsCategoriesTable extends Migration | |
8 | +{ | |
9 | + /** | |
10 | + * Run the migrations. | |
11 | + * | |
12 | + * @return void | |
13 | + */ | |
14 | + public function up() | |
15 | + { | |
16 | + Schema::create('settings_categories', function (Blueprint $table) { | |
17 | + $table->bigIncrements('id'); | |
18 | + $table->string('name'); | |
19 | + $table->boolean('enabled')->default(true); | |
20 | + $table->timestamps(); | |
21 | + }); | |
22 | + } | |
23 | + | |
24 | + /** | |
25 | + * Reverse the migrations. | |
26 | + * | |
27 | + * @return void | |
28 | + */ | |
29 | + public function down() | |
30 | + { | |
31 | + Schema::dropIfExists('settings_categories'); | |
32 | + } | |
33 | +} | ... | ... |
database/migrations/2020_08_03_151235_populate_settings_categories_table.php
0 → 100755
... | ... | @@ -0,0 +1,100 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Support\Facades\DB; | |
5 | + | |
6 | +class PopulateSettingsCategoriesTable extends Migration | |
7 | +{ | |
8 | + /** | |
9 | + * Run the migrations. | |
10 | + * | |
11 | + * @return void | |
12 | + */ | |
13 | + public function up() | |
14 | + { | |
15 | + $categories = [ | |
16 | + [ | |
17 | + 'id' => 1, | |
18 | + 'name' => 'Sem categoria', | |
19 | + 'enabled' => true, | |
20 | + 'created_at' => date('Y-m-d H:i:s'), | |
21 | + 'updated_at' => date('Y-m-d H:i:s'), | |
22 | + ], | |
23 | + [ | |
24 | + 'id' => 2, | |
25 | + 'name' => 'Integração entre iEducar e iDiário', | |
26 | + 'enabled' => true, | |
27 | + 'created_at' => date('Y-m-d H:i:s'), | |
28 | + 'updated_at' => date('Y-m-d H:i:s'), | |
29 | + ], | |
30 | + [ | |
31 | + 'id' => 3, | |
32 | + 'name' => 'Administrativo', | |
33 | + 'enabled' => true, | |
34 | + 'created_at' => date('Y-m-d H:i:s'), | |
35 | + 'updated_at' => date('Y-m-d H:i:s'), | |
36 | + ], | |
37 | + [ | |
38 | + 'id' => 4, | |
39 | + 'name' => 'Banco de dados', | |
40 | + 'enabled' => false, | |
41 | + 'created_at' => date('Y-m-d H:i:s'), | |
42 | + 'updated_at' => date('Y-m-d H:i:s'), | |
43 | + ], | |
44 | + [ | |
45 | + 'id' => 5, | |
46 | + 'name' => 'RDStation', | |
47 | + 'enabled' => true, | |
48 | + 'created_at' => date('Y-m-d H:i:s'), | |
49 | + 'updated_at' => date('Y-m-d H:i:s'), | |
50 | + ], | |
51 | + [ | |
52 | + 'id' => 6, | |
53 | + 'name' => 'Recaptcha', | |
54 | + 'enabled' => true, | |
55 | + 'created_at' => date('Y-m-d H:i:s'), | |
56 | + 'updated_at' => date('Y-m-d H:i:s'), | |
57 | + ], | |
58 | + [ | |
59 | + 'id' => 7, | |
60 | + 'name' => 'Track de erros', | |
61 | + 'enabled' => true, | |
62 | + 'created_at' => date('Y-m-d H:i:s'), | |
63 | + 'updated_at' => date('Y-m-d H:i:s'), | |
64 | + ], | |
65 | + [ | |
66 | + 'id' => 8, | |
67 | + 'name' => 'Inscrições online', | |
68 | + 'enabled' => true, | |
69 | + 'created_at' => date('Y-m-d H:i:s'), | |
70 | + 'updated_at' => date('Y-m-d H:i:s'), | |
71 | + ], | |
72 | + [ | |
73 | + 'id' => 9, | |
74 | + 'name' => 'Validações de relatórios', | |
75 | + 'enabled' => true, | |
76 | + 'created_at' => date('Y-m-d H:i:s'), | |
77 | + 'updated_at' => date('Y-m-d H:i:s'), | |
78 | + ], | |
79 | + [ | |
80 | + 'id' => 10, | |
81 | + 'name' => 'Validações de sistema', | |
82 | + 'enabled' => true, | |
83 | + 'created_at' => date('Y-m-d H:i:s'), | |
84 | + 'updated_at' => date('Y-m-d H:i:s'), | |
85 | + ], | |
86 | + ]; | |
87 | + | |
88 | + DB::table('settings_categories')->insert($categories); | |
89 | + } | |
90 | + | |
91 | + /** | |
92 | + * Reverse the migrations. | |
93 | + * | |
94 | + * @return void | |
95 | + */ | |
96 | + public function down() | |
97 | + { | |
98 | + DB::table('settings_categories')->delete(); | |
99 | + } | |
100 | +} | ... | ... |
database/migrations/2020_08_03_163703_add_foreign_key_in_settings_table.php
0 → 100755
... | ... | @@ -0,0 +1,33 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Support\Facades\Schema; | |
4 | +use Illuminate\Database\Schema\Blueprint; | |
5 | +use Illuminate\Database\Migrations\Migration; | |
6 | + | |
7 | +class AddForeignKeyInSettingsTable extends Migration | |
8 | +{ | |
9 | + /** | |
10 | + * Run the migrations. | |
11 | + * | |
12 | + * @return void | |
13 | + */ | |
14 | + public function up() | |
15 | + { | |
16 | + Schema::table('settings', function (Blueprint $table) { | |
17 | + $table->integer('setting_category_id')->default(1); | |
18 | + $table->foreign('setting_category_id')->on('settings_categories')->references('id'); | |
19 | + }); | |
20 | + } | |
21 | + | |
22 | + /** | |
23 | + * Reverse the migrations. | |
24 | + * | |
25 | + * @return void | |
26 | + */ | |
27 | + public function down() | |
28 | + { | |
29 | + Schema::table('settings', function (Blueprint $table) { | |
30 | + $table->dropColumn(['setting_category_id']); | |
31 | + }); | |
32 | + } | |
33 | +} | ... | ... |
database/migrations/2020_08_03_165637_update_categories_in_settings.php
0 → 100755
... | ... | @@ -0,0 +1,146 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Support\Facades\DB; | |
5 | + | |
6 | +class UpdateCategoriesInSettings extends Migration | |
7 | +{ | |
8 | + /** | |
9 | + * Run the migrations. | |
10 | + * | |
11 | + * @return void | |
12 | + */ | |
13 | + public function up() | |
14 | + { | |
15 | + DB::unprepared(" | |
16 | + UPDATE settings | |
17 | + SET setting_category_id = ( | |
18 | + CASE key | |
19 | + WHEN 'legacy.apis.access_key' THEN 2 | |
20 | + WHEN 'legacy.apis.secret_key' THEN 2 | |
21 | + WHEN 'legacy.apis.educacao_token_header' THEN 2 | |
22 | + WHEN 'legacy.apis.educacao_token_key' THEN 2 | |
23 | + WHEN 'legacy.app.novoeducacao.caminho_api' THEN 2 | |
24 | + WHEN 'legacy.app.novoeducacao.url' THEN 2 | |
25 | + WHEN 'legacy.app.administrative_pending.exist' THEN 3 | |
26 | + WHEN 'legacy.app.administrative_pending.msg' THEN 3 | |
27 | + WHEN 'legacy.app.administrative_tools_url' THEN 3 | |
28 | + WHEN 'legacy.config.active_on_ieducar' THEN 3 | |
29 | + WHEN 'legacy.app.database.dbname' THEN 4 | |
30 | + WHEN 'legacy.app.database.hostname' THEN 4 | |
31 | + WHEN 'legacy.app.database.password' THEN 4 | |
32 | + WHEN 'legacy.app.database.port' THEN 4 | |
33 | + WHEN 'legacy.app.database.username' THEN 4 | |
34 | + WHEN 'legacy.app.rdstation.private_token' THEN 5 | |
35 | + WHEN 'legacy.app.rdstation.token' THEN 5 | |
36 | + WHEN 'legacy.app.recaptcha_v3.minimum_score' THEN 6 | |
37 | + WHEN 'legacy.app.recaptcha_v3.private_key' THEN 6 | |
38 | + WHEN 'legacy.app.recaptcha_v3.public_key' THEN 6 | |
39 | + WHEN 'legacy.app.recaptcha.options.lang' THEN 6 | |
40 | + WHEN 'legacy.app.recaptcha.options.secure' THEN 6 | |
41 | + WHEN 'legacy.app.recaptcha.options.theme' THEN 6 | |
42 | + WHEN 'legacy.app.recaptcha.private_key' THEN 6 | |
43 | + WHEN 'legacy.app.recaptcha.public_key' THEN 6 | |
44 | + WHEN 'legacy.modules.error.email_recipient' THEN 7 | |
45 | + WHEN 'legacy.modules.error.honeybadger_key' THEN 7 | |
46 | + WHEN 'legacy.modules.error.link_to_support' THEN 7 | |
47 | + WHEN 'legacy.modules.error.send_notification_email' THEN 7 | |
48 | + WHEN 'legacy.modules.error.show_details' THEN 7 | |
49 | + WHEN 'legacy.modules.error.track' THEN 7 | |
50 | + WHEN 'legacy.modules.error.tracker_name' THEN 7 | |
51 | + WHEN 'preregistration.active' THEN 8 | |
52 | + WHEN 'preregistration.city' THEN 8 | |
53 | + WHEN 'preregistration.enabled' THEN 8 | |
54 | + WHEN 'preregistration.endpoint' THEN 8 | |
55 | + WHEN 'preregistration.entity' THEN 8 | |
56 | + WHEN 'preregistration.google_api_key' THEN 8 | |
57 | + WHEN 'preregistration.grades' THEN 8 | |
58 | + WHEN 'preregistration.ibge_code' THEN 8 | |
59 | + WHEN 'preregistration.lat' THEN 8 | |
60 | + WHEN 'preregistration.lng' THEN 8 | |
61 | + WHEN 'preregistration.logo.horizontal' THEN 8 | |
62 | + WHEN 'preregistration.logo.vertical' THEN 8 | |
63 | + WHEN 'preregistration.messages.initial_message' THEN 8 | |
64 | + WHEN 'preregistration.messages.review_message' THEN 8 | |
65 | + WHEN 'preregistration.messages.subtitle' THEN 8 | |
66 | + WHEN 'preregistration.messages.success_info' THEN 8 | |
67 | + WHEN 'preregistration.messages.success_message' THEN 8 | |
68 | + WHEN 'preregistration.messages.title' THEN 8 | |
69 | + WHEN 'preregistration.radius' THEN 8 | |
70 | + WHEN 'preregistration.state_abbreviation' THEN 8 | |
71 | + WHEN 'preregistration.title' THEN 8 | |
72 | + WHEN 'preregistration.token' THEN 8 | |
73 | + WHEN 'preregistration.year' THEN 8 | |
74 | + WHEN 'legacy.report.atestado_vaga_alternativo' THEN 9 | |
75 | + WHEN 'legacy.report.caminho_fundo_carteira_transporte' THEN 9 | |
76 | + WHEN 'legacy.report.caminho_fundo_certificado' THEN 9 | |
77 | + WHEN 'legacy.report.carteira_estudante.codigo' THEN 9 | |
78 | + WHEN 'legacy.report.diario_classe.dias_temporarios' THEN 9 | |
79 | + WHEN 'legacy.report.emitir_tabela_conversao' THEN 9 | |
80 | + WHEN 'legacy.report.header.alternativo' THEN 9 | |
81 | + WHEN 'legacy.report.header.show_data_emissao' THEN 9 | |
82 | + WHEN 'legacy.report.historico_escolar.modelo_sp' THEN 9 | |
83 | + WHEN 'legacy.report.lei_conclusao_ensino_medio' THEN 9 | |
84 | + WHEN 'legacy.report.lei_estudante' THEN 9 | |
85 | + WHEN 'legacy.report.logo_file_name' THEN 9 | |
86 | + WHEN 'legacy.report.modelo_atestado_transferencia_botucatu' THEN 9 | |
87 | + WHEN 'legacy.report.modelo_atestado_transferencia_parauapebas' THEN 9 | |
88 | + WHEN 'legacy.report.modelo_ficha_individual' THEN 9 | |
89 | + WHEN 'legacy.report.mostrar_relatorios' THEN 9 | |
90 | + WHEN 'legacy.report.portaria_aprovacao_pontos' THEN 9 | |
91 | + WHEN 'legacy.report.print_back_conclusion_certificate' THEN 9 | |
92 | + WHEN 'legacy.report.default_factory' THEN 9 | |
93 | + WHEN 'legacy.report.remote_factory.logo_name' THEN 9 | |
94 | + WHEN 'legacy.report.remote_factory.password' THEN 9 | |
95 | + WHEN 'legacy.report.remote_factory.this_app_name' THEN 9 | |
96 | + WHEN 'legacy.report.remote_factory.token' THEN 9 | |
97 | + WHEN 'legacy.report.remote_factory.url' THEN 9 | |
98 | + WHEN 'legacy.report.remote_factory.username' THEN 9 | |
99 | + WHEN 'legacy.report.show_error_details' THEN 9 | |
100 | + WHEN 'legacy.report.source_path' THEN 9 | |
101 | + WHEN 'legacy.report.reservas_de_vagas_integrais_por_escola.renda_per_capita_order' THEN 9 | |
102 | + WHEN 'legacy.app.alunos.mostrar_codigo_sistema' THEN 10 | |
103 | + WHEN 'legacy.app.alunos.codigo_sistema' THEN 10 | |
104 | + WHEN 'legacy.app.alunos.laudo_medico_obrigatorio' THEN 10 | |
105 | + WHEN 'legacy.app.alunos.nao_apresentar_campo_alfabetizado' THEN 10 | |
106 | + WHEN 'legacy.app.alunos.obrigar_recursos_tecnologicos' THEN 10 | |
107 | + WHEN 'legacy.app.auditoria.notas' THEN 10 | |
108 | + WHEN 'legacy.app.diario.nomenclatura_exame' THEN 10 | |
109 | + WHEN 'legacy.app.faltas_notas.mostrar_botao_replicar' THEN 10 | |
110 | + WHEN 'legacy.app.filaunica.criterios' THEN 10 | |
111 | + WHEN 'legacy.app.filaunica.current_year' THEN 10 | |
112 | + WHEN 'legacy.app.filaunica.ordenacao' THEN 10 | |
113 | + WHEN 'legacy.app.filaunica.trabalho_obrigatorio' THEN 10 | |
114 | + WHEN 'legacy.app.fisica.exigir_cartao_sus' THEN 10 | |
115 | + WHEN 'legacy.app.matricula.dependencia' THEN 10 | |
116 | + WHEN 'legacy.app.matricula.multiplas_matriculas' THEN 10 | |
117 | + WHEN 'legacy.app.mostrar_aplicacao' THEN 10 | |
118 | + WHEN 'legacy.app.processar_historicos_conceituais' THEN 10 | |
119 | + WHEN 'legacy.app.projetos.ignorar_turno_igual_matricula' THEN 10 | |
120 | + WHEN 'legacy.app.remove_obrigatorios_cadastro_pessoa' THEN 10 | |
121 | + WHEN 'legacy.app.reserva_vaga.permite_indeferir_candidatura' THEN 10 | |
122 | + WHEN 'legacy.app.rg_pessoa_fisica_pais_opcional' THEN 10 | |
123 | + WHEN 'legacy.app.user_accounts.default_password_expiration_period' THEN 10 | |
124 | + WHEN 'legacy.educacenso.enable_export' THEN 10 | |
125 | + WHEN 'legacy.filaunica.obriga_certidao_nascimento' THEN 10 | |
126 | + WHEN 'legacy.app.template.pdf.logo' THEN 10 | |
127 | + WHEN 'legacy.app.template.vars.instituicao' THEN 10 | |
128 | + WHEN 'legacy.app.entity.name' THEN 10 | |
129 | + WHEN 'legacy.app.name' THEN 10 | |
130 | + ELSE 1 | |
131 | + END | |
132 | + ); | |
133 | + "); | |
134 | + } | |
135 | + | |
136 | + /** | |
137 | + * Reverse the migrations. | |
138 | + * | |
139 | + * @return void | |
140 | + */ | |
141 | + public function down() | |
142 | + { | |
143 | + DB::table('settings') | |
144 | + ->update(['setting_category_id' => 1]); | |
145 | + } | |
146 | +} | ... | ... |
database/migrations/2020_08_03_170501_atualiza_nomenclatura_dos_campos_da_tela_de_configuracoes.php
0 → 100755
... | ... | @@ -0,0 +1,144 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Support\Facades\DB; | |
5 | + | |
6 | +class AtualizaNomenclaturaDosCamposDaTelaDeConfiguracoes extends Migration | |
7 | +{ | |
8 | + /** | |
9 | + * Run the migrations. | |
10 | + * | |
11 | + * @return void | |
12 | + */ | |
13 | + public function up() | |
14 | + { | |
15 | + DB::unprepared(" | |
16 | + UPDATE settings | |
17 | + SET description = ( | |
18 | + CASE key | |
19 | + WHEN 'legacy.apis.access_key' THEN 'Chave de acesso ao iEducar' | |
20 | + WHEN 'legacy.apis.secret_key' THEN 'Chave secreta do iEducar' | |
21 | + WHEN 'legacy.apis.educacao_token_header' THEN 'Cabeçalho do Token da Api do i-Diário' | |
22 | + WHEN 'legacy.apis.educacao_token_key' THEN 'Chave do Token da Api do i-Diário' | |
23 | + WHEN 'legacy.app.administrative_pending.exist' THEN 'Possui pendência administrativa?' | |
24 | + WHEN 'legacy.app.administrative_pending.msg' THEN 'Texto de pendência administrativa' | |
25 | + WHEN 'legacy.app.administrative_tools_url' THEN 'Url do administrativo' | |
26 | + WHEN 'legacy.app.alunos.mostrar_codigo_sistema' THEN 'Exibir campo \"Código sistema\" no cadastro do aluno' | |
27 | + WHEN 'legacy.app.alunos.codigo_sistema' THEN 'Label do campo \"Código sistema\" no cadastro do aluno' | |
28 | + WHEN 'legacy.app.alunos.laudo_medico_obrigatorio' THEN 'Obrigar laudo médico para alunos com deficiência' | |
29 | + WHEN 'legacy.app.alunos.nao_apresentar_campo_alfabetizado' THEN 'Não apresentar check \"Alfabetizado\" no cadastro do aluno' | |
30 | + WHEN 'legacy.app.alunos.obrigar_recursos_tecnologicos' THEN 'Obrigar informar recursos tecnológicos do aluno' | |
31 | + WHEN 'legacy.app.auditoria.notas' THEN 'Auditar lançamento de notas' | |
32 | + WHEN 'legacy.app.aws.bucketname' THEN 'Bucket S3 para armazenar uploads' | |
33 | + WHEN 'legacy.app.database.dbname' THEN 'Nome' | |
34 | + WHEN 'legacy.app.database.hostname' THEN 'Host' | |
35 | + WHEN 'legacy.app.database.password' THEN 'Senha' | |
36 | + WHEN 'legacy.app.database.port' THEN 'Porta' | |
37 | + WHEN 'legacy.app.database.username' THEN 'Usuário' | |
38 | + WHEN 'legacy.app.diario.nomenclatura_exame' THEN 'Apresentar nota de exame como nota de conselho' | |
39 | + WHEN 'legacy.app.entity.name' THEN 'Nome da instituição' | |
40 | + WHEN 'legacy.app.faltas_notas.mostrar_botao_replicar' THEN 'Permitir replicar notas conceituais por área de conhecimento' | |
41 | + WHEN 'legacy.app.filaunica.criterios' THEN 'Apresentar critérios no fila única' | |
42 | + WHEN 'legacy.app.filaunica.current_year' THEN 'Ano atual para consultar protocolos do fila única' | |
43 | + WHEN 'legacy.app.filaunica.ordenacao' THEN 'Ordenação dos protocolos do fila única' | |
44 | + WHEN 'legacy.app.filaunica.trabalho_obrigatorio' THEN 'Obriga informar trabalho dos responsáveis do candidato do fila única' | |
45 | + WHEN 'legacy.app.fisica.exigir_cartao_sus' THEN 'Obrigar campo \"Número da carteira do SUS\" no cadastro do aluno' | |
46 | + WHEN 'legacy.app.gtm.id' THEN 'Código do tag manager' | |
47 | + WHEN 'legacy.app.locale.country' THEN 'País do cliente (código do iEducar)' | |
48 | + WHEN 'legacy.app.locale.province' THEN 'Sigla UF do cliente' | |
49 | + WHEN 'legacy.app.locale.timezone' THEN 'Configuração de timezone' | |
50 | + WHEN 'legacy.app.matricula.dependencia' THEN 'Permitir matrículas de dependência?' | |
51 | + WHEN 'legacy.app.matricula.multiplas_matriculas' THEN 'Permitir múltiplas matrículas?' | |
52 | + WHEN 'legacy.app.mostrar_aplicacao' THEN 'Mostrar condições específicas do sistema para o cliente' | |
53 | + WHEN 'legacy.app.name' THEN 'Nome da entidade no controle de versão' | |
54 | + WHEN 'legacy.app.processar_historicos_conceituais' THEN 'Processar históricos de notas conceituais' | |
55 | + WHEN 'legacy.app.projetos.ignorar_turno_igual_matricula' THEN 'Permitir vincular alunos em projetos do mesmo período da turma em andamento' | |
56 | + WHEN 'legacy.app.rdstation.private_token' THEN 'Token do RDStation' | |
57 | + WHEN 'legacy.app.rdstation.token' THEN 'Token privado do RDStation' | |
58 | + WHEN 'legacy.app.recaptcha_v3.minimum_score' THEN 'Pontuação mínima (V3)' | |
59 | + WHEN 'legacy.app.recaptcha_v3.private_key' THEN 'Chave privada (V3)' | |
60 | + WHEN 'legacy.app.recaptcha_v3.public_key' THEN 'Chave pública (V3)' | |
61 | + WHEN 'legacy.app.recaptcha.options.lang' THEN 'Linguagem' | |
62 | + WHEN 'legacy.app.recaptcha.options.secure' THEN 'Nível de segurança' | |
63 | + WHEN 'legacy.app.recaptcha.options.theme' THEN 'Tema' | |
64 | + WHEN 'legacy.app.recaptcha.private_key' THEN 'Chave privada' | |
65 | + WHEN 'legacy.app.recaptcha.public_key' THEN 'Chave pública' | |
66 | + WHEN 'legacy.app.remove_obrigatorios_cadastro_pessoa' THEN 'Remove obrigatoriedade dos campos de pessoa física' | |
67 | + WHEN 'legacy.app.reserva_vaga.permite_indeferir_candidatura' THEN 'Permitir indeferir candidatura da reserva de vaga' | |
68 | + WHEN 'legacy.app.rg_pessoa_fisica_pais_opcional' THEN 'Tornar ocional informar RG para os pais dos alunos' | |
69 | + WHEN 'legacy.app.template.pdf.logo' THEN 'Caminho logo apresentada na impressão da agenda' | |
70 | + WHEN 'legacy.app.template.vars.instituicao' THEN 'Nome do produto' | |
71 | + WHEN 'legacy.app.user_accounts.default_password_expiration_period' THEN 'Dias para expiração de senha' | |
72 | + WHEN 'legacy.config.active_on_ieducar' THEN 'Suspender cliente' | |
73 | + WHEN 'legacy.educacenso.enable_export' THEN 'Habilitar exportação do arquivo do Educacenso' | |
74 | + WHEN 'legacy.filaunica.obriga_certidao_nascimento' THEN 'Obrigar campo de certidão de nascimento no fila única' | |
75 | + WHEN 'legacy.modules.error.email_recipient' THEN 'Email destinatário de erros' | |
76 | + WHEN 'legacy.report.atestado_vaga_alternativo' THEN 'Emitir atestado de vaga alternativo' | |
77 | + WHEN 'legacy.report.caminho_fundo_carteira_transporte' THEN 'Caminho da imagem de fundo da carteira de transporte' | |
78 | + WHEN 'legacy.report.caminho_fundo_certificado' THEN 'Caminho da imagem de fundo do certificado de conclusão' | |
79 | + WHEN 'legacy.report.carteira_estudante.codigo' THEN 'Código apresentado na carteira do estudante' | |
80 | + WHEN 'legacy.report.emitir_tabela_conversao' THEN 'Apresentar tabela de conversão em documentos' | |
81 | + WHEN 'legacy.report.header.alternativo' THEN 'Emitir cabeçalho alternativo em documentos' | |
82 | + WHEN 'legacy.report.header.show_data_emissao' THEN 'Apresentar data de emissão no cabeçalho dos documentos' | |
83 | + WHEN 'legacy.report.historico_escolar.modelo_sp' THEN 'Apresentar apenas a opção \"Modelo SP\" na emissão de histórico escolar' | |
84 | + WHEN 'legacy.report.lei_conclusao_ensino_medio' THEN 'Lei de conclusão do ensino médio' | |
85 | + WHEN 'legacy.report.lei_estudante' THEN 'Lei do estudante' | |
86 | + WHEN 'legacy.report.logo_file_name' THEN 'Nome do arquivo referente à logo dos relatórios' | |
87 | + WHEN 'legacy.report.modelo_atestado_transferencia_botucatu' THEN 'Emitir modelo de Botucatu no atestado de transferência' | |
88 | + WHEN 'legacy.report.modelo_atestado_transferencia_parauapebas' THEN 'Emitir modelo de Parauapebas no atestado de transferência' | |
89 | + WHEN 'legacy.report.modelo_ficha_individual' THEN 'Modelo de ficha individual' | |
90 | + WHEN 'legacy.report.mostrar_relatorios' THEN 'Mostrar relatórios específicos para o cliente' | |
91 | + WHEN 'legacy.report.portaria_aprovacao_pontos' THEN 'Portaria aprovação de pontos' | |
92 | + WHEN 'legacy.report.print_back_conclusion_certificate' THEN 'Emitir verso do certificado de conclusão do ensino fundamental' | |
93 | + WHEN 'legacy.report.default_factory' THEN 'Factory principal' | |
94 | + WHEN 'legacy.report.remote_factory.logo_name' THEN 'Logo dos relatórios' | |
95 | + WHEN 'legacy.report.remote_factory.password' THEN 'Senha' | |
96 | + WHEN 'legacy.report.remote_factory.this_app_name' THEN 'Nome da aplicação' | |
97 | + WHEN 'legacy.report.remote_factory.token' THEN 'Token de segurança' | |
98 | + WHEN 'legacy.report.remote_factory.url' THEN 'Url dos relatórios' | |
99 | + WHEN 'legacy.report.remote_factory.username' THEN 'Usuário' | |
100 | + WHEN 'legacy.report.show_error_details' THEN 'Exibir detalhes dos erros de relatórios' | |
101 | + WHEN 'legacy.report.source_path' THEN 'Caminhos dos relatórios' | |
102 | + WHEN 'legacy.modules.error.track' THEN 'Habilitar track de erros' | |
103 | + WHEN 'legacy.modules.error.tracker_name' THEN 'Classe usada para registrar erros' | |
104 | + WHEN 'legacy.report.reservas_de_vagas_integrais_por_escola.renda_per_capita_order' THEN 'Ordenar lista de espera da reserva de vaga pela renda' | |
105 | + WHEN 'preregistration.active' THEN 'Habilitar cadastros no inscrições online' | |
106 | + WHEN 'preregistration.city' THEN 'Nome do município' | |
107 | + WHEN 'preregistration.enabled' THEN 'Habilitar inscrições online' | |
108 | + WHEN 'preregistration.endpoint' THEN 'Uri do sistema' | |
109 | + WHEN 'preregistration.entity' THEN 'Nome do cliente' | |
110 | + WHEN 'preregistration.google_api_key' THEN 'Chave da api do google' | |
111 | + WHEN 'preregistration.grades' THEN 'Códigos das séries permitidas' | |
112 | + WHEN 'preregistration.ibge_code' THEN 'Inep do município' | |
113 | + WHEN 'preregistration.lat' THEN 'Latitude inicial' | |
114 | + WHEN 'preregistration.lng' THEN 'Longitude inicial' | |
115 | + WHEN 'preregistration.logo.horizontal' THEN 'Url da logo horizontal' | |
116 | + WHEN 'preregistration.logo.vertical' THEN 'Url da logo vertical' | |
117 | + WHEN 'preregistration.messages.initial_message' THEN 'Mensagem inicial para preenchimento do formulário' | |
118 | + WHEN 'preregistration.messages.review_message' THEN 'Mensagem de revisão de preenchimento do formulário' | |
119 | + WHEN 'preregistration.messages.subtitle' THEN 'Mensagem de subtítulo' | |
120 | + WHEN 'preregistration.messages.success_info' THEN 'Mensagem informativa de sucesso' | |
121 | + WHEN 'preregistration.messages.success_message' THEN 'Mensagem conclusiva de sucesso' | |
122 | + WHEN 'preregistration.messages.title' THEN 'Título do formulário' | |
123 | + WHEN 'preregistration.radius' THEN 'Raio (em metros) das escolas que serão exibidas a partir do endereço' | |
124 | + WHEN 'preregistration.state_abbreviation' THEN 'Estado do município' | |
125 | + WHEN 'preregistration.title' THEN 'Título da página inicial' | |
126 | + WHEN 'preregistration.token' THEN 'Token de segurança' | |
127 | + WHEN 'preregistration.year' THEN 'Ano vigente' | |
128 | + ELSE '' | |
129 | + END | |
130 | + ); | |
131 | + "); | |
132 | + } | |
133 | + | |
134 | + /** | |
135 | + * Reverse the migrations. | |
136 | + * | |
137 | + * @return void | |
138 | + */ | |
139 | + public function down() | |
140 | + { | |
141 | + DB::table('settings') | |
142 | + ->update(['description' => '']); | |
143 | + } | |
144 | +} | ... | ... |
database/migrations/2020_08_04_143226_atualiza_tipo_dos_campos_da_tela_de_configuracoes.php
0 → 100755
... | ... | @@ -0,0 +1,79 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Support\Facades\DB; | |
5 | + | |
6 | +class AtualizaTipoDosCamposDaTelaDeConfiguracoes extends Migration | |
7 | +{ | |
8 | + /** | |
9 | + * Run the migrations. | |
10 | + * | |
11 | + * @return void | |
12 | + */ | |
13 | + public function up() | |
14 | + { | |
15 | + DB::unprepared(" | |
16 | + UPDATE settings | |
17 | + SET type = ( | |
18 | + CASE key | |
19 | + WHEN 'legacy.app.administrative_pending.exist' THEN 'boolean' | |
20 | + WHEN 'legacy.app.alunos.mostrar_codigo_sistema' THEN 'boolean' | |
21 | + WHEN 'legacy.app.alunos.laudo_medico_obrigatorio' THEN 'boolean' | |
22 | + WHEN 'legacy.app.alunos.nao_apresentar_campo_alfabetizado' THEN 'boolean' | |
23 | + WHEN 'legacy.app.alunos.obrigar_recursos_tecnologicos' THEN 'boolean' | |
24 | + WHEN 'legacy.app.auditoria.notas' THEN 'boolean' | |
25 | + WHEN 'legacy.app.database.port' THEN 'integer' | |
26 | + WHEN 'legacy.app.diario.nomenclatura_exame' THEN 'boolean' | |
27 | + WHEN 'legacy.app.faltas_notas.mostrar_botao_replicar' THEN 'boolean' | |
28 | + WHEN 'legacy.app.filaunica.criterios' THEN 'boolean' | |
29 | + WHEN 'legacy.app.filaunica.current_year' THEN 'integer' | |
30 | + WHEN 'legacy.app.filaunica.trabalho_obrigatorio' THEN 'boolean' | |
31 | + WHEN 'legacy.app.fisica.exigir_cartao_sus' THEN 'boolean' | |
32 | + WHEN 'legacy.app.locale.country' THEN 'integer' | |
33 | + WHEN 'legacy.app.matricula.dependencia' THEN 'boolean' | |
34 | + WHEN 'legacy.app.matricula.multiplas_matriculas' THEN 'boolean' | |
35 | + WHEN 'legacy.app.processar_historicos_conceituais' THEN 'boolean' | |
36 | + WHEN 'legacy.app.projetos.ignorar_turno_igual_matricula' THEN 'boolean' | |
37 | + WHEN 'legacy.app.recaptcha_v3.minimum_score' THEN 'float' | |
38 | + WHEN 'legacy.app.recaptcha.options.secure' THEN 'float' | |
39 | + WHEN 'legacy.app.remove_obrigatorios_cadastro_pessoa' THEN 'boolean' | |
40 | + WHEN 'legacy.app.reserva_vaga.permite_indeferir_candidatura' THEN 'boolean' | |
41 | + WHEN 'legacy.app.rg_pessoa_fisica_pais_opcional' THEN 'boolean' | |
42 | + WHEN 'legacy.config.active_on_ieducar' THEN 'boolean' | |
43 | + WHEN 'legacy.educacenso.enable_export' THEN 'boolean' | |
44 | + WHEN 'legacy.filaunica.obriga_certidao_nascimento' THEN 'boolean' | |
45 | + WHEN 'legacy.report.atestado_vaga_alternativo' THEN 'boolean' | |
46 | + WHEN 'legacy.report.emitir_tabela_conversao' THEN 'boolean' | |
47 | + WHEN 'legacy.report.header.alternativo' THEN 'boolean' | |
48 | + WHEN 'legacy.report.header.show_data_emissao' THEN 'boolean' | |
49 | + WHEN 'legacy.report.historico_escolar.modelo_sp' THEN 'boolean' | |
50 | + WHEN 'legacy.report.modelo_atestado_transferencia_botucatu' THEN 'boolean' | |
51 | + WHEN 'legacy.report.modelo_atestado_transferencia_parauapebas' THEN 'boolean' | |
52 | + WHEN 'legacy.report.print_back_conclusion_certificate' THEN 'boolean' | |
53 | + WHEN 'legacy.report.show_error_details' THEN 'boolean' | |
54 | + WHEN 'legacy.modules.error.track' THEN 'boolean' | |
55 | + WHEN 'legacy.report.reservas_de_vagas_integrais_por_escola.renda_per_capita_order' THEN 'boolean' | |
56 | + WHEN 'preregistration.active' THEN 'boolean' | |
57 | + WHEN 'preregistration.enabled' THEN 'boolean' | |
58 | + WHEN 'preregistration.ibge_code' THEN 'integer' | |
59 | + WHEN 'preregistration.lat' THEN 'float' | |
60 | + WHEN 'preregistration.lng' THEN 'float' | |
61 | + WHEN 'preregistration.radius' THEN 'integer' | |
62 | + WHEN 'preregistration.year' THEN 'integer' | |
63 | + ELSE 'string' | |
64 | + END | |
65 | + ); | |
66 | + "); | |
67 | + } | |
68 | + | |
69 | + /** | |
70 | + * Reverse the migrations. | |
71 | + * | |
72 | + * @return void | |
73 | + */ | |
74 | + public function down() | |
75 | + { | |
76 | + DB::table('settings') | |
77 | + ->update(['type' => 'string']); | |
78 | + } | |
79 | +} | ... | ... |
database/migrations/2020_08_09_171250_cria_campo_para_importacao_de_serie_no_pre_matricula.php
0 → 100644
... | ... | @@ -0,0 +1,39 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Support\Facades\DB; | |
4 | +use Illuminate\Support\Facades\Schema; | |
5 | +use Illuminate\Database\Schema\Blueprint; | |
6 | +use Illuminate\Database\Migrations\Migration; | |
7 | + | |
8 | +class CriaCampoParaImportacaoDeSerieNoPreMatricula extends Migration | |
9 | +{ | |
10 | + /** | |
11 | + * Run the migrations. | |
12 | + * | |
13 | + * @return void | |
14 | + */ | |
15 | + public function up() | |
16 | + { | |
17 | + $result = DB::selectOne("SELECT column_name | |
18 | + FROM information_schema.columns | |
19 | + WHERE table_name='serie' and column_name='importar_serie_pre_matricula';"); | |
20 | + | |
21 | + if (!$result) { | |
22 | + Schema::table('pmieducar.serie', function (Blueprint $table) { | |
23 | + $table->addColumn('boolean', 'importar_serie_pre_matricula')->default(false); | |
24 | + }); | |
25 | + } | |
26 | + } | |
27 | + | |
28 | + /** | |
29 | + * Reverse the migrations. | |
30 | + * | |
31 | + * @return void | |
32 | + */ | |
33 | + public function down() | |
34 | + { | |
35 | + Schema::table('pmieducar.serie', function (Blueprint $table) { | |
36 | + $table->dropColumn('importar_serie_pre_matricula'); | |
37 | + }); | |
38 | + } | |
39 | +} | ... | ... |
database/migrations/2020_08_10_171250_cria_campo_para_importacao_de_serie_no_pre_matricula.php
... | ... | @@ -1,32 +0,0 @@ |
1 | -<?php | |
2 | - | |
3 | -use Illuminate\Support\Facades\Schema; | |
4 | -use Illuminate\Database\Schema\Blueprint; | |
5 | -use Illuminate\Database\Migrations\Migration; | |
6 | - | |
7 | -class CriaCampoParaImportacaoDeSerieNoPreMatricula extends Migration | |
8 | -{ | |
9 | - /** | |
10 | - * Run the migrations. | |
11 | - * | |
12 | - * @return void | |
13 | - */ | |
14 | - public function up() | |
15 | - { | |
16 | - Schema::table('pmieducar.serie', function (Blueprint $table) { | |
17 | - $table->addColumn('boolean', 'importar_serie_pre_matricula')->default(false); | |
18 | - }); | |
19 | - } | |
20 | - | |
21 | - /** | |
22 | - * Reverse the migrations. | |
23 | - * | |
24 | - * @return void | |
25 | - */ | |
26 | - public function down() | |
27 | - { | |
28 | - Schema::table('pmieducar.serie', function (Blueprint $table) { | |
29 | - $table->dropColumn('importar_serie_pre_matricula'); | |
30 | - }); | |
31 | - } | |
32 | -} |
database/migrations/2020_09_15_100344_update_component_name.php
0 → 100644
... | ... | @@ -0,0 +1,27 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Support\Facades\DB; | |
5 | + | |
6 | +class UpdateComponentName extends Migration | |
7 | +{ | |
8 | + /** | |
9 | + * Run the migrations. | |
10 | + * | |
11 | + * @return void | |
12 | + */ | |
13 | + public function up() | |
14 | + { | |
15 | + DB::statement('UPDATE modules.componente_curricular SET nome = replace(nome, \'extrangeira\', \'estrangeira\') WHERE nome ILIKE \'%extrangeira%\';'); | |
16 | + } | |
17 | + | |
18 | + /** | |
19 | + * Reverse the migrations. | |
20 | + * | |
21 | + * @return void | |
22 | + */ | |
23 | + public function down() | |
24 | + { | |
25 | + DB::statement('UPDATE modules.componente_curricular set nome = replace(nome, \'estrangeira\', \'extrangeira\') WHERE nome ILIKE \'%estrangeira%\';'); | |
26 | + } | |
27 | +} | ... | ... |
database/migrations/2020_10_06_114058_add_column_data_entrada_matricula_in_educacenso_imports.php
0 → 100755
... | ... | @@ -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 AddColumnDataEntradaMatriculaInEducacensoImports extends Migration | |
8 | +{ | |
9 | + /** | |
10 | + * Run the migrations. | |
11 | + * | |
12 | + * @return void | |
13 | + */ | |
14 | + public function up() | |
15 | + { | |
16 | + Schema::table('public.educacenso_imports', function (Blueprint $table) { | |
17 | + $table->date('registration_date')->nullable(); | |
18 | + }); | |
19 | + } | |
20 | + | |
21 | + /** | |
22 | + * Reverse the migrations. | |
23 | + * | |
24 | + * @return void | |
25 | + */ | |
26 | + public function down() | |
27 | + { | |
28 | + Schema::table('public.educacenso_imports', function (Blueprint $table) { | |
29 | + $table->dropColumn('registration_date'); | |
30 | + }); | |
31 | + } | |
32 | +} | ... | ... |
database/migrations/2020_10_12_232901_adiciona_campo_hint_configuracoes.php
0 → 100755
... | ... | @@ -0,0 +1,32 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Database\Schema\Blueprint; | |
5 | +use Illuminate\Support\Facades\Schema; | |
6 | + | |
7 | +class AdicionaCampoHintConfiguracoes extends Migration | |
8 | +{ | |
9 | + /** | |
10 | + * Run the migrations. | |
11 | + * | |
12 | + * @return void | |
13 | + */ | |
14 | + public function up() | |
15 | + { | |
16 | + Schema::table('public.settings', function(Blueprint $table) { | |
17 | + $table->string('hint')->nullable(); | |
18 | + }); | |
19 | + } | |
20 | + | |
21 | + /** | |
22 | + * Reverse the migrations. | |
23 | + * | |
24 | + * @return void | |
25 | + */ | |
26 | + public function down() | |
27 | + { | |
28 | + Schema::table('public.settings', function(Blueprint $table) { | |
29 | + $table->dropColumn('hint'); | |
30 | + }); | |
31 | + } | |
32 | +} | ... | ... |
database/migrations/2020_10_15_000000_remove_spaces_in_name.php
0 → 100644
... | ... | @@ -0,0 +1,30 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Database\Schema\Blueprint; | |
5 | +use Illuminate\Support\Facades\DB; | |
6 | +use Illuminate\Support\Facades\Schema; | |
7 | + | |
8 | +class RemoveSpacesInName extends Migration | |
9 | +{ | |
10 | + private function sql() | |
11 | + { | |
12 | + return <<<SQL | |
13 | + update cadastro.pessoa | |
14 | + set nome = trim(nome), | |
15 | + slug = trim(slug) | |
16 | + where substring(nome, length(nome), 1) = ' ' | |
17 | + or substring(nome, 1, 1) = ' '; | |
18 | + SQL; | |
19 | + } | |
20 | + | |
21 | + /** | |
22 | + * Run the migrations. | |
23 | + * | |
24 | + * @return void | |
25 | + */ | |
26 | + public function up() | |
27 | + { | |
28 | + DB::unprepared($this->sql()); | |
29 | + } | |
30 | +} | ... | ... |
database/migrations/2020_10_20_000000_remove_spaces_in_slug.php
0 → 100644
... | ... | @@ -0,0 +1,30 @@ |
1 | +<?php | |
2 | + | |
3 | +use Illuminate\Database\Migrations\Migration; | |
4 | +use Illuminate\Support\Facades\DB; | |
5 | + | |
6 | +class RemoveSpacesInSlug extends Migration | |
7 | +{ | |
8 | + private function sql() | |
9 | + { | |
10 | + return <<<SQL | |
11 | + update cadastro.pessoa | |
12 | + set nome = trim(nome), | |
13 | + slug = trim(slug) | |
14 | + where substring(nome, length(nome), 1) = ' ' | |
15 | + or substring(nome, 1, 1) = ' ' | |
16 | + or substring(slug, length(slug), 1) = ' ' | |
17 | + or substring(slug, 1, 1) = ' '; | |
18 | + SQL; | |
19 | + } | |
20 | + | |
21 | + /** | |
22 | + * Run the migrations. | |
23 | + * | |
24 | + * @return void | |
25 | + */ | |
26 | + public function up() | |
27 | + { | |
28 | + DB::unprepared($this->sql()); | |
29 | + } | |
30 | +} | ... | ... |
ieducar/intranet/educar_escola_cad.php
... | ... | @@ -703,7 +703,7 @@ class indice extends clsCadastro |
703 | 703 | $this->inputsHelper()->numeric('longitude', array('max_length' => '20', 'size' => '20', 'required' => false, 'value' => $this->longitude, 'label_hint' => 'São aceito somente números, ponto "." e hífen "-"')); |
704 | 704 | |
705 | 705 | $this->campoCheck("bloquear_lancamento_diario_anos_letivos_encerrados", "Bloquear lançamento no diário para anos letivos encerrados", $this->bloquear_lancamento_diario_anos_letivos_encerrados); |
706 | - $this->campoCheck("utiliza_regra_diferenciada", "Utiliza regra diferenciada", dbBool($this->utiliza_regra_diferenciada), '', false, false, false, 'Se marcado, utilizará regra de avaliação diferenciada informada na Série'); | |
706 | + $this->campoCheck("utiliza_regra_diferenciada", "Utiliza regra alternativa", dbBool($this->utiliza_regra_diferenciada), '', false, false, false, 'Se marcado a escola utilizará a regra de avaliação alternativa informada na Série'); | |
707 | 707 | |
708 | 708 | $resources = SelectOptions::situacoesFuncionamentoEscola(); |
709 | 709 | $options = array('label' => 'Situação de funcionamento', 'resources' => $resources, 'value' => $this->situacao_funcionamento); | ... | ... |
ieducar/intranet/educar_exemplar_devolucao_lst.php
... | ... | @@ -102,7 +102,7 @@ class indice extends clsListagem |
102 | 102 | $this->campoLista("situacao", "Situação", $situacoes, $this->situacao); |
103 | 103 | |
104 | 104 | $this->campoNumero("ref_cod_exemplar","Código exemplar", $this->ref_cod_exemplar, 15, 10); |
105 | - $this->campoNumero("tombo","Tombo", $this->tombo, 15, 10); | |
105 | + $this->campoNumero("tombo","Tombo", $this->tombo, 15, 13); | |
106 | 106 | |
107 | 107 | if ($this->ref_cod_biblioteca) |
108 | 108 | { | ... | ... |
ieducar/intranet/educar_importacao_educacenso.php
1 | 1 | <?php |
2 | -//error_reporting(E_ALL); | |
3 | -//ini_set("display_errors", 1); | |
4 | - | |
5 | -use App\Models\City; | |
6 | -use App\Models\Country; | |
7 | -use App\Models\District; | |
8 | -use App\Models\PersonHasPlace; | |
9 | -use App\Models\Place; | |
10 | -use App\Models\State; | |
11 | -use iEducar\Modules\Educacenso\RunMigrations; | |
12 | - | |
13 | -ini_set("max_execution_time", 0); | |
14 | -/** | |
15 | - * i-Educar - Sistema de gestão escolar | |
16 | - * | |
17 | - * Copyright (C) 2006 Prefeitura Municipal de Itajaí | |
18 | - * <ctima@itajai.sc.gov.br> | |
19 | - * | |
20 | - * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo | |
21 | - * sob os termos da Licença Pública Geral GNU conforme publicada pela Free | |
22 | - * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) | |
23 | - * qualquer versão posterior. | |
24 | - * | |
25 | - * Este programa é distribuído na expectativa de que seja útil, porém, SEM | |
26 | - * NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU | |
27 | - * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral | |
28 | - * do GNU para mais detalhes. | |
29 | - * | |
30 | - * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto | |
31 | - * com este programa; se não, escreva para a Free Software Foundation, Inc., no | |
32 | - * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
33 | - * | |
34 | - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
35 | - * @category i-Educar | |
36 | - * @license @@license@@ | |
37 | - * @package iEd_Pmieducar | |
38 | - * @since Arquivo disponível desde a versão 1.0.0 | |
39 | - * @version $Id$ | |
40 | - */ | |
2 | + | |
3 | +ini_set('max_execution_time', 0); | |
41 | 4 | |
42 | 5 | require_once 'include/clsBase.inc.php'; |
43 | 6 | require_once 'include/clsCadastro.inc.php'; |
... | ... | @@ -47,76 +10,80 @@ require_once 'lib/Portabilis/DataMapper/Utils.php'; |
47 | 10 | require_once 'include/pmieducar/geral.inc.php'; |
48 | 11 | require_once 'include/modules/clsModulesProfessorTurma.inc.php'; |
49 | 12 | |
50 | -/** | |
51 | - * @author Caroline Salib Canto <caroline@portabilis.com.br> | |
52 | - * @category i-Educar | |
53 | - * @license @@license@@ | |
54 | - * @package iEd_Pmieducar | |
55 | - * @since ? | |
56 | - * @version @@package_version@@ | |
57 | - */ | |
58 | 13 | class clsIndexBase extends clsBase |
59 | 14 | { |
60 | - function Formular() | |
61 | - { | |
62 | - $this->SetTitulo($this->_instituicao . ' i-Educar - Importação educacenso'); | |
63 | - $this->processoAp = 9998849; | |
64 | - } | |
15 | + public function Formular() | |
16 | + { | |
17 | + $this->SetTitulo($this->_instituicao . ' i-Educar - Importação educacenso'); | |
18 | + $this->processoAp = 9998849; | |
19 | + } | |
65 | 20 | } |
66 | 21 | |
67 | 22 | class indice extends clsCadastro |
68 | 23 | { |
69 | - var $pessoa_logada; | |
70 | - | |
71 | - var $arquivo; | |
72 | - | |
73 | - function Inicializar() | |
74 | - { | |
75 | - $obj_permissoes = new clsPermissoes(); | |
76 | - $obj_permissoes->permissao_cadastra(9998849, $this->pessoa_logada, 7, | |
77 | - 'educar_index.php'); | |
78 | - $this->ref_cod_instituicao = $obj_permissoes->getInstituicao($this->pessoa_logada); | |
79 | - | |
80 | - $this->breadcrumb('Importação educacenso', [ | |
81 | - url('intranet/educar_educacenso_index.php') => 'Educacenso', | |
82 | - ]); | |
83 | - | |
84 | - $this->titulo = "Nova importação"; | |
85 | - | |
86 | - return 'Editar'; | |
87 | - } | |
88 | - | |
89 | - function Gerar() | |
90 | - { | |
91 | - $resources = [ | |
92 | - null => 'Selecione', | |
93 | - '2019' => '2019', | |
94 | - '2020' => '2020', | |
95 | - ]; | |
96 | - $options = [ | |
97 | - 'label' => 'Ano', | |
98 | - 'resources' => $resources, | |
99 | - 'value' => $this->ano, | |
100 | - ]; | |
101 | - $this->inputsHelper()->select('ano', $options); | |
102 | - | |
103 | - $this->campoArquivo('arquivo', 'Arquivo', $this->arquivo,40,'<br/> <span style="font-style: italic; font-size= 10px;">* Somente arquivos com formato txt serão aceitos</span>'); | |
104 | - | |
105 | - $this->nome_url_sucesso = "Importar"; | |
106 | - | |
107 | - Portabilis_View_Helper_Application::loadJavascript($this, '/modules/Educacenso/Assets/Javascripts/Importacao.js'); | |
108 | - } | |
109 | - | |
110 | - function Novo() | |
111 | - { | |
112 | - return; | |
113 | - } | |
114 | - | |
115 | - function Editar() | |
116 | - { | |
117 | - return; | |
118 | - } | |
119 | - | |
24 | + public $pessoa_logada; | |
25 | + | |
26 | + public $arquivo; | |
27 | + | |
28 | + public function Inicializar() | |
29 | + { | |
30 | + $obj_permissoes = new clsPermissoes(); | |
31 | + $obj_permissoes->permissao_cadastra( | |
32 | + 9998849, | |
33 | + $this->pessoa_logada, | |
34 | + 7, | |
35 | + 'educar_index.php' | |
36 | + ); | |
37 | + $this->ref_cod_instituicao = $obj_permissoes->getInstituicao($this->pessoa_logada); | |
38 | + | |
39 | + $this->breadcrumb('Importação educacenso', [ | |
40 | + url('intranet/educar_educacenso_index.php') => 'Educacenso', | |
41 | + ]); | |
42 | + | |
43 | + $this->titulo = 'Nova importação'; | |
44 | + | |
45 | + return 'Editar'; | |
46 | + } | |
47 | + | |
48 | + public function Gerar() | |
49 | + { | |
50 | + $resources = [ | |
51 | + null => 'Selecione', | |
52 | + '2019' => '2019', | |
53 | + '2020' => '2020', | |
54 | + ]; | |
55 | + $options = [ | |
56 | + 'label' => 'Ano', | |
57 | + 'resources' => $resources, | |
58 | + 'value' => $this->ano, | |
59 | + ]; | |
60 | + $this->inputsHelper()->select('ano', $options); | |
61 | + | |
62 | + $this->inputsHelper()->date( | |
63 | + 'data_entrada_matricula', | |
64 | + [ | |
65 | + 'label' => 'Data de entrada das matrículas', | |
66 | + 'required' => true, | |
67 | + 'placeholder' => 'dd/mm/yyyy' | |
68 | + ] | |
69 | + ); | |
70 | + | |
71 | + $this->campoArquivo('arquivo', 'Arquivo', $this->arquivo, 40, '<br/> <span style="font-style: italic; font-size= 10px;">* Somente arquivos com formato txt serão aceitos</span>'); | |
72 | + | |
73 | + $this->nome_url_sucesso = 'Importar'; | |
74 | + | |
75 | + Portabilis_View_Helper_Application::loadJavascript($this, '/modules/Educacenso/Assets/Javascripts/Importacao.js'); | |
76 | + } | |
77 | + | |
78 | + public function Novo() | |
79 | + { | |
80 | + return; | |
81 | + } | |
82 | + | |
83 | + public function Editar() | |
84 | + { | |
85 | + return; | |
86 | + } | |
120 | 87 | } |
121 | 88 | // Instancia objeto de página |
122 | 89 | $pagina = new clsIndexBase(); |
... | ... | @@ -129,4 +96,3 @@ $pagina->addForm($miolo); |
129 | 96 | |
130 | 97 | // Gera o código HTML |
131 | 98 | $pagina->MakeAll(); |
132 | -?> | ... | ... |
ieducar/intranet/educar_matricula_det.php
... | ... | @@ -182,8 +182,6 @@ class indice extends clsDetalhe |
182 | 182 | $turma = new clsPmieducarTurma($enturmacao['ref_cod_turma']); |
183 | 183 | $turma = $turma->detalhe(); |
184 | 184 | $turma_id = $enturmacao['ref_cod_turma']; |
185 | - $nomesTurmas[] = $turma['nm_turma']; | |
186 | - $datasEnturmacoes[] = Portabilis_Date_Utils::pgSQLToBr($enturmacao['data_enturmacao']); | |
187 | 185 | |
188 | 186 | if (in_array($turma['etapa_educacenso'], App_Model_Educacenso::etapas_multisseriadas())) { |
189 | 187 | $existeTurmaMulti = true; |
... | ... | @@ -193,6 +191,9 @@ class indice extends clsDetalhe |
193 | 191 | continue; |
194 | 192 | } |
195 | 193 | |
194 | + $nomesTurmas[] = $turma['nm_turma']; | |
195 | + $datasEnturmacoes[] = Portabilis_Date_Utils::pgSQLToBr($enturmacao['data_enturmacao']); | |
196 | + | |
196 | 197 | if ($turma['turma_turno_id'] == clsPmieducarTurma::TURNO_INTEGRAL) { |
197 | 198 | $existeTurmaTurnoIntegral = true; |
198 | 199 | } | ... | ... |
ieducar/intranet/educar_pesquisa_cliente_lst.php
... | ... | @@ -75,7 +75,7 @@ class indice extends clsListagem |
75 | 75 | ) ); |
76 | 76 | |
77 | 77 | $this->campoTexto( "nm_cliente", "Cliente", $this->nm_cliente, 30, 255, false ); |
78 | - $this->campoNumero( "codigo", "Código", $this->codigo, 9, 9 ); | |
78 | + $this->campoNumero( "codigo", "Código", $this->codigo, 15, 13 ); | |
79 | 79 | $this->campoOculto("ref_cod_biblioteca",$this->ref_cod_biblioteca); |
80 | 80 | |
81 | 81 | if (isset($_GET["ref_cod_biblioteca"])) |
... | ... | @@ -88,7 +88,7 @@ class indice extends clsListagem |
88 | 88 | $obj_acervo = new clsPmieducarCliente(); |
89 | 89 | $obj_acervo->setOrderby( "nome ASC" ); |
90 | 90 | $obj_acervo->setLimite( $this->limite, $this->offset ); |
91 | - | |
91 | + | |
92 | 92 | if ($this->ref_cod_biblioteca) |
93 | 93 | { |
94 | 94 | $lista = $obj_acervo->listaPesquisaCliente( | ... | ... |
ieducar/intranet/educar_serie_cad.php
... | ... | @@ -214,9 +214,9 @@ class indice extends clsCadastro |
214 | 214 | |
215 | 215 | $regras = ['' => 'Selecione'] + $regras; |
216 | 216 | |
217 | - $this->campoTabelaInicio("regras","Regras de avaliação",["Regra de avaliação","Regra de avaliação diferenciada", "Ano escolar"],$this->regras_ano_letivo); | |
218 | - $this->campoLista('regras_avaliacao_id', 'Regra de avaliação', $regras, $this->regras_avaliacao_id); | |
219 | - $this->campoLista('regras_avaliacao_diferenciada_id', 'Regra de avaliação diferenciada', $regras, $this->regras_avaliacao_diferenciada_id, '', FALSE, 'Será utilizada quando campo <b>Utilizar regra de avaliação diferenciada</b> estiver marcado no cadastro da escola', '', FALSE, FALSE); | |
217 | + $this->campoTabelaInicio("regras","Regras de avaliação",["Regra de avaliação (padrão)","Regra de avaliação (alternativa)<br><font size=-1; color=gray>O campo deve ser preenchido se existirem escolas avaliadas de forma alternativa (ex.: escola rural, indígena, etc)</font>", "Ano escolar"],$this->regras_ano_letivo); | |
218 | + $this->campoLista('regras_avaliacao_id', 'Regra de avaliação (padrão)', $regras, $this->regras_avaliacao_id); | |
219 | + $this->campoLista('regras_avaliacao_diferenciada_id', 'Regra de avaliação (alternativa)', $regras, $this->regras_avaliacao_difer>enciada_id, '', FALSE, 'Será utilizada quando campo <b>Utilizar regra de avaliação diferenciada</b> estiver marcado no cadastro da escola', '', FALSE, FALSE); | |
220 | 220 | $this->campoNumero("anos_letivos", "Ano letivo", $this->anos_letivos, 4, 4, true); |
221 | 221 | $this->campoTabelaFim(); |
222 | 222 | ... | ... |
ieducar/intranet/educar_servidor_alocacao_cad.php
... | ... | @@ -50,7 +50,6 @@ class indice extends clsCadastro |
50 | 50 | { |
51 | 51 | $retorno = 'Novo'; |
52 | 52 | |
53 | - | |
54 | 53 | $ref_cod_servidor = $_GET['ref_cod_servidor']; |
55 | 54 | $ref_ref_cod_instituicao = $_GET['ref_cod_instituicao']; |
56 | 55 | $cod_servidor_alocacao = $_GET['cod_servidor_alocacao']; |
... | ... | @@ -86,7 +85,10 @@ class indice extends clsCadastro |
86 | 85 | |
87 | 86 | $obj_permissoes = new clsPermissoes(); |
88 | 87 | $obj_permissoes->permissao_cadastra( |
89 | - 635, $this->pessoa_logada, 7, 'educar_servidor_lst.php' | |
88 | + 635, | |
89 | + $this->pessoa_logada, | |
90 | + 7, | |
91 | + 'educar_servidor_lst.php' | |
90 | 92 | ); |
91 | 93 | |
92 | 94 | if ($obj_permissoes->permissao_excluir(635, $this->pessoa_logada, 7)) { |
... | ... | @@ -94,7 +96,9 @@ class indice extends clsCadastro |
94 | 96 | } |
95 | 97 | |
96 | 98 | $this->url_cancelar = sprintf( |
97 | - 'educar_servidor_alocacao_lst.php?ref_cod_servidor=%d&ref_cod_instituicao=%d', $this->ref_cod_servidor, $this->ref_ref_cod_instituicao | |
99 | + 'educar_servidor_alocacao_lst.php?ref_cod_servidor=%d&ref_cod_instituicao=%d', | |
100 | + $this->ref_cod_servidor, | |
101 | + $this->ref_ref_cod_instituicao | |
98 | 102 | ); |
99 | 103 | $this->nome_url_cancelar = 'Cancelar'; |
100 | 104 | |
... | ... | @@ -143,8 +147,31 @@ class indice extends clsCadastro |
143 | 147 | $this->campoOculto('ref_cod_servidor', $this->ref_cod_servidor); |
144 | 148 | |
145 | 149 | // Carga horária |
150 | + $servidorAlocacao = new clsPmieducarServidorAlocacao( | |
151 | + $this->cod_servidor_alocacao, | |
152 | + $this->ref_ref_cod_instituicao, | |
153 | + null, | |
154 | + null, | |
155 | + null, | |
156 | + $this->ref_cod_servidor, | |
157 | + null, | |
158 | + null, | |
159 | + null, | |
160 | + null, | |
161 | + null, | |
162 | + null, | |
163 | + null, | |
164 | + $this->ano ?: date('Y'), | |
165 | + $this->data_admissao, | |
166 | + null, | |
167 | + null, | |
168 | + $this->data_saida, | |
169 | + ); | |
170 | + | |
146 | 171 | $carga = $this->carga_horaria_disponivel; |
147 | 172 | $this->campoRotulo('carga_horaria_disponivel', 'Carga horária do servidor', $carga . ':00'); |
173 | + $cargadisponivel = $servidorAlocacao->getCargaHorariaAno(); | |
174 | + $this->campoRotulo('carga_horaria_sem_alocacao', 'Carga horária alocada', substr($cargadisponivel, 0, -3)); | |
148 | 175 | |
149 | 176 | $this->inputsHelper()->integer('ano', ['value' => $this->ano, 'max_length' => 4]); |
150 | 177 | |
... | ... | @@ -202,7 +229,7 @@ class indice extends clsCadastro |
202 | 229 | |
203 | 230 | $this->campoLista('ref_cod_funcionario_vinculo', 'Vínculo', $opcoes, $this->ref_cod_funcionario_vinculo, null, false, '', '', false, false); |
204 | 231 | |
205 | - $this->campoRotulo('informacao_carga_horaria','<b>Informações sobre carga horária</b>'); | |
232 | + $this->campoRotulo('informacao_carga_horaria', '<b>Informações sobre carga horária</b>'); | |
206 | 233 | $this->campoHora('hora_inicial', 'Hora de início', $this->hora_inicial); |
207 | 234 | $this->campoHora('hora_final', 'Hora de término', $this->hora_final); |
208 | 235 | $this->campoHoraServidor('carga_horaria_alocada', 'Carga horária', $this->carga_horaria_alocada, true); |
... | ... | @@ -212,7 +239,6 @@ class indice extends clsCadastro |
212 | 239 | |
213 | 240 | public function Novo() |
214 | 241 | { |
215 | - | |
216 | 242 | $obj_permissoes = new clsPermissoes(); |
217 | 243 | $obj_permissoes->permissao_cadastra( |
218 | 244 | 635, |
... | ... | @@ -243,8 +269,10 @@ class indice extends clsCadastro |
243 | 269 | ); |
244 | 270 | |
245 | 271 | $carga_horaria_disponivel = $this->hhmmToMinutes($this->carga_horaria_disponivel); |
246 | - $carga_horaria_alocada = $this->hhmmToMinutes($this->carga_horaria_alocada); | |
247 | - $carga_horaria_alocada += $this->hhmmToMinutes($servidorAlocacao->getCargaHorariaAno()); | |
272 | + if ($dataSaida > now() || $dataSaida == null) { | |
273 | + $carga_horaria_alocada = $this->hhmmToMinutes($this->carga_horaria_alocada); | |
274 | + } | |
275 | + $carga_horaria_alocada += $this->hhmmToMinutes($servidorAlocacao->getCargaHorariaAnoSemAlocacaoAtual()); | |
248 | 276 | |
249 | 277 | if ($carga_horaria_disponivel >= $carga_horaria_alocada) { |
250 | 278 | $obj_novo = new clsPmieducarServidorAlocacao( |
... | ... | @@ -301,7 +329,6 @@ class indice extends clsCadastro |
301 | 329 | |
302 | 330 | $this->mensagem .= 'Cadastro efetuado com sucesso.<br />'; |
303 | 331 | $this->simpleRedirect(sprintf('educar_servidor_alocacao_det.php?cod_servidor_alocacao=%d', $this->cod_servidor_alocacao)); |
304 | - | |
305 | 332 | } |
306 | 333 | |
307 | 334 | public function Editar() |
... | ... | @@ -311,8 +338,6 @@ class indice extends clsCadastro |
311 | 338 | |
312 | 339 | public function Excluir() |
313 | 340 | { |
314 | - | |
315 | - | |
316 | 341 | if ($this->cod_servidor_alocacao) { |
317 | 342 | $obj_tmp = new clsPmieducarServidorAlocacao($this->cod_servidor_alocacao, null, $this->pessoa_logada); |
318 | 343 | $excluiu = $obj_tmp->excluir(); | ... | ... |
ieducar/intranet/educar_servidor_alocacao_det.php
1 | 1 | <?php |
2 | -// error_reporting(E_ALL); | |
3 | -// ini_set("display_errors", 1); | |
4 | -/** | |
5 | - * i-Educar - Sistema de gestão escolar | |
6 | - * | |
7 | - * Copyright (C) 2006 Prefeitura Municipal de Itajaí | |
8 | - * <ctima@itajai.sc.gov.br> | |
9 | - * | |
10 | - * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo | |
11 | - * sob os termos da Licença Pública Geral GNU conforme publicada pela Free | |
12 | - * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) | |
13 | - * qualquer versão posterior. | |
14 | - * | |
15 | - * Este programa é distribuído na expectativa de que seja útil, porém, SEM | |
16 | - * NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU | |
17 | - * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral | |
18 | - * do GNU para mais detalhes. | |
19 | - * | |
20 | - * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto | |
21 | - * com este programa; se não, escreva para a Free Software Foundation, Inc., no | |
22 | - * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
23 | - * | |
24 | - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
25 | - * @category i-Educar | |
26 | - * @license @@license@@ | |
27 | - * @package iEd_Pmieducar | |
28 | - * @since Arquivo disponível desde a versão 1.0.0 | |
29 | - * @version $Id$ | |
30 | - */ | |
31 | 2 | |
32 | 3 | require_once 'include/clsBase.inc.php'; |
33 | 4 | require_once 'include/clsDetalhe.inc.php'; |
... | ... | @@ -38,143 +9,118 @@ require_once 'lib/Portabilis/Date/Utils.php'; |
38 | 9 | require_once 'ComponenteCurricular/Model/ComponenteDataMapper.php'; |
39 | 10 | require_once 'Educacenso/Model/DocenteDataMapper.php'; |
40 | 11 | |
41 | -/** | |
42 | - * clsIndexBase class. | |
43 | - * | |
44 | - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
45 | - * @category i-Educar | |
46 | - * @license @@license@@ | |
47 | - * @package iEd_Pmieducar | |
48 | - * @since Classe disponível desde a versão 1.0.0 | |
49 | - * @version @@package_version@@ | |
50 | - */ | |
51 | -class clsIndexBase extends clsBase { | |
52 | - function Formular() | |
53 | - { | |
54 | - $this->SetTitulo($this->_instituicao . ' Servidores - Servidor alocação'); | |
55 | - $this->processoAp = 635; | |
56 | - } | |
12 | +class clsIndexBase extends clsBase | |
13 | +{ | |
14 | + public function Formular() | |
15 | + { | |
16 | + $this->SetTitulo($this->_instituicao . ' Servidores - Servidor alocação'); | |
17 | + $this->processoAp = 635; | |
18 | + } | |
57 | 19 | } |
58 | 20 | |
59 | -/** | |
60 | - * indice class. | |
61 | - * | |
62 | - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
63 | - * @category i-Educar | |
64 | - * @license @@license@@ | |
65 | - * @package iEd_Pmieducar | |
66 | - * @since Classe disponível desde a versão 1.0.0 | |
67 | - * @version @@package_version@@ | |
68 | - */ | |
69 | 21 | class indice extends clsDetalhe |
70 | 22 | { |
71 | - var $titulo; | |
72 | - | |
73 | - /** | |
74 | - * Atributos de dados | |
75 | - */ | |
76 | - var $cod_servidor_alocacao = null; | |
77 | - var $ref_cod_servidor = null; | |
78 | - var $ref_cod_instituicao = null; | |
79 | - var $ref_cod_servidor_funcao = null; | |
80 | - var $ref_cod_funcionario_vinculo = null; | |
81 | - var $ano = null; | |
82 | - var $data_admissao = null; | |
83 | - var $data_saida = null; | |
84 | - /** | |
85 | - * Implementação do método Gerar() | |
86 | - */ | |
87 | - function Gerar() | |
88 | - { | |
89 | - $this->titulo = 'Servidor alocação - Detalhe'; | |
90 | - $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet'); | |
91 | - | |
92 | - $this->cod_servidor_alocacao = $_GET['cod_servidor_alocacao']; | |
93 | - | |
94 | - $tmp_obj = new clsPmieducarServidorAlocacao($this->cod_servidor_alocacao, $this->ref_cod_instituicao); | |
95 | - | |
96 | - $registro = $tmp_obj->detalhe(); | |
97 | - | |
98 | - if (!$registro) { | |
99 | - $this->simpleRedirect('educar_servidor_lst.php'); | |
100 | - } | |
23 | + public $titulo; | |
101 | 24 | |
102 | - $this->ref_cod_servidor = $registro['ref_cod_servidor']; | |
103 | - $this->ref_cod_instituicao = $registro['ref_ref_cod_instituicao']; | |
104 | - $this->ref_cod_servidor_funcao = $registro['ref_cod_servidor_funcao']; | |
105 | - $this->data_admissao = $registro['data_admissao']; | |
106 | - $this->data_saida = $registro['data_saida']; | |
107 | - $this->ref_cod_funcionario_vinculo = $registro['ref_cod_funcionario_vinculo']; | |
108 | - $this->ano = $registro['ano']; | |
25 | + public $cod_servidor_alocacao = null; | |
26 | + public $ref_cod_servidor = null; | |
27 | + public $ref_cod_instituicao = null; | |
28 | + public $ref_cod_servidor_funcao = null; | |
29 | + public $ref_cod_funcionario_vinculo = null; | |
30 | + public $ano = null; | |
31 | + public $data_admissao = null; | |
32 | + public $data_saida = null; | |
109 | 33 | |
110 | - //Nome do servidor | |
111 | - $fisica = new clsPessoaFisica($this->ref_cod_servidor); | |
112 | - $fisica = $fisica->detalhe(); | |
34 | + public function Gerar() | |
35 | + { | |
36 | + $this->titulo = 'Servidor alocação - Detalhe'; | |
37 | + $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet'); | |
113 | 38 | |
114 | - $this->addDetalhe(array("Servidor", "{$fisica["nome"]}")); | |
39 | + $this->cod_servidor_alocacao = $_GET['cod_servidor_alocacao']; | |
115 | 40 | |
116 | - //Escola | |
117 | - $escola = new clsPmieducarEscola($registro['ref_cod_escola']); | |
118 | - $escola = $escola->detalhe(); | |
41 | + $tmp_obj = new clsPmieducarServidorAlocacao($this->cod_servidor_alocacao, $this->ref_cod_instituicao); | |
119 | 42 | |
120 | - $this->addDetalhe(array("Escola", "{$escola["nome"]}")); | |
43 | + $registro = $tmp_obj->detalhe(); | |
121 | 44 | |
122 | - //Ano | |
123 | - $this->addDetalhe(array("Ano", "{$registro['ano']}")); | |
45 | + if (!$registro) { | |
46 | + $this->simpleRedirect('educar_servidor_lst.php'); | |
47 | + } | |
124 | 48 | |
125 | - //Periodo | |
126 | - $periodo = array( | |
127 | - 1 => 'Matutino', | |
128 | - 2 => 'Vespertino', | |
129 | - 3 => 'Noturno' | |
130 | - ); | |
49 | + $this->ref_cod_servidor = $registro['ref_cod_servidor']; | |
50 | + $this->ref_cod_instituicao = $registro['ref_ref_cod_instituicao']; | |
51 | + $this->ref_cod_servidor_funcao = $registro['ref_cod_servidor_funcao']; | |
52 | + $this->data_admissao = $registro['data_admissao']; | |
53 | + $this->data_saida = $registro['data_saida']; | |
54 | + $this->ref_cod_funcionario_vinculo = $registro['ref_cod_funcionario_vinculo']; | |
55 | + $this->ano = $registro['ano']; | |
131 | 56 | |
132 | - $this->addDetalhe(array("Periodo", "{$periodo[$registro['periodo']]}")); | |
57 | + //Nome do servidor | |
58 | + $fisica = new clsPessoaFisica($this->ref_cod_servidor); | |
59 | + $fisica = $fisica->detalhe(); | |
133 | 60 | |
134 | - //Carga horária | |
135 | - $this->addDetalhe(array("Carga horária", "{$registro['carga_horaria']}")); | |
61 | + $this->addDetalhe(['Servidor', "{$fisica['nome']}"]); | |
136 | 62 | |
137 | - //Função | |
138 | - if ($this->ref_cod_servidor_funcao) { | |
139 | - $funcaoServidor = new clsPmieducarServidorFuncao(null, null, null, null, $this->ref_cod_servidor_funcao); | |
140 | - $funcaoServidor = $funcaoServidor->detalhe(); | |
63 | + //Escola | |
64 | + $escola = new clsPmieducarEscola($registro['ref_cod_escola']); | |
65 | + $escola = $escola->detalhe(); | |
141 | 66 | |
142 | - $funcao = new clsPmieducarFuncao($funcaoServidor['ref_cod_funcao']); | |
143 | - $funcao = $funcao->detalhe(); | |
67 | + $this->addDetalhe(['Escola', "{$escola['nome']}"]); | |
144 | 68 | |
145 | - $this->addDetalhe(array("Função", "{$funcao['nm_funcao']}")); | |
146 | - } | |
69 | + //Ano | |
70 | + $this->addDetalhe(['Ano', "{$registro['ano']}"]); | |
147 | 71 | |
148 | - //Vinculo | |
149 | - if ($this->ref_cod_funcionario_vinculo) { | |
150 | - $funcionarioVinculo = new clsPortalFuncionario(); | |
151 | - $funcionarioVinculo = $funcionarioVinculo->getNomeVinculo($registro['ref_cod_funcionario_vinculo']); | |
72 | + //Periodo | |
73 | + $periodo = [ | |
74 | + 1 => 'Matutino', | |
75 | + 2 => 'Vespertino', | |
76 | + 3 => 'Noturno' | |
77 | + ]; | |
152 | 78 | |
153 | - $this->addDetalhe(array("Vinculo", "{$funcionarioVinculo}")); | |
154 | - } | |
79 | + $this->addDetalhe(['Periodo', "{$periodo[$registro['periodo']]}"]); | |
155 | 80 | |
156 | - if (!empty($this->data_admissao)) { | |
157 | - $this->addDetalhe(array("Data de admissão", Portabilis_Date_Utils::pgSQLToBr($this->data_admissao))); | |
158 | - } | |
81 | + //Carga horária | |
82 | + $this->addDetalhe(['Carga horária', substr($registro['carga_horaria'], 0, - 3)]); | |
159 | 83 | |
160 | - if (!empty($this->data_saida)) { | |
161 | - $this->addDetalhe(array("Data de saída", Portabilis_Date_Utils::pgSQLToBr($this->data_saida))); | |
162 | - } | |
84 | + //Função | |
85 | + if ($this->ref_cod_servidor_funcao) { | |
86 | + $funcaoServidor = new clsPmieducarServidorFuncao(null, null, null, null, $this->ref_cod_servidor_funcao); | |
87 | + $funcaoServidor = $funcaoServidor->detalhe(); | |
163 | 88 | |
164 | - $obj_permissoes = new clsPermissoes(); | |
165 | - if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7)) { | |
89 | + $funcao = new clsPmieducarFuncao($funcaoServidor['ref_cod_funcao']); | |
90 | + $funcao = $funcao->detalhe(); | |
166 | 91 | |
167 | - $this->url_novo = "educar_servidor_alocacao_cad.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}"; | |
168 | - $this->url_editar = "educar_servidor_alocacao_cad.php?cod_servidor_alocacao={$this->cod_servidor_alocacao}"; | |
169 | - } | |
92 | + $this->addDetalhe(['Função', "{$funcao['nm_funcao']}"]); | |
93 | + } | |
94 | + | |
95 | + //Vinculo | |
96 | + if ($this->ref_cod_funcionario_vinculo) { | |
97 | + $funcionarioVinculo = new clsPortalFuncionario(); | |
98 | + $funcionarioVinculo = $funcionarioVinculo->getNomeVinculo($registro['ref_cod_funcionario_vinculo']); | |
99 | + | |
100 | + $this->addDetalhe(['Vinculo', "{$funcionarioVinculo}"]); | |
101 | + } | |
102 | + | |
103 | + if (!empty($this->data_admissao)) { | |
104 | + $this->addDetalhe(['Data de admissão', Portabilis_Date_Utils::pgSQLToBr($this->data_admissao)]); | |
105 | + } | |
170 | 106 | |
171 | - $this->url_cancelar = "educar_servidor_alocacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}"; | |
172 | - $this->largura = '100%'; | |
107 | + if (!empty($this->data_saida)) { | |
108 | + $this->addDetalhe(['Data de saída', Portabilis_Date_Utils::pgSQLToBr($this->data_saida)]); | |
109 | + } | |
173 | 110 | |
174 | - $this->breadcrumb('Detalhe da alocação', [ | |
111 | + $obj_permissoes = new clsPermissoes(); | |
112 | + if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7)) { | |
113 | + $this->url_novo = "educar_servidor_alocacao_cad.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}"; | |
114 | + $this->url_editar = "educar_servidor_alocacao_cad.php?cod_servidor_alocacao={$this->cod_servidor_alocacao}"; | |
115 | + } | |
116 | + | |
117 | + $this->url_cancelar = "educar_servidor_alocacao_lst.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}"; | |
118 | + $this->largura = '100%'; | |
119 | + | |
120 | + $this->breadcrumb('Detalhe da alocação', [ | |
175 | 121 | url('intranet/educar_servidores_index.php') => 'Servidores', |
176 | 122 | ]); |
177 | - } | |
123 | + } | |
178 | 124 | } |
179 | 125 | |
180 | 126 | // Instancia o objeto da página | ... | ... |
ieducar/intranet/educar_servidor_alocacao_lst.php
1 | 1 | <?php |
2 | -// error_reporting(E_ERROR); | |
3 | -// ini_set("display_errors", 1); | |
4 | -/** | |
5 | - * i-Educar - Sistema de gestão escolar | |
6 | - * | |
7 | - * Copyright (C) 2006 Prefeitura Municipal de Itajaí | |
8 | - * <ctima@itajai.sc.gov.br> | |
9 | - * | |
10 | - * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo | |
11 | - * sob os termos da Licença Pública Geral GNU conforme publicada pela Free | |
12 | - * Software Foundation; tanto a versão 2 da Licença, como (a seu critério) | |
13 | - * qualquer versão posterior. | |
14 | - * | |
15 | - * Este programa é distribuído na expectativa de que seja útil, porém, SEM | |
16 | - * NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU | |
17 | - * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral | |
18 | - * do GNU para mais detalhes. | |
19 | - * | |
20 | - * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto | |
21 | - * com este programa; se não, escreva para a Free Software Foundation, Inc., no | |
22 | - * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
23 | - * | |
24 | - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
25 | - * @category i-Educar | |
26 | - * @license @@license@@ | |
27 | - * @package iEd_Pmieducar | |
28 | - * @since Arquivo disponível desde a versão 1.0.0 | |
29 | - * @version $Id$ | |
30 | - */ | |
31 | 2 | |
32 | 3 | require_once 'include/clsBase.inc.php'; |
33 | 4 | require_once 'include/clsListagem.inc.php'; |
... | ... | @@ -36,190 +7,178 @@ require_once 'include/pmieducar/geral.inc.php'; |
36 | 7 | |
37 | 8 | require_once 'CoreExt/View/Helper/UrlHelper.php'; |
38 | 9 | |
39 | -/** | |
40 | - * clsIndexBase class. | |
41 | - * | |
42 | - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
43 | - * @category i-Educar | |
44 | - * @license @@license@@ | |
45 | - * @package iEd_Pmieducar | |
46 | - * @since Classe disponível desde a versão 1.0.0 | |
47 | - * @version @@package_version@@ | |
48 | - */ | |
49 | 10 | class clsIndexBase extends clsBase |
50 | 11 | { |
51 | - function Formular() | |
52 | - { | |
53 | - $this->SetTitulo($this->_instituicao . ' Servidores - Servidor'); | |
54 | - $this->processoAp = 635; | |
55 | - } | |
12 | + public function Formular() | |
13 | + { | |
14 | + $this->SetTitulo($this->_instituicao . ' Servidores - Servidor'); | |
15 | + $this->processoAp = 635; | |
16 | + } | |
56 | 17 | } |
57 | 18 | |
58 | -/** | |
59 | - * indice class. | |
60 | - * | |
61 | - * @author Prefeitura Municipal de Itajaí <ctima@itajai.sc.gov.br> | |
62 | - * @category i-Educar | |
63 | - * @license @@license@@ | |
64 | - * @package iEd_Pmieducar | |
65 | - * @since Classe disponível desde a versão 1.0.0 | |
66 | - * @version @@package_version@@ | |
67 | - */ | |
68 | 19 | class indice extends clsListagem |
69 | 20 | { |
70 | - var $pessoa_logada; | |
71 | - var $titulo; | |
72 | - var $limite; | |
73 | - var $offset; | |
74 | - | |
75 | - var $ref_cod_servidor; | |
76 | - var $ref_cod_funcao; | |
77 | - var $carga_horaria; | |
78 | - var $data_cadastro; | |
79 | - var $data_exclusao; | |
80 | - var $ref_cod_escola; | |
81 | - var $ref_cod_instituicao; | |
82 | - var $ano_letivo; | |
83 | - | |
84 | - function Gerar() | |
85 | - { | |
86 | - $this->titulo = 'Alocação servidor - Listagem'; | |
87 | - | |
88 | - // passa todos os valores obtidos no GET para atributos do objeto | |
89 | - foreach ($_GET AS $var => $val) { | |
90 | - $this->$var = ($val === '') ? NULL : $val; | |
91 | - } | |
21 | + public $pessoa_logada; | |
22 | + public $titulo; | |
23 | + public $limite; | |
24 | + public $offset; | |
25 | + | |
26 | + public $ref_cod_servidor; | |
27 | + public $ref_cod_funcao; | |
28 | + public $carga_horaria; | |
29 | + public $data_cadastro; | |
30 | + public $data_exclusao; | |
31 | + public $ref_cod_escola; | |
32 | + public $ref_cod_instituicao; | |
33 | + public $ano_letivo; | |
34 | + | |
35 | + public function Gerar() | |
36 | + { | |
37 | + $this->titulo = 'Alocação servidor - Listagem'; | |
92 | 38 | |
93 | - $tmp_obj = new clsPmieducarServidor($this->ref_cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_instituicao); | |
94 | - $registro = $tmp_obj->detalhe(); | |
39 | + // passa todos os valores obtidos no GET para atributos do objeto | |
40 | + foreach ($_GET as $var => $val) { | |
41 | + $this->$var = ($val === '') ? null : $val; | |
42 | + } | |
95 | 43 | |
96 | - if (!$registro) { | |
97 | - $this->simpleRedirect('educar_servidor_lst.php'); | |
98 | - } | |
44 | + $tmp_obj = new clsPmieducarServidor($this->ref_cod_servidor, null, null, null, null, null, null, $this->ref_cod_instituicao); | |
45 | + $registro = $tmp_obj->detalhe(); | |
46 | + | |
47 | + if (!$registro) { | |
48 | + $this->simpleRedirect('educar_servidor_lst.php'); | |
49 | + } | |
99 | 50 | |
100 | - $this->addCabecalhos( array( | |
51 | + $this->addCabecalhos([ | |
101 | 52 | 'Escola', |
102 | 53 | 'Função', |
103 | 54 | 'Ano', |
104 | 55 | 'Período', |
105 | 56 | 'Carga horária', |
57 | + 'Data admissão', | |
58 | + 'Data saída', | |
106 | 59 | 'Vínculo' |
107 | - )); | |
60 | + ]); | |
108 | 61 | |
109 | - $fisica = new clsPessoaFisica($this->ref_cod_servidor); | |
110 | - $fisica = $fisica->detalhe(); | |
62 | + $fisica = new clsPessoaFisica($this->ref_cod_servidor); | |
63 | + $fisica = $fisica->detalhe(); | |
111 | 64 | |
112 | - $this->campoOculto('ref_cod_servidor', $this->ref_cod_servidor); | |
113 | - $this->campoRotulo('nm_servidor', 'Servidor', $fisica['nome']); | |
65 | + $this->campoOculto('ref_cod_servidor', $this->ref_cod_servidor); | |
66 | + $this->campoRotulo('nm_servidor', 'Servidor', $fisica['nome']); | |
114 | 67 | |
115 | - $this->inputsHelper()->dynamic('instituicao', array('required' => false, 'show-select' => true, 'value' => $this->ref_cod_instituicao)); | |
116 | - $this->inputsHelper()->dynamic('escola', array('required' => false, 'show-select' => true, 'value' => $this->ref_cod_escola)); | |
117 | - $this->inputsHelper()->dynamic('anoLetivo', array('required' => false, 'show-select' => true, 'value' => $this->ano_letivo)); | |
68 | + $this->inputsHelper()->dynamic('instituicao', ['required' => false, 'show-select' => true, 'value' => $this->ref_cod_instituicao]); | |
69 | + $this->inputsHelper()->dynamic('escola', ['required' => false, 'show-select' => true, 'value' => $this->ref_cod_escola]); | |
70 | + $this->inputsHelper()->dynamic('anoLetivo', ['required' => false, 'show-select' => true, 'value' => $this->ano_letivo]); | |
118 | 71 | |
119 | - $parametros = new clsParametrosPesquisas(); | |
120 | - $parametros->setSubmit(0); | |
72 | + $parametros = new clsParametrosPesquisas(); | |
73 | + $parametros->setSubmit(0); | |
121 | 74 | |
122 | - // Paginador | |
123 | - $this->limite = 20; | |
124 | - $this->offset = ($_GET['pagina_' . $this->nome]) ? | |
75 | + // Paginador | |
76 | + $this->limite = 20; | |
77 | + $this->offset = ($_GET['pagina_' . $this->nome]) ? | |
125 | 78 | $_GET['pagina_' . $this->nome] * $this->limite - $this->limite : 0; |
126 | 79 | |
127 | - $obj_servidor_alocacao = new clsPmieducarServidorAlocacao(); | |
128 | - | |
129 | - if (App_Model_IedFinder::usuarioNivelBibliotecaEscolar($this->pessoa_logada)) { | |
130 | - $obj_servidor_alocacao->codUsuario = $this->pessoa_logada; | |
131 | - } | |
132 | - | |
133 | - $obj_servidor_alocacao->setOrderby('ano ASC'); | |
134 | - $obj_servidor_alocacao->setLimite($this->limite, $this->offset); | |
135 | - | |
136 | - $lista = $obj_servidor_alocacao->lista( | |
137 | - null, | |
138 | - $this->ref_cod_instituicao, | |
139 | - null, | |
140 | - null, | |
141 | - $this->ref_cod_escola, | |
142 | - $this->ref_cod_servidor, | |
143 | - null, | |
144 | - null, | |
145 | - null, | |
146 | - null, | |
147 | - null, | |
148 | - null, | |
149 | - null, | |
150 | - null, | |
151 | - null, | |
152 | - $this->ano_letivo | |
153 | - ); | |
154 | - $total = $obj_servidor_alocacao->_total; | |
155 | - | |
156 | - // UrlHelper | |
157 | - $url = CoreExt_View_Helper_UrlHelper::getInstance(); | |
158 | - | |
159 | - // Monta a lista | |
160 | - if (is_array($lista) && count($lista)) { | |
161 | - foreach ($lista as $registro) { | |
162 | - | |
163 | - $path = 'educar_servidor_alocacao_det.php'; | |
164 | - $options = array( | |
165 | - 'query' => array( | |
166 | - 'cod_servidor_alocacao' => $registro['cod_servidor_alocacao'], | |
167 | - )); | |
168 | - | |
169 | - //Escola | |
170 | - $escola = new clsPmieducarEscola($registro['ref_cod_escola']); | |
171 | - $escola = $escola->detalhe(); | |
172 | - | |
173 | - //Periodo | |
174 | - $periodo = array( | |
175 | - 1 => 'Matutino', | |
176 | - 2 => 'Vespertino', | |
177 | - 3 => 'Noturno' | |
80 | + $obj_servidor_alocacao = new clsPmieducarServidorAlocacao(); | |
81 | + | |
82 | + if (App_Model_IedFinder::usuarioNivelBibliotecaEscolar($this->pessoa_logada)) { | |
83 | + $obj_servidor_alocacao->codUsuario = $this->pessoa_logada; | |
84 | + } | |
85 | + | |
86 | + $obj_servidor_alocacao->setOrderby('ano ASC, data_saida, data_admissao'); | |
87 | + $obj_servidor_alocacao->setLimite($this->limite, $this->offset); | |
88 | + | |
89 | + $lista = $obj_servidor_alocacao->lista( | |
90 | + null, | |
91 | + $this->ref_cod_instituicao, | |
92 | + null, | |
93 | + null, | |
94 | + $this->ref_cod_escola, | |
95 | + $this->ref_cod_servidor, | |
96 | + null, | |
97 | + null, | |
98 | + null, | |
99 | + null, | |
100 | + null, | |
101 | + null, | |
102 | + null, | |
103 | + null, | |
104 | + null, | |
105 | + $this->ano_letivo, | |
106 | + $this->data_admissao, | |
107 | + $this->hora_inicial, | |
108 | + $this->hora_final, | |
109 | + $this->hora_atividade, | |
110 | + $this->horas_excedentes, | |
111 | + $this->data_saida | |
178 | 112 | ); |
113 | + $total = $obj_servidor_alocacao->_total; | |
179 | 114 | |
180 | - //Função | |
181 | - $funcaoServidor = new clsPmieducarServidorFuncao(null, null, null, null, $registro['ref_cod_servidor_funcao']); | |
182 | - $funcaoServidor = $funcaoServidor->detalhe(); | |
183 | - | |
184 | - $funcao = new clsPmieducarFuncao($funcaoServidor['ref_cod_funcao']); | |
185 | - $funcao = $funcao->detalhe(); | |
186 | - | |
187 | - //Vinculo | |
188 | - $funcionarioVinculo = new clsPortalFuncionario(); | |
189 | - $funcionarioVinculo = $funcionarioVinculo->getNomeVinculo($registro['ref_cod_funcionario_vinculo']); | |
190 | - | |
191 | - $this->addLinhas(array( | |
192 | - $url->l($escola['nome'], $path, $options), | |
193 | - $url->l($funcao['nm_funcao'], $path, $options), | |
194 | - $url->l($registro['ano'], $path, $options), | |
195 | - $url->l($periodo[$registro['periodo']], $path, $options), | |
196 | - $url->l($registro['carga_horaria'], $path, $options), | |
197 | - $url->l($funcionarioVinculo, $path, $options), | |
198 | - )); | |
199 | - } | |
200 | - } | |
201 | - | |
202 | - $this->addPaginador2('educar_servidor_alocacao_lst.php', $total, $_GET, $this->nome, $this->limite); | |
115 | + // UrlHelper | |
116 | + $url = CoreExt_View_Helper_UrlHelper::getInstance(); | |
203 | 117 | |
204 | - $obj_permissoes = new clsPermissoes(); | |
205 | - | |
206 | - $this->array_botao = array(); | |
207 | - $this->array_botao_url = array(); | |
208 | - if( $obj_permissoes->permissao_cadastra( 635, $this->pessoa_logada, 7 ) ) | |
209 | - { | |
210 | - $this->array_botao_url[]= "educar_servidor_alocacao_cad.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}"; | |
211 | - $this->array_botao[]= "Novo"; | |
212 | - } | |
213 | - | |
214 | - $this->array_botao[] = "Voltar"; | |
215 | - $this->array_botao_url[] = "educar_servidor_det.php?cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}"; | |
216 | - | |
217 | - $this->largura = '100%'; | |
218 | - | |
219 | - $this->breadcrumb('Registro de alocações do servidor', [ | |
118 | + // Monta a lista | |
119 | + if (is_array($lista) && count($lista)) { | |
120 | + foreach ($lista as $registro) { | |
121 | + $path = 'educar_servidor_alocacao_det.php'; | |
122 | + $options = [ | |
123 | + 'query' => [ | |
124 | + 'cod_servidor_alocacao' => $registro['cod_servidor_alocacao'], | |
125 | + ]]; | |
126 | + | |
127 | + //Escola | |
128 | + $escola = new clsPmieducarEscola($registro['ref_cod_escola']); | |
129 | + $escola = $escola->detalhe(); | |
130 | + | |
131 | + //Periodo | |
132 | + $periodo = [ | |
133 | + 1 => 'Matutino', | |
134 | + 2 => 'Vespertino', | |
135 | + 3 => 'Noturno' | |
136 | + ]; | |
137 | + | |
138 | + //Função | |
139 | + $funcaoServidor = new clsPmieducarServidorFuncao(null, null, null, null, $registro['ref_cod_servidor_funcao']); | |
140 | + $funcaoServidor = $funcaoServidor->detalhe(); | |
141 | + | |
142 | + $funcao = new clsPmieducarFuncao($funcaoServidor['ref_cod_funcao']); | |
143 | + $funcao = $funcao->detalhe(); | |
144 | + | |
145 | + //Vinculo | |
146 | + $funcionarioVinculo = new clsPortalFuncionario(); | |
147 | + $funcionarioVinculo = $funcionarioVinculo->getNomeVinculo($registro['ref_cod_funcionario_vinculo']); | |
148 | + | |
149 | + $this->addLinhas([ | |
150 | + $url->l($escola['nome'], $path, $options), | |
151 | + $url->l($funcao['nm_funcao'], $path, $options), | |
152 | + $url->l($registro['ano'], $path, $options), | |
153 | + $url->l($periodo[$registro['periodo']], $path, $options), | |
154 | + $url->l($horas = substr($registro['carga_horaria'], 0, - 3), $path, $options), | |
155 | + $url->l(Portabilis_Date_Utils::pgSQLToBr($registro['data_admissao']), $path, $options), | |
156 | + $url->l(Portabilis_Date_Utils::pgSQLToBr($registro['data_saida']), $path, $options), | |
157 | + $url->l($funcionarioVinculo, $path, $options), | |
158 | + ]); | |
159 | + } | |
160 | + } | |
161 | + | |
162 | + $this->addPaginador2('educar_servidor_alocacao_lst.php', $total, $_GET, $this->nome, $this->limite); | |
163 | + | |
164 | + $obj_permissoes = new clsPermissoes(); | |
165 | + | |
166 | + $this->array_botao = []; | |
167 | + $this->array_botao_url = []; | |
168 | + if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7)) { | |
169 | + $this->array_botao_url[]= "educar_servidor_alocacao_cad.php?ref_cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}"; | |
170 | + $this->array_botao[]= 'Novo'; | |
171 | + } | |
172 | + | |
173 | + $this->array_botao[] = 'Voltar'; | |
174 | + $this->array_botao_url[] = "educar_servidor_det.php?cod_servidor={$this->ref_cod_servidor}&ref_cod_instituicao={$this->ref_cod_instituicao}"; | |
175 | + | |
176 | + $this->largura = '100%'; | |
177 | + | |
178 | + $this->breadcrumb('Registro de alocações do servidor', [ | |
220 | 179 | url('intranet/educar_servidores_index.php') => 'Servidores', |
221 | 180 | ]); |
222 | - } | |
181 | + } | |
223 | 182 | } |
224 | 183 | |
225 | 184 | // Instancia objeto de página | ... | ... |
ieducar/intranet/educar_servidor_cad.php
... | ... | @@ -107,32 +107,31 @@ class indice extends clsCadastro |
107 | 107 | $db = new clsBanco(); |
108 | 108 | |
109 | 109 | // Carga horária alocada no ultimo ano de alocação |
110 | - $sql = sprintf(" | |
110 | + $sql = sprintf( | |
111 | + ' | |
111 | 112 | SELECT |
112 | - carga_horaria | |
113 | + SUM(extract(hours from carga_horaria::interval)) | |
113 | 114 | FROM |
114 | 115 | pmieducar.servidor_alocacao |
115 | 116 | WHERE |
116 | - ref_cod_servidor = '%d' AND | |
117 | - ativo = 1 | |
117 | + ref_cod_servidor = %d AND | |
118 | + ativo = 1 | |
118 | 119 | AND ano = ( |
119 | 120 | SELECT max(ano) |
120 | 121 | FROM pmieducar.servidor_alocacao |
121 | - WHERE ref_cod_servidor = $this->cod_servidor | |
122 | - )", | |
122 | + WHERE ref_cod_servidor = %d | |
123 | + )', | |
124 | + $this->cod_servidor, | |
123 | 125 | $this->cod_servidor |
124 | 126 | ); |
125 | 127 | |
126 | 128 | $db->Consulta($sql); |
127 | - | |
128 | - $carga = 0; | |
129 | 129 | while ($db->ProximoRegistro()) { |
130 | 130 | $cargaHoraria = $db->Tupla(); |
131 | - $cargaHoraria = explode(':', $cargaHoraria['carga_horaria']); | |
132 | - $carga += $cargaHoraria[0] * 60 + $cargaHoraria[1]; | |
131 | + $cargaHoraria = $cargaHoraria['sum']; | |
133 | 132 | } |
133 | + $this->total_horas_alocadas = $cargaHoraria; | |
134 | 134 | |
135 | - $this->total_horas_alocadas = sprintf('%02d:%02d', $carga / 60, $carga % 60); | |
136 | 135 | // Funções |
137 | 136 | $obj_funcoes = new clsPmieducarServidorFuncao(); |
138 | 137 | $lst_funcoes = $obj_funcoes->lista($this->ref_cod_instituicao, $this->cod_servidor); |
... | ... | @@ -187,7 +186,7 @@ class indice extends clsCadastro |
187 | 186 | |
188 | 187 | $nomeMenu = $retorno == 'Editar' ? $retorno : 'Cadastrar'; |
189 | 188 | |
190 | - $this->breadcrumb("Funções do servidor", [ | |
189 | + $this->breadcrumb('Funções do servidor', [ | |
191 | 190 | url('intranet/educar_servidores_index.php') => 'Servidores', |
192 | 191 | ]); |
193 | 192 | |
... | ... | @@ -252,7 +251,6 @@ class indice extends clsCadastro |
252 | 251 | ); |
253 | 252 | } |
254 | 253 | |
255 | - // ---- | |
256 | 254 | $this->inputsHelper()->integer( |
257 | 255 | 'cod_docente_inep', |
258 | 256 | [ |
... | ... | @@ -280,17 +278,17 @@ class indice extends clsCadastro |
280 | 278 | |
281 | 279 | $opcoes = ['' => 'Selecione']; |
282 | 280 | |
283 | - if (is_numeric($this->ref_cod_instituicao)) { | |
284 | - $objTemp = new clsPmieducarFuncao(); | |
285 | - $objTemp->setOrderby('nm_funcao ASC'); | |
286 | - $lista = $objTemp->lista(null, null, null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao); | |
281 | + if (is_numeric($this->ref_cod_instituicao)) { | |
282 | + $objTemp = new clsPmieducarFuncao(); | |
283 | + $objTemp->setOrderby('nm_funcao ASC'); | |
284 | + $lista = $objTemp->lista(null, null, null, null, null, null, null, null, null, null, 1, $this->ref_cod_instituicao); | |
287 | 285 | |
288 | - if (is_array($lista) && count($lista)) { | |
289 | - foreach ($lista as $registro) { | |
290 | - $opcoes[$registro['cod_funcao'] . '-' . $registro['professor']] = $registro['nm_funcao']; | |
291 | - } | |
286 | + if (is_array($lista) && count($lista)) { | |
287 | + foreach ($lista as $registro) { | |
288 | + $opcoes[$registro['cod_funcao'] . '-' . $registro['professor']] = $registro['nm_funcao']; | |
292 | 289 | } |
293 | 290 | } |
291 | + } | |
294 | 292 | |
295 | 293 | $this->campoTabelaInicio( |
296 | 294 | 'funcao', |
... | ... | @@ -331,7 +329,7 @@ class indice extends clsCadastro |
331 | 329 | $this->campoTextoInv( |
332 | 330 | 'total_horas_alocadas_', |
333 | 331 | 'Total de Horas Alocadadas', |
334 | - $this->total_horas_alocadas, | |
332 | + $this->total_horas_alocadas . ':00', | |
335 | 333 | 9, |
336 | 334 | 20 |
337 | 335 | ); |
... | ... | @@ -373,14 +371,14 @@ class indice extends clsCadastro |
373 | 371 | |
374 | 372 | $opcoes = ['' => 'Selecione']; |
375 | 373 | |
376 | - $objTemp = new clsCadastroEscolaridade(); | |
377 | - $lista = $objTemp->lista(); | |
374 | + $objTemp = new clsCadastroEscolaridade(); | |
375 | + $lista = $objTemp->lista(); | |
378 | 376 | |
379 | - if (is_array($lista) && count($lista)) { | |
380 | - foreach ($lista as $registro) { | |
381 | - $opcoes[$registro['idesco']] = $registro['descricao']; | |
382 | - } | |
377 | + if (is_array($lista) && count($lista)) { | |
378 | + foreach ($lista as $registro) { | |
379 | + $opcoes[$registro['idesco']] = $registro['descricao']; | |
383 | 380 | } |
381 | + } | |
384 | 382 | |
385 | 383 | $obj_permissoes = new clsPermissoes(); |
386 | 384 | if ($obj_permissoes->permissao_cadastra(632, $this->pessoa_logada, 4)) { | ... | ... |
ieducar/intranet/include/pmieducar/clsPmieducarHistoricoEscolar.inc.php
... | ... | @@ -763,7 +763,7 @@ class clsPmieducarHistoricoEscolar extends Model |
763 | 763 | $ref_usuario_cad = $pessoa_logada, |
764 | 764 | $detMatricula['nome_serie'], |
765 | 765 | $detMatricula['ano'], |
766 | - 1000, | |
766 | + $detMatricula['carga_horaria'], | |
767 | 767 | null, |
768 | 768 | strtoupper($dadosEscola['nome']), |
769 | 769 | strtoupper($dadosEscola['cidade']), |
... | ... | @@ -824,7 +824,7 @@ class clsPmieducarHistoricoEscolar extends Model |
824 | 824 | |
825 | 825 | protected static function dadosMatricula($ref_cod_matricula) |
826 | 826 | { |
827 | - $sql = "SELECT m.ref_cod_aluno, nm_serie as nome_serie, s.cod_serie, m.ano, m.ref_ref_cod_escola, c.ref_cod_instituicao, c.nm_curso as nome_curso | |
827 | + $sql = "SELECT m.ref_cod_aluno, nm_serie as nome_serie, s.cod_serie, m.ano, m.ref_ref_cod_escola, c.ref_cod_instituicao, c.nm_curso as nome_curso, s.carga_horaria | |
828 | 828 | FROM pmieducar.matricula m |
829 | 829 | INNER JOIN pmieducar.serie s ON m.ref_ref_cod_serie = s.cod_serie |
830 | 830 | INNER JOIN pmieducar.curso c ON m.ref_cod_curso = c.cod_curso | ... | ... |
ieducar/intranet/include/pmieducar/clsPmieducarServidorAlocacao.inc.php
... | ... | @@ -800,7 +800,7 @@ class clsPmieducarServidorAlocacao extends Model |
800 | 800 | * |
801 | 801 | * @throws Exception |
802 | 802 | */ |
803 | - public function getCargaHorariaAno() | |
803 | + public function getCargaHorariaAnoSemAlocacaoAtual() | |
804 | 804 | { |
805 | 805 | if (is_numeric($this->ref_cod_servidor) && is_numeric($this->ano)) { |
806 | 806 | $db = new clsBanco(); |
... | ... | @@ -808,10 +808,11 @@ class clsPmieducarServidorAlocacao extends Model |
808 | 808 | $sql = "SELECT SUM(carga_horaria::interval) |
809 | 809 | FROM pmieducar.servidor_alocacao |
810 | 810 | WHERE ref_cod_servidor = {$this->ref_cod_servidor} |
811 | - AND ano = {$this->ano}"; | |
811 | + AND ano = {$this->ano} | |
812 | + AND (data_saida > now() or data_saida is null)"; | |
812 | 813 | |
813 | 814 | if ($this->cod_servidor_alocacao) { |
814 | - $sql .= "AND cod_servidor_alocacao != {$this->cod_servidor_alocacao}"; | |
815 | + $sql .= " AND cod_servidor_alocacao <> {$this->cod_servidor_alocacao}"; | |
815 | 816 | } |
816 | 817 | |
817 | 818 | $db->Consulta($sql); |
... | ... | @@ -824,6 +825,27 @@ class clsPmieducarServidorAlocacao extends Model |
824 | 825 | return ''; |
825 | 826 | } |
826 | 827 | |
828 | + public function getCargaHorariaAno() | |
829 | + { | |
830 | + if (is_numeric($this->ref_cod_servidor) && is_numeric($this->ano)) { | |
831 | + $db = new clsBanco(); | |
832 | + | |
833 | + $sql = "SELECT SUM(carga_horaria::interval) | |
834 | + FROM pmieducar.servidor_alocacao | |
835 | + WHERE ref_cod_servidor = {$this->ref_cod_servidor} | |
836 | + AND ano = {$this->ano} | |
837 | + AND (data_saida > now() or data_saida is null)"; | |
838 | + | |
839 | + $db->Consulta($sql); | |
840 | + $db->ProximoRegistro(); | |
841 | + $registro = $db->Tupla(); | |
842 | + | |
843 | + return $registro[0]; | |
844 | + } | |
845 | + | |
846 | + return ''; | |
847 | + } | |
848 | + | |
827 | 849 | public function periodoAlocado() |
828 | 850 | { |
829 | 851 | if (is_numeric($this->ref_cod_escola) |
... | ... | @@ -839,7 +861,8 @@ class clsPmieducarServidorAlocacao extends Model |
839 | 861 | AND ref_cod_servidor = {$this->ref_cod_servidor} |
840 | 862 | AND ano = {$this->ano} |
841 | 863 | AND periodo = {$this->periodo} |
842 | - AND ativo = 1"; | |
864 | + AND ativo = 1 | |
865 | + AND (data_saida > now() or data_saida is null)"; | |
843 | 866 | |
844 | 867 | if (is_numeric($this->cod_servidor_alocacao)) { |
845 | 868 | $sql .= " AND cod_servidor_alocacao <> {$this->cod_servidor_alocacao}"; | ... | ... |
ieducar/modules/Avaliacao/Assets/Javascripts/Diario.js
... | ... | @@ -7,7 +7,7 @@ var API_URL_BASE = 'diarioApi'; |
7 | 7 | var RESOURCE_NAME = 'matricula'; |
8 | 8 | var RESOURCES_NAME = 'matriculas'; |
9 | 9 | |
10 | -var REGRA_DIFERENCIADA_TEXT = '* Regra diferenciada para alunos com deficiência'; | |
10 | +var REGRA_DIFERENCIADA_TEXT = '* Regra inclusiva para alunos com deficiência'; | |
11 | 11 | |
12 | 12 | var POST_LABEL = ''; |
13 | 13 | var DELETE_LABEL = ''; | ... | ... |
ieducar/modules/Cadastro/Assets/Javascripts/Servidor.js
... | ... | @@ -32,7 +32,7 @@ function verificaDeficiencias() { |
32 | 32 | } |
33 | 33 | |
34 | 34 | function submitForm() { |
35 | - if (!validaServidor() || !validaPosGraduacao() || !validaCursoFormacaoContinuada() || !validationUtils.validatesFields(false) || !validateGraduations()) { | |
35 | + if (!validaServidor() || !validaPosGraduacao() || !validaCursoFormacaoContinuada() || !validationUtils.validatesFields(false) || !validateGraduations() || !validaCargaHoraria()) { | |
36 | 36 | return false; |
37 | 37 | } |
38 | 38 | |
... | ... | @@ -241,7 +241,6 @@ $j(document).ready(function() { |
241 | 241 | // DADOS GERAIS |
242 | 242 | $j('#tab1').click( |
243 | 243 | function(){ |
244 | - | |
245 | 244 | $j('.servidorTab-active').toggleClass('servidorTab-active servidorTab'); |
246 | 245 | $j('#tab1').toggleClass('servidorTab servidorTab-active') |
247 | 246 | $j('.tablecadastro >tbody > tr').each(function(index, row) { |
... | ... | @@ -423,6 +422,13 @@ function validateGraduations() { |
423 | 422 | return result; |
424 | 423 | } |
425 | 424 | |
425 | + var courseName = $j('input[id="employee_course[0]"]'); | |
426 | + | |
427 | + if (obrigarCamposCenso && courseName.val() === undefined) { | |
428 | + messageUtils.error('É necessário informar pelo menos um curso superior concluído'); | |
429 | + return false; | |
430 | + } | |
431 | + | |
426 | 432 | $j.each($j('input[id^="employee_course_id"]'), function (index, field) { |
427 | 433 | var id = $j(field).attr('id'); |
428 | 434 | var idNum = id.match(/\[(\d+)\]/); |
... | ... | @@ -470,3 +476,15 @@ function validateGraduations() { |
470 | 476 | |
471 | 477 | return result; |
472 | 478 | } |
479 | + | |
480 | +function validaCargaHoraria() { | |
481 | + if ($j('#carga_horaria').val() < $j('#total_horas_alocadas_').val()) { | |
482 | + messageUtils.error('A Carga horária total deve ser maior ou igual a quantidade de horas alocadas para o servidor.<br>'); | |
483 | + return false; | |
484 | + } | |
485 | + return true; | |
486 | +} | |
487 | + | |
488 | +$j('#carga_horaria').change(function () { | |
489 | + validaCargaHoraria() | |
490 | +}); | ... | ... |
ieducar/modules/ComponenteCurricular/Model/CodigoEducacenso.php
... | ... | @@ -16,10 +16,10 @@ class ComponenteCurricular_Model_CodigoEducacenso extends CoreExt_Enum |
16 | 16 | 4 => 'Biologia', |
17 | 17 | 5 => 'Ciências', |
18 | 18 | 6 => 'Língua/Literatura portuguesa', |
19 | - 7 => 'Língua/Literatura extrangeira - Inglês', | |
20 | - 8 => 'Língua/Literatura extrangeira - Espanhol', | |
21 | - 30 => 'Língua/Literatura extrangeira - Francês', | |
22 | - 9 => 'Língua/Literatura extrangeira - Outra', | |
19 | + 7 => 'Língua/Literatura estrangeira - Inglês', | |
20 | + 8 => 'Língua/Literatura estrangeira - Espanhol', | |
21 | + 30 => 'Língua/Literatura estrangeira - Francês', | |
22 | + 9 => 'Língua/Literatura estrangeira - Outra', | |
23 | 23 | 10 => 'Artes (educação artística, teatro, dança, música, artes plásticas e outras)', |
24 | 24 | 11 => 'Educação física', |
25 | 25 | 12 => 'História', | ... | ... |
ieducar/modules/RegraAvaliacao/Model/RegraRecuperacao.php
... | ... | @@ -65,8 +65,8 @@ class RegraAvaliacao_Model_RegraRecuperacao extends CoreExt_Entity |
65 | 65 | return [ |
66 | 66 | 'descricao' => new CoreExt_Validate_String(['min' => 1, 'max' => 25]), |
67 | 67 | 'etapasRecuperadas' => new CoreExt_Validate_String(['min' => 1, 'max' => 25]), |
68 | - 'media' => new CoreExt_Validate_Numeric(['min' => 0.001, 'max' => 9999.0]), | |
69 | - 'notaMaxima' => new CoreExt_Validate_Numeric(['min' => 0.001, 'max' => 9999.0]) | |
68 | + 'media' => new CoreExt_Validate_Numeric(['min' => 0, 'max' => 100]), | |
69 | + 'notaMaxima' => new CoreExt_Validate_Numeric(['min' => 0, 'max' => 100]) | |
70 | 70 | ]; |
71 | 71 | } |
72 | 72 | ... | ... |
ieducar/modules/RegraAvaliacao/Model/TipoParecerDescritivo.php
... | ... | @@ -17,7 +17,7 @@ class RegraAvaliacao_Model_TipoParecerDescritivo extends CoreExt_Enum |
17 | 17 | self::NENHUM => 'Não usar parecer descritivo', |
18 | 18 | self::ETAPA_COMPONENTE => 'Um parecer por etapa e por componente curricular', |
19 | 19 | self::ETAPA_GERAL => 'Um parecer por etapa, geral', |
20 | - self::ANUAL_COMPONENTE => 'Uma parecer por ano letivo e por componente curricular', | |
20 | + self::ANUAL_COMPONENTE => 'Um parecer por ano letivo e por componente curricular', | |
21 | 21 | self::ANUAL_GERAL => 'Um parecer por ano letivo, geral', |
22 | 22 | ]; |
23 | 23 | ... | ... |
ieducar/modules/RegraAvaliacao/Views/EditController.php
... | ... | @@ -94,8 +94,8 @@ class EditController extends Core_Controller_Page_EditController |
94 | 94 | 'help' => '' |
95 | 95 | ], |
96 | 96 | 'regraDiferenciada' => [ |
97 | - 'label' => 'Regra diferenciada', | |
98 | - 'help' => 'Regra para avaliação de alunos com deficiência' | |
97 | + 'label' => 'Regra inclusiva', | |
98 | + 'help' => 'Regra de avaliação inclusiva para alunos com deficiência' | |
99 | 99 | ], |
100 | 100 | 'notaMaximaGeral' => [ |
101 | 101 | 'label' => 'Nota máxima geral', |
... | ... | @@ -312,7 +312,7 @@ class EditController extends Core_Controller_Page_EditController |
312 | 312 | '/modules/RegraAvaliacao/Assets/Javascripts/RegraAvaliacao.js' |
313 | 313 | ); |
314 | 314 | |
315 | - $nomeMenu = $this->getRequest()->id == null ? 'Cadastrar' : 'Editar'; | |
315 | + $nomeMenu = ($this->getRequest()->id == null || $this->getRequest()->copy) ? 'Cadastrar' : 'Editar'; | |
316 | 316 | $localizacao = new LocalizacaoSistema(); |
317 | 317 | $localizacao->entradaCaminhos([ |
318 | 318 | $_SERVER['SERVER_NAME'].'/intranet' => 'Início', |
... | ... | @@ -328,6 +328,10 @@ class EditController extends Core_Controller_Page_EditController |
328 | 328 | */ |
329 | 329 | public function Gerar() |
330 | 330 | { |
331 | + if ($this->getRequest()->copy) { | |
332 | + $this->tipoacao = 'Novo'; | |
333 | + } | |
334 | + | |
331 | 335 | $this->campoOculto('id', $this->getEntity()->id); |
332 | 336 | |
333 | 337 | // Instituição |
... | ... | @@ -878,7 +882,7 @@ class EditController extends Core_Controller_Page_EditController |
878 | 882 | } |
879 | 883 | |
880 | 884 | // Verifica pela existência do field identity |
881 | - if (isset($this->getRequest()->id) && 0 < $this->getRequest()->id) { | |
885 | + if (isset($this->getRequest()->id) && 0 < $this->getRequest()->id && !$this->getRequest()->copy) { | |
882 | 886 | $this->setEntity($this->getDataMapper()->find($this->getRequest()->id)); |
883 | 887 | $entity = $this->getEntity(); |
884 | 888 | } |
... | ... | @@ -980,6 +984,10 @@ class EditController extends Core_Controller_Page_EditController |
980 | 984 | return false; |
981 | 985 | } |
982 | 986 | |
987 | + if ($this->getRequest()->copy) { | |
988 | + $this->_options['edit_success_params'] = ['id' => $entity->fetch()['id']]; | |
989 | + } | |
990 | + | |
983 | 991 | return true; |
984 | 992 | } |
985 | 993 | } | ... | ... |
ieducar/modules/RegraAvaliacao/Views/ViewController.php
... | ... | @@ -51,5 +51,7 @@ class ViewController extends Core_Controller_Page_ViewController |
51 | 51 | $this->breadcrumb('Detalhes da regra de avaliação', [ |
52 | 52 | url('intranet/educar_index.php') => 'Escola', |
53 | 53 | ]); |
54 | + | |
55 | + $this->addBotao('Copiar regra',"/module/RegraAvaliacao/edit?id={$this->getRequest()->id}©=true" ); | |
54 | 56 | } |
55 | 57 | } | ... | ... |
resources/views/classroom/update-school-class-report-card/index.blade.php
... | ... | @@ -73,7 +73,11 @@ |
73 | 73 | </tr> |
74 | 74 | |
75 | 75 | <tr id="tr_nm_tipo_boletim"> |
76 | - <td class="formlttd" valign="top"><span class="form">Tipo de boletim antigo</span></td> | |
76 | + <td class="formlttd" valign="top"> | |
77 | + <span class="form">Modelo de boletim antigo</span> | |
78 | + <br> | |
79 | + <sub style="vertical-align:top;">Deixe em branco para atualizar em todas as turmas</sub> | |
80 | + </td> | |
77 | 81 | <td class="formlttd" valign="top"> |
78 | 82 | <span class="form"> |
79 | 83 | <select class="geral" name="old_report_card" id="old_report_card" style="width: 308px;"> |
... | ... | @@ -98,8 +102,12 @@ |
98 | 102 | </tr> |
99 | 103 | |
100 | 104 | <tr id="tr_nm_tipo_boletim"> |
101 | - <td class="formlttd" valign="top"><span class="form">Tipo de boletim novo</span></td> | |
102 | - <td class="formlttd" valign="top"> | |
105 | + <td class="formmdtd" valign="top"> | |
106 | + <span class="form">Novo modelo de boletim</span> | |
107 | + <br> | |
108 | + <sub style="vertical-align:top;">Deixe em branco para não alterar</sub> | |
109 | + </td> | |
110 | + <td class="formmdtd" valign="top"> | |
103 | 111 | <span class="form"> |
104 | 112 | <select class="geral" name="new_report_card" id="new_report_card" style="width: 308px;"> |
105 | 113 | <option value="">Selecione um tipo</option> |
... | ... | @@ -124,7 +132,7 @@ |
124 | 132 | |
125 | 133 | <tr id="tr_nm_tipo_boletim"> |
126 | 134 | <td class="formlttd" valign="top"> |
127 | - <span class="form">Tipo de boletim diferenciado novo</span> | |
135 | + <span class="form">Novo modelo de boletim (diferenciado)</span> | |
128 | 136 | <br> |
129 | 137 | <sub style="vertical-align:top;">Deixe em branco para não alterar</sub> |
130 | 138 | </td> |
... | ... | @@ -168,12 +176,14 @@ |
168 | 176 | <tr> |
169 | 177 | <th>Código da turma</th> |
170 | 178 | <th>Nome da turma</th> |
171 | - <th>Tipo de boletim antigo</th> | |
172 | - <th>Tipo de boletim novo</th> | |
173 | - @if(isset(Session::get('classrooms')[0]['new_alternative_report'])) | |
174 | - <th>Tipo de boletim diferenciado antigo</th> | |
175 | - <th>Tipo de boletim diferenciado novo</th> | |
176 | - @endif | |
179 | + @isset(Session::get('classrooms')[0]['new_report']) | |
180 | + <th>Modelo de boletim antigo</th> | |
181 | + <th>Novo modelo de boletim</th> | |
182 | + @endisset | |
183 | + @isset(Session::get('classrooms')[0]['new_alternative_report']) | |
184 | + <th>Modelo de boletim antigo (diferenciado)</th> | |
185 | + <th>Novo modelo de boletim (diferenciado)</th> | |
186 | + @endisset | |
177 | 187 | </tr> |
178 | 188 | </thead> |
179 | 189 | <tbody> |
... | ... | @@ -181,15 +191,19 @@ |
181 | 191 | <tr class="form-success"> |
182 | 192 | <td>{{ $classroom['id'] }}</td> |
183 | 193 | <td>{{ $classroom['name'] }}</td> |
184 | - <td>{{ $reportCards[$classroom['old_report']] }}</td> | |
185 | - <td>{{ $reportCards[$classroom['new_report']] }}</td> | |
194 | + @if(isset($classroom['new_report'])) | |
195 | + @isset($reportCards[$classroom['old_report']]) | |
196 | + <td>{!! $reportCards[$classroom['old_report']] !!}</td> | |
197 | + @endisset | |
198 | + <td>{!! $reportCards[$classroom['new_report']] !!}</td> | |
199 | + @endif | |
186 | 200 | @if(isset($classroom['new_alternative_report'])) |
187 | 201 | <td> |
188 | 202 | @isset($reportCards[$classroom['old_alternative_report']]) |
189 | - {{ $reportCards[$classroom['old_alternative_report']] }} | |
203 | + {!! $reportCards[$classroom['old_alternative_report']] !!} | |
190 | 204 | @endisset |
191 | 205 | </td> |
192 | - <td>{{ $reportCards[$classroom['new_alternative_report']] }}</td> | |
206 | + <td>{!! $reportCards[$classroom['new_alternative_report']] !!}</td> | |
193 | 207 | @endif |
194 | 208 | </tr> |
195 | 209 | @endforeach | ... | ... |
resources/views/educacenso/import/index.blade.php
... | ... | @@ -7,11 +7,12 @@ |
7 | 7 | @section('content') |
8 | 8 | <table class="table-default"> |
9 | 9 | <tr class="titulo-tabela-listagem"> |
10 | - <th colspan="5">Importações - Listagem</th> | |
10 | + <th colspan="6">Importações - Listagem</th> | |
11 | 11 | </tr> |
12 | 12 | <tr> |
13 | 13 | <td style="font-weight:bold;">Ano</td> |
14 | 14 | <td style="font-weight:bold;">Escola</td> |
15 | + <td style="font-weight:bold;">Data de entrada das matrículas</td> | |
15 | 16 | <td style="font-weight:bold;">Usuário</td> |
16 | 17 | <td style="font-weight:bold;">Data</td> |
17 | 18 | <td style="font-weight:bold;">Situação</td> |
... | ... | @@ -25,6 +26,9 @@ |
25 | 26 | {{ $import->school }} |
26 | 27 | </td> |
27 | 28 | <td> |
29 | + @if($import->registration_date) {{ $import->registration_date->format('d/m/Y') }} @endif | |
30 | + </td> | |
31 | + <td> | |
28 | 32 | {{ $import->user->realName }} |
29 | 33 | </td> |
30 | 34 | <td> | ... | ... |
resources/views/settings/boolean-input.blade.php
1 | 1 | <tr> |
2 | - <td><span class="form">{{$key}}</span></td> | |
2 | + <td> | |
3 | + <span class="form">@if($description != '') {{$description}} @else {{$key}} @endif</span> | |
4 | + <br> | |
5 | + <sub style="vertical-align:top;">{{$hint}}</sub> | |
6 | + </td> | |
3 | 7 | <td> |
4 | 8 | <input type="hidden" name="{{$id}}" value="0"> |
5 | - <input name="{{$id}}" type="checkbox" @if($value == 1) checked @endif value="1" /> | |
9 | + <input name="{{$id}}" type="checkbox" @if($value == 1) checked @endif value="1" @if(!$enabled) disabled @endif /> | |
6 | 10 | </td> |
7 | 11 | </tr> | ... | ... |
resources/views/settings/float-input.blade.php
1 | 1 | <tr> |
2 | - <td><span class="form">{{$key}}</span></td> | |
3 | 2 | <td> |
4 | - <input name="{{$id}}" type="number" step="0.01" value="{{$value}}"/> | |
3 | + <span class="form">@if($description != '') {{$description}} @else {{$key}} @endif</span> | |
4 | + <br> | |
5 | + <sub style="vertical-align:top;">{{$hint}}</sub> | |
6 | + </td> | |
7 | + <td> | |
8 | + <input name="{{$id}}" type="number" step="0.01" value="{{$value}}" @if(!$enabled) disabled @endif/> | |
5 | 9 | </td> |
6 | 10 | </tr> | ... | ... |
resources/views/settings/index.blade.php
1 | -@inject('view', 'App\Support\View\SettingView') | |
1 | +@inject('settingView', 'App\Support\View\SettingView') | |
2 | 2 | @extends('layout.default') |
3 | 3 | |
4 | 4 | @push('styles') |
... | ... | @@ -13,8 +13,23 @@ |
13 | 13 | <tr> |
14 | 14 | <td class="titulo-tabela-listagem" colspan="2" height="24"><b>Configurações iniciais</b></td> |
15 | 15 | </tr> |
16 | - @foreach($fields as $field) | |
17 | - {!! $view->makeInput($field->id, $field->description, $field->type, $field->key, $field->value) !!} | |
16 | + @foreach($categories as $category) | |
17 | + <tr> | |
18 | + <td colspan="2" height="24"> | |
19 | + <strong>{{$category->name}}</strong> | |
20 | + </td> | |
21 | + </tr> | |
22 | + @foreach($category->settings()->orderBy('description')->orderBy('key')->get() as $field) | |
23 | + {!! $settingView->makeInput( | |
24 | + $field->id, | |
25 | + $field->description, | |
26 | + $field->type, | |
27 | + $field->key, | |
28 | + $field->value, | |
29 | + $category->enabled, | |
30 | + $field->hint | |
31 | + ) !!} | |
32 | + @endforeach | |
18 | 33 | @endforeach |
19 | 34 | </tbody> |
20 | 35 | </table> | ... | ... |
resources/views/settings/integer-input.blade.php
1 | 1 | <tr> |
2 | - <td><span class="form">{{$key}}</span></td> | |
3 | 2 | <td> |
4 | - <input name="{{$id}}" type="number" value="{{$value}}"/> | |
3 | + <span class="form">@if($description != '') {{$description}} @else {{$key}} @endif</span> | |
4 | + <br> | |
5 | + <sub style="vertical-align:top;">{{$hint}}</sub> | |
6 | + </td> | |
7 | + <td> | |
8 | + <input name="{{$id}}" type="number" value="{{$value}}" @if(!$enabled) disabled @endif /> | |
5 | 9 | </td> |
6 | 10 | </tr> | ... | ... |
resources/views/settings/string-input.blade.php
1 | 1 | <tr> |
2 | - <td><span class="form"> @if($description != '') {{$description}} @else {{$key}} @endif </span></td> | |
3 | 2 | <td> |
4 | - <input name="{{$id}}" type="text" value="{{$value}}" size="40"/> | |
3 | + <span class="form"> @if($description != '') {{$description}} @else {{$key}} @endif </span> | |
4 | + <br> | |
5 | + <sub style="vertical-align:top;">{{$hint}}</sub> | |
6 | + </td> | |
7 | + <td> | |
8 | + <input name="{{$id}}" type="text" value="{{$value}}" size="40" @if(!$enabled) disabled @endif /> | |
5 | 9 | </td> |
6 | 10 | </tr> | ... | ... |