Compare View

switch
from
...
to
 
Commits (158)
Showing 523 changed files   Show diff stats

Too many changes.

To preserve performance only 100 of 523 files displayed.

.github/ISSUE_TEMPLATE/bugs.md 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +---
  2 +name: Reportar um bug
  3 +about: Encontrou um bug no i-Educar? Use este template!
  4 +title: ''
  5 +labels: ''
  6 +assignees: ''
  7 +
  8 +---
  9 +
  10 +Olá e obrigado por nos ajudar a tornar o i-Educar um projeto mais estável. Não esqueça de revisar o nosso
  11 +[guia de contribuição](https://github.com/portabilis/i-educar/blob/master/contributing.md) para saber melhor como colaborar com a nossa comunidade. Para reportar seu bug use o template abaixo:
  12 +
  13 +**MENU:**
  14 +
  15 +Nesta seção deve ser apontado qual o menu no sistema deve ser realizada a alteração.
  16 +
  17 +**DESCRIÇÃO:**
  18 +
  19 +Nesta seção deve ser colocado uma descrição do problema ou necessidade.
  20 +
  21 +**OBSERVAÇÕES:**
  22 +
  23 +Observações em geral sobre o problema apontado.
  24 +
  25 +**AMBIENTE:**
  26 +
  27 +- Plataforma utilizada (Docker, instalação direta)
  28 +- Sistema operacional e versão (Ubuntu 16.04, Windows 7)
  29 +- Navegador e versão (Chrome 75)
  30 +- Outros detalhes importantes
... ...
.github/ISSUE_TEMPLATE/outros.md 0 → 100644
... ... @@ -0,0 +1,19 @@
  1 +---
  2 +name: Outros
  3 +about: Para indicar melhorias ou recursos use este template!
  4 +title: ''
  5 +labels: ''
  6 +assignees: ''
  7 +
  8 +---
  9 +
  10 +Olá e obrigado por nos ajudar a tornar o i-Educar um projeto melhor. Não esqueça de revisar o nosso
  11 +[guia de contribuição](https://github.com/portabilis/i-educar/blob/master/contributing.md) para saber melhor como colaborar com a nossa comunidade. Você também pode usar o template abaixo para preencher sua issue:
  12 +
  13 +**CONTEXTO:**
  14 +
  15 +Por que esta alteração é importante? Como você usaria isto? Como esta alteração pode beneficiar outros usuários?
  16 +
  17 +**IMPLEMENTAÇÃO:**
  18 +
  19 +Não obrigatório, mas sugira uma idéia de como isto poderia ser implementado.
... ...
app/Console/Commands/QueryAllCommand.php 0 → 100644
... ... @@ -0,0 +1,64 @@
  1 +<?php
  2 +
  3 +namespace App\Console\Commands;
  4 +
  5 +use App\Menu;
  6 +use Exception;
  7 +use Illuminate\Console\Command;
  8 +use Illuminate\Support\Facades\DB;
  9 +
  10 +class QueryAllCommand extends Command
  11 +{
  12 + /**
  13 + * The name and signature of the console command.
  14 + *
  15 + * @var string
  16 + */
  17 + protected $signature = 'query:all';
  18 +
  19 + /**
  20 + * The console command description.
  21 + *
  22 + * @var string
  23 + */
  24 + protected $description = 'Count duplicated scores';
  25 +
  26 + /**
  27 + * @return array
  28 + */
  29 + private function getConnections()
  30 + {
  31 + $connections = config('database.connections');
  32 +
  33 + return array_diff(array_keys($connections), ['sqlite', 'mysql', 'pgsql', 'sqlsrv', 'bussolastaging']);
  34 + }
  35 +
  36 + /**
  37 + * Execute the console command.
  38 + *
  39 + * @return mixed
  40 + */
  41 + public function handle()
  42 + {
  43 + $array = [];
  44 + $data = [];
  45 + $file = file_get_contents(storage_path('query.sql'));
  46 +
  47 + foreach ($this->getConnections() as $connection) {
  48 + try {
  49 + $data = (array) DB::connection($connection)->selectOne($file);
  50 + } catch (Exception $exception) {
  51 + continue;
  52 + }
  53 +
  54 + if (isset($data)) {
  55 + $array[] = array_merge([$connection], $data);
  56 + }
  57 + }
  58 +
  59 + $header = array_keys($data);
  60 + array_unshift($header, 'connection');
  61 +
  62 + $this->table($header, $array);
  63 + }
  64 +}
... ...
app/Exceptions/Enrollment/PreviousEnrollCancellationDateException.php 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +<?php
  2 +
  3 +namespace App\Exceptions\Enrollment;
  4 +
  5 +use App\Models\LegacyRegistration;
  6 +use DateTime;
  7 +use RuntimeException;
  8 +
  9 +class PreviousEnrollCancellationDateException extends RuntimeException
  10 +{
  11 + /**
  12 + * A data de cancelamento da enturmação é anterior a data de
  13 + * matrícula.
  14 + *
  15 + * @param LegacyRegistration $registration
  16 + * @param DateTime $cancellationDate
  17 + */
  18 + public function __construct(LegacyRegistration $registration, DateTime $cancellationDate)
  19 + {
  20 + $message = 'A data de saída %s deve ser maior que a data de matrícula %s.';
  21 +
  22 + $message = sprintf(
  23 + $message, $cancellationDate->format('d/m/Y'), (new DateTime($registration->data_matricula))->format('d/m/Y')
  24 + );
  25 +
  26 + parent::__construct($message);
  27 + }
  28 +}
... ...
app/Exceptions/Enrollment/PreviousEnrollRegistrationDateException.php 0 → 100644
... ... @@ -0,0 +1,27 @@
  1 +<?php
  2 +
  3 +namespace App\Exceptions\Enrollment;
  4 +
  5 +use App\Models\LegacyRegistration;
  6 +use DateTime;
  7 +use RuntimeException;
  8 +
  9 +class PreviousEnrollRegistrationDateException extends RuntimeException
  10 +{
  11 + /**
  12 + * A data de enturmação é anterior a data de matrícula.
  13 + *
  14 + * @param DateTime $date
  15 + * @param LegacyRegistration $registration
  16 + */
  17 + public function __construct(DateTime $date, LegacyRegistration $registration)
  18 + {
  19 + $message = 'A data de enturmação %s é anterior a data da matrícula %s.';
  20 +
  21 + $message = sprintf(
  22 + $message, $date->format('d/m/Y'), (new DateTime($registration->data_matricula))->format('d/m/Y')
  23 + );
  24 +
  25 + parent::__construct($message);
  26 + }
  27 +}
... ...
app/Http/Controllers/Api/VersionController.php 0 → 100644
... ... @@ -0,0 +1,42 @@
  1 +<?php
  2 +
  3 +namespace App\Http\Controllers\Api;
  4 +
  5 +use App\Http\Controllers\Controller;
  6 +use Symfony\Component\Process\Process;
  7 +use Throwable;
  8 +
  9 +class VersionController extends Controller
  10 +{
  11 + /**
  12 + * Return build version or last commit hash.
  13 + *
  14 + * @return string
  15 + */
  16 + private function getBuildVersion()
  17 + {
  18 + try {
  19 + $process = new Process(['git', 'rev-parse', 'HEAD'], base_path());
  20 + $process->run();
  21 + } catch (Throwable $throwable) {
  22 + return 'unknow';
  23 + }
  24 +
  25 + return trim($process->getOutput());
  26 + }
  27 + /**
  28 + * Return version data.
  29 + *
  30 + * @return array
  31 + */
  32 + public function version()
  33 + {
  34 + $composer = json_decode(file_get_contents(base_path('composer.json')));
  35 +
  36 + return [
  37 + 'entity' => config('legacy.app.name'),
  38 + 'version' => $composer->version,
  39 + 'build' => $this->getBuildVersion(),
  40 + ];
  41 + }
  42 +}
... ...
app/Http/Controllers/ExemptionListController.php 0 → 100644
... ... @@ -0,0 +1,65 @@
  1 +<?php
  2 +
  3 +namespace App\Http\Controllers;
  4 +
  5 +use App\Models\LegacyDisciplineExemption;
  6 +use App\Process;
  7 +use Illuminate\Http\Request;
  8 +use Illuminate\Support\Facades\Input;
  9 +use Illuminate\View\View;
  10 +
  11 +class ExemptionListController extends Controller
  12 +{
  13 + /**
  14 + * @param Request $request
  15 + * @return View
  16 + */
  17 + public function index(Request $request)
  18 + {
  19 + $this->breadcrumb('Consulta de dispensas', [
  20 + url('intranet/educar_index.php') => 'Escola',
  21 + ]);
  22 +
  23 + $this->menu(Process::EXEMPTION_LIST);
  24 +
  25 + $query = LegacyDisciplineExemption::active()->with('registration.student.person');
  26 +
  27 + if ($request->get('ano')) {
  28 + $ano = $request->get('ano');
  29 + $query->whereHas('registration', function ($registrationQuery) use ($ano) {
  30 + $registrationQuery->where('ano', $ano);
  31 + });
  32 + }
  33 +
  34 + $schools[] = $request->get('ref_cod_escola');
  35 +
  36 + if ($request->user()->isSchooling()) {
  37 + $schools = $request->user()->schools->pluck('cod_escola')->all();
  38 + }
  39 +
  40 + if (array_filter($schools)) {
  41 + $query->whereIn('ref_cod_escola', $schools);
  42 + }
  43 +
  44 + if ($request->get('ref_cod_serie')) {
  45 + $query->where('ref_cod_serie', $request->get('ref_cod_serie'));
  46 + }
  47 +
  48 + if ($request->get('ref_cod_curso')) {
  49 + $courseId = $request->get('ref_cod_curso');
  50 + $query->whereHas('registration', function ($registrationQuery) use ($courseId) {
  51 + $registrationQuery->where('ref_cod_curso', $courseId);
  52 + });
  53 + }
  54 +
  55 + if ($request->get('ref_cod_componente_curricular')) {
  56 + $query->where('ref_cod_disciplina', $request->get('ref_cod_componente_curricular'));
  57 + }
  58 +
  59 + $query->orderBy('data_cadastro', 'desc');
  60 +
  61 + $exemptions = $query->paginate(20)->appends(Input::except('page'));
  62 +
  63 + return view('exemption.index', compact('exemptions'));
  64 + }
  65 +}
... ...
app/Http/Kernel.php
... ... @@ -20,6 +20,7 @@ class Kernel extends HttpKernel
20 20 \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
21 21 \App\Http\Middleware\TrustProxies::class,
22 22 \App\Http\Middleware\ChangeAppName::class,
  23 + \App\Http\Middleware\ConnectTenantDatabase::class,
23 24 ];
24 25  
25 26 /**
... ... @@ -36,8 +37,6 @@ class Kernel extends HttpKernel
36 37 \Illuminate\View\Middleware\ShareErrorsFromSession::class,
37 38 // \App\Http\Middleware\VerifyCsrfToken::class,
38 39 \Illuminate\Routing\Middleware\SubstituteBindings::class,
39   - \App\Http\Middleware\ChangeAppName::class,
40   - \App\Http\Middleware\ConnectTenantDatabase::class,
41 40 \App\Http\Middleware\SetLayoutVariables::class,
42 41 \App\Http\Middleware\LoadSettings::class,
43 42 ],
... ...
app/Models/LegacyCourse.php
... ... @@ -26,7 +26,7 @@ class LegacyCourse extends Model
26 26 */
27 27 protected $fillable = [
28 28 'ref_usuario_cad', 'ref_cod_tipo_regime', 'ref_cod_nivel_ensino', 'ref_cod_tipo_ensino', 'nm_curso',
29   - 'sgl_curso', 'qtd_etapas', 'carga_horaria', 'data_cadastro', 'ref_cod_instituicao',
  29 + 'sgl_curso', 'qtd_etapas', 'carga_horaria', 'data_cadastro', 'ref_cod_instituicao', 'hora_falta',
30 30 ];
31 31  
32 32 /**
... ...
app/Models/LegacyDisciplineExemption.php 0 → 100644
... ... @@ -0,0 +1,101 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Builder;
  6 +use Illuminate\Database\Eloquent\Model;
  7 +use Illuminate\Database\Eloquent\Relations\BelongsTo;
  8 +use Illuminate\Database\Eloquent\Relations\HasMany;
  9 +
  10 +/**
  11 + * Class LegacyDisciplineExemption
  12 + * @property LegacyRegistration $registration
  13 + * @property integer cod_dispensa
  14 + */
  15 +class LegacyDisciplineExemption extends Model
  16 +{
  17 + /**
  18 + * @var string
  19 + */
  20 + protected $table = 'pmieducar.dispensa_disciplina';
  21 +
  22 + protected $primaryKey = 'cod_dispensa';
  23 +
  24 + /**
  25 + * @var array
  26 + */
  27 + protected $fillable = [
  28 + 'ref_cod_matricula',
  29 + 'ref_cod_disciplina',
  30 + 'ref_cod_escola',
  31 + 'ref_cod_serie',
  32 + 'ref_usuario_exc',
  33 + 'ref_usuario_cad',
  34 + 'ref_cod_tipo_dispensa',
  35 + 'data_cadastro',
  36 + 'data_exclusao',
  37 + 'ativo',
  38 + 'observacao',
  39 + 'cod_dispensa',
  40 + 'updated_at',
  41 + ];
  42 +
  43 + protected $dates = [
  44 + 'data_cadastro',
  45 + 'data_exclusao',
  46 + 'updated_at'
  47 + ];
  48 +
  49 + /**
  50 + * @var bool
  51 + */
  52 + public $timestamps = false;
  53 +
  54 + /**
  55 + * Relação com a matrícula.
  56 + *
  57 + * @return BelongsTo
  58 + */
  59 + public function registration()
  60 + {
  61 + return $this->belongsTo(LegacyRegistration::class, 'ref_cod_matricula');
  62 + }
  63 +
  64 + /**
  65 + * @return BelongsTo
  66 + */
  67 + public function discipline()
  68 + {
  69 + return $this->belongsTo(LegacyDiscipline::class, 'ref_cod_disciplina');
  70 + }
  71 +
  72 + /**
  73 + * @return BelongsTo
  74 + */
  75 + public function type()
  76 + {
  77 + return $this->belongsTo(LegacyExemptionType::class, 'ref_cod_tipo_dispensa');
  78 + }
  79 +
  80 + /**
  81 + * @return HasMany
  82 + */
  83 + public function stages()
  84 + {
  85 + return $this->hasMany(LegacyExemptionStage::class, 'ref_cod_dispensa', 'cod_dispensa');
  86 + }
  87 +
  88 + /**
  89 + * @param Builder $query
  90 + * @return Builder
  91 + */
  92 + public function scopeActive($query)
  93 + {
  94 + return $query->where('ativo', 1);
  95 + }
  96 +
  97 + public function getDateFormat()
  98 + {
  99 + return 'Y-m-d H:i:s.u';
  100 + }
  101 +}
... ...
app/Models/LegacyEvaluationRule.php
... ... @@ -28,7 +28,7 @@ class LegacyEvaluationRule extends Model
28 28 * @var array
29 29 */
30 30 protected $fillable = [
31   - 'instituicao_id', 'nome', 'formula_media_id', 'tipo_nota', 'tipo_progressao', 'tipo_presenca',
  31 + 'instituicao_id', 'nome', 'formula_media_id', 'formula_recuperacao_id', 'tipo_nota', 'tipo_progressao', 'tipo_presenca',
32 32 ];
33 33  
34 34 /**
... ...
app/Models/LegacyExemptionStage.php 0 → 100644
... ... @@ -0,0 +1,45 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +use Illuminate\Database\Eloquent\Relations\BelongsTo;
  7 +
  8 +/**
  9 + * Class LegacyDisciplineExemption
  10 + * @property LegacyRegistration $registration
  11 + */
  12 +class LegacyExemptionStage extends Model
  13 +{
  14 + /**
  15 + * @var string
  16 + */
  17 + protected $table = 'pmieducar.dispensa_etapa';
  18 +
  19 + /**
  20 + * @var string
  21 + */
  22 + protected $primaryKey = 'ref_cod_dispensa';
  23 +
  24 + /**
  25 + * @var array
  26 + */
  27 + protected $fillable = [
  28 + 'ref_cod_dispensa',
  29 + 'etapa',
  30 + 'ref_cod_disciplina',
  31 + ];
  32 +
  33 + /**
  34 + * @var bool
  35 + */
  36 + public $timestamps = false;
  37 +
  38 + /**
  39 + * @return BelongsTo
  40 + */
  41 + public function exemption()
  42 + {
  43 + return $this->belongsTo(LegacyDisciplineExemption::class, 'ref_cod_dispensa', 'cod_dispensa');
  44 + }
  45 +}
... ...
app/Models/LegacyExemptionType.php 0 → 100644
... ... @@ -0,0 +1,43 @@
  1 +<?php
  2 +
  3 +namespace App\Models;
  4 +
  5 +use Illuminate\Database\Eloquent\Model;
  6 +
  7 +/**
  8 + * Class LegacyDisciplineExemption
  9 + * @property LegacyRegistration $registration
  10 + */
  11 +class LegacyExemptionType extends Model
  12 +{
  13 + /**
  14 + * @var string
  15 + */
  16 + protected $table = 'pmieducar.tipo_dispensa';
  17 +
  18 + protected $primaryKey = 'cod_tipo_dispensa';
  19 +
  20 + /**
  21 + * @var array
  22 + */
  23 + protected $fillable = [
  24 + 'ref_usuario_exc',
  25 + 'ref_usuario_cad',
  26 + 'nm_tipo',
  27 + 'descricao',
  28 + 'data_cadastro',
  29 + 'data_exclusao',
  30 + 'ativo',
  31 + 'ref_cod_instituicao',
  32 + ];
  33 +
  34 + /**
  35 + * @var bool
  36 + */
  37 + public $timestamps = false;
  38 +
  39 + public function __toString()
  40 + {
  41 + return $this->nm_tipo;
  42 + }
  43 +}
... ...
app/Models/LegacyInstitution.php
... ... @@ -111,4 +111,12 @@ class LegacyInstitution extends Model
111 111 {
112 112 return $this->cod_instituicao;
113 113 }
  114 +
  115 + /**
  116 + * @return bool
  117 + */
  118 + public function getAllowRegistrationOutAcademicYearAttribute()
  119 + {
  120 + return boolval($this->permitir_matricula_fora_periodo_letivo);
  121 + }
114 122 }
... ...
app/Models/LegacyRegistration.php
... ... @@ -111,4 +111,12 @@ class LegacyRegistration extends Model
111 111  
112 112 return $hasOne;
113 113 }
  114 +
  115 + /**
  116 + * @return HasMany
  117 + */
  118 + public function exemptions()
  119 + {
  120 + return $this->hasMany(LegacyDisciplineExemption::class, 'ref_cod_matricula', 'cod_matricula');
  121 + }
114 122 }
... ...
app/Models/LegacySchool.php
... ... @@ -5,6 +5,7 @@ namespace App\Models;
5 5 use Illuminate\Database\Eloquent\Model;
6 6 use Illuminate\Database\Eloquent\Relations\BelongsTo;
7 7 use Illuminate\Database\Eloquent\Relations\BelongsToMany;
  8 +use Illuminate\Support\Facades\DB;
