Skip to content

Commit

Permalink
Merge branch 'dev' into fix/class_turn
Browse files Browse the repository at this point in the history
  • Loading branch information
igorgoncalves committed Apr 25, 2024
2 parents 6b10f5f + 35355ad commit 1105108
Show file tree
Hide file tree
Showing 140 changed files with 3,840 additions and 255 deletions.
20 changes: 15 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
## [Versão 3.77.135]
- Adicionado novas inconsistências para a falta de componentes curriculasres

## [Versão 3.77.134]
- Consertado tela de frequencia para os professores
-
## [Versão 3.77.133]
- Realizado correções nas validações das datas para Professor, Estudante e Escola
- Correção no id da classe para as inconsistências

## [Versão 3.77.132]
-
## [Versão 3.78.132]
- Adicionado campo para a assinatura do diretor
- Adicionado unidades de medida para o lançamento no estoque

## [Versão 3.77.130]
## [Versão 3.77.132]
- Criando as telas relacionadas a agricultor no novo módulo de merenda escolar

## [Versão 3.76.130]
## [Versão 3.76.131]
- Adicionado gerência de editais anuais de aquisição de gêneros alimentícios da agricultura familiar e empreendedor familiar rural

## [Versão 3.76.130]
- Correção no conteúdo ministrado em sala de aula

## [Versão 3.76.129]
- Correção na descrição da séries para as inconsistências sagres


## [Versão 3.76.128]
- Corrigido erro que não mostrava o nome da escola e das turmas nas inconsistências sagres
- Corrigido na busca por profissional na mesma escola
Expand Down
72 changes: 53 additions & 19 deletions app/controllers/ClassesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ public function accessRules()
'index',
'frequency',
'saveFrequency',
'SaveFrequencies',
'classContents',
'getClassContents',
'saveClassContents',
'getmonthsanddisciplines',
'getdisciplines',
'getfrequency',
'saveJustification'
'saveJustification',
'saveJustifications'
),
'users' => array('@'),
),
Expand Down Expand Up @@ -82,7 +84,6 @@ public function actionClassContents()
);

$classrooms = Classroom::model()->findAll($criteria);

} else {
$classrooms = Classroom::model()->findAll(
'school_year = :school_year and school_inep_fk = :school_inep_fk order by name',
Expand Down Expand Up @@ -115,7 +116,6 @@ public function actionGetClassContents()

if (!$isMinorEducation) {
$schedules = $this->getSchedulesFromMajorStage($classroomId, $month, $year, $disciplineId);

} else {
$schedules = $this->getSchedulesFromMinorStage($classroomId, $month, $year);
}
Expand Down Expand Up @@ -183,7 +183,7 @@ public function actionGetClassContents()
"courseClasses" => $courseClasses,
]);
} else {
echo json_encode(["valid" => false, "error" => "Mês/Ano " . ($_POST["fundamentalMaior"] == "1" ? "e Disciplina": "") . " sem aula no Quadro de Horário."]);
echo json_encode(["valid" => false, "error" => "Mês/Ano " . ($_POST["fundamentalMaior"] == "1" ? "e Disciplina" : "") . " sem aula no Quadro de Horário."]);
}
}

Expand All @@ -195,7 +195,7 @@ public function actionGetClassContents()
* @param integer $disciplineId
* @return Schedule[]
*/
private function getSchedulesFromMajorStage($classroomId, $month, $year, $disciplineId)
private function getSchedulesFromMajorStage($classroomId, $month, $disciplineId, $year)
{
return Schedule::model()->findAll(
"classroom_fk = :classroom_fk and month = :month and year = :year and discipline_fk = :discipline_fk and unavailable = 0 order by day, schedule",
Expand Down Expand Up @@ -244,7 +244,6 @@ private function getStudentsByClassroom($classroomId)
)
->bindParam(":classroom_fk", $classroomId)
->queryAll();

}

