Unterrichtsplanung: Serienerzeugung, Stundenraster, Aufsichten & Vertretung (Kapitel 4.2/4.3 Nachtrag)

Stunden serienweise aus dem Stundenplan erzeugen (4.2.5); Stundenraster
(Uhrzeiten je Stunde) in den Einstellungen mit Zeitbedarf-Rückmeldung im
Verlaufsplan-Editor; wiederkehrende Pausenaufsicht; neuer "Vertretung
eintragen"-Dialog für einmalige Vertretungsaufsicht, Vertretungsstunde,
Sondereinsätze (Ausflüge, Berufsmessen) und schlichten Stundenausfall.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-15 21:59:07 +02:00
co-authored by Claude Sonnet 5
parent 99b2de6519
commit d6dee72acc
30 changed files with 2743 additions and 48 deletions
@@ -1,6 +1,8 @@
using Avalonia.Controls;
using LehrerApp.Core.Interfaces;
using LehrerApp.Core.Models;
using LehrerApp.Core.Services;
using LehrerApp.Desktop.Services;
using LehrerApp.Desktop.ViewModels.Groups;
using LehrerApp.Desktop.Views.Shared;
using Microsoft.Extensions.DependencyInjection;
@@ -27,6 +29,7 @@ public partial class PlanningTabView : UserControl
vm.OnConfirmDeleteLesson = ShowDeleteLessonDialog;
vm.OnPickMoveTarget = ShowMoveLessonDialog;
vm.OnShowLesson = ShowLessonViewerDialog;
vm.OnGenerateLessonSeries = ShowGenerateLessonSeriesDialog;
}
}
@@ -80,6 +83,8 @@ public partial class PlanningTabView : UserControl
App.Services.GetRequiredService<ILessonRepository>(),
App.Services.GetRequiredService<IShorthandCodeRepository>(),
App.Services.GetRequiredService<IAlternativeLessonPathRepository>(),
App.Services.GetRequiredService<ITimetableSlotRepository>(),
App.Services.GetRequiredService<PeriodScheduleService>(),
unitId, groupId, materialSuggestions, shorthandHistorySuggestions, editingLesson);
var dialog = new LessonDialog { DataContext = dialogVm };
@@ -122,4 +127,24 @@ public partial class PlanningTabView : UserControl
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is not null) await dialog.ShowDialog(owner);
}
private async Task<LessonSeriesResult?> ShowGenerateLessonSeriesDialog(Unit unit)
{
var dialogVm = new GenerateLessonSeriesDialogViewModel(
App.Services.GetRequiredService<ITimetableSlotRepository>(),
App.Services.GetRequiredService<ILessonRepository>(),
App.Services.GetRequiredService<ISchoolHolidayRepository>(),
App.Services.GetRequiredService<PublicHolidayService>(),
App.Services.GetRequiredService<SchoolCalendarSettingsService>(),
unit.Id, unit.GroupId, unit.StartDate, unit.EndDate);
var dialog = new GenerateLessonSeriesDialog { DataContext = dialogVm };
var owner = TopLevel.GetTopLevel(this) as Window;
if (owner is null) return null;
var ok = await dialog.ShowDialog<bool>(owner);
if (ok && dialogVm.Result is { } result)
App.Services.GetRequiredService<NotificationService>().ShowSuccess(result.Summary);
return ok ? dialogVm.Result : null;
}
}