8 9  
9 10 /**
10 11 * LegacySchool
... ... @@ -86,4 +87,9 @@ class LegacySchool extends Model
86 87 {
87 88 return $this->belongsTo(LegacyOrganization::class, 'ref_idpes');
88 89 }
  90 +
  91 + public function getNameAttribute()
  92 + {
  93 + return DB::selectOne('SELECT relatorio.get_nome_escola(:escola) AS nome', ['escola' => $this->id])->nome;
  94 + }
89 95 }
... ...
app/Models/LegacySchoolGradeDiscipline.php
... ... @@ -3,6 +3,7 @@
3 3 namespace App\Models;
4 4  
5 5 use Illuminate\Database\Eloquent\Model;
  6 +use Illuminate\Database\Eloquent\Relations\BelongsTo;
6 7  
7 8 class LegacySchoolGradeDiscipline extends Model
8 9 {
... ... @@ -21,4 +22,12 @@ class LegacySchoolGradeDiscipline extends Model
21 22 ];
22 23  
23 24 public $timestamps = false;
  25 +
  26 + /**
  27 + * @return BelongsTo
  28 + */
  29 + public function discipline()
  30 + {
  31 + return $this->belongsTo(LegacyDiscipline::class, 'ref_cod_disciplina');
  32 + }
24 33 }
... ...
app/Process.php
... ... @@ -13,7 +13,10 @@ class Process
13 13 const MENU_LIBRARY = 57;
14 14 const MENU_CONFIGURATIONS = 25;
15 15  
  16 + const CONSULTAS = 9998890;
  17 +
16 18 const ENROLLMENT_HISTORY = 1001;
17 19 const ATTENDED_CANDIDATE = 1002;
18 20 const UNDO_STUDENT_UNIFICATION = 2001;
  21 + const EXEMPTION_LIST = 2002;
19 22 }
... ...
app/Services/EnrollmentService.php
... ... @@ -9,8 +9,10 @@ use App\Exceptions\Enrollment\EnrollDateBeforeAcademicYearException;
9 9 use App\Exceptions\Enrollment\ExistsActiveEnrollmentException;
10 10 use App\Exceptions\Enrollment\ExistsActiveEnrollmentSameTimeException;
11 11 use App\Exceptions\Enrollment\NoVacancyException;
  12 +use App\Exceptions\Enrollment\PreviousEnrollCancellationDateException;
12 13 use App\Exceptions\Enrollment\PreviousEnrollDateException;
13 14 use App\Exceptions\Enrollment\PreviousCancellationDateException;
  15 +use App\Exceptions\Enrollment\PreviousEnrollRegistrationDateException;
14 16 use App\Models\LegacyRegistration;
15 17 use App\Models\LegacySchoolClass;
16 18 use App\Models\LegacyEnrollment;
... ... @@ -139,8 +141,12 @@ class EnrollmentService
139 141 */
140 142 public function cancelEnrollment(LegacyEnrollment $enrollment, DateTime $date)
141 143 {
  144 + $schoolClass = $enrollment->schoolClass;
  145 +
142 146 if ($date->format('Y-m-d') < $enrollment->schoolClass->begin_academic_year->format('Y-m-d')) {
143   - throw new CancellationDateBeforeAcademicYearException($enrollment->schoolClass, $date);
  147 + if (!$schoolClass->school->institution->allowRegistrationOutAcademicYear) {
  148 + throw new CancellationDateBeforeAcademicYearException($enrollment->schoolClass, $date);
  149 + }
144 150 }
145 151  
146 152 if ($date->format('Y-m-d') > $enrollment->schoolClass->end_academic_year->format('Y-m-d')) {
... ... @@ -151,6 +157,10 @@ class EnrollmentService
151 157 throw new PreviousCancellationDateException($enrollment, $date);
152 158 }
153 159  
  160 + if ($date < $enrollment->registration->data_matricula) {
  161 + throw new PreviousEnrollCancellationDateException($enrollment->registration, $date);
  162 + }
  163 +
154 164 $enrollment->ref_usuario_exc = $this->user->getKey();
155 165 $enrollment->data_exclusao = $date;
156 166 $enrollment->ativo = 0;
... ... @@ -180,7 +190,9 @@ class EnrollmentService
180 190 }
181 191  
182 192 if ($date->format('Y-m-d') < $schoolClass->begin_academic_year->format('Y-m-d')) {
183   - throw new EnrollDateBeforeAcademicYearException($schoolClass, $date);
  193 + if (!$schoolClass->school->institution->allowRegistrationOutAcademicYear) {
  194 + throw new EnrollDateBeforeAcademicYearException($schoolClass, $date);
  195 + }
184 196 }
185 197  
186 198 if ($date->format('Y-m-d') > $schoolClass->end_academic_year->format('Y-m-d')) {
... ... @@ -204,6 +216,10 @@ class EnrollmentService
204 216 throw new PreviousEnrollDateException($date, $registration->lastEnrollment);
205 217 }
206 218  
  219 + if ($registration->data_matricula > $date) {
  220 + throw new PreviousEnrollRegistrationDateException($date, $registration);
  221 + }
  222 +
207 223 $isMandatoryCensoFields = $schoolClass->school->institution->isMandatoryCensoFields();
208 224  
209 225 if ($isMandatoryCensoFields && !$this->getAvailableTimeService()->isAvailable($registration->ref_cod_aluno, $schoolClass->id)) {
... ...
app/Services/SchoolGradeDisciplineService.php 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +<?php
  2 +
  3 +namespace App\Services;
  4 +
  5 +use App\Models\LegacySchoolGradeDiscipline;
  6 +use Illuminate\Support\Collection;
  7 +
  8 +class SchoolGradeDisciplineService
  9 +{
  10 + /**
  11 + * @param $schoolId
  12 + * @param $gradeId
  13 + * @return LegacySchoolGradeDiscipline[]|Collection
  14 + */
  15 + public function getDisciplines($schoolId, $gradeId)
  16 + {
  17 + return LegacySchoolGradeDiscipline::where('ref_ref_cod_escola', $schoolId)
  18 + ->where('ref_ref_cod_serie', $gradeId)->get()->pluck('discipline');
  19 + }
  20 +}
... ...
app/Support/Database/IncrementSequence.php 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +<?php
  2 +
  3 +namespace App\Support\Database;
  4 +
  5 +use Illuminate\Support\Facades\DB;
  6 +
  7 +trait IncrementSequence
  8 +{
  9 + /**
  10 + * @param string $table
  11 + * @param string $column
  12 + *
  13 + * @return void
  14 + */
  15 + public function incrementSequence($table, $column = 'id')
  16 + {
  17 + if (class_exists($table)) {
  18 + $class = new $table;
  19 +
  20 + $table = $class->getTable();
  21 + $column = $class->getKeyName();
  22 + }
  23 +
  24 + DB::unprepared(
  25 + "
  26 + SELECT setval(pg_get_serial_sequence('{$table}', '{$column}'), coalesce(max({$column}), 1)) FROM {$table};
  27 + "
  28 + );
  29 + }
  30 +}
... ...
composer.json
... ... @@ -3,7 +3,7 @@
3 3 "description": "Software livre de gestão escolar",
4 4 "type": "project",
5 5 "license": "GPL-2.0-or-later",
6   - "version": "2.2.5",
  6 + "version": "2.2.8",
7 7 "keywords": [
8 8 "Portabilis",
9 9 "i-Educar"
... ...
composer.lock
... ... @@ -4,20 +4,20 @@
4 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 5 "This file is @generated automatically"
6 6 ],
7   - "content-hash": "1d59cbce68d627afba776643163ef79c",
  7 + "content-hash": "05f3300a60f7224c9d631a9447757d9d",
8 8 "packages": [
9 9 {
10 10 "name": "aws/aws-sdk-php",
11   - "version": "3.112.0",
  11 + "version": "3.112.14",
12 12 "source": {
13 13 "type": "git",
14 14 "url": "https://github.com/aws/aws-sdk-php.git",
15   - "reference": "1e21446c6780a3b9b5e4315bd6d4347d2c3381eb"
  15 + "reference": "491960b26d7c02d8d9c9c998646d25a99e10fd16"
16 16 },
17 17 "dist": {
18 18 "type": "zip",
19   - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/1e21446c6780a3b9b5e4315bd6d4347d2c3381eb",
20   - "reference": "1e21446c6780a3b9b5e4315bd6d4347d2c3381eb",
  19 + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/491960b26d7c02d8d9c9c998646d25a99e10fd16",
  20 + "reference": "491960b26d7c02d8d9c9c998646d25a99e10fd16",
21 21 "shasum": ""
22 22 },
23 23 "require": {
... ... @@ -87,7 +87,7 @@
87 87 "s3",
88 88 "sdk"
89 89 ],
90   - "time": "2019-09-12T18:09:53+00:00"
  90 + "time": "2019-10-03T18:12:08+00:00"
91 91 },
92 92 {
93 93 "name": "cocur/slugify",
... ... @@ -1098,22 +1098,22 @@
1098 1098 },
1099 1099 {
1100 1100 "name": "honeybadger-io/honeybadger-laravel",
1101   - "version": "v1.7.2",
  1101 + "version": "v1.7.3",
1102 1102 "source": {
1103 1103 "type": "git",
1104 1104 "url": "https://github.com/honeybadger-io/honeybadger-laravel.git",
1105   - "reference": "2b5209a7df12bf09393174cc663146e5ad516d2a"
  1105 + "reference": "e084eda97051341808095447c1560377b01c3086"
1106 1106 },
1107 1107 "dist": {
1108 1108 "type": "zip",
1109   - "url": "https://api.github.com/repos/honeybadger-io/honeybadger-laravel/zipball/2b5209a7df12bf09393174cc663146e5ad516d2a",
1110   - "reference": "2b5209a7df12bf09393174cc663146e5ad516d2a",
  1109 + "url": "https://api.github.com/repos/honeybadger-io/honeybadger-laravel/zipball/e084eda97051341808095447c1560377b01c3086",
  1110 + "reference": "e084eda97051341808095447c1560377b01c3086",
1111 1111 "shasum": ""
1112 1112 },
1113 1113 "require": {
1114 1114 "honeybadger-io/honeybadger-php": "^1.7",
1115   - "illuminate/console": "^5.5|^6.0",
1116   - "illuminate/support": "^5.5|^6.0",
  1115 + "illuminate/console": "^5.5",
  1116 + "illuminate/support": "^5.5",
1117 1117 "php": "^7.1",
1118 1118 "sixlive/dotenv-editor": "^1.1"
1119 1119 },
... ... @@ -1163,20 +1163,20 @@
1163 1163 "logging",
1164 1164 "monitoring"
1165 1165 ],
1166   - "time": "2019-09-05T16:28:05+00:00"
  1166 + "time": "2019-09-21T14:45:50+00:00"
1167 1167 },
1168 1168 {
1169 1169 "name": "honeybadger-io/honeybadger-php",
1170   - "version": "v1.7.0",
  1170 + "version": "v1.7.1",
1171 1171 "source": {
1172 1172 "type": "git",
1173 1173 "url": "https://github.com/honeybadger-io/honeybadger-php.git",
1174   - "reference": "da7a3b09083e5267e4f85e2697c9c3f1c6a9da5c"
  1174 + "reference": "be829b9934401dd7252df2ebd745aad06fc5d1fe"
1175 1175 },
1176 1176 "dist": {
1177 1177 "type": "zip",
1178   - "url": "https://api.github.com/repos/honeybadger-io/honeybadger-php/zipball/da7a3b09083e5267e4f85e2697c9c3f1c6a9da5c",
1179   - "reference": "da7a3b09083e5267e4f85e2697c9c3f1c6a9da5c",
  1178 + "url": "https://api.github.com/repos/honeybadger-io/honeybadger-php/zipball/be829b9934401dd7252df2ebd745aad06fc5d1fe",
  1179 + "reference": "be829b9934401dd7252df2ebd745aad06fc5d1fe",
1180 1180 "shasum": ""
1181 1181 },
1182 1182 "require": {
... ... @@ -1219,7 +1219,7 @@
1219 1219 "logging",
1220 1220 "monitoring"
1221 1221 ],
1222   - "time": "2019-09-04T13:54:28+00:00"
  1222 + "time": "2019-09-13T15:07:18+00:00"
1223 1223 },
1224 1224 {
1225 1225 "name": "jakub-onderka/php-console-color",
... ... @@ -2066,16 +2066,16 @@
2066 2066 },
2067 2067 {
2068 2068 "name": "nesbot/carbon",
2069   - "version": "2.24.0",
  2069 + "version": "2.25.0",
2070 2070 "source": {
2071 2071 "type": "git",
2072 2072 "url": "https://github.com/briannesbitt/Carbon.git",
2073   - "reference": "934459c5ac0658bc765ad1e53512c7c77adcac29"
  2073 + "reference": "b70da677101cca7b584c7489770d2677c2733593"
2074 2074 },
2075 2075 "dist": {
2076 2076 "type": "zip",
2077   - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/934459c5ac0658bc765ad1e53512c7c77adcac29",
2078   - "reference": "934459c5ac0658bc765ad1e53512c7c77adcac29",
  2077 + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/b70da677101cca7b584c7489770d2677c2733593",
  2078 + "reference": "b70da677101cca7b584c7489770d2677c2733593",
2079 2079 "shasum": ""
2080 2080 },
2081 2081 "require": {
... ... @@ -2122,14 +2122,14 @@
2122 2122 "homepage": "http://github.com/kylekatarnls"
2123 2123 }
2124 2124 ],
2125   - "description": "A API extension for DateTime that supports 281 different languages.",
  2125 + "description": "An API extension for DateTime that supports 281 different languages.",
2126 2126 "homepage": "http://carbon.nesbot.com",
2127 2127 "keywords": [
2128 2128 "date",
2129 2129 "datetime",
2130 2130 "time"
2131 2131 ],
2132   - "time": "2019-08-31T16:37:55+00:00"
  2132 + "time": "2019-09-30T16:22:22+00:00"
2133 2133 },
2134 2134 {
2135 2135 "name": "nikic/php-parser",
... ... @@ -4779,16 +4779,16 @@
4779 4779 },
4780 4780 {
4781 4781 "name": "doctrine/annotations",
4782   - "version": "v1.7.0",
  4782 + "version": "v1.8.0",
4783 4783 "source": {
4784 4784 "type": "git",
4785 4785 "url": "https://github.com/doctrine/annotations.git",
4786   - "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb"
  4786 + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc"
4787 4787 },
4788 4788 "dist": {
4789 4789 "type": "zip",
4790   - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fa4c4e861e809d6a1103bd620cce63ed91aedfeb",
4791   - "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb",
  4790 + "url": "https://api.github.com/repos/doctrine/annotations/zipball/904dca4eb10715b92569fbcd79e201d5c349b6bc",
  4791 + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc",
4792 4792 "shasum": ""
4793 4793 },
4794 4794 "require": {
... ... @@ -4797,7 +4797,7 @@
4797 4797 },
4798 4798 "require-dev": {
4799 4799 "doctrine/cache": "1.*",
4800   - "phpunit/phpunit": "^7.5@dev"
  4800 + "phpunit/phpunit": "^7.5"
4801 4801 },
4802 4802 "type": "library",
4803 4803 "extra": {
... ... @@ -4843,7 +4843,7 @@
4843 4843 "docblock",
4844 4844 "parser"
4845 4845 ],
4846   - "time": "2019-08-08T18:11:40+00:00"
  4846 + "time": "2019-10-01T18:55:10+00:00"
4847 4847 },
4848 4848 {
4849 4849 "name": "doctrine/instantiator",
... ... @@ -5211,16 +5211,16 @@
5211 5211 },
5212 5212 {
5213 5213 "name": "laravel/dusk",
5214   - "version": "v5.5.1",
  5214 + "version": "v5.5.2",
5215 5215 "source": {
5216 5216 "type": "git",
5217 5217 "url": "https://github.com/laravel/dusk.git",
5218   - "reference": "9d2a643dbeb27fafd7f7d3961b74ee62eb5081bf"
  5218 + "reference": "aed755282a13a9b36d26854a0105d519aa22fec9"
5219 5219 },
5220 5220 "dist": {
5221 5221 "type": "zip",
5222   - "url": "https://api.github.com/repos/laravel/dusk/zipball/9d2a643dbeb27fafd7f7d3961b74ee62eb5081bf",
5223   - "reference": "9d2a643dbeb27fafd7f7d3961b74ee62eb5081bf",
  5222 + "url": "https://api.github.com/repos/laravel/dusk/zipball/aed755282a13a9b36d26854a0105d519aa22fec9",
  5223 + "reference": "aed755282a13a9b36d26854a0105d519aa22fec9",
5224 5224 "shasum": ""
5225 5225 },
5226 5226 "require": {
... ... @@ -5272,7 +5272,7 @@
5272 5272 "testing",
5273 5273 "webdriver"
5274 5274 ],
5275   - "time": "2019-09-12T07:51:16+00:00"
  5275 + "time": "2019-09-24T20:30:07+00:00"
5276 5276 },
5277 5277 {
5278 5278 "name": "laravel/telescope",
... ... @@ -5399,16 +5399,16 @@
5399 5399 },
5400 5400 {
5401 5401 "name": "mockery/mockery",
5402   - "version": "1.2.3",
  5402 + "version": "1.2.4",
5403 5403 "source": {
5404 5404 "type": "git",
5405 5405 "url": "https://github.com/mockery/mockery.git",
5406   - "reference": "4eff936d83eb809bde2c57a3cea0ee9643769031"
  5406 + "reference": "b3453f75fd23d9fd41685f2148f4abeacabc6405"
5407 5407 },
5408 5408 "dist": {
5409 5409 "type": "zip",
5410   - "url": "https://api.github.com/repos/mockery/mockery/zipball/4eff936d83eb809bde2c57a3cea0ee9643769031",
5411   - "reference": "4eff936d83eb809bde2c57a3cea0ee9643769031",
  5410 + "url": "https://api.github.com/repos/mockery/mockery/zipball/b3453f75fd23d9fd41685f2148f4abeacabc6405",
  5411 + "reference": "b3453f75fd23d9fd41685f2148f4abeacabc6405",
5412 5412 "shasum": ""
5413 5413 },
5414 5414 "require": {
... ... @@ -5422,7 +5422,7 @@
5422 5422 "type": "library",
5423 5423 "extra": {
5424 5424 "branch-alias": {
5425   - "dev-master": "1.0.x-dev"
  5425 + "dev-master": "1.2.x-dev"
5426 5426 }
5427 5427 },
5428 5428 "autoload": {
... ... @@ -5460,7 +5460,7 @@
5460 5460 "test double",
5461 5461 "testing"
5462 5462 ],
5463   - "time": "2019-08-07T15:01:07+00:00"
  5463 + "time": "2019-09-30T08:30:27+00:00"
5464 5464 },
5465 5465 {
5466 5466 "name": "moontoast/math",
... ... @@ -5928,22 +5928,22 @@
5928 5928 },
5929 5929 {
5930 5930 "name": "phpspec/prophecy",
5931   - "version": "1.8.1",
  5931 + "version": "1.9.0",
5932 5932 "source": {
5933 5933 "type": "git",
5934 5934 "url": "https://github.com/phpspec/prophecy.git",
5935   - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76"
  5935 + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203"
5936 5936 },
5937 5937 "dist": {
5938 5938 "type": "zip",
5939   - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
5940   - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76",
  5939 + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203",
  5940 + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203",
5941 5941 "shasum": ""
5942 5942 },
5943 5943 "require": {
5944 5944 "doctrine/instantiator": "^1.0.2",
5945 5945 "php": "^5.3|^7.0",
5946   - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
  5946 + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
5947 5947 "sebastian/comparator": "^1.1|^2.0|^3.0",
5948 5948 "sebastian/recursion-context": "^1.0|^2.0|^3.0"
5949 5949 },
... ... @@ -5987,7 +5987,7 @@
5987 5987 "spy",
5988 5988 "stub"
5989 5989 ],
5990   - "time": "2019-06-13T12:50:23+00:00"
  5990 + "time": "2019-10-03T11:07:50+00:00"
5991 5991 },
5992 5992 {
5993 5993 "name": "phpunit/php-code-coverage",
... ... @@ -6194,16 +6194,16 @@
6194 6194 },
6195 6195 {
6196 6196 "name": "phpunit/php-token-stream",
6197   - "version": "3.1.0",
  6197 + "version": "3.1.1",
6198 6198 "source": {
6199 6199 "type": "git",
6200 6200 "url": "https://github.com/sebastianbergmann/php-token-stream.git",
6201   - "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a"
  6201 + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff"
6202 6202 },
6203 6203 "dist": {
6204 6204 "type": "zip",
6205   - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e899757bb3df5ff6e95089132f32cd59aac2220a",
6206   - "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a",
  6205 + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff",
  6206 + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff",
6207 6207 "shasum": ""
6208 6208 },
6209 6209 "require": {
... ... @@ -6239,20 +6239,20 @@
6239 6239 "keywords": [
6240 6240 "tokenizer"
6241 6241 ],
6242   - "time": "2019-07-25T05:29:42+00:00"
  6242 + "time": "2019-09-17T06:23:10+00:00"
6243 6243 },
6244 6244 {
6245 6245 "name": "phpunit/phpunit",
6246   - "version": "7.5.15",
  6246 + "version": "7.5.16",
6247 6247 "source": {
6248 6248 "type": "git",
6249 6249 "url": "https://github.com/sebastianbergmann/phpunit.git",
6250   - "reference": "d79c053d972856b8b941bb233e39dc521a5093f0"
  6250 + "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661"
6251 6251 },
6252 6252 "dist": {
6253 6253 "type": "zip",
6254   - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d79c053d972856b8b941bb233e39dc521a5093f0",
6255   - "reference": "d79c053d972856b8b941bb233e39dc521a5093f0",
  6254 + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/316afa6888d2562e04aeb67ea7f2017a0eb41661",
  6255 + "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661",
6256 6256 "shasum": ""
6257 6257 },
6258 6258 "require": {
... ... @@ -6312,8 +6312,8 @@
6312 6312 "authors": [
6313 6313 {
6314 6314 "name": "Sebastian Bergmann",
6315   - "role": "lead",
6316   - "email": "sebastian@phpunit.de"
  6315 + "email": "sebastian@phpunit.de",
  6316 + "role": "lead"
6317 6317 }
6318 6318 ],
6319 6319 "description": "The PHP Unit Testing framework.",
... ... @@ -6323,7 +6323,7 @@
6323 6323 "testing",
6324 6324 "xunit"
6325 6325 ],
6326   - "time": "2019-08-21T07:05:16+00:00"
  6326 + "time": "2019-09-14T09:08:39+00:00"
6327 6327 },
6328 6328 {
6329 6329 "name": "sebastian/code-unit-reverse-lookup",
... ... @@ -6545,16 +6545,16 @@
6545 6545 },
6546 6546 {
6547 6547 "name": "sebastian/exporter",
6548   - "version": "3.1.1",
  6548 + "version": "3.1.2",
6549 6549 "source": {
6550 6550 "type": "git",
6551 6551 "url": "https://github.com/sebastianbergmann/exporter.git",
6552   - "reference": "06a9a5947f47b3029d76118eb5c22802e5869687"
  6552 + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e"
6553 6553 },
6554 6554 "dist": {
6555 6555 "type": "zip",
6556   - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/06a9a5947f47b3029d76118eb5c22802e5869687",
6557   - "reference": "06a9a5947f47b3029d76118eb5c22802e5869687",
  6556 + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e",
  6557 + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e",
6558 6558 "shasum": ""
6559 6559 },
6560 6560 "require": {
... ... @@ -6608,7 +6608,7 @@
6608 6608 "export",
6609 6609 "exporter"
6610 6610 ],
6611   - "time": "2019-08-11T12:43:14+00:00"
  6611 + "time": "2019-09-14T09:02:43+00:00"
6612 6612 },
6613 6613 {
6614 6614 "name": "sebastian/global-state",
... ...
config/assets.php
... ... @@ -14,7 +14,7 @@ return [
14 14 |
15 15 */
16 16  
17   - 'version' => '0.0.31',
  17 + 'version' => '0.0.34',
18 18  
19 19 /*
20 20 |--------------------------------------------------------------------------
... ...
database/factories/LegacyAverageFormulaFactory.php
... ... @@ -15,6 +15,14 @@ $factory-&gt;define(LegacyAverageFormula::class, function (Faker $faker) {
15 15 ];
16 16 });
17 17  
  18 +$factory->defineAs(LegacyAverageFormula::class, 'calculo-media-ponderada', function (Faker $faker) use ($factory) {
  19 + $averageFormula = $factory->raw(LegacyAverageFormula::class);
  20 + return array_merge($averageFormula, [
  21 + 'formula_media' => $faker->randomElement(['((((Se / Et) * 7) + (Rc * 3)) / 10)', '(((((Se / Et) * 3) + (Rc * 2)) / 5))', '((Rc * 0.4) + (Se / Et * 0.6))']),
  22 + 'tipo_formula' => 2,
  23 + ]);
  24 +});
  25 +
18 26 $factory->defineAs(LegacyEvaluationRule::class, 'media-presenca-sem-recuperacao', function (Faker $faker) use ($factory) {
19 27 $evaluationRule = $factory->raw(LegacyEvaluationRule::class);
20 28  
... ... @@ -28,4 +36,4 @@ $factory-&gt;defineAs(LegacyEvaluationRule::class, &#39;media-presenca-sem-recuperacao&#39;
28 36 'nota_minima_geral' => 0,
29 37  
30 38 ]);
31   -});
32 39 \ No newline at end of file
  40 +});
... ...
database/factories/LegacyCourseFactory.php
... ... @@ -19,9 +19,10 @@ $factory-&gt;define(LegacyCourse::class, function (Faker $faker) {
19 19 'nm_curso' => $faker->words(3, true),
20 20 'sgl_curso' => $faker->word,
21 21 'qtd_etapas' => $faker->randomElement([2, 3, 4]),
22   - 'carga_horaria' => $faker->randomElement([200, 400, 800]),
  22 + 'carga_horaria' => 800,
23 23 'data_cadastro' => now(),
24 24 'ref_cod_instituicao' => factory(LegacyInstitution::class)->states('unique')->make(),
  25 + 'hora_falta' => 0.75,
25 26 ];
26 27 });
27 28  
... ... @@ -31,4 +32,4 @@ $factory-&gt;defineAs(LegacyCourse::class, &#39;padrao-ano-escolar&#39;, function (Faker $f
31 32 return array_merge($course, [
32 33 'padrao_ano_escolar' => 1,
33 34 ]);
34   -});
35 35 \ No newline at end of file
  36 +});
... ...
database/factories/LegacyDisciplineAcademicYearFactory.php
... ... @@ -9,7 +9,7 @@ $factory-&gt;define(LegacyDisciplineAcademicYear::class, function (Faker $faker) {
9 9 return [
10 10 'componente_curricular_id' => factory(LegacyDiscipline::class)->create(),
11 11 'ano_escolar_id' => factory(LegacySchool::class)->create(),
12   - 'carga_horaria' => $faker->randomNumber(2),
  12 + 'carga_horaria' => 100,
13 13 'tipo_nota' => $faker->randomElement([1,2]),
14 14 'anos_letivos' => '{'.now()->year.'}',
15 15 ];
... ...
database/factories/LegacyDisciplineExemptionFactory.php 0 → 100644
... ... @@ -0,0 +1,26 @@
  1 +<?php
  2 +
  3 +use App\Models\LegacyDiscipline;
  4 +use App\Models\LegacyDisciplineExemption;
  5 +use App\Models\LegacyExemptionType;
  6 +use App\Models\LegacyLevel;
  7 +use App\Models\LegacyRegistration;
  8 +use App\Models\LegacySchool;
  9 +use App\Models\LegacyUser;
  10 +use Faker\Generator as Faker;
  11 +use Illuminate\Database\Eloquent\Factory;
  12 +
  13 +/** @var Factory $factory */
  14 +
  15 +$factory->define(LegacyDisciplineExemption::class, function (Faker $faker) {
  16 + return [
  17 + 'ref_cod_matricula' => factory(LegacyRegistration::class)->create(),
  18 + 'ref_cod_disciplina' => factory(LegacyDiscipline::class)->create(),
  19 + 'ref_cod_escola' => factory(LegacySchool::class)->create(),
  20 + 'ref_cod_serie' => factory(LegacyLevel::class)->create(),
  21 + 'ref_cod_tipo_dispensa' => factory(LegacyExemptionType::class)->create(),
  22 + 'ref_usuario_cad' => factory(LegacyUser::class)->state('unique')->make(),
  23 + 'data_cadastro' => now(),
  24 + 'ativo' => 1,
  25 + ];
  26 +});
... ...
database/factories/LegacyEvaluationRuleFactory.php
... ... @@ -61,3 +61,19 @@ $factory-&gt;defineAs(LegacyEvaluationRule::class, &#39;progressao-continuada-nota-conc
61 61  
62 62 ]);
63 63 });
  64 +
  65 +$factory->defineAs(LegacyEvaluationRule::class, 'progressao-calculo-media-recuperacao-ponderada', function () use ($factory) {
  66 + $evaluationRule = $factory->raw(LegacyEvaluationRule::class);
  67 +
  68 + return array_merge($evaluationRule, [
  69 + 'tipo_nota' => RegraAvaliacao_Model_Nota_TipoValor::NUMERICA,
  70 + 'formula_recuperacao_id' => factory(LegacyAverageFormula::class, 'calculo-media-ponderada')->create(),
  71 + 'tipo_progressao' => RegraAvaliacao_Model_TipoProgressao::NAO_CONTINUADA_MEDIA_PRESENCA,
  72 + 'tipo_presenca' => RegraAvaliacao_Model_TipoPresenca::POR_COMPONENTE,
  73 + 'porcentagem_presenca' => 75,
  74 + 'media' => 7,
  75 + 'media_recuperacao' => 6,
  76 + 'nota_maxima_geral' => 10,
  77 + 'nota_minima_geral' => 0,
  78 + ]);
  79 +});