/**
Expand Down Expand Up @@ -274,7 +273,6 @@ private function buildClassContents($schedules, $students)
}

return $classContents;

}

private function updateStudentAnottations($schedule, $students)
Expand Down Expand Up @@ -340,7 +338,6 @@ private function loadSchedulesByStage($isMajorStage, $classroom, $month, $year,
"year" => $year,
]
);

}

/**
Expand All @@ -364,7 +361,6 @@ private function saveSchedule($schedule, $classContent)
foreach ($classContent["contents"] as $content) {
$this->saveClassContents($content, $schedule);
}

}

private function saveClassContents($content, $schedule)
Expand Down Expand Up @@ -464,6 +460,7 @@ public function actionGetFrequency()
$criteria->order = 'name';
$enrollments = StudentEnrollment::model()->findAllByAttributes(array('classroom_fk' => $_POST["classroom"]), $criteria);
if ($schedules != null) {
$scheduleDays = $this->getScheduleDays($schedules);
if ($enrollments != null) {
$students = [];
$dayName = ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"];
Expand All @@ -474,23 +471,56 @@ public function actionGetFrequency()
foreach ($schedules as $schedule) {
$classFault = ClassFaults::model()->find("schedule_fk = :schedule_fk and student_fk = :student_fk", ["schedule_fk" => $schedule->id, "student_fk" => $enrollment->student_fk]);
$available = date("Y-m-d") >= $schedule->year . "-" . str_pad($schedule->month, 2, "0", STR_PAD_LEFT) . "-" . str_pad($schedule->day, 2, "0", STR_PAD_LEFT);
$date = $this->gerateDate($schedule->day, $schedule->month, $schedule->year);
array_push($array["schedules"], [
"available" => $available,
"day" => $schedule->day,
"week_day" => $dayName[$schedule->week_day],
"schedule" => $schedule->schedule,
"fault" => $classFault != null,
"justification" => $classFault->justification
"justification" => $classFault->justification,
"date" => $date
]);
}
array_push($students, $array);
}
echo json_encode(["valid" => true, "students" => $students]);
echo json_encode(["valid" => true, "students" => $students, "scheduleDays" => $scheduleDays]);
} else {
echo json_encode(["valid" => false, "error" => "Matricule alunos nesta turma para trazer o Quadro de Frequência."]);
}
} else {
echo json_encode(["valid" => false, "error" => "Mês/Ano " . ($_POST["fundamentalMaior"] == "1" ? "e Disciplina": "") . " sem aula no Quadro de Horário."]);
echo json_encode(["valid" => false, "error" => "Mês/Ano " . ($_POST["fundamentalMaior"] == "1" ? "e Disciplina" : "") . " sem aula no Quadro de Horário."]);
}
}
private function gerateDate($day, $month, $year)
{
$day = ($day < 10) ? '0' . $day : $day;
$month = ($month < 10) ? '0' . $month : $month;
return $day . "/" . $month . "/" . $year;
}
private function getScheduleDays($schedules)
{
$result = [];
foreach ($schedules as $schedule) {
$day = ($schedule->day < 10) ? '0' . $schedule->day : $schedule->day;
$month = ($schedule->month < 10) ? '0' . $schedule->month : $schedule->month;
$date = $day . "/" . $month . "/" . $schedule->year;
$index = array_search($date, array_column($result, 'date'));
if ($index === false) {
array_push($result, [
"day" => $schedule->day,
"date" => $date
]);
}
}
return $result;
}

public function actionSaveFrequencies()
{
$schedules = Schedule::model()->findAll("classroom_fk = :classroom_fk and day = :day and year = :year and month = :month", ["classroom_fk" => $_POST["classroomId"], "day" => $_POST["day"], "month" => $_POST["month"], "year" => $_POST["year"]]);
foreach ($schedules as $schedule) {
$this->saveFrequency($schedule);
}
}

Expand Down Expand Up @@ -522,7 +552,6 @@ private function saveFrequency($schedule)
} else {
ClassFaults::model()->deleteAll("schedule_fk = :schedule_fk and student_fk = :student_fk", ["schedule_fk" => $schedule->id, "student_fk" => $_POST["studentId"]]);
}

} else {
if ($_POST["fault"] == "1") {
$enrollments = StudentEnrollment::model()->findAll("classroom_fk = :classroom_fk", ["classroom_fk" => $_POST["classroomId"]]);
Expand All @@ -542,6 +571,15 @@ private function saveFrequency($schedule)
}
}

public function actionSaveJustifications()
{
$schedules = Schedule::model()->findAll("classroom_fk = :classroom_fk and day = :day and month = :month and year = :year ", ["classroom_fk" => $_POST["classroomId"], "day" => $_POST["day"], "month" => $_POST["month"], "year" => $_POST["year"]]);
foreach ($schedules as $schedule) {
$classFault = ClassFaults::model()->find("schedule_fk = :schedule_fk and student_fk = :student_fk", ["schedule_fk" => $schedule->id, "student_fk" => $_POST["studentId"]]);
$classFault->justification = $_POST["justification"] == "" ? null : $_POST["justification"];
$classFault->save();
}
}
public function actionSaveJustification()
{

Expand All @@ -550,15 +588,12 @@ public function actionSaveJustification()
$classFault = ClassFaults::model()->find("schedule_fk = :schedule_fk and student_fk = :student_fk", ["schedule_fk" => $schedule->id, "student_fk" => $_POST["studentId"]]);
$classFault->justification = $_POST["justification"] == "" ? null : $_POST["justification"];
$classFault->save();


} else {
$schedules = Schedule::model()->findAll("classroom_fk = :classroom_fk and day = :day and month = :month and year = :year ", ["classroom_fk" => $_POST["classroomId"], "day" => $_POST["day"], "month" => $_POST["month"], "year" => $_POST["year"]]);
foreach ($schedules as $schedule) {
$classFault = ClassFaults::model()->find("schedule_fk = :schedule_fk and student_fk = :student_fk", ["schedule_fk" => $schedule->id, "student_fk" => $_POST["studentId"]]);
$classFault->justification = $_POST["justification"] == "" ? null : $_POST["justification"];
$classFault->save();

}
}
}
Expand Down Expand Up @@ -594,7 +629,8 @@ public function actionGetMonthsAndDisciplines()
join instructor_identification ii on ii.id = itd.instructor_fk
join curricular_matrix cm on cm.id = tm.curricular_matrix_fk
join edcenso_discipline ed on ed.id = cm.discipline_fk
where ii.users_fk = :userid and itd.classroom_id_fk = :crid order by ed.name")->bindParam(":userid", Yii::app()->user->loginInfos->id)->bindParam(":crid", $classroom->id)->queryAll();
where ii.users_fk = :userid and itd.classroom_id_fk = :crid order by ed.name"
)->bindParam(":userid", Yii::app()->user->loginInfos->id)->bindParam(":crid", $classroom->id)->queryAll();
} else {
$disciplines = Yii::app()->db->createCommand("select ed.id, ed.name from curricular_matrix join edcenso_discipline ed on ed.id = curricular_matrix.discipline_fk where stage_fk = :stage_fk and school_year = :year order by ed.name")->bindParam(":stage_fk", $classroom->edcenso_stage_vs_modality_fk)->bindParam(":year", Yii::app()->user->year)->queryAll();
}
Expand All @@ -608,8 +644,6 @@ public function actionGetMonthsAndDisciplines()
$result = ["valid" => false, "error" => "A Turma está sem Calendário Escolar vinculado."];
}
echo json_encode($result);


}

/**
Expand Down
17 changes: 16 additions & 1 deletion app/controllers/StudentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ public function actionUpdate($id)
$modelStudentDocumentsAndAddress = $this->loadModel($id, $this->STUDENT_DOCUMENTS_AND_ADDRESS);
$modelStudentRestrictions = $this->loadModel($id, $this->STUDENT_RESTRICTIONS);

$oldCpf = $modelStudentDocumentsAndAddress->cpf;

$vaccines = Vaccine::model()->findAll(array('order' => 'name'));
$studentVaccinesSaves = StudentVaccine::model()->findAll(['select' => 'vaccine_id', 'condition' => 'student_id=:student_id', 'params' => [':student_id' => $id]]);
if ($studentVaccinesSaves) {
Expand All @@ -478,6 +480,19 @@ public function actionUpdate($id)
date_default_timezone_set("America/Recife");
$modelStudentIdentification->last_change = date('Y-m-d G:i:s');

$newCpf = $_POST[$this->STUDENT_DOCUMENTS_AND_ADDRESS]['cpf'];

if($oldCpf !== $newCpf && $newCpf !== "") {
$existCpf = StudentDocumentsAndAddress::model()->findByAttributes(array('cpf' => $modelStudentDocumentsAndAddress->cpf));

if($existCpf !== null) {
Yii::app()->user->setFlash(
'error', Yii::t('default', 'Já existe um registro associado a este CPF de um aluno cadastrado!')
);
$this->redirect(array('/student/update', 'id' => $modelStudentDocumentsAndAddress->id));
}
}

if ($modelStudentIdentification->validate() && $modelStudentDocumentsAndAddress->validate()) {
if ($modelStudentIdentification->save()) {
$modelStudentRestrictions->student_fk = $modelStudentIdentification->id;
Expand Down Expand Up @@ -525,7 +540,7 @@ public function actionUpdate($id)
}
}
}

if ($saved) {
$flash = "success";
$msg = 'O Cadastro de ' . $modelStudentIdentification->name . ' foi alterado com sucesso!';
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions app/extensions/bncc-import/Arte.csv.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[remap]

importer="csv_translation"
type="Translation"
uid="uid://bx4g0rbsp14sw"

[deps]

files=["res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Arte. cultivando a percepção.translation", "res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Arte. o imaginário.translation", "res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Arte. a capacidade de simbolizar e o repertório imagético..translation"]

source_file="res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Arte.csv"
dest_files=["res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Arte. cultivando a percepção.translation", "res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Arte. o imaginário.translation", "res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Arte. a capacidade de simbolizar e o repertório imagético..translation"]

[params]

compress=true
delimiter=0
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions app/extensions/bncc-import/Ciências.csv.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[remap]

importer="csv_translation"
type="Translation"
uid="uid://bhmkok23b4enw"

[deps]

files=["res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Ciências. discutindo sua origem.translation", "res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Ciências. os modos como são descartados e como podem ser usados de forma mais consciente..translation"]

source_file="res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Ciências.csv"
dest_files=["res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Ciências. discutindo sua origem.translation", "res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Ciências. os modos como são descartados e como podem ser usados de forma mais consciente..translation"]

[params]

compress=true
delimiter=0
Binary file not shown.
17 changes: 17 additions & 0 deletions app/extensions/bncc-import/Educação Física.csv.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[remap]

importer="csv_translation"
type="Translation"
uid="uid://cm1mb0qc76yv2"

[deps]

files=["res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Educação Física. fruir e recriar diferentes brincadeiras e jogos da cultura popular presentes no contexto comunitário e regional.translation", "res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Educação Física. reconhecendo e respeitando as diferenças individuais de desempenho dos colegas..translation"]

source_file="res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Educação Física.csv"
dest_files=["res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Educação Física. fruir e recriar diferentes brincadeiras e jogos da cultura popular presentes no contexto comunitário e regional.translation", "res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Educação Física. reconhecendo e respeitando as diferenças individuais de desempenho dos colegas..translation"]

[params]

compress=true
delimiter=0
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions app/extensions/bncc-import/Ensino religioso.csv.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[remap]

importer="csv_translation"
type="Translation"
uid="uid://w6embo321fi6"

[deps]

files=["res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Ensino religioso. o outro e o nós;(EF01ER01) Identificar e acolher as semelhanças e diferenças entre o eu.translation", "res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Ensino religioso. o outro e o nós..translation"]

source_file="res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Ensino religioso.csv"
dest_files=["res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Ensino religioso. o outro e o nós;(EF01ER01) Identificar e acolher as semelhanças e diferenças entre o eu.translation", "res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Ensino religioso. o outro e o nós..translation"]

[params]

compress=true
delimiter=0
Binary file not shown.
17 changes: 17 additions & 0 deletions app/extensions/bncc-import/Geografia.csv.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[remap]

importer="csv_translation"
type="Translation"
uid="uid://d0o7c1dllq5rt"

[deps]

files=["res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Geografia. escola etc.) e identificar semelhanças e diferenças entre esses lugares..translation"]

source_file="res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Geografia.csv"
dest_files=["res://OneDrive - Instituto de Pesquisas em Tecnologia e Inovação/Documentos/GitHub/br.tag/app/extensions/bncc-import/Geografia. escola etc.) e identificar semelhanças e diferenças entre esses lugares..translation"]

[params]

compress=true
delimiter=0
Binary file not shown.

0 comments on commit 1105108

Please sign in to comment.