diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bc7e71e5..99873cc7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,10 @@ - Criando o formulário de notas por conceito na tela na sessão de administrador, permitindo a criação de um novo conceito e também modificar conceitos existentes - Modificando a forma como notas por conceito são calculadas, para calcular a média final do aluno - -## [Versão 3.93.212] +## [Versão 3.94.210] +- Permitido que se adicione casa decimal na carga horária na matriz curricular. o Valor da hora-aula é definida nas configurações gerais do município. +- +## [Versão 3.93.210] - Ordem das etapas ajustada no relatório de Matrículas Anuais ## [Versão 3.93.211] diff --git a/app/migrations/2024-12-22_curricularmatrix_decimalworkload/sql b/app/migrations/2024-12-22_curricularmatrix_decimalworkload/sql new file mode 100644 index 000000000..f23226efd --- /dev/null +++ b/app/migrations/2024-12-22_curricularmatrix_decimalworkload/sql @@ -0,0 +1,2 @@ +ALTER TABLE `curricular_matrix` +CHANGE `workload` `workload` float NOT NULL AFTER `discipline_fk`; \ No newline at end of file diff --git a/app/modules/curricularmatrix/messages/pt_br/index.php b/app/modules/curricularmatrix/messages/pt_br/index.php index 579a6bca1..11760d506 100755 --- a/app/modules/curricularmatrix/messages/pt_br/index.php +++ b/app/modules/curricularmatrix/messages/pt_br/index.php @@ -8,6 +8,6 @@ "Stages" => "Etapas", "Disciplines" => "Componentes curriculares/eixos", "Workload" => "Carga Horária", - "Credits" => "Horas Semanais", + "Credits" => "Horários Semanais", "Add" => "Adicionar" ]; diff --git a/app/modules/curricularmatrix/models/CurricularMatrix.php b/app/modules/curricularmatrix/models/CurricularMatrix.php index ecadcef43..8e2c8444b 100755 --- a/app/modules/curricularmatrix/models/CurricularMatrix.php +++ b/app/modules/curricularmatrix/models/CurricularMatrix.php @@ -7,7 +7,7 @@ * @property integer $id * @property integer $stage_fk * @property integer $discipline_fk - * @property integer $workload + * @property double $workload * @property integer $credits * @property integer $school_year * @@ -46,8 +46,9 @@ public function rules() // NOTE: you should only define rules for those attributes that // will receive user inputs. return [ - ['stage_fk, discipline_fk, workload, credits, school_year', 'required'], - ['stage_fk, discipline_fk, workload, credits, school_year', 'numerical', 'integerOnly' => true], + ['stage_fk, discipline_fk, credits, school_year', 'required'], + ['stage_fk, discipline_fk, credits, school_year', 'numerical', 'integerOnly' => true], + ['workload', 'numerical'], ['id, stage_fk, discipline_fk, workload, credits, school_year', 'safe', 'on' => 'search'], ]; } diff --git a/app/modules/curricularmatrix/resources/common/css/layout.css b/app/modules/curricularmatrix/resources/common/css/layout.css index b58f9a09b..d327d8a46 100755 --- a/app/modules/curricularmatrix/resources/common/css/layout.css +++ b/app/modules/curricularmatrix/resources/common/css/layout.css @@ -66,4 +66,8 @@ form{ .alert-container { display: none; +} + +#workload { + width: 100%; } \ No newline at end of file diff --git a/app/modules/timesheet/controllers/TimesheetController.php b/app/modules/timesheet/controllers/TimesheetController.php index a86b5b045..d8f560889 100755 --- a/app/modules/timesheet/controllers/TimesheetController.php +++ b/app/modules/timesheet/controllers/TimesheetController.php @@ -109,6 +109,8 @@ public function actionGetTimesheet($classroomId = NULL) $response["softUnavailableDays"] = $this->getUnavailableDays($classroomId, false, "soft"); $response["schedules"] = []; + $vha = (object)\InstanceConfig::model()->findByAttributes(array('parameter_key' => 'VHA')); + $hours = $vha["value"] / 60; foreach ($schedules as $schedule) { // if (!isset($response["schedules"][$schedule->month])) { // $response["schedules"][$schedule->month] = []; @@ -135,7 +137,7 @@ public function actionGetTimesheet($classroomId = NULL) if (!$schedule->unavailable) { $cmKey = array_search($schedule["discipline_fk"], array_column($response["disciplines"], 'disciplineId')); - $response["disciplines"][$cmKey]["workloadUsed"]++; + $response["disciplines"][$cmKey]["workloadUsed"] += $hours; } $response["schedules"][$schedule->year][$schedule->month][$schedule->schedule][$schedule->day] = [ @@ -482,7 +484,9 @@ public function actionChangeUnavailableSchedule() $schedule->save(); $disciplines = []; - array_push($disciplines, ["disciplineId" => $schedule->discipline_fk, "workloadUsed" => $schedule->unavailable ? -1 : 1]); + $vha = (object)\InstanceConfig::model()->findByAttributes(array('parameter_key' => 'VHA')); + $hours = $vha["value"] / 60; + array_push($disciplines, ["disciplineId" => $schedule->discipline_fk, "workloadUsed" => $schedule->unavailable ? -$hours : $hours]); echo json_encode(["unavailable" => $schedule->unavailable, "disciplines" => $disciplines]); } @@ -595,7 +599,7 @@ public function actionChangeSchedules() " select " . " edcenso_discipline.id as disciplineId, " . " edcenso_discipline.name as disciplineName, " . - " (select count(schedule.id) from schedule where classroom_fk = " . $_POST["classroomId"] . " and schedule.unavailable = 0 and schedule.discipline_fk = disciplineId) as workloadUsed, " . + " (select (count(schedule.id) * (select value from instance_config where parameter_key = 'VHA') / 60) from schedule where classroom_fk = " . $_POST["classroomId"] . " and schedule.unavailable = 0 and schedule.discipline_fk = disciplineId) as workloadUsed, " . " curricular_matrix.workload as workloadTotal, " . " (select ii.name from teaching_matrixes tm join instructor_teaching_data itd on itd.id = tm.teaching_data_fk join instructor_identification ii on itd.instructor_fk = ii.id where itd.classroom_id_fk = " . $_POST["classroomId"] . " and tm.curricular_matrix_fk = curricular_matrix.id) as instructorName " . " from curricular_matrix " . @@ -625,6 +629,8 @@ public function actionRemoveSchedule() if ($_POST["schedule"]["hardUnavailableDaySelected"] || !$_POST["replicate"]) { $finalDate = new Datetime($_POST["schedule"]["year"] . "-" . str_pad($_POST["schedule"]["month"], 2, "0", STR_PAD_LEFT) . "-" . $_POST["schedule"]["day"]); } + $vha = (object)\InstanceConfig::model()->findByAttributes(array('parameter_key' => 'VHA')); + $hours = $vha["value"] / 60; for ($date = $selectedDate; $date <= $finalDate; $date->modify("+7 days")) { $schedule = Schedule::model()->findByAttributes(array('classroom_fk' => $_POST["classroomId"], 'year' => $date->format("Y"), 'month' => $date->format("n"), 'day' => $date->format("j"), 'schedule' => $_POST["schedule"]["schedule"])); if ($schedule != null) { @@ -632,9 +638,9 @@ public function actionRemoveSchedule() if (!$schedule->unavailable) { $key = array_search($schedule->discipline_fk, array_column($disciplines, 'disciplineId')); if ($key === false) { - array_push($disciplines, ["disciplineId" => $schedule->discipline_fk, "workloadUsed" => -1]); + array_push($disciplines, ["disciplineId" => $schedule->discipline_fk, "workloadUsed" => -$hours]); } else { - $disciplines[$key]["workloadUsed"]--; + $disciplines[$key]["workloadUsed"] -= $hours; } } @@ -698,6 +704,8 @@ public function actionAddSchedule() if ($_POST["hardUnavailableDaySelected"] || !$_POST["replicate"]) { $finalDate = new Datetime($_POST["schedule"]["year"] . "-" . str_pad($_POST["schedule"]["month"], 2, "0", STR_PAD_LEFT) . "-" . $_POST["schedule"]["day"]); } + $vha = (object)\InstanceConfig::model()->findByAttributes(array('parameter_key' => 'VHA')); + $hours = $vha["value"] / 60; for ($date = $selectedDate; $date <= $finalDate; $date->modify("+7 days")) { if (!in_array($date->format("Y-m-d"), $hardUnavailableDays) || $_POST["hardUnavailableDaySelected"]) { $schedule = Schedule::model()->findByAttributes(array('classroom_fk' => $_POST["classroomId"], 'year' => $date->format("Y"), 'month' => $date->format("n"), 'day' => $date->format("j"), 'schedule' => $_POST["schedule"]["schedule"])); @@ -718,9 +726,9 @@ public function actionAddSchedule() $schedule->unavailable = 0; $key = array_search($_POST["disciplineId"], array_column($disciplines, 'disciplineId')); if ($key === false) { - array_push($disciplines, ["disciplineId" => $_POST["disciplineId"], "workloadUsed" => 1]); + array_push($disciplines, ["disciplineId" => $_POST["disciplineId"], "workloadUsed" => $hours]); } else { - $disciplines[$key]["workloadUsed"]++; + $disciplines[$key]["workloadUsed"] += $hours; } } $schedule->turn = $classroom->turn; diff --git a/app/modules/timesheet/resources/common/css/layout.css b/app/modules/timesheet/resources/common/css/layout.css index 247bfeef7..c1e099329 100755 --- a/app/modules/timesheet/resources/common/css/layout.css +++ b/app/modules/timesheet/resources/common/css/layout.css @@ -374,16 +374,18 @@ table.table-timesheet td { .workload-discipline { display: inline-block; - width: 80%; + width: 70%; font-weight: bold; vertical-align: middle; + font-size: 12px; } .workload-numbers { display: inline-block; - width: 20%; + width: 30%; font-style: italic; text-align: right; + font-size: 12px; } .workload-red { diff --git a/app/modules/timesheet/resources/common/js/timesheet.js b/app/modules/timesheet/resources/common/js/timesheet.js index 60f45b554..dab99596b 100755 --- a/app/modules/timesheet/resources/common/js/timesheet.js +++ b/app/modules/timesheet/resources/common/js/timesheet.js @@ -233,7 +233,7 @@ function calculateWorkload(disciplines, increment) { hasOverflow = workloadUsed > workloadTotal; } var workloadColor = workloadUsed > workloadTotal ? "workload-red" : (workloadUsed === workloadTotal ? "workload-green" : ""); - html += "
" + this.disciplineName + "
" + workloadUsed + "/" + workloadTotal + "
" + (this.instructorName === null ? "SEM PROFESSOR" : this.instructorName) + "
"; + html += "
" + this.disciplineName + "
" + workloadUsed.toFixed(2).replace(/\.00$/, '') + "/" + workloadTotal + "
" + (this.instructorName === null ? "SEM PROFESSOR" : this.instructorName) + "
"; }); $(".workloads").find(".workload").remove(); $(".workloads").append(html); @@ -245,7 +245,7 @@ function calculateWorkload(disciplines, increment) { workloadUsed > workloadTotal ? workload.addClass("workload-red").removeClass("workload-green") : (workloadUsed === workloadTotal ? workload.addClass("workload-green").removeClass("workload-red") : workload.removeClass("workload-red").removeClass("workload-green")); - workload.find(".workload-used").text(workloadUsed); + workload.find(".workload-used").text(workloadUsed.toFixed(2).replace(/\.00$/, '')); }); hasOverflow = $(".workloads").find(".workload.workload-red").length; } diff --git a/themes/default/views/curricularmatrix/curricularmatrix/index.php b/themes/default/views/curricularmatrix/curricularmatrix/index.php index 975e200ae..dd6047d0f 100755 --- a/themes/default/views/curricularmatrix/curricularmatrix/index.php +++ b/themes/default/views/curricularmatrix/curricularmatrix/index.php @@ -17,8 +17,6 @@ ?> - -
@@ -53,8 +51,8 @@
- "t-field-number__label control-label"]) ?> - "0", "max" => "9999", 'style' => 'border: 1px solid #aaa;box-sizing:border-box;height: 43px']) ?> + "t-field-text__label control-label"]) ?> + 'border: 1px solid #aaa;box-sizing:border-box;height: 43px', 'onkeypress' => 'return event.charCode == 46 || (event.charCode >= 48 && event.charCode <= 57)']) ?>
@@ -152,17 +150,17 @@
user->year - 1) ?> + href="javascript:;">user->year - 1) ?>