... ...
database/factories/LegacyExemptionStageFactory.php 0 → 100644
... ... @@ -0,0 +1,16 @@
  1 +<?php
  2 +
  3 +use App\Models\LegacyDisciplineExemption;
  4 +use App\Models\LegacyExemptionStage;
  5 +use Faker\Generator as Faker;
  6 +use Illuminate\Database\Eloquent\Factory;
  7 +
  8 +/** @var Factory $factory */
  9 +
  10 +$factory->define(LegacyExemptionStage::class, function (Faker $faker) {
  11 + $exemption = factory(LegacyDisciplineExemption::class)->create();
  12 + return [
  13 + 'ref_cod_dispensa' => $exemption->cod_dispensa,
  14 + 'etapa' => 1,
  15 + ];
  16 +});
... ...
database/factories/LegacyExemptionTypeFactory.php 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +<?php
  2 +
  3 +use App\Models\LegacyExemptionType;
  4 +use App\Models\LegacyInstitution;
  5 +use App\Models\LegacyUser;
  6 +use Faker\Generator as Faker;
  7 +use Illuminate\Database\Eloquent\Factory;
  8 +
  9 +/** @var Factory $factory */
  10 +
  11 +$factory->define(LegacyExemptionType::class, function (Faker $faker) {
  12 + return [
  13 + 'nm_tipo' => $faker->words(2, true),
  14 + 'descricao' => $faker->words(5, true),
  15 + 'ativo' => 1,
  16 + 'ref_usuario_cad' => factory(LegacyUser::class)->state('unique')->make(),
  17 + 'data_cadastro' => now(),
  18 + 'ref_cod_instituicao' => factory(LegacyInstitution::class)->state('unique')->make(),
  19 + ];
  20 +});
... ...
database/factories/LegacyLevelFactory.php
... ... @@ -13,7 +13,7 @@ $factory-&gt;define(LegacyLevel::class, function (Faker $faker) {
13 13 'ref_usuario_cad' => 1,
14 14 'ref_cod_curso' => factory(LegacyCourse::class)->create(),
15 15 'etapa_curso' => $faker->randomElement([1, 2, 3, 4]),
16   - 'carga_horaria' => $faker->randomFloat(),
  16 + 'carga_horaria' => 800,
17 17 'data_cadastro' => $faker->dateTime(),
18 18 ];
19 19 });
... ...
database/migrations/2019_03_21_121126_altera_view_situacao.php 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +<?php
  2 +
  3 +use App\Support\Database\AsView;
  4 +use Illuminate\Database\Migrations\Migration;
  5 +
  6 +class AlteraViewSituacao extends Migration
  7 +{
  8 + use AsView;
  9 +
  10 + /**
  11 + * Run the migrations.
  12 + *
  13 + * @return void
  14 + */
  15 + public function up()
  16 + {
  17 + $this->createView('relatorio.view_situacao', '2019-03-21');
  18 + }
  19 +
  20 + /**
  21 + * Reverse the migrations.
  22 + *
  23 + * @return void
  24 + */
  25 + public function down()
  26 + {
  27 + $this->dropView('relatorio.view_situacao');
  28 + $this->createView('relatorio.view_situacao', '2019-02-28');
  29 + }
  30 +}
... ...
database/migrations/2019_09_06_174033_create_exemption_list_menu.php 0 → 100644
... ... @@ -0,0 +1,33 @@
  1 +<?php
  2 +
  3 +use App\Menu;
  4 +use App\Process;
  5 +use Illuminate\Database\Migrations\Migration;
  6 +
  7 +class CreateExemptionListMenu extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Menu::query()->create([
  17 + 'parent_id' => Menu::query()->where('old', Process::CONSULTAS)->firstOrFail()->getKey(),
  18 + 'title' => 'Consulta de dispensas',
  19 + 'link' => '/consulta-dispensas',
  20 + 'process' => Process::EXEMPTION_LIST,
  21 + ]);
  22 + }
  23 +
  24 + /**
  25 + * Reverse the migrations.
  26 + *
  27 + * @return void
  28 + */
  29 + public function down()
  30 + {
  31 + Menu::query()->where('process', Process::EXEMPTION_LIST)->delete();
  32 + }
  33 +}
... ...
database/migrations/2019_09_12_100000_alter_descricao_length_in_tabele_arredondamento_valor.php 0 → 100644
... ... @@ -0,0 +1,32 @@
  1 +<?php
  2 +
  3 +use Illuminate\Support\Facades\Schema;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Database\Migrations\Migration;
  6 +
  7 +class AlterDescricaoLengthInTabeleArredondamentoValor extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Schema::table('modules.tabela_arredondamento_valor', function (Blueprint $table) {
  17 + $table->string('descricao', 50)->change();
  18 + });
  19 + }
  20 +
  21 + /**
  22 + * Reverse the migrations.
  23 + *
  24 + * @return void
  25 + */
  26 + public function down()
  27 + {
  28 + Schema::table('modules.tabela_arredondamento_valor', function (Blueprint $table) {
  29 + $table->string('descricao', 25)->change();
  30 + });
  31 + }
  32 +}
... ...
database/migrations/2019_09_12_154225_cria_parametro_permitir_matricula_fora_periodo_letivo.php 0 → 100644
... ... @@ -0,0 +1,32 @@
  1 +<?php
  2 +
  3 +use Illuminate\Support\Facades\Schema;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Database\Migrations\Migration;
  6 +
  7 +class CriaParametroPermitirMatriculaForaPeriodoLetivo extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Schema::table('pmieducar.instituicao', function (Blueprint $table) {
  17 + $table->boolean('permitir_matricula_fora_periodo_letivo')->default(false);
  18 + });
  19 + }
  20 +
  21 + /**
  22 + * Reverse the migrations.
  23 + *
  24 + * @return void
  25 + */
  26 + public function down()
  27 + {
  28 + Schema::table('pmieducar.instituicao', function (Blueprint $table) {
  29 + $table->dropColumn('permitir_matricula_fora_periodo_letivo');
  30 + });
  31 + }
  32 +}
... ...
database/migrations/2019_09_16_094112_ordena_menu_consulta_dispensa_disciplinas.php 0 → 100644
... ... @@ -0,0 +1,32 @@
  1 +<?php
  2 +
  3 +use App\Menu;
  4 +use App\Process;
  5 +use Illuminate\Database\Migrations\Migration;
  6 +
  7 +class OrdenaMenuConsultaDispensaDisciplinas extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Menu::where('process', Process::EXEMPTION_LIST)->first()->update(['order' => 1]);
  17 + Menu::where('process', 9998900)->first()->update(['order' => 2]);
  18 + Menu::where('process', 9998910)->first()->update(['order' => 3]);
  19 + }
  20 +
  21 + /**
  22 + * Reverse the migrations.
  23 + *
  24 + * @return void
  25 + */
  26 + public function down()
  27 + {
  28 + Menu::where('process', Process::EXEMPTION_LIST)->first()->update(['order' => 0]);
  29 + Menu::where('process', 9998900)->first()->update(['order' => 0]);
  30 + Menu::where('process', 9998910)->first()->update(['order' => 0]);
  31 + }
  32 +}
... ...
database/migrations/2019_09_19_135150_inclui_campos_para_uniforme_do_tipo_saia.php 0 → 100755
... ... @@ -0,0 +1,38 @@
  1 +<?php
  2 +
  3 +use Illuminate\Support\Facades\Schema;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Database\Migrations\Migration;
  6 +
  7 +class IncluiCamposParaUniformeDoTipoSaia extends Migration
  8 +{
  9 + /**
  10 + * Run the migrations.
  11 + *
  12 + * @return void
  13 + */
  14 + public function up()
  15 + {
  16 + Schema::table('pmieducar.distribuicao_uniforme', function (Blueprint $table) {
  17 + $table->smallInteger('saia_qtd')->nullable();
  18 + });
  19 + Schema::table('pmieducar.distribuicao_uniforme', function (Blueprint $table) {
  20 + $table->string('saia_tm', 20)->nullable();
  21 + });
  22 + }
  23 +
  24 + /**
  25 + * Reverse the migrations.
  26 + *
  27 + * @return void
  28 + */
  29 + public function down()
  30 + {
  31 + Schema::table('pmieducar.distribuicao_uniforme', function (Blueprint $table) {
  32 + $table->dropColumn('saia_qtd');
  33 + });
  34 + Schema::table('pmieducar.distribuicao_uniforme', function (Blueprint $table) {
  35 + $table->dropColumn('saia_tm');
  36 + });
  37 + }
  38 +}
