Skip to content

Commit

Permalink
Planner: fix autosave of class name in Add Lesson Plan
Browse files Browse the repository at this point in the history
  • Loading branch information
SKuipers committed Nov 16, 2024
1 parent 723a217 commit 21f32c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/Planner/planner_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@
if ($viewBy == 'class') {
$form->addHiddenValue('gibbonCourseClassID', $values['gibbonCourseClassID']);
$row = $form->addRow();
$row->addLabel('schoolYearName', __('Class'));
$row->addTextField('schoolYearName')->setValue($values['course'].'.'.$values['class'])->required()->readonly();
$row->addLabel('courseClassName', __('Class'));
$row->addTextField('courseClassName')->setValue($values['course'].'.'.$values['class'])->required()->readonly();
} else {
if ($highestAction == 'Lesson Planner_viewEditAllClasses') {
$data = array('gibbonSchoolYearID' => $session->get('gibbonSchoolYearID'));
Expand Down Expand Up @@ -392,6 +392,9 @@
$formData = $container->get(FormSessionStorage::class);
$formData->load('plannerAdd');

if ($viewBy == 'class') {
$formData->addData(['courseClassName' => $extra ?? '']);
}
if (!empty($nextDate)) {
$formData->addData(['date' => $nextDate, 'timeStart' => $nextTimeStart, 'timeEnd' => $nextTimeEnd]);
}
Expand Down

0 comments on commit 21f32c9

Please sign in to comment.