... ...
database/migrations/2019_09_20_143952_atualiza_view_situacao_20190920.php 0 → 100644
... ... @@ -0,0 +1,30 @@
  1 +<?php
  2 +
  3 +use App\Support\Database\AsView;
  4 +use Illuminate\Database\Migrations\Migration;
  5 +
  6 +class AtualizaViewSituacao20190920 extends Migration
  7 +{
  8 + use AsView;
  9 +
  10 + /**
  11 + * Run the migrations.
  12 + *
  13 + * @return void
  14 + */
  15 + public function up()
  16 + {
  17 + $this->createView('relatorio.view_situacao', '2019-09-20');
  18 + }
  19 +
  20 + /**
  21 + * Reverse the migrations.
  22 + *
  23 + * @return void
  24 + */
  25 + public function down()
  26 + {
  27 + $this->dropView('relatorio.view_situacao');
  28 + $this->createView('relatorio.view_situacao', '2019-03-21');
  29 + }
  30 +}
... ...
database/migrations/2019_09_30_101954_trim_rg_column.php 0 → 100644
... ... @@ -0,0 +1,27 @@
  1 +<?php
  2 +
  3 +use Illuminate\Support\Facades\DB;
  4 +use Illuminate\Database\Migrations\Migration;
  5 +
  6 +class TrimRgColumn extends Migration
  7 +{
  8 + /**
  9 + * Run the migrations.
  10 + *
  11 + * @return void
  12 + */
  13 + public function up()
  14 + {
  15 + DB::update('UPDATE cadastro.documento SET rg = TRIM(rg)');
  16 + }
  17 +
  18 + /**
  19 + * Reverse the migrations.
  20 + *
  21 + * @return void
  22 + */
  23 + public function down()
  24 + {
  25 + //
  26 + }
  27 +}
... ...
database/sqls/views/relatorio.view_situacao-2019-03-21.sql 0 → 100644
... ... @@ -0,0 +1,144 @@
  1 +CREATE OR REPLACE VIEW relatorio.view_situacao AS
  2 +SELECT
  3 + matricula.cod_matricula,
  4 + situacao_matricula.cod_situacao,
  5 + matricula_turma.ref_cod_turma AS cod_turma,
  6 + matricula_turma.sequencial,
  7 + (
  8 + CASE
  9 + WHEN matricula_turma.remanejado THEN
  10 + 'Remanejado'::character varying
  11 + WHEN matricula_turma.transferido THEN
  12 + 'Transferido'::character varying
  13 + WHEN matricula_turma.reclassificado THEN
  14 + 'Reclassificado'::character varying
  15 + WHEN matricula_turma.abandono THEN
  16 + 'Abandono'::character varying
  17 + WHEN matricula.aprovado = 1 THEN
  18 + 'Aprovado'::character varying
  19 + WHEN matricula.aprovado = 12 THEN
  20 + 'Ap. Depen.'::character varying
  21 + WHEN matricula.aprovado = 13 THEN
  22 + 'Ap. Cons.'::character varying
  23 + WHEN matricula.aprovado = 2 THEN
  24 + 'Reprovado'::character varying
  25 + WHEN matricula.aprovado = 3 THEN
  26 + 'Cursando'::character varying
  27 + WHEN matricula.aprovado = 4 THEN
  28 + 'Transferido'::character varying
  29 + WHEN matricula.aprovado = 5 THEN
  30 + 'Reclassificado'::character varying
  31 + WHEN matricula.aprovado = 6 THEN
  32 + 'Abandono'::character varying
  33 + WHEN matricula.aprovado = 14 THEN
  34 + 'Rp. Faltas'::character varying
  35 + WHEN matricula.aprovado = 15 THEN
  36 + 'Falecido'::character varying
  37 + ELSE 'Recl'::character varying
  38 + END
  39 + ) AS texto_situacao,
  40 + (
  41 + CASE
  42 + WHEN matricula_turma.remanejado THEN
  43 + 'Rem'::character varying
  44 + WHEN matricula_turma.transferido THEN
  45 + 'Trs'::character varying
  46 + WHEN matricula_turma.reclassificado THEN
  47 + 'Recl'::character varying
  48 + WHEN matricula_turma.abandono THEN
  49 + 'Aba'::character varying
  50 + WHEN matricula.aprovado = 1 THEN
  51 + 'Apr'::character varying
  52 + WHEN matricula.aprovado = 12 THEN
  53 + 'ApDp'::character varying
  54 + WHEN matricula.aprovado = 13 THEN
  55 + 'ApCo'::character varying
  56 + WHEN matricula.aprovado = 2 THEN
  57 + 'Rep'::character varying
  58 + WHEN matricula.aprovado = 3 THEN
  59 + 'Cur'::character varying
  60 + WHEN matricula.aprovado = 4 THEN
  61 + 'Trs'::character varying
  62 + WHEN matricula.aprovado = 5 THEN
  63 + 'Recl'::character varying
  64 + WHEN matricula.aprovado = 6 THEN
  65 + 'Aba'::character varying
  66 + WHEN matricula.aprovado = 14 THEN
  67 + 'RpFt'::character varying
  68 + WHEN matricula.aprovado = 15 THEN
  69 + 'Fal'::character varying
  70 + ELSE 'Recl'::character varying
  71 + END
  72 + ) AS texto_situacao_simplificado
  73 +FROM
  74 + relatorio.situacao_matricula,
  75 + pmieducar.matricula
  76 +JOIN pmieducar.escola
  77 + ON escola.cod_escola = matricula.ref_ref_cod_escola
  78 +JOIN pmieducar.instituicao
  79 + ON instituicao.cod_instituicao = escola.ref_cod_instituicao
  80 +LEFT JOIN pmieducar.matricula_turma
  81 + ON matricula_turma.ref_cod_matricula = matricula.cod_matricula
  82 +WHERE TRUE
  83 + AND matricula.ativo = 1
  84 + AND (
  85 + CASE WHEN instituicao.data_base_remanejamento IS NULL THEN
  86 + COALESCE(matricula_turma.remanejado, false) = false
  87 + ELSE
  88 + true
  89 + END
  90 + )
  91 + AND (
  92 + matricula_turma.ativo = 1
  93 + OR
  94 + (
  95 + instituicao.data_base_remanejamento IS NOT NULL
  96 + AND matricula_turma.data_exclusao::date > instituicao.data_base_remanejamento
  97 + AND (
  98 + matricula_turma.transferido
  99 + OR matricula_turma.remanejado
  100 + OR matricula_turma.reclassificado
  101 + OR matricula_turma.abandono
  102 + OR matricula_turma.falecido
  103 + )
  104 + )
  105 + )
  106 + AND
  107 + (
  108 + CASE
  109 + WHEN situacao_matricula.cod_situacao = 10 THEN
  110 + matricula.aprovado = ANY (ARRAY[1, 2, 3, 4, 5, 6, 12, 13, 14, 15])
  111 + WHEN situacao_matricula.cod_situacao = 9 THEN
  112 + (matricula.aprovado = ANY (ARRAY[1, 2, 3, 5, 12, 13, 14]))
  113 + AND (NOT matricula_turma.reclassificado OR matricula_turma.reclassificado IS NULL)
  114 + AND (NOT matricula_turma.abandono OR matricula_turma.abandono IS NULL)
  115 + AND (NOT matricula_turma.remanejado OR matricula_turma.remanejado IS NULL)
  116 + AND (NOT matricula_turma.transferido OR matricula_turma.transferido IS NULL)
  117 + AND (NOT matricula_turma.falecido OR matricula_turma.falecido IS NULL)
  118 + WHEN
  119 + situacao_matricula.cod_situacao = 2 THEN
  120 + (matricula.aprovado = ANY (ARRAY[2, 14]))
  121 + AND (NOT matricula_turma.reclassificado OR matricula_turma.reclassificado IS NULL)
  122 + AND (NOT matricula_turma.abandono OR matricula_turma.abandono IS NULL)
  123 + AND (NOT matricula_turma.remanejado OR matricula_turma.remanejado IS NULL)
  124 + AND (NOT matricula_turma.transferido OR matricula_turma.transferido IS NULL)
  125 + AND (NOT matricula_turma.falecido OR matricula_turma.falecido IS NULL)
  126 + WHEN
  127 + situacao_matricula.cod_situacao = 1 THEN
  128 + (matricula.aprovado = ANY (ARRAY[1, 12, 13]))
  129 + AND (NOT matricula_turma.reclassificado OR matricula_turma.reclassificado IS NULL)
  130 + AND (NOT matricula_turma.abandono OR matricula_turma.abandono IS NULL)
  131 + AND (NOT matricula_turma.remanejado OR matricula_turma.remanejado IS NULL)
  132 + AND (NOT matricula_turma.transferido OR matricula_turma.transferido IS NULL)
  133 + AND (NOT matricula_turma.falecido OR matricula_turma.falecido IS NULL)
  134 + WHEN situacao_matricula.cod_situacao = ANY (ARRAY[3, 12, 13]) THEN
  135 + matricula.aprovado = situacao_matricula.cod_situacao
  136 + AND (NOT matricula_turma.reclassificado OR matricula_turma.reclassificado IS NULL)
  137 + AND (NOT matricula_turma.abandono OR matricula_turma.abandono IS NULL)
  138 + AND (NOT matricula_turma.remanejado OR matricula_turma.remanejado IS NULL)
  139 + AND (NOT matricula_turma.transferido OR matricula_turma.transferido IS NULL)
  140 + AND (NOT matricula_turma.falecido OR matricula_turma.falecido IS NULL)
  141 + ELSE
  142 + matricula.aprovado = situacao_matricula.cod_situacao
  143 + END
  144 + );
... ...
database/sqls/views/relatorio.view_situacao-2019-09-20.sql 0 → 100644
... ... @@ -0,0 +1,155 @@
  1 +CREATE OR REPLACE VIEW relatorio.view_situacao AS
  2 +SELECT
  3 + matricula.cod_matricula,
  4 + situacao_matricula.cod_situacao,
  5 + matricula_turma.ref_cod_turma AS cod_turma,
  6 + matricula_turma.sequencial,
  7 + (
  8 + CASE
  9 + WHEN matricula_turma.remanejado THEN
  10 + 'Remanejado'::character varying
  11 + WHEN matricula_turma.transferido THEN
  12 + 'Transferido'::character varying
  13 + WHEN matricula_turma.reclassificado THEN
  14 + 'Reclassificado'::character varying
  15 + WHEN matricula_turma.abandono THEN
  16 + 'Abandono'::character varying
  17 + WHEN matricula.aprovado = 1 THEN
  18 + 'Aprovado'::character varying
  19 + WHEN matricula.aprovado = 12 THEN
  20 + 'Ap. Depen.'::character varying
  21 + WHEN matricula.aprovado = 13 THEN
  22 + 'Ap. Cons.'::character varying
  23 + WHEN matricula.aprovado = 2 THEN
  24 + 'Reprovado'::character varying
  25 + WHEN matricula.aprovado = 3 THEN
  26 + 'Cursando'::character varying
  27 + WHEN matricula.aprovado = 4 THEN
  28 + 'Transferido'::character varying
  29 + WHEN matricula.aprovado = 5 THEN
  30 + 'Reclassificado'::character varying
  31 + WHEN matricula.aprovado = 6 THEN
  32 + 'Abandono'::character varying
  33 + WHEN matricula.aprovado = 14 THEN
  34 + 'Rp. Faltas'::character varying
  35 + WHEN matricula.aprovado = 15 THEN
  36 + 'Falecido'::character varying
  37 + ELSE 'Recl'::character varying
  38 + END
  39 + ) AS texto_situacao,
  40 + (
  41 + CASE
  42 + WHEN matricula_turma.remanejado THEN
  43 + 'Rem'::character varying
  44 + WHEN matricula_turma.transferido THEN
  45 + 'Trs'::character varying
  46 + WHEN matricula_turma.reclassificado THEN
  47 + 'Recl'::character varying
  48 + WHEN matricula_turma.abandono THEN
  49 + 'Aba'::character varying
  50 + WHEN matricula.aprovado = 1 THEN
  51 + 'Apr'::character varying
  52 + WHEN matricula.aprovado = 12 THEN
  53 + 'ApDp'::character varying
  54 + WHEN matricula.aprovado = 13 THEN
  55 + 'ApCo'::character varying
  56 + WHEN matricula.aprovado = 2 THEN
  57 + 'Rep'::character varying
  58 + WHEN matricula.aprovado = 3 THEN
  59 + 'Cur'::character varying
  60 + WHEN matricula.aprovado = 4 THEN
  61 + 'Trs'::character varying
  62 + WHEN matricula.aprovado = 5 THEN
  63 + 'Recl'::character varying
  64 + WHEN matricula.aprovado = 6 THEN
  65 + 'Aba'::character varying
  66 + WHEN matricula.aprovado = 14 THEN
  67 + 'RpFt'::character varying
  68 + WHEN matricula.aprovado = 15 THEN
  69 + 'Fal'::character varying
  70 + ELSE 'Recl'::character varying
  71 + END
  72 + ) AS texto_situacao_simplificado
  73 +FROM
  74 + relatorio.situacao_matricula,
  75 + pmieducar.matricula
  76 +JOIN pmieducar.escola
  77 + ON escola.cod_escola = matricula.ref_ref_cod_escola
  78 +JOIN pmieducar.instituicao
  79 + ON instituicao.cod_instituicao = escola.ref_cod_instituicao
  80 +LEFT JOIN pmieducar.matricula_turma
  81 + ON matricula_turma.ref_cod_matricula = matricula.cod_matricula
  82 +WHERE TRUE
  83 + AND matricula.ativo = 1
  84 + AND (
  85 + CASE WHEN instituicao.data_base_remanejamento IS NULL THEN
  86 + COALESCE(matricula_turma.remanejado, false) = false
  87 + ELSE
  88 + COALESCE(matricula_turma.remanejado, false) = false OR
  89 + matricula_turma.data_exclusao::date > instituicao.data_base_remanejamento
  90 + END
  91 + )
  92 + AND (
  93 + matricula_turma.ativo = 1
  94 + OR
  95 + (
  96 + (
  97 + instituicao.data_base_remanejamento IS NOT NULL
  98 + AND matricula_turma.data_exclusao::date > instituicao.data_base_remanejamento
  99 + OR (
  100 + matricula_turma.sequencial = (
  101 + select max(sequencial)
  102 + from pmieducar.matricula_turma mt
  103 + where mt.ref_cod_matricula = matricula_turma.ref_cod_matricula
  104 + and mt.ref_cod_turma = matricula_turma.ref_cod_turma
  105 + )
  106 + )
  107 + )
  108 + AND (
  109 + matricula_turma.transferido
  110 + OR matricula_turma.remanejado
  111 + OR matricula_turma.reclassificado
  112 + OR matricula_turma.abandono
  113 + OR matricula_turma.falecido
  114 + )
  115 + )
  116 + )
  117 + AND
  118 + (
  119 + CASE
  120 + WHEN situacao_matricula.cod_situacao = 10 THEN
  121 + matricula.aprovado = ANY (ARRAY[1, 2, 3, 4, 5, 6, 12, 13, 14, 15])
  122 + WHEN situacao_matricula.cod_situacao = 9 THEN
  123 + (matricula.aprovado = ANY (ARRAY[1, 2, 3, 5, 12, 13, 14]))
  124 + AND (NOT matricula_turma.reclassificado OR matricula_turma.reclassificado IS NULL)
  125 + AND (NOT matricula_turma.abandono OR matricula_turma.abandono IS NULL)
  126 + AND (NOT matricula_turma.remanejado OR matricula_turma.remanejado IS NULL)
  127 + AND (NOT matricula_turma.transferido OR matricula_turma.transferido IS NULL)
  128 + AND (NOT matricula_turma.falecido OR matricula_turma.falecido IS NULL)
  129 + WHEN
  130 + situacao_matricula.cod_situacao = 2 THEN
  131 + (matricula.aprovado = ANY (ARRAY[2, 14]))
  132 + AND (NOT matricula_turma.reclassificado OR matricula_turma.reclassificado IS NULL)
  133 + AND (NOT matricula_turma.abandono OR matricula_turma.abandono IS NULL)
  134 + AND (NOT matricula_turma.remanejado OR matricula_turma.remanejado IS NULL)
  135 + AND (NOT matricula_turma.transferido OR matricula_turma.transferido IS NULL)
  136 + AND (NOT matricula_turma.falecido OR matricula_turma.falecido IS NULL)
  137 + WHEN
  138 + situacao_matricula.cod_situacao = 1 THEN
  139 + (matricula.aprovado = ANY (ARRAY[1, 12, 13]))
  140 + AND (NOT matricula_turma.reclassificado OR matricula_turma.reclassificado IS NULL)
  141 + AND (NOT matricula_turma.abandono OR matricula_turma.abandono IS NULL)
  142 + AND (NOT matricula_turma.remanejado OR matricula_turma.remanejado IS NULL)
  143 + AND (NOT matricula_turma.transferido OR matricula_turma.transferido IS NULL)
  144 + AND (NOT matricula_turma.falecido OR matricula_turma.falecido IS NULL)
  145 + WHEN situacao_matricula.cod_situacao = ANY (ARRAY[3, 12, 13]) THEN
  146 + matricula.aprovado = situacao_matricula.cod_situacao
  147 + AND (NOT matricula_turma.reclassificado OR matricula_turma.reclassificado IS NULL)
  148 + AND (NOT matricula_turma.abandono OR matricula_turma.abandono IS NULL)
  149 + AND (NOT matricula_turma.remanejado OR matricula_turma.remanejado IS NULL)
  150 + AND (NOT matricula_turma.transferido OR matricula_turma.transferido IS NULL)
  151 + AND (NOT matricula_turma.falecido OR matricula_turma.falecido IS NULL)
  152 + ELSE
  153 + matricula.aprovado = situacao_matricula.cod_situacao
  154 + END
  155 + );
... ...
ieducar/intranet/DocumentacaoPadrao.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} i-Educar - Documentação padrão" );
13 13 $this->processoAp = "578";
14   - $this->addEstilo('localizacaoSistema');
15 14 }
16 15 }
17 16  
... ...
ieducar/intranet/agenda.php
... ... @@ -44,7 +44,6 @@ class clsIndex extends clsBase
44 44 $this->processoAp = '0';
45 45 $this->addEstilo( "agenda" );
46 46 $this->addScript( "agenda" );
47   - $this->addEstilo('localizacaoSistema');
48 47 }
49 48 }
50 49  
... ...
ieducar/intranet/agenda_admin_cad.php
... ... @@ -13,7 +13,6 @@ class clsIndex extends clsBase
13 13 {
14 14 $this->SetTitulo( "{$this->_instituicao} Agenda" );
15 15 $this->processoAp = "343";
16   - $this->addEstilo('localizacaoSistema');
17 16 }
18 17 }
19 18  
... ...
ieducar/intranet/agenda_admin_det.php
... ... @@ -13,7 +13,6 @@ class clsIndex extends clsBase
13 13 {
14 14 $this->SetTitulo( "{$this->_instituicao} Agenda" );
15 15 $this->processoAp = "343";
16   - $this->addEstilo('localizacaoSistema');
17 16 }
18 17 }
19 18  
... ...
ieducar/intranet/agenda_admin_lst.php
... ... @@ -12,7 +12,6 @@ class clsIndex extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} Agenda" );
14 14 $this->processoAp = "343";
15   - $this->addEstilo('localizacaoSistema');
16 15 }
17 16 }
18 17  
... ...
ieducar/intranet/agenda_imprimir.php
... ... @@ -14,7 +14,6 @@ class clsIndex extends clsBase
14 14 {
15 15 $this->SetTitulo( "{$this->_instituicao} Agenda" );
16 16 $this->processoAp = "345";
17   - $this->addEstilo('localizacaoSistema');
18 17 }
19 18 }
20 19  
... ...
ieducar/intranet/agenda_preferencias.php
... ... @@ -14,7 +14,6 @@ class clsIndex extends clsBase
14 14 {
15 15 $this->SetTitulo( "{$this->_instituicao} Agenda - Preferencias" );
16 16 $this->processoAp = "345";
17   - $this->addEstilo('localizacaoSistema');
18 17 }
19 18 }
20 19  
... ...
ieducar/intranet/agenda_responsavel.php
... ... @@ -7,12 +7,11 @@ require_once (&quot;include/clsBanco.inc.php&quot;);
7 7  
8 8 class clsIndex extends clsBase
9 9 {
10   -
  10 +
11 11 function Formular()
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} Agenda" );
14 14 $this->processoAp = "341";
15   - $this->addEstilo('localizacaoSistema');
16 15 }
17 16 }
18 17  
... ... @@ -27,51 +26,51 @@ class indice extends clsListagem
27 26 $this->pessoa = $this->pessoa_logada;
28 27  
29 28 $this->titulo = "Agendas que eu posso editar";
30   -
31   -
  29 +
  30 +
32 31 $this->addCabecalhos( array( "Agenda" ) );
33 32  
34 33 $this->campoTexto('pesquisa', 'Agenda', '', 50, 255);
35   -
  34 +
36 35 $db = new clsBanco();
37   -
  36 +
38 37 $and = "";
39   -
  38 +
40 39 if (!empty($_GET['pesquisa']))
41 40 {
42 41 $pesquisa = str_replace(' ', '%', $_GET['pesquisa']);
43 42 $and = "AND nm_agenda ilike ('%{$pesquisa}%')";
44 43 $pesquisa = str_replace('%', ' ', $_GET['pesquisa']);
45 44 }
46   -
  45 +
47 46 $db = new clsBanco();
48 47 $total = $db->UnicoCampo( "SELECT COUNT(0) + (SELECT COUNT(*) FROM portal.agenda_responsavel WHERE ref_ref_cod_pessoa_fj = {$this->pessoa} ) FROM portal.agenda WHERE ref_ref_cod_pessoa_own = {$this->pessoa} {$and} " );
49   -
  48 +
50 49 // Paginador
51 50 $limite = 15;
52 51 $iniciolimit = ( $_GET["pagina_{$this->nome}"] ) ? $_GET["pagina_{$this->nome}"]*$limite-$limite: 0;
53   -
  52 +
54 53 $sql = "SELECT cod_agenda, 1 AS minha FROM agenda WHERE ref_ref_cod_pessoa_own = {$this->pessoa} {$and} UNION SELECT ref_cod_agenda, 0 AS minha FROM agenda_responsavel WHERE ref_ref_cod_pessoa_fj = {$this->pessoa} ORDER BY minha DESC";
55   -
  54 +
56 55 $db1 = new clsBanco();
57 56 $db1->Consulta( $sql );
58 57 while ( $db1->ProximoRegistro() )
59 58 {
60 59 list ( $cd_agenda, $propriedade ) = $db1->Tupla();
61   -
  60 +
62 61 $db2 = new clsBanco();
63 62 $db2->Consulta( "SELECT nm_agenda, ref_ref_cod_pessoa_own FROM agenda WHERE cod_agenda = {$cd_agenda} {$and}" );
64 63 while ( $db2->ProximoRegistro() )
65 64 {
66 65 list ( $nm_agenda, $cod_pessoa_own ) = $db2->Tupla();
67   - $this->addLinhas( array(
  66 + $this->addLinhas( array(
68 67 "<a href='agenda.php?cod_agenda={$cd_agenda}'><img src='imagens/noticia.jpg' border=0>$nm_agenda</a>"));
69 68 }
70 69 }
71   -
  70 +
72 71 // Paginador
73 72 $this->addPaginador2( "agenda_responsavel.php", $total, $_GET, $this->nome, $limite );
74   -
  73 +
75 74 $this->largura = "100%";
76 75  
77 76 $localizacao = new LocalizacaoSistema();
... ... @@ -79,7 +78,7 @@ class indice extends clsListagem
79 78 $_SERVER['SERVER_NAME']."/intranet" => "In&iacute;cio",
80 79 "" => "Agendas"
81 80 ));
82   - $this->enviaLocalizacao($localizacao->montar());
  81 + $this->enviaLocalizacao($localizacao->montar());
83 82 }
84 83 }
85 84  
... ...
ieducar/intranet/conexoes_lst.php
... ... @@ -10,12 +10,11 @@ require_once (&quot;include/clsBanco.inc.php&quot;);
10 10  
11 11 class clsIndex extends clsBase
12 12 {
13   -
  13 +
14 14 function Formular()
15 15 {
16 16 $this->SetTitulo( "{$this->_instituicao} Conexões!" );
17 17 $this->processoAp = "157";
18   - $this->addEstilo('localizacaoSistema');
19 18 }
20 19 }
21 20  
... ... @@ -24,16 +23,16 @@ class indice extends clsListagem
24 23 function Gerar()
25 24 {
26 25 $this->titulo = "Conexões";
27   -
28   -
  26 +
  27 +
29 28 $this->addCabecalhos( array( "Data Hora", "Local do Acesso") );
30   -
  29 +
31 30 // Paginador
32 31 $limite = 20;
33 32 $iniciolimit = ( $_GET["pagina_{$this->nome}"] ) ? $_GET["pagina_{$this->nome}"]*$limite-$limite: 0;
34   -
  33 +
35 34 $id_pessoa = Session::get('id_pessoa');
36   -
  35 +
37 36 $sql = "SELECT b.data_hora, b.ip_externo FROM acesso b WHERE cod_pessoa={$id_pessoa}";
38 37 if (!empty($_GET['status']))
39 38 {
... ... @@ -47,23 +46,23 @@ class indice extends clsListagem
47 46 $data = explode("/", $_GET['data_inicial']);
48 47 $where .= " AND data_hora >= '{$data[2]}-{$data[1]}-{$data[0]}'";
49 48 }
50   -
  49 +
51 50 if(!empty($_GET['data_final']))
52 51 {
53 52 $data = explode("/", $_GET['data_final']);
54 53 $where .= " AND data_hora <= '{$data[2]}-{$data[1]}-{$data[0]}'";
55 54 }
56   -
  55 +
57 56 $db = new clsBanco();
58 57 $total = $db->UnicoCampo("SELECT count(*) FROM acesso WHERE cod_pessoa={$id_pessoa} $where");
59   -
60   - $sql .= " $where ORDER BY b.data_hora DESC LIMIT $iniciolimit, $limite";
61   -
  58 +
  59 + $sql .= " $where ORDER BY b.data_hora DESC LIMIT $iniciolimit, $limite";
  60 +
62 61 $db->Consulta( $sql );
63 62 while ( $db->ProximoRegistro() )
64 63 {
65 64 list ($data_hora, $ip_externo) = $db->Tupla();
66   -
  65 +
67 66 $local = $ip_externo == '200.215.80.163' ? 'Prefeitura' : 'Externo';
68 67  
69 68 $this->addLinhas( array("<img src='imagens/noticia.jpg' border=0>$data_hora", $local ) );
... ... @@ -71,16 +70,16 @@ class indice extends clsListagem
71 70  
72 71 /*$this->acao = "go(\"bairros_cad.php\")";
73 72 $this->nome_acao = "Novo";*/
74   -
  73 +
75 74 $opcoes[""] = "Escolha uma opção...";
76 75 $opcoes["P"] = "Prefeitura";
77 76 $opcoes["X"] = "Externo";
78   -
  77 +
79 78 $this->campoLista( "status", "Status", $opcoes, $_GET['status'] );
80   -
  79 +
81 80 $this->campoData("data_inicial","Data Inicial",$_GET['data_inicial']);
82 81 $this->campoData("data_final","Data Final",$_GET['data_final']);
83   -
  82 +
84 83 $this->addPaginador2( "conexoes_lst.php", $total, $_GET, $this->nome, $limite );
85 84  
86 85 $this->largura = "100%";
... ... @@ -90,7 +89,7 @@ class indice extends clsListagem
90 89 $_SERVER['SERVER_NAME']."/intranet" => "In&iacute;cio",
91 90 "" => "Listagem de conex&otilde;es realizadas"
92 91 ));
93   - $this->enviaLocalizacao($localizacao->montar());
  92 + $this->enviaLocalizacao($localizacao->montar());
94 93  
95 94 }
96 95 }
... ...
ieducar/intranet/educar_abandono_cad.php
... ... @@ -15,7 +15,6 @@ class clsIndexBase extends clsBase
15 15 {
16 16 $this->SetTitulo( "{$this->_instituicao} i-Educar - Transfer&ecirc;ncia Solicita&ccedil;&atilde;o" );
17 17 $this->processoAp = "578";
18   - $this->addEstilo("localizacaoSistema");
19 18 }
20 19 }
21 20  
... ...
ieducar/intranet/educar_abandono_tipo_cad.php
... ... @@ -37,7 +37,6 @@ class clsIndexBase extends clsBase
37 37 {
38 38 $this->SetTitulo( "{$this->_instituicao} i-Educar - Motivo Abandono" );
39 39 $this->processoAp = "950";
40   - $this->addEstilo("localizacaoSistema");
41 40 }
42 41 }
43 42  
... ...
ieducar/intranet/educar_abandono_tipo_det.php
... ... @@ -36,7 +36,6 @@ class clsIndexBase extends clsBase
36 36 {
37 37 $this->SetTitulo( "{$this->_instituicao} i-Educar - Motivo Abandono" );
38 38 $this->processoAp = "950";
39   - $this->addEstilo("localizacaoSistema");
40 39 }
41 40 }
42 41  
... ... @@ -72,17 +71,10 @@ class indice extends clsDetalhe
72 71 {
73 72 $this->simpleRedirect('educar_abandono_tipo_lst.php');
74 73 }
75   - if (class_exists("clsPmieducarInstituicao"))
76   - {
77   - $obj_instituicao = new clsPmieducarInstituicao($registro["ref_cod_instituicao"]);
78   - $obj_instituicao_det = $obj_instituicao->detalhe();
79   - $registro["ref_cod_instituicao"] = $obj_instituicao_det['nm_instituicao'];
80   - }
81   - else
82   - {
83   - $cod_instituicao = "Erro na gera&ccedil;&atilde;o";
84   - echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";
85   - }
  74 +
  75 + $obj_instituicao = new clsPmieducarInstituicao($registro["ref_cod_instituicao"]);
  76 + $obj_instituicao_det = $obj_instituicao->detalhe();
  77 + $registro["ref_cod_instituicao"] = $obj_instituicao_det['nm_instituicao'];
86 78  
87 79 $obj_permissoes = new clsPermissoes();
88 80 $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
... ...
ieducar/intranet/educar_abandono_tipo_lst.php
... ... @@ -35,7 +35,6 @@ class clsIndexBase extends clsBase
35 35 {
36 36 $this->SetTitulo( "{$this->_instituicao} i-Educar - Motivo Abandono" );
37 37 $this->processoAp = "950";
38   - $this->addEstilo("localizacaoSistema");
39 38 }
40 39 }
41 40  
... ... @@ -134,17 +133,9 @@ class indice extends clsListagem
134 133 {
135 134 foreach ( $lista AS $registro )
136 135 {
137   - if( class_exists( "clsPmieducarInstituicao" ) )
138   - {
139   - $obj_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
140   - $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe();
141   - $registro["ref_cod_instituicao"] = $obj_cod_instituicao_det["nm_instituicao"];
142   - }
143   - else
144   - {
145   - $registro["ref_cod_instituicao"] = "Erro na gera&ccedil;&atilde;o";
146   - echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";
147   - }
  136 + $obj_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
  137 + $obj_cod_instituicao_det = $obj_cod_instituicao->detalhe();
  138 + $registro["ref_cod_instituicao"] = $obj_cod_instituicao_det["nm_instituicao"];
148 139  
149 140 $lista_busca = array(
150 141 "<a href=\"educar_abandono_tipo_det.php?cod_abandono_tipo={$registro["cod_abandono_tipo"]}\">{$registro["nome"]}</a>"
... ...
ieducar/intranet/educar_acervo_assunto_cad.php
... ... @@ -15,7 +15,6 @@ class clsIndexBase extends clsBase
15 15 {
16 16 $this->SetTitulo( "{$this->_instituicao} i-Educar - Acervo Assunto" );
17 17 $this->processoAp = "592";
18   - $this->addEstilo('localizacaoSistema');
19 18 }
20 19 }
21 20  
... ...
ieducar/intranet/educar_acervo_assunto_det.php
... ... @@ -13,7 +13,6 @@ class clsIndexBase extends clsBase
13 13 {
14 14 $this->SetTitulo( "{$this->_instituicao} i-Educar - Acervo Assunto" );
15 15 $this->processoAp = "592";
16   - $this->addEstilo('localizacaoSistema');
17 16 }
18 17 }
19 18  
... ...
ieducar/intranet/educar_acervo_assunto_lst.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} i-Educar - Acervo Assunto" );
13 13 $this->processoAp = "592";
14   - $this->addEstilo('localizacaoSistema');
15 14 }
16 15 }
17 16  
... ...
ieducar/intranet/educar_acervo_autor_cad.php
... ... @@ -13,7 +13,6 @@ class clsIndexBase extends clsBase
13 13 {
14 14 $this->SetTitulo( "{$this->_instituicao} i-Educar - Autor" );
15 15 $this->processoAp = "594";
16   - $this->addEstilo('localizacaoSistema');
17 16 }
18 17 }
19 18  
... ... @@ -66,19 +65,11 @@ class indice extends clsCadastro
66 65 $this->fexcluir = true;
67 66 }
68 67  
69   - if( class_exists( "clsPmieducarBiblioteca" ) )
70   - {
71 68 $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] );
72 69 $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
73 70 $this->ref_cod_instituicao = $det_ref_cod_biblioteca["ref_cod_instituicao"];
74 71 $this->ref_cod_escola = $det_ref_cod_biblioteca["ref_cod_escola"];
75 72  
76   - }
77   - else
78   - {
79   - $registro["ref_cod_biblioteca"] = "Erro na gera&ccedil;&atilde;o";
80   - }
81   -
82 73 $retorno = "Editar";
83 74 }
84 75 }
... ...
ieducar/intranet/educar_acervo_autor_det.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} i-Educar - Autor" );
14 14 $this->processoAp = "594";
15   - $this->addEstilo('localizacaoSistema');
16 15 }
17 16 }
18 17  
... ... @@ -50,30 +49,23 @@ class indice extends clsDetalhe
50 49 }
51 50 $obj_permissoes = new clsPermissoes();
52 51 $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
53   - if( class_exists( "clsPmieducarBiblioteca" ) )
  52 +
  53 + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] );
  54 + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
  55 + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"];
  56 + $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"];
  57 + $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"];
  58 + if( $registro["ref_cod_instituicao"] )
54 59 {
55   - $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] );
56   - $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
57   - $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"];
58   - $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"];
59   - $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"];
60   - if( $registro["ref_cod_instituicao"] )
61   - {
62   - $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
63   - $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
64   - $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
65   - }
66   - if( $registro["ref_cod_escola"] )
67   - {
68   - $obj_ref_cod_escola = new clsPmieducarEscola();
69   - $det_ref_cod_escola = array_shift($obj_ref_cod_escola->lista($registro["ref_cod_escola"]));
70   - $registro["ref_cod_escola"] = $det_ref_cod_escola["nome"];
71   - }
  60 + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
  61 + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
  62 + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
72 63 }
73   - else
  64 + if( $registro["ref_cod_escola"] )
74 65 {
75   - $registro["ref_cod_biblioteca"] = "Erro na gera&ccedil;&atilde;o";
76   - echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarBiblioteca\n-->";
  66 + $obj_ref_cod_escola = new clsPmieducarEscola();
  67 + $det_ref_cod_escola = array_shift($obj_ref_cod_escola->lista($registro["ref_cod_escola"]));
  68 + $registro["ref_cod_escola"] = $det_ref_cod_escola["nome"];
77 69 }
78 70  
79 71 if( $registro["ref_cod_instituicao"] && $nivel_usuario == 1)
... ...
ieducar/intranet/educar_acervo_autor_lst.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} i-Educar - Autor" );
13 13 $this->processoAp = "594";
14   - $this->addEstilo('localizacaoSistema');
15 14 }
16 15 }
17 16  
... ... @@ -144,46 +143,29 @@ class indice extends clsListagem
144 143 {
145 144 $obj_biblioteca = new clsPmieducarBiblioteca($registro['ref_cod_biblioteca']);
146 145 $det_biblioteca = $obj_biblioteca->detalhe();
147   - // pega detalhes de foreign_keys
148   - if( class_exists( "clsPmieducarEscola" ) )
149   - {
150   - $obj_ref_cod_escola = new clsPmieducarEscola( $det_biblioteca["ref_cod_escola"] );
151   - $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
152   - $registro["ref_cod_escola"] = $det_ref_cod_escola["nome"];
153   - }
154   - else
155   - {
156   - $registro["ref_cod_escola"] = "Erro na geracao";
157   - echo "<!--\nErro\nClasse nao existente: clsPmieducarEscola\n-->";
158   - }
  146 +
  147 + $obj_ref_cod_escola = new clsPmieducarEscola( $det_biblioteca["ref_cod_escola"] );
  148 + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
  149 + $registro["ref_cod_escola"] = $det_ref_cod_escola["nome"];
159 150  
160 151 switch ($nivel_usuario){
161 152 case 1:
162   -
163   - if( class_exists( "clsPmieducarInstituicao" ) && class_exists( "clsPmieducarEscola" ) )
164   - {
165   - $obj_ref_cod_escola = new clsPmieducarEscola( $det_biblioteca["ref_cod_escola"] );
166   - $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
167   - $registro["ref_cod_instituicao"] = $det_ref_cod_escola["ref_cod_instituicao"];
168   -
169   - $obj_ref_cod_intituicao = new clsPmieducarInstituicao( $det_biblioteca["ref_cod_instituicao"] );
170   - $det_ref_cod_intituicao = $obj_ref_cod_intituicao->detalhe();
171   - $registro["ref_cod_instituicao"] = $det_ref_cod_intituicao["nm_instituicao"];
172   - }
173   - else
174   - {
175   - $registro["ref_cod_instituicao"] = "Erro na geracao";
176   - echo "<!--\nErro\nClasse nao existente: clsPmieducarIntituicao\n-->";
177   - }
178   -
179   -
180   - $this->addLinhas( array(
181   - "<a href=\"educar_acervo_autor_det.php?cod_acervo_autor={$registro["cod_acervo_autor"]}\">{$registro["nm_autor"]}</a>",
182   - "<a href=\"educar_acervo_autor_det.php?cod_acervo_autor={$registro["cod_acervo_autor"]}\">{$det_biblioteca["nm_biblioteca"]}</a>",
183   - "<a href=\"educar_acervo_autor_det.php?cod_acervo_autor={$registro["cod_acervo_autor"]}\">{$registro["ref_cod_escola"]}</a>",
184   - "<a href=\"educar_acervo_autor_det.php?cod_acervo_autor={$registro["cod_acervo_autor"]}\">{$registro["ref_cod_instituicao"]}</a>"
185   - ) );
186   - break;
  153 + $obj_ref_cod_escola = new clsPmieducarEscola( $det_biblioteca["ref_cod_escola"] );
  154 + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
  155 + $registro["ref_cod_instituicao"] = $det_ref_cod_escola["ref_cod_instituicao"];
  156 +
  157 + $obj_ref_cod_intituicao = new clsPmieducarInstituicao( $det_biblioteca["ref_cod_instituicao"] );
  158 + $det_ref_cod_intituicao = $obj_ref_cod_intituicao->detalhe();
  159 + $registro["ref_cod_instituicao"] = $det_ref_cod_intituicao["nm_instituicao"];
  160 +
  161 + $this->addLinhas( array(
  162 + "<a href=\"educar_acervo_autor_det.php?cod_acervo_autor={$registro["cod_acervo_autor"]}\">{$registro["nm_autor"]}</a>",
  163 + "<a href=\"educar_acervo_autor_det.php?cod_acervo_autor={$registro["cod_acervo_autor"]}\">{$det_biblioteca["nm_biblioteca"]}</a>",
  164 + "<a href=\"educar_acervo_autor_det.php?cod_acervo_autor={$registro["cod_acervo_autor"]}\">{$registro["ref_cod_escola"]}</a>",
  165 + "<a href=\"educar_acervo_autor_det.php?cod_acervo_autor={$registro["cod_acervo_autor"]}\">{$registro["ref_cod_instituicao"]}</a>"
  166 + ) );
  167 +
  168 + break;
187 169 case 2:
188 170 $this->addLinhas( array(
189 171 "<a href=\"educar_acervo_autor_det.php?cod_acervo_autor={$registro["cod_acervo_autor"]}\">{$registro["nm_autor"]}</a>",
... ...
ieducar/intranet/educar_acervo_cad.php
... ... @@ -16,7 +16,6 @@ class clsIndexBase extends clsBase
16 16 {
17 17 $this->SetTitulo( "{$this->_instituicao} i-Educar - Obras" );
18 18 $this->processoAp = "598";
19   - $this->addEstilo('localizacaoSistema');
20 19 }
21 20 }
22 21  
... ... @@ -174,64 +173,45 @@ class indice extends clsCadastro
174 173  
175 174 // Coleção
176 175 $opcoes = array( "" => "Selecione" );
177   - if( class_exists( "clsPmieducarAcervoColecao" ) )
  176 +
  177 + $objTemp = new clsPmieducarAcervoColecao();
  178 + $lista = $objTemp->lista();
  179 + if ( is_array( $lista ) && count( $lista ) )
178 180 {
179   - $objTemp = new clsPmieducarAcervoColecao();
180   - $lista = $objTemp->lista();
181   - if ( is_array( $lista ) && count( $lista ) )
  181 + foreach ( $lista as $registro )
182 182 {
183   - foreach ( $lista as $registro )
184   - {
185   - $opcoes["{$registro['cod_acervo_colecao']}"] = "{$registro['nm_colecao']}";
186   - }
  183 + $opcoes["{$registro['cod_acervo_colecao']}"] = "{$registro['nm_colecao']}";
187 184 }
188 185 }
189   - else
190   - {
191   - echo "<!--\nErro\nClasse clsPmieducarAcervoColecao nao encontrada\n-->";
192   - $opcoes = array( "" => "Erro na geracao" );
193   - }
194 186 $this->campoLista( "ref_cod_acervo_colecao", "Cole&ccedil;&atilde;o", $opcoes, $this->ref_cod_acervo_colecao,"",false,"","<img id='img_colecao' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"showExpansivelImprimir(500, 200,'educar_acervo_colecao_cad_pop.php',[], 'Coleção')\" />",false,false );
195 187  
196 188 // Idioma
197 189 $opcoes = array( "" => "Selecione" );
198   - if( class_exists( "clsPmieducarAcervoIdioma" ) )
  190 +
  191 + $objTemp = new clsPmieducarAcervoIdioma();
  192 + $lista = $objTemp->lista();
  193 + if ( is_array( $lista ) && count( $lista ) )
199 194 {
200   - $objTemp = new clsPmieducarAcervoIdioma();
201   - $lista = $objTemp->lista();
202   - if ( is_array( $lista ) && count( $lista ) )
  195 + foreach ( $lista as $registro )
203 196 {
204   - foreach ( $lista as $registro )
205   - {
206   - $opcoes["{$registro['cod_acervo_idioma']}"] = "{$registro['nm_idioma']}";
207   - }
  197 + $opcoes["{$registro['cod_acervo_idioma']}"] = "{$registro['nm_idioma']}";
208 198 }
209 199 }
210   - else
211   - {
212   - echo "<!--\nErro\nClasse clsPmieducarAcervoIdioma nao encontrada\n-->";
213   - $opcoes = array( "" => "Erro na geracao" );
214   - }
  200 +
215 201 $this->campoLista( "ref_cod_acervo_idioma", "Idioma", $opcoes, $this->ref_cod_acervo_idioma, "", false, "", "<img id='img_idioma' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"showExpansivelImprimir(400, 150,'educar_acervo_idioma_cad_pop.php',[], 'Idioma')\" />" );
216 202  
217 203 $opcoes = array( "" => "Selecione" );
218   - if( class_exists( "clsPmieducarAcervoEditora" ) )
  204 +
  205 + $objTemp = new clsPmieducarAcervoEditora();
  206 + $lista = $objTemp->lista();
  207 + if ( is_array( $lista ) && count( $lista ) )
219 208 {
220   - $objTemp = new clsPmieducarAcervoEditora();
221   - $lista = $objTemp->lista();
222   - if ( is_array( $lista ) && count( $lista ) )
  209 + foreach ( $lista as $registro )
223 210 {
224   - foreach ( $lista as $registro )
225   - {
226   - $opcoes["{$registro['cod_acervo_editora']}"] = "{$registro['nm_editora']}";
227   - }
  211 + $opcoes["{$registro['cod_acervo_editora']}"] = "{$registro['nm_editora']}";
228 212 }
229 213 }
230   - else
231   - {
232   - echo "<!--\nErro\nClasse clsPmieducarAcervoEditora nao encontrada\n-->";
233   - $opcoes = array( "" => "Erro na geracao" );
234   - }
  214 +
235 215 $this->campoLista( "ref_cod_acervo_editora", "Editora", $opcoes, $this->ref_cod_acervo_editora, "", false, "", "<img id='img_editora' src='imagens/banco_imagens/escreve.gif' style='cursor:hand; cursor:pointer;' border='0' onclick=\"showExpansivelImprimir(400, 320,'educar_acervo_editora_cad_pop.php',[], 'Editora')\" />" );
236 216  
237 217  
... ...
ieducar/intranet/educar_acervo_colecao_cad.php
... ... @@ -13,7 +13,6 @@ class clsIndexBase extends clsBase
13 13 {
14 14 $this->SetTitulo( "{$this->_instituicao} i-Educar - Cole&ccedil;&atilde;o" );
15 15 $this->processoAp = "593";
16   - $this->addEstilo('localizacaoSistema');
17 16 }
18 17 }
19 18  
... ...
ieducar/intranet/educar_acervo_colecao_det.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} i-Educar - Cole&ccedil&atilde;o" );
14 14 $this->processoAp = "593";
15   - $this->addEstilo('localizacaoSistema');
16 15 }
17 16 }
18 17  
... ... @@ -38,51 +37,34 @@ class indice extends clsDetalhe
38 37 {
39 38 $this->titulo = "Cole&ccedil&atilde;o - Detalhe";
40 39  
41   -
42 40 $this->cod_acervo_colecao=$_GET["cod_acervo_colecao"];
43 41  
44 42 $tmp_obj = new clsPmieducarAcervoColecao( $this->cod_acervo_colecao );
45 43 $registro = $tmp_obj->detalhe();
46 44  
  45 + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] );
  46 + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
  47 + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"];
47 48  
48   - if( class_exists( "clsPmieducarBiblioteca" ) )
49   - {
50   - $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] );
51   - $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
52   - $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"];
53   - if( class_exists( "clsPmieducarInstituicao" ) )
54   - {
55 49 $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"];
56 50 $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
57 51 $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
58 52 $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
59   - }
60   - else
61   - {
62   - $registro["ref_cod_instituicao"] = "Erro na geracao";
63   - echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->";
64   - }
65   - }
66 53  
67   - if( class_exists( "clsPmieducarEscola" ) )
68   - {
69 54 $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"];
70 55 $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
71 56 $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
72 57 $idpes = $det_ref_cod_escola["ref_idpes"];
73   - if ($idpes)
74   - {
75   - $obj_escola = new clsPessoaJuridica( $idpes );
76   - $obj_escola_det = $obj_escola->detalhe();
77   - $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
78   - }
79   - else
80   - {
81   - $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
82   - $obj_escola_det = $obj_escola->detalhe();
83   - $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
84   - }
85   - }
  58 +
  59 + if ($idpes) {
  60 + $obj_escola = new clsPessoaJuridica($idpes);
  61 + $obj_escola_det = $obj_escola->detalhe();
  62 + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
  63 + } else {
  64 + $obj_escola = new clsPmieducarEscolaComplemento($registro["ref_cod_escola"]);
  65 + $obj_escola_det = $obj_escola->detalhe();
  66 + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
  67 + }
86 68  
87 69 $obj_permissoes = new clsPermissoes();
88 70 $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
... ...
ieducar/intranet/educar_acervo_colecao_lst.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} i-Educar - Cole&ccedil&atilde;o" );
13 13 $this->processoAp = "593";
14   - $this->addEstilo('localizacaoSistema');
15 14 }
16 15 }
17 16  
... ...
ieducar/intranet/educar_acervo_det.php
... ... @@ -13,7 +13,6 @@ class clsIndexBase extends clsBase
13 13 {
14 14 $this->SetTitulo( "{$this->_instituicao} i-Educar - Obras" );
15 15 $this->processoAp = "598";
16   - $this->addEstilo('localizacaoSistema');
17 16 }
18 17 }
19 18  
... ... @@ -62,109 +61,51 @@ class indice extends clsDetalhe
62 61 $this->simpleRedirect('educar_acervo_lst.php');
63 62 }
64 63  
65   - if( class_exists( "clsPmieducarBiblioteca" ) )
66   - {
67   - $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] );
68   - $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
69   - $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"];
70   - if( class_exists( "clsPmieducarInstituicao" ) )
71   - {
72   - $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"];
73   - $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
74   - $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
75   - $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
76   - }
77   - else
78   - {
79   - $registro["ref_cod_instituicao"] = "Erro na geracao";
80   - echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->";
81   - }
  64 + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] );
  65 + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
  66 + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"];
82 67  
83   - if( class_exists( "clsPmieducarEscola" ) )
84   - {
85   - $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"];
86   - $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
87   - $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
88   - $idpes = $det_ref_cod_escola["ref_idpes"];
89   - if ($idpes)
90   - {
91   - $obj_escola = new clsPessoaJuridica( $idpes );
92   - $obj_escola_det = $obj_escola->detalhe();
93   - $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
94   - }
95   - else
96   - {
97   - $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
98   - $obj_escola_det = $obj_escola->detalhe();
99   - $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
100   - }
101   - }
102   - }
103   - else
104   - {
105   - $registro["ref_cod_biblioteca"] = "Erro na geracao";
106   - echo "<!--\nErro\nClasse nao existente: clsPmieducarBiblioteca\n-->";
107   - }
  68 + $registro["ref_cod_instituicao"] = $det_ref_cod_biblioteca["ref_cod_instituicao"];
  69 + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
  70 + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
  71 + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
108 72  
109   - if( class_exists( "clsPmieducarExemplarTipo" ) )
  73 + $registro["ref_cod_escola"] = $det_ref_cod_biblioteca["ref_cod_escola"];
  74 + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
  75 + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
  76 + $idpes = $det_ref_cod_escola["ref_idpes"];
  77 + if ($idpes)
110 78 {
111   - $obj_ref_cod_exemplar_tipo = new clsPmieducarExemplarTipo( $registro["ref_cod_exemplar_tipo"] );
112   - $det_ref_cod_exemplar_tipo = $obj_ref_cod_exemplar_tipo->detalhe();
113   - $registro["ref_cod_exemplar_tipo"] = $det_ref_cod_exemplar_tipo["nm_tipo"];
  79 + $obj_escola = new clsPessoaJuridica( $idpes );
  80 + $obj_escola_det = $obj_escola->detalhe();
  81 + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
114 82 }
115 83 else
116 84 {
117   - $registro["ref_cod_exemplar_tipo"] = "Erro na geracao";
118   - echo "<!--\nErro\nClasse nao existente: clsPmieducarExemplarTipo\n-->";
  85 + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
  86 + $obj_escola_det = $obj_escola->detalhe();
  87 + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
119 88 }
120 89  
121   - if( class_exists( "clsPmieducarAcervo" ) )
122   - {
123   - $obj_ref_cod_acervo = new clsPmieducarAcervo( $registro["ref_cod_acervo"] );
124   - $det_ref_cod_acervo = $obj_ref_cod_acervo->detalhe();
125   - $registro["ref_cod_acervo"] = $det_ref_cod_acervo["titulo"];
126   - }
127   - else
128   - {
129   - $registro["ref_cod_acervo"] = "Erro na geracao";
130   - echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervo\n-->";
131   - }
  90 + $obj_ref_cod_exemplar_tipo = new clsPmieducarExemplarTipo( $registro["ref_cod_exemplar_tipo"] );
  91 + $det_ref_cod_exemplar_tipo = $obj_ref_cod_exemplar_tipo->detalhe();
  92 + $registro["ref_cod_exemplar_tipo"] = $det_ref_cod_exemplar_tipo["nm_tipo"];
132 93  
133   - if( class_exists( "clsPmieducarAcervoColecao" ) )
134   - {
135   - $obj_ref_cod_acervo_colecao = new clsPmieducarAcervoColecao( $registro["ref_cod_acervo_colecao"] );
136   - $det_ref_cod_acervo_colecao = $obj_ref_cod_acervo_colecao->detalhe();
137   - $registro["ref_cod_acervo_colecao"] = $det_ref_cod_acervo_colecao["nm_colecao"];
138   - }
139   - else
140   - {
141   - $registro["ref_cod_acervo_colecao"] = "Erro na geracao";
142   - echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervoColecao\n-->";
143   - }
  94 + $obj_ref_cod_acervo = new clsPmieducarAcervo( $registro["ref_cod_acervo"] );
  95 + $det_ref_cod_acervo = $obj_ref_cod_acervo->detalhe();
  96 + $registro["ref_cod_acervo"] = $det_ref_cod_acervo["titulo"];
144 97  
145   - if( class_exists( "clsPmieducarAcervoIdioma" ) )
146   - {
147   - $obj_ref_cod_acervo_idioma = new clsPmieducarAcervoIdioma( $registro["ref_cod_acervo_idioma"] );
148   - $det_ref_cod_acervo_idioma = $obj_ref_cod_acervo_idioma->detalhe();
149   - $registro["ref_cod_acervo_idioma"] = $det_ref_cod_acervo_idioma["nm_idioma"];
150   - }
151   - else
152   - {
153   - $registro["ref_cod_acervo_idioma"] = "Erro na geracao";
154   - echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervoIdioma\n-->";
155   - }
  98 + $obj_ref_cod_acervo_colecao = new clsPmieducarAcervoColecao( $registro["ref_cod_acervo_colecao"] );
  99 + $det_ref_cod_acervo_colecao = $obj_ref_cod_acervo_colecao->detalhe();
  100 + $registro["ref_cod_acervo_colecao"] = $det_ref_cod_acervo_colecao["nm_colecao"];
156 101  
157   - if( class_exists( "clsPmieducarAcervoEditora" ) )
158   - {
159   - $obj_ref_cod_acervo_editora = new clsPmieducarAcervoEditora( $registro["ref_cod_acervo_editora"] );
160   - $det_ref_cod_acervo_editora = $obj_ref_cod_acervo_editora->detalhe();
161   - $registro["ref_cod_acervo_editora"] = $det_ref_cod_acervo_editora["nm_editora"];
162   - }
163   - else
164   - {
165   - $registro["ref_cod_acervo_editora"] = "Erro na geracao";
166   - echo "<!--\nErro\nClasse nao existente: clsPmieducarAcervoEditora\n-->";
167   - }
  102 + $obj_ref_cod_acervo_idioma = new clsPmieducarAcervoIdioma( $registro["ref_cod_acervo_idioma"] );
  103 + $det_ref_cod_acervo_idioma = $obj_ref_cod_acervo_idioma->detalhe();
  104 + $registro["ref_cod_acervo_idioma"] = $det_ref_cod_acervo_idioma["nm_idioma"];
  105 +
  106 + $obj_ref_cod_acervo_editora = new clsPmieducarAcervoEditora( $registro["ref_cod_acervo_editora"] );
  107 + $det_ref_cod_acervo_editora = $obj_ref_cod_acervo_editora->detalhe();
  108 + $registro["ref_cod_acervo_editora"] = $det_ref_cod_acervo_editora["nm_editora"];
168 109  
169 110 $obj_permissoes = new clsPermissoes();
170 111 $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
... ...
ieducar/intranet/educar_acervo_editora_cad.php
... ... @@ -13,7 +13,6 @@ class clsIndexBase extends clsBase
13 13 {
14 14 $this->SetTitulo( "{$this->_instituicao} i-Educar - Editora" );
15 15 $this->processoAp = "595";
16   - $this->addEstilo('localizacaoSistema');
17 16 }
18 17 }
19 18  
... ... @@ -104,46 +103,34 @@ class indice extends clsCadastro
104 103 $this->campoCep( "cep", "CEP", $this->cep, false );
105 104  
106 105 $opcoes = array( "" => "Selecione" );
107   - if( class_exists( "clsUf" ) )
  106 +
  107 + $objTemp = new clsUf();
  108 + $lista = $objTemp->lista();
  109 + if ( is_array( $lista ) && count( $lista ) )
108 110 {
109   - $objTemp = new clsUf();
110   - $lista = $objTemp->lista();
111   - if ( is_array( $lista ) && count( $lista ) )
  111 + foreach ( $lista as $registro )
112 112 {
113   - foreach ( $lista as $registro )
114   - {
115   - $opcoes["{$registro['sigla_uf']}"] = "{$registro['nome']}";
116   - }
  113 + $opcoes["{$registro['sigla_uf']}"] = "{$registro['nome']}";
117 114 }
118 115 }
119   - else
120   - {
121   - echo "<!--\nErro\nClasse clsUf nao encontrada\n-->";
122   - $opcoes = array( "" => "Erro na geracao" );
123   - }
  116 +
124 117 $this->campoLista( "ref_sigla_uf", "Estado", $opcoes, $this->ref_sigla_uf, '', false, '', '', false, false );
125 118  
126 119 $this->campoTexto( "cidade", "Cidade", $this->cidade, 30, 60, false );
127 120 $this->campoTexto( "bairro", "Bairro", $this->bairro, 30, 60, false );
128 121  
129 122 $opcoes = array( "" => "Selecione" );
130   - if( class_exists( "clsTipoLogradouro" ) )
  123 +
  124 + $objTemp = new clsTipoLogradouro();
  125 + $lista = $objTemp->lista();
  126 + if ( is_array( $lista ) && count( $lista ) )
131 127 {
132   - $objTemp = new clsTipoLogradouro();
133   - $lista = $objTemp->lista();
134   - if ( is_array( $lista ) && count( $lista ) )
  128 + foreach ( $lista as $registro )
135 129 {
136   - foreach ( $lista as $registro )
137   - {
138   - $opcoes["{$registro['idtlog']}"] = "{$registro['descricao']}";
139   - }
  130 + $opcoes["{$registro['idtlog']}"] = "{$registro['descricao']}";
140 131 }
141 132 }
142   - else
143   - {
144   - echo "<!--\nErro\nClasse clsUrbanoTipoLogradouro nao encontrada\n-->";
145   - $opcoes = array( "" => "Erro na geracao" );
146   - }
  133 +
147 134 $this->campoLista( "ref_idtlog", "Tipo Logradouro", $opcoes, $this->ref_idtlog, '', false, '', '', false, false );
148 135  
149 136 $this->campoTexto( "logradouro", "Logradouro", $this->logradouro, 30, 255, false );
... ...
ieducar/intranet/educar_acervo_editora_cad_pop.php
... ... @@ -70,46 +70,34 @@ class indice extends clsCadastro
70 70 $this->campoCep( "cep", "CEP", $this->cep, false );
71 71  
72 72 $opcoes = array( "" => "Selecione" );
73   - if( class_exists( "clsUf" ) )
  73 +
  74 + $objTemp = new clsUf();
  75 + $lista = $objTemp->lista();
  76 + if ( is_array( $lista ) && count( $lista ) )
74 77 {
75   - $objTemp = new clsUf();
76   - $lista = $objTemp->lista();
77   - if ( is_array( $lista ) && count( $lista ) )
  78 + foreach ( $lista as $registro )
78 79 {
79   - foreach ( $lista as $registro )
80   - {
81   - $opcoes["{$registro['sigla_uf']}"] = "{$registro['nome']}";
82   - }
  80 + $opcoes["{$registro['sigla_uf']}"] = "{$registro['nome']}";
83 81 }
84 82 }
85   - else
86   - {
87   - echo "<!--\nErro\nClasse clsUf nao encontrada\n-->";
88   - $opcoes = array( "" => "Erro na geracao" );
89   - }
  83 +
90 84 $this->campoLista( "ref_sigla_uf", "Estado", $opcoes, $this->ref_sigla_uf, '', false, '', '', false, false );
91 85  
92 86 $this->campoTexto( "cidade", "Cidade", $this->cidade, 30, 60, false );
93 87 $this->campoTexto( "bairro", "Bairro", $this->bairro, 30, 60, false );
94 88  
95 89 $opcoes = array( "" => "Selecione" );
96   - if( class_exists( "clsTipoLogradouro" ) )
  90 +
  91 + $objTemp = new clsTipoLogradouro();
  92 + $lista = $objTemp->lista();
  93 + if ( is_array( $lista ) && count( $lista ) )
97 94 {
98   - $objTemp = new clsTipoLogradouro();
99   - $lista = $objTemp->lista();
100   - if ( is_array( $lista ) && count( $lista ) )
  95 + foreach ( $lista as $registro )
101 96 {
102   - foreach ( $lista as $registro )
103   - {
104   - $opcoes["{$registro['idtlog']}"] = "{$registro['descricao']}";
105   - }
  97 + $opcoes["{$registro['idtlog']}"] = "{$registro['descricao']}";
106 98 }
107 99 }
108   - else
109   - {
110   - echo "<!--\nErro\nClasse clsUrbanoTipoLogradouro nao encontrada\n-->";
111   - $opcoes = array( "" => "Erro na geracao" );
112   - }
  100 +
113 101 $this->campoLista( "ref_idtlog", "Tipo Logradouro", $opcoes, $this->ref_idtlog, '', false, '', '', false, false );
114 102  
115 103 $this->campoTexto( "logradouro", "Logradouro", $this->logradouro, 30, 255, false );
... ...
ieducar/intranet/educar_acervo_editora_det.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} i-Educar - Editora" );
14 14 $this->processoAp = "595";
15   - $this->addEstilo('localizacaoSistema');
16 15 }
17 16 }
18 17  
... ... @@ -57,29 +56,13 @@ class indice extends clsDetalhe
57 56 $this->simpleRedirect('educar_acervo_editora_lst.php');
58 57 }
59 58  
60   - if( class_exists( "clsTipoLogradouro" ) )
61   - {
62   - $obj_ref_idtlog = new clsTipoLogradouro( $registro["ref_idtlog"] );
63   - $det_ref_idtlog = $obj_ref_idtlog->detalhe();
64   - $registro["ref_idtlog"] = $det_ref_idtlog["descricao"];
65   - }
66   - else
67   - {
68   - $registro["ref_idtlog"] = "Erro na geracao";
69   - echo "<!--\nErro\nClasse nao existente: clsUrbanoTipoLogradouro\n-->";
70   - }
  59 + $obj_ref_idtlog = new clsTipoLogradouro( $registro["ref_idtlog"] );
  60 + $det_ref_idtlog = $obj_ref_idtlog->detalhe();
  61 + $registro["ref_idtlog"] = $det_ref_idtlog["descricao"];
71 62  
72   - if( class_exists( "clsUf" ) )
73   - {
74   - $obj_ref_sigla_uf = new clsUf( $registro["ref_sigla_uf"] );
75   - $det_ref_sigla_uf = $obj_ref_sigla_uf->detalhe();
76   - $registro["ref_sigla_uf"] = $det_ref_sigla_uf["nome"];
77   - }
78   - else
79   - {
80   - $registro["ref_sigla_uf"] = "Erro na geracao";
81   - echo "<!--\nErro\nClasse nao existente: clsUf\n-->";
82   - }
  63 + $obj_ref_sigla_uf = new clsUf( $registro["ref_sigla_uf"] );
  64 + $det_ref_sigla_uf = $obj_ref_sigla_uf->detalhe();
  65 + $registro["ref_sigla_uf"] = $det_ref_sigla_uf["nome"];
83 66  
84 67 if( $registro["nm_editora"] )
85 68 {
... ...
ieducar/intranet/educar_acervo_editora_lst.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} i-Educar - Editora" );
13 13 $this->processoAp = "595";
14   - $this->addEstilo('localizacaoSistema');
15 14 }
16 15 }
17 16  
... ... @@ -88,23 +87,16 @@ class indice extends clsListagem
88 87  
89 88 // Filtros de Foreign Keys
90 89 $opcoes = array( "" => "Selecione" );
91   - if( class_exists( "clsUf" ) )
  90 +
  91 + $objTemp = new clsUf();
  92 + $lista = $objTemp->lista();
  93 + if ( is_array( $lista ) && count( $lista ) )
92 94 {
93   - $objTemp = new clsUf();
94   - $lista = $objTemp->lista();
95   - if ( is_array( $lista ) && count( $lista ) )
  95 + foreach ( $lista as $registro )
96 96 {
97   - foreach ( $lista as $registro )
98   - {
99   - $opcoes["{$registro['sigla_uf']}"] = "{$registro['nome']}";
100   - }
  97 + $opcoes["{$registro['sigla_uf']}"] = "{$registro['nome']}";
101 98 }
102 99 }
103   - else
104   - {
105   - echo "<!--\nErro\nClasse clsUf n&atilde;o encontrada\n-->";
106   - $opcoes = array( "" => "Erro na gera&ccedil;&atilde;o" );
107   - }
108 100  
109 101 $this->campoLista( "ref_sigla_uf", "Estado", $opcoes, $this->ref_sigla_uf, null,null,null,null,null,false );
110 102  
... ... @@ -154,17 +146,10 @@ class indice extends clsListagem
154 146 {
155 147 foreach ( $lista AS $registro )
156 148 {
157   - if( class_exists( "clsUf" ) )
158   - {
159   - $obj_ref_sigla_uf = new clsUf( $registro["ref_sigla_uf"] );
160   - $det_ref_sigla_uf = $obj_ref_sigla_uf->detalhe();
161   - $registro["ref_sigla_uf"] = $det_ref_sigla_uf["nome"];
162   - }
163   - else
164   - {
165   - $registro["ref_sigla_uf"] = "Erro na gera&ccedil;&atilde;o";
166   - echo "<!--\nErro\nClasse n&atilde;o existente: clsUf\n-->";
167   - }
  149 + $obj_ref_sigla_uf = new clsUf( $registro["ref_sigla_uf"] );
  150 + $det_ref_sigla_uf = $obj_ref_sigla_uf->detalhe();
  151 + $registro["ref_sigla_uf"] = $det_ref_sigla_uf["nome"];
  152 +
168 153 $obj_biblioteca = new clsPmieducarBiblioteca($registro['ref_cod_biblioteca']);
169 154 $det_biblioteca = $obj_biblioteca->detalhe();
170 155 $registro['ref_cod_biblioteca'] = $det_biblioteca['nm_biblioteca'];
... ...
ieducar/intranet/educar_acervo_idioma_cad.php
... ... @@ -13,7 +13,6 @@ class clsIndexBase extends clsBase
13 13 {
14 14 $this->SetTitulo( "{$this->_instituicao} i-Educar - Idioma" );
15 15 $this->processoAp = "590";
16   - $this->addEstilo('localizacaoSistema');
17 16 }
18 17 }
19 18  
... ...
ieducar/intranet/educar_acervo_idioma_det.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} i-Educar - Idioma" );
14 14 $this->processoAp = "590";
15   - $this->addEstilo('localizacaoSistema');
16 15 }
17 16 }
18 17  
... ...
ieducar/intranet/educar_acervo_idioma_lst.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} i-Educar - Idioma" );
13 13 $this->processoAp = "590";
14   - $this->addEstilo('localizacaoSistema');
15 14 }
16 15 }
17 16  
... ...
ieducar/intranet/educar_acervo_lst.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} i-Educar - Obras" );
13 13 $this->processoAp = "598";
14   - $this->addEstilo('localizacaoSistema');
15 14 }
16 15 }
17 16  
... ... @@ -198,18 +197,9 @@ class indice extends clsListagem
198 197 {
199 198 foreach ( $lista AS $registro )
200 199 {
201   - // pega detalhes de foreign_keys
202   - if( class_exists( "clsPmieducarBiblioteca" ) )
203   - {
204   - $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] );
205   - $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
206   - $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"];
207   - }
208   - else
209   - {
210   - $registro["ref_cod_biblioteca"] = "Erro na geracao";
211   - echo "<!--\nErro\nClasse nao existente: clsPmieducarBiblioteca\n-->";
212   - }
  200 + $obj_ref_cod_biblioteca = new clsPmieducarBiblioteca( $registro["ref_cod_biblioteca"] );
  201 + $det_ref_cod_biblioteca = $obj_ref_cod_biblioteca->detalhe();
  202 + $registro["ref_cod_biblioteca"] = $det_ref_cod_biblioteca["nm_biblioteca"];
213 203  
214 204 $lista_busca = array(
215 205 "<a href=\"educar_acervo_det.php?cod_acervo={$registro["cod_acervo"]}\">{$registro["titulo"]} {$registro["sub_titulo"]}</a>",
... ...
ieducar/intranet/educar_aluno_beneficio_cad.php
... ... @@ -13,7 +13,6 @@ class clsIndexBase extends clsBase
13 13 {
14 14 $this->SetTitulo( "{$this->_instituicao} i-Educar - Benef&iacute;cio Aluno" );
15 15 $this->processoAp = "581";
16   - $this->addEstilo("localizacaoSistema");
17 16 }
18 17 }
19 18  
... ...
ieducar/intranet/educar_aluno_beneficio_det.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} i-Educar - Benef&iacute;cio Aluno" );
14 14 $this->processoAp = "581";
15   - $this->addEstilo("localizacaoSistema");
16 15 }
17 16 }
18 17  
... ...
ieducar/intranet/educar_aluno_beneficio_lst.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} i-Educar - Benefício do aluno");
13 13 $this->processoAp = "581";
14   - $this->addEstilo("localizacaoSistema");
15 14 }
16 15 }
17 16  
... ...
ieducar/intranet/educar_aluno_lst.php
... ... @@ -90,7 +90,6 @@ class indice extends clsListagem
90 90 $this->campoTexto('nome_responsavel', 'Nome do Responsável', $this->nome_responsavel, 50, 255);
91 91  
92 92 $opcoes = ['' => 'Selecione'];
93   - if (class_exists('clsPublicSetorBai')) {
94 93 $objTemp = new clsPublicSetorBai();
95 94 $objTemp->setOrderBy(' nome asc ');
96 95 $lista = $objTemp->lista();
... ... @@ -100,10 +99,6 @@ class indice extends clsListagem
100 99 $opcoes[$registro['idsetorbai']] = $registro['nome'];
101 100 }
102 101 }
103   - } else {
104   - echo '<!--\nErro\nClasse clsMunicipio nao encontrada\n-->';
105   - $opcoes = ['' => 'Erro na geracao'];
106   - }
107 102  
108 103 $this->campoLista('idsetorbai', 'Setor', $opcoes, $this->idsetorbai, null, null, null, null, null, false);
109 104  
... ...
ieducar/intranet/educar_ano_letivo_modulo_cad.php
... ... @@ -19,7 +19,6 @@ class clsIndexBase extends clsBase
19 19 {
20 20 $this->SetTitulo($this->_instituicao . ' Ano Letivo Etapa');
21 21 $this->processoAp = 561;
22   - $this->addEstilo('localizacaoSistema');
23 22 }
24 23 }
25 24  
... ... @@ -180,7 +179,6 @@ class indice extends clsCadastro
180 179  
181 180 $opcoesCampoModulo = [];
182 181  
183   - if (class_exists('clsPmieducarModulo')) {
184 182 $objTemp = new clsPmieducarModulo();
185 183 $objTemp->setOrderby('nm_tipo ASC');
186 184  
... ... @@ -207,9 +205,6 @@ class indice extends clsCadastro
207 205 $opcoesCampoModulo[$registro['cod_modulo']] = sprintf('%s - %d etapa(s)', $registro['nm_tipo'], $registro['num_etapas']);
208 206 }
209 207 }
210   - } else {
211   - $opcoesCampoModulo = ['' => 'Erro na geração'];
212   - }
213 208  
214 209 $this->campoLista(
215 210 'ref_cod_modulo',
... ...
ieducar/intranet/educar_avaliacao_desempenho_cad.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} Servidores - Avalia&ccedil;&atilde;o Desempenho" );
14 14 $this->processoAp = "635";
15   - $this->addEstilo("localizacaoSistema");
16 15 }
17 16 }
18 17  
... ... @@ -95,18 +94,10 @@ class indice extends clsCadastro
95 94 $this->campoTexto( "nm_instituicao", "Institui&ccedil;&atilde;o", $nm_instituicao, 30, 255, false, false, false, "", "", "", "", true);
96 95 }
97 96  
98   - // foreign keys
99   - if( class_exists( "clsPessoa_" ) )
100   - {
101   - $obj_cod_servidor = new clsPessoa_( $this->ref_cod_servidor );
102   - $det_cod_servidor = $obj_cod_servidor->detalhe();
103   - $nm_servidor = $det_cod_servidor["nome"];
104   - }
105   - else
106   - {
107   - $nm_servidor = "Erro na geracao";
108   - echo "<!--\nErro\nClasse nao existente: clsPessoa_\n-->";
109   - }
  97 + $obj_cod_servidor = new clsPessoa_( $this->ref_cod_servidor );
  98 + $det_cod_servidor = $obj_cod_servidor->detalhe();
  99 + $nm_servidor = $det_cod_servidor["nome"];
  100 +
110 101 $this->campoTexto( "nm_servidor", "Servidor", $nm_servidor, 30, 255, false, false, false, "", "", "", "", true);
111 102  
112 103 // text
... ...
ieducar/intranet/educar_avaliacao_desempenho_det.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} Servidores - Avalia&ccedil;&atilde;o Desempenho" );
14 14 $this->processoAp = "635";
15   - $this->addEstilo("localizacaoSistema");
16 15 }
17 16 }
18 17  
... ... @@ -53,28 +52,13 @@ class indice extends clsDetalhe
53 52 $this->simpleRedirect('educar_avaliacao_desempenho_lst.php');
54 53 }
55 54  
56   - if( class_exists( "clsPmieducarInstituicao" ) )
57   - {
58   - $obj_instituicao = new clsPmieducarInstituicao( $registro["ref_ref_cod_instituicao"] );
59   - $det_instituicao = $obj_instituicao->detalhe();
60   - $nm_instituicao = $det_instituicao["nm_instituicao"];
61   - }
62   - else
63   - {
64   - $nm_instituicao = "Erro na geracao";
65   - echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->";
66   - }
67   - if( class_exists( "clsPessoa_" ) )
68   - {
69   - $obj_cod_servidor = new clsPessoa_( $this->ref_cod_servidor );
70   - $det_cod_servidor = $obj_cod_servidor->detalhe();
71   - $nm_servidor = $det_cod_servidor["nome"];
72   - }
73   - else
74   - {
75   - $nm_servidor = "Erro na geracao";
76   - echo "<!--\nErro\nClasse nao existente: clsPessoa_\n-->";
77   - }
  55 + $obj_instituicao = new clsPmieducarInstituicao( $registro["ref_ref_cod_instituicao"] );
  56 + $det_instituicao = $obj_instituicao->detalhe();
  57 + $nm_instituicao = $det_instituicao["nm_instituicao"];
  58 +
  59 + $obj_cod_servidor = new clsPessoa_( $this->ref_cod_servidor );
  60 + $det_cod_servidor = $obj_cod_servidor->detalhe();
  61 + $nm_servidor = $det_cod_servidor["nome"];
78 62  
79 63 $obj_permissoes = new clsPermissoes();
80 64 $nivel_usuario = $obj_permissoes->nivel_acesso($this->pessoa_logada);
... ...
ieducar/intranet/educar_avaliacao_desempenho_lst.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} Servidores - Avaliação Desempenho" );
13 13 $this->processoAp = "635";
14   - $this->addEstilo("localizacaoSistema");
15 14 }
16 15 }
17 16  
... ... @@ -113,31 +112,13 @@ class indice extends clsListagem
113 112 {
114 113 foreach ( $lista AS $registro )
115 114 {
116   - // pega detalhes de foreign_keys
117   - if( class_exists( "clsPessoa_" ) )
118   - {
119   - $obj_cod_servidor = new clsPessoa_( $registro["ref_cod_servidor"] );
120   - $det_cod_servidor = $obj_cod_servidor->detalhe();
121   - $nm_servidor = $det_cod_servidor["nome"];
122   - }
123   - else
124   - {
125   - $nm_servidor = "Erro na geracao";
126   - echo "<!--\nErro\nClasse nao existente: clsPessoa_\n-->";
127   - }
128   -
129   - if( class_exists( "clsPmieducarInstituicao" ) )
130   - {
131   - $obj_instituicao = new clsPmieducarInstituicao( $registro["ref_ref_cod_instituicao"] );
132   - $det_instituicao = $obj_instituicao->detalhe();
133   - $nm_instituicao = $det_instituicao["nm_instituicao"];
134   - }
135   - else
136   - {
137   - $nm_instituicao = "Erro na geracao";
138   - echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->";
139   - }
  115 + $obj_cod_servidor = new clsPessoa_( $registro["ref_cod_servidor"] );
  116 + $det_cod_servidor = $obj_cod_servidor->detalhe();
  117 + $nm_servidor = $det_cod_servidor["nome"];
140 118  
  119 + $obj_instituicao = new clsPmieducarInstituicao( $registro["ref_ref_cod_instituicao"] );
  120 + $det_instituicao = $obj_instituicao->detalhe();
  121 + $nm_instituicao = $det_instituicao["nm_instituicao"];
141 122  
142 123 $lista_busca = array(
143 124 "<a href=\"educar_avaliacao_desempenho_det.php?sequencial={$registro["sequencial"]}&ref_cod_servidor={$registro["ref_cod_servidor"]}&ref_ref_cod_instituicao={$registro["ref_ref_cod_instituicao"]}\">{$registro["titulo_avaliacao"]}</a>",
... ...
ieducar/intranet/educar_avancar_mod_cad.php
... ... @@ -6,10 +6,10 @@ class clsIndexBase extends clsBase
6 6 {
7 7 $this->SetTitulo($this->_instituicao . ' i-Educar');
8 8 $this->processoAp = '845';
9   - $this->addEstilo('localizacaoSistema');
10 9 }
11 10 }
12 11  
  12 +use App\Models\LegacyInstitution;
13 13 use Illuminate\Support\Facades\Session;
14 14  
15 15 class indice extends clsCadastro
... ... @@ -69,10 +69,15 @@ class indice extends clsCadastro
69 69  
70 70 $inicioAnoLetivo = $registros[0]['data_inicio'];
71 71  
  72 + /** @var LegacyInstitution $instituicao */
  73 + $instituicao = app(LegacyInstitution::class);
  74 +
72 75 if ($this->data_matricula < $inicioAnoLetivo) {
73   - Session::now('notice', 'A data da matrícula deve ser posterior ao dia ' . Portabilis_Date_Utils::pgSQLToBr($inicioAnoLetivo) . '.');
  76 + if (!$instituicao->allowRegistrationOutAcademicYear) {
  77 + Session::now('notice', 'A data da matrícula deve ser posterior ao dia ' . Portabilis_Date_Utils::pgSQLToBr($inicioAnoLetivo) . '.');
74 78  
75   - return false;
  79 + return false;
  80 + }
76 81 }
77 82  
78 83 $this->db = new clsBanco();
... ...
ieducar/intranet/educar_backup_lst.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} Backups" );
14 14 $this->processoAp = "9998858";
15   - $this->addEstilo('localizacaoSistema');
16 15 }
17 16 }
18 17  
... ...
ieducar/intranet/educar_biblioteca_cad.php
... ... @@ -14,7 +14,6 @@ class clsIndexBase extends clsBase
14 14 {
15 15 $this->SetTitulo( "{$this->_instituicao} i-Educar - Biblioteca" );
16 16 $this->processoAp = "591";
17   - $this->addEstilo('localizacaoSistema');
18 17 }
19 18 }
20 19  
... ... @@ -156,35 +155,9 @@ class indice extends clsCadastro
156 155 $opcoes = array( "" => "Selecione" );
157 156 if ($this->ref_cod_instituicao)
158 157 {
159   - if( class_exists( "clsPmieducarUsuario" ) )
160   - {
161   - $objTemp = new clsPmieducarUsuario();
162   - $objTemp->setOrderby("nivel ASC");
163   - $lista = $objTemp->lista(null,null,$this->ref_cod_instituicao,null,null,null,null,null,null,null,1);
164   - if ( is_array( $lista ) && count( $lista ) )
165   - {
166   - foreach ( $lista as $registro )
167   - {
168   - $obj_cod_usuario = new clsPessoa_($registro["cod_usuario"] );
169   - $obj_usuario_det = $obj_cod_usuario->detalhe();
170   - $nome_usuario = $obj_usuario_det['nome'];
171   - $opcoes["{$registro['cod_usuario']}"] = "{$nome_usuario}";
172   - }
173   - }
174   - }
175   - else
176   - {
177   - echo "<!--\nErro\nClasse clsPmieducarUsuario n&atilde;o encontrada\n-->";
178   - $opcoes = array( "" => "Erro na gera&ccedil;&atilde;o" );
179   - }
180   - }
181   - /*if( class_exists( "clsPmieducarUsuario" ) )
182   - {
183   - // cria array com todos os usuarios escola (nivel 4)
184   - $usuarios_escola = "user_escola = new Array();\n";
185 158 $objTemp = new clsPmieducarUsuario();
186 159 $objTemp->setOrderby("nivel ASC");
187   - $lista = $objTemp->lista(null,null,null,null,null,null,null,null,null,null,1,4);
  160 + $lista = $objTemp->lista(null,null,$this->ref_cod_instituicao,null,null,null,null,null,null,null,1);
188 161 if ( is_array( $lista ) && count( $lista ) )
189 162 {
190 163 foreach ( $lista as $registro )
... ... @@ -192,37 +165,14 @@ class indice extends clsCadastro
192 165 $obj_cod_usuario = new clsPessoa_($registro["cod_usuario"] );
193 166 $obj_usuario_det = $obj_cod_usuario->detalhe();
194 167 $nome_usuario = $obj_usuario_det['nome'];
195   - $usuarios_escola .= "user_escola[user_escola.length] = new Array({$registro["cod_usuario"]},'{$nome_usuario}', {$registro["ref_cod_instituicao"]}, '{$registro["ref_cod_escola"]}');\n";
  168 + $opcoes["{$registro['cod_usuario']}"] = "{$nome_usuario}";
196 169 }
197 170 }
198   - echo "<script>{$usuarios_escola}</script>";
199   -
200   - // cria array com todos os usuarios biblioteca (nivel 8)
201   - $usuarios_biblioteca = "user_biblioteca = new Array();\n";
202   - $objTemp = new clsPmieducarUsuario();
203   - $objTemp->setOrderby("nivel ASC");
204   - $lista = $objTemp->lista(null,null,null,null,null,null,null,null,null,null,1,8);
205   - if ( is_array( $lista ) && count( $lista ) )
206   - {
207   - foreach ( $lista as $registro )
208   - {
209   - $obj_cod_usuario = new clsPessoa_($registro["cod_usuario"] );
210   - $obj_usuario_det = $obj_cod_usuario->detalhe();
211   - $nome_usuario = $obj_usuario_det['nome'];
212   - $usuarios_biblioteca .= "user_biblioteca[user_biblioteca.length] = new Array({$registro["cod_usuario"]},'{$nome_usuario}', {$registro["ref_cod_instituicao"]}, '{$registro["ref_cod_escola"]}');\n";
213   - }
214   - }
215   - echo "<script>{$usuarios_biblioteca}</script>";
216 171 }
217   - else
218   - {
219   - echo "<!--\nErro\nClasse clsPmieducarUsuario n&atilde;o encontrada\n-->";
220   - $opcoes = array( "" => "Erro na gera&ccedil;&atilde;o" );
221   - }*/
  172 +
222 173 $this->campoLista( "ref_cod_usuario", "Usu&aacute;rio", $opcoes, $this->ref_cod_usuario,"",false,"","<a href='#' onclick=\"getElementById('incluir_usuario').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_adiciona.gif' title='Incluir' border=0></a>",false,false);
223 174  
224 175 $this->campoOculto( "incluir_usuario", "" );
225   -// $this->campoRotulo( "bt_incluir_usuario", "Usu&aacute;rio", "<a href='#' onclick=\"getElementById('incluir_usuario').value = 'S'; getElementById('tipoacao').value = ''; {$this->__nome}.submit();\"><img src='imagens/nvp_bot_incluir2.gif' title='Incluir' border=0></a>" );
226 176  
227 177 $this->campoQuebra();
228 178 }
... ...
ieducar/intranet/educar_biblioteca_dados_cad.php
... ... @@ -13,7 +13,6 @@ class clsIndexBase extends clsBase
13 13 {
14 14 $this->SetTitulo( "{$this->_instituicao} i-Educar - Dados Biblioteca" );
15 15 $this->processoAp = "629";
16   - $this->addEstilo('localizacaoSistema');
17 16 }
18 17 }
19 18  
... ...
ieducar/intranet/educar_biblioteca_dados_det.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} i-Educar - Dados Biblioteca" );
14 14 $this->processoAp = "629";
15   - $this->addEstilo('localizacaoSistema');
16 15 }
17 16 }
18 17  
... ...
ieducar/intranet/educar_biblioteca_dados_lst.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} i-Educar - Dados Biblioteca" );
13 13 $this->processoAp = "629";
14   - $this->addEstilo('localizacaoSistema');
15 14 }
16 15 }
17 16  
... ... @@ -142,41 +141,24 @@ class indice extends clsListagem
142 141 {
143 142 foreach ( $lista AS $registro )
144 143 {
145   - // pega detalhes de foreign_keys
146   - if( class_exists( "clsPmieducarInstituicao" ) )
  144 + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
  145 + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
  146 + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
  147 +
  148 + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
  149 + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
  150 + $idpes = $det_ref_cod_escola["ref_idpes"];
  151 + if ($idpes)
147 152 {
148   - $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
149   - $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
150   - $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
  153 + $obj_escola = new clsPessoaJuridica( $idpes );
  154 + $obj_escola_det = $obj_escola->detalhe();
  155 + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
151 156 }
152 157 else
153 158 {
154   - $registro["ref_cod_instituicao"] = "Erro na gera&ccedil;&atilde;o";
155   - echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";
156   - }
157   -
158   - if( class_exists( "clsPmieducarEscola" ) )
159   - {
160   - $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
161   - $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
162   - $idpes = $det_ref_cod_escola["ref_idpes"];
163   - if ($idpes)
164   - {
165   - $obj_escola = new clsPessoaJuridica( $idpes );
166   - $obj_escola_det = $obj_escola->detalhe();
167   - $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
168   - }
169   - else
170   - {
171   - $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
172   - $obj_escola_det = $obj_escola->detalhe();
173   - $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
174   - }
175   - }
176   - else
177   - {
178   - $registro["ref_cod_escola"] = "Erro na gera&ccedil;&atilde;o";
179   - echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarEscola\n-->";
  159 + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
  160 + $obj_escola_det = $obj_escola->detalhe();
  161 + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
180 162 }
181 163  
182 164 $lista_busca = array(
... ...
ieducar/intranet/educar_biblioteca_det.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} i-Educar - Biblioteca" );
14 14 $this->processoAp = "591";
15   - $this->addEstilo('localizacaoSistema');
16 15 }
17 16 }
18 17  
... ... @@ -48,40 +47,24 @@ class indice extends clsDetalhe
48 47 $this->simpleRedirect('educar_biblioteca_lst.php');
49 48 }
50 49  
51   - if( class_exists( "clsPmieducarInstituicao" ) )
52   - {
53   - $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
54   - $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
55   - $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
56   - }
57   - else
58   - {
59   - $registro["ref_cod_instituicao"] = "Erro na geracao";
60   - echo "<!--\nErro\nClasse nao existente: clsPmieducarInstituicao\n-->";
61   - }
  50 + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
  51 + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
  52 + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
62 53  
63   - if( class_exists( "clsPmieducarEscola" ) )
  54 + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
  55 + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
  56 + $idpes = $det_ref_cod_escola["ref_idpes"];
  57 + if ($idpes)
64 58 {
65   - $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
66   - $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
67   - $idpes = $det_ref_cod_escola["ref_idpes"];
68   - if ($idpes)
69   - {
70   - $obj_escola = new clsPessoaJuridica( $idpes );
71   - $obj_escola_det = $obj_escola->detalhe();
72   - $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
73   - }
74   - else
75   - {
76   - $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
77   - $obj_escola_det = $obj_escola->detalhe();
78   - $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
79   - }
  59 + $obj_escola = new clsPessoaJuridica( $idpes );
  60 + $obj_escola_det = $obj_escola->detalhe();
  61 + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
80 62 }
81 63 else
82 64 {
83   - $registro["ref_cod_escola"] = "Erro na geracao";
84   - echo "<!--\nErro\nClasse nao existente: clsPmieducarEscola\n-->";
  65 + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
  66 + $obj_escola_det = $obj_escola->detalhe();
  67 + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
85 68 }
86 69  
87 70 $obj_permissoes = new clsPermissoes();
... ...
ieducar/intranet/educar_biblioteca_lst.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} i-Educar - Biblioteca" );
13 13 $this->processoAp = "591";
14   - $this->addEstilo('localizacaoSistema');
15 14 }
16 15 }
17 16  
... ... @@ -117,41 +116,24 @@ class indice extends clsListagem
117 116 {
118 117 foreach ( $lista AS $registro )
119 118 {
120   - // pega detalhes de foreign_keys
121   - if( class_exists( "clsPmieducarInstituicao" ) )
  119 + $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
  120 + $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
  121 + $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
  122 +
  123 + $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
  124 + $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
  125 + $idpes = $det_ref_cod_escola["ref_idpes"];
  126 + if ($idpes)
122 127 {
123   - $obj_ref_cod_instituicao = new clsPmieducarInstituicao( $registro["ref_cod_instituicao"] );
124   - $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
125   - $registro["ref_cod_instituicao"] = $det_ref_cod_instituicao["nm_instituicao"];
  128 + $obj_escola = new clsPessoaJuridica( $idpes );
  129 + $obj_escola_det = $obj_escola->detalhe();
  130 + $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
126 131 }
127 132 else
128 133 {
129   - $registro["ref_cod_instituicao"] = "Erro na gera&ccedil;&atilde;o";
130   - echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarInstituicao\n-->";
131   - }
132   -
133   - if( class_exists( "clsPmieducarEscola" ) )
134   - {
135   - $obj_ref_cod_escola = new clsPmieducarEscola( $registro["ref_cod_escola"] );
136   - $det_ref_cod_escola = $obj_ref_cod_escola->detalhe();
137   - $idpes = $det_ref_cod_escola["ref_idpes"];
138   - if ($idpes)
139   - {
140   - $obj_escola = new clsPessoaJuridica( $idpes );
141   - $obj_escola_det = $obj_escola->detalhe();
142   - $registro["ref_cod_escola"] = $obj_escola_det["fantasia"];
143   - }
144   - else
145   - {
146   - $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
147   - $obj_escola_det = $obj_escola->detalhe();
148   - $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
149   - }
150   - }
151   - else
152   - {
153   - $registro["ref_cod_escola"] = "Erro na gera&ccedil;&atilde;o";
154   - echo "<!--\nErro\nClasse n&atilde;o existente: clsPmieducarEscola\n-->";
  134 + $obj_escola = new clsPmieducarEscolaComplemento( $registro["ref_cod_escola"] );
  135 + $obj_escola_det = $obj_escola->detalhe();
  136 + $registro["ref_cod_escola"] = $obj_escola_det["nm_escola"];
155 137 }
156 138  
157 139 $lista_busca = array(
... ...
ieducar/intranet/educar_bloqueio_ano_letivo_cad.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} i-Educar - Bloqueio do ano letivo" );
14 14 $this->processoAp = "21251";
15   - $this->addEstilo("localizacaoSistema");
16 15 }
17 16 }
18 17  
... ...
ieducar/intranet/educar_bloqueio_ano_letivo_det.php
... ... @@ -12,7 +12,6 @@ class clsIndexBase extends clsBase
12 12 {
13 13 $this->SetTitulo( "{$this->_instituicao} i-Educar - Bloqueio do ano letivo" );
14 14 $this->processoAp = "21251";
15   - $this->addEstilo("localizacaoSistema");
16 15 }
17 16 }
18 17  
... ...
ieducar/intranet/educar_bloqueio_ano_letivo_lst.php
... ... @@ -11,7 +11,6 @@ class clsIndexBase extends clsBase
11 11 {
12 12 $this->SetTitulo( "{$this->_instituicao} i-Educar - Bloqueio do ano letivo" );
13 13 $this->processoAp = "21251";
14   - $this->addEstilo("localizacaoSistema");
15 14 }
16 15 }
17 16  
... ...
ieducar/intranet/educar_bloqueio_lancamento_faltas_notas_cad.php
... ... @@ -50,7 +50,6 @@ class clsIndexBase extends clsBase
50 50 {
51 51 $this->SetTitulo($this->_instituicao . ' i-Educar - Bloqueio de lançamento de notas e faltas por etapa');
52 52 $this->processoAp = 999848;
53   - $this->addEstilo("localizacaoSistema");
54 53 }
55 54 }
56 55  
... ...
ieducar/intranet/educar_bloqueio_lancamento_faltas_notas_det.php
... ... @@ -49,7 +49,6 @@ class clsIndexBase extends clsBase
49 49 {
50 50 $this->SetTitulo($this->_instituicao . ' i-Educar - Bloqueio de lançamento de notas e faltas por etapa');
51 51 $this->processoAp = 999848;
52   - $this->addEstilo("localizacaoSistema");
53 52 }
54 53 }
55 54  
... ...
ieducar/intranet/educar_bloqueio_lancamento_faltas_notas_lst.php
... ... @@ -51,7 +51,6 @@ class clsIndexBase extends clsBase
51 51 {
52 52 $this->SetTitulo($this->_instituicao . ' i-Educar - Bloqueio de lançamento de notas e faltas por etapa');
53 53 $this->processoAp = 999848;
54   - $this->addEstilo("localizacaoSistema");
55 54 }
56 55 }
57 56  
... ...
ieducar/intranet/educar_calendario_ano_letivo_cad.php
... ... @@ -16,7 +16,6 @@ class clsIndexBase extends clsBase
16 16 {
17 17 $this->SetTitulo( "{$this->_instituicao} i-Educar - Calendario Ano Letivo" );
18 18 $this->processoAp = "620";
19   - $this->addEstilo("localizacaoSistema");
20 19 }
21 20 }
22 21  
... ...