Schülerdokumentation: Einträge, Fehlzeitenbilanz, Datenschutz (Kapitel 5)
Dokumentationseinträge mit Typwahl (Gespräch, Vorkommnis, Förderplan, Fehlzeit, Elternanruf, Elternbrief), vertrauliche Einträge nur nach Bestätigung sichtbar, weiche Löschung mit Nachvollziehbarkeit. Fehlzeiten als Auswertung des bestehenden Anwesenheits-Trackings statt zweiter Erfassung, mit Schwellenwert-Warnung im Schülerdetail und Dashboard. Förderplan-Wiedervorlage als Dashboard-Karte. Datenschutz: Löschfristen mit manueller Bereinigung und DSGVO-Art.-15-Datenauskunft als Export. Auf Nutzer-Feedback hin ergänzt: Elternanruf mit begleitendem Gesprächsprotokoll-Dialog (Punkte abhaken, Eindrücke festhalten), Elternbrief mit Versand-/Rückmeldungs-Tracking, Datei-Anhänge über LiteDBs Dateispeicher, frei vergebbare Labels zur Nachverfolgung mit Dringlichkeits-Farbcodierung, sowie eine sichtbare Farblegende für das bestehende Notenentwicklungs-Diagramm. Dabei einen Absturz behoben: leere Textfelder lieferten über das Binding null statt "", was beim Speichern eine NullReferenceException auslöste. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Platform.Storage;
|
||||
using LehrerApp.Core.Interfaces;
|
||||
using LehrerApp.Core.Models;
|
||||
using LehrerApp.Desktop.ViewModels.Students;
|
||||
using LehrerApp.Desktop.Views.Shared;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.Students;
|
||||
|
||||
@@ -15,6 +19,10 @@ public partial class StudentDetailView : UserControl
|
||||
if (DataContext is not StudentDetailViewModel vm) return;
|
||||
vm.OnEditContact = ShowContactDialog;
|
||||
vm.OnViewAddress = ShowAddressViewer;
|
||||
vm.OnEditDocumentation = ShowDocumentationDialog;
|
||||
vm.OnConfirmDeleteDocumentation = ShowDeleteDocumentationDialog;
|
||||
vm.OnSaveExportFile = SaveExportFile;
|
||||
vm.OnConductParentCall = ShowParentCallSessionDialog;
|
||||
}
|
||||
|
||||
private async Task<Contact?> ShowContactDialog(Contact? contact)
|
||||
@@ -45,4 +53,57 @@ public partial class StudentDetailView : UserControl
|
||||
vm.ViewSelectedAddressCommand.CanExecute(null))
|
||||
vm.ViewSelectedAddressCommand.Execute(null);
|
||||
}
|
||||
|
||||
private async Task<Documentation?> ShowDocumentationDialog(Guid studentId, Documentation? editing)
|
||||
{
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
if (owner is null) return null;
|
||||
|
||||
var vm = new DocumentationDialogViewModel(studentId, editing,
|
||||
App.Services.GetRequiredService<IAttachmentStorage>());
|
||||
var dialog = new DocumentationDialog { DataContext = vm };
|
||||
var saved = await dialog.ShowDialog<bool>(owner);
|
||||
if (!saved) vm.DiscardUnsavedAttachments();
|
||||
return saved ? vm.Result : null;
|
||||
}
|
||||
|
||||
private async Task<Documentation?> ShowParentCallSessionDialog(Documentation documentation, string studentTitle)
|
||||
{
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
if (owner is null) return null;
|
||||
|
||||
var vm = new ParentCallSessionViewModel(documentation, studentTitle);
|
||||
var dialog = new ParentCallSessionDialog { DataContext = vm };
|
||||
var saved = await dialog.ShowDialog<bool>(owner);
|
||||
return saved ? vm.Result : null;
|
||||
}
|
||||
|
||||
private async Task<bool> ShowDeleteDocumentationDialog(DocumentationItem item)
|
||||
{
|
||||
var info = new ConfirmDialogInfo
|
||||
{
|
||||
Title = "Eintrag löschen?",
|
||||
Message = $"\"{item.Model.Title}\" wird als gelöscht markiert und nicht mehr angezeigt.",
|
||||
ConfirmText = "Löschen",
|
||||
};
|
||||
var dialog = new ConfirmDialog { DataContext = info };
|
||||
var owner = TopLevel.GetTopLevel(this) as Window;
|
||||
return owner is not null && await dialog.ShowDialog<bool>(owner);
|
||||
}
|
||||
|
||||
private async Task SaveExportFile(string json)
|
||||
{
|
||||
var topLevel = TopLevel.GetTopLevel(this);
|
||||
if (topLevel is null || DataContext is not StudentDetailViewModel vm || vm.Student is null) return;
|
||||
|
||||
var file = await topLevel.StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
|
||||
{
|
||||
Title = "Datenauskunft exportieren",
|
||||
SuggestedFileName = $"Datenauskunft_{vm.Student.LastName}_{vm.Student.FirstName}.json",
|
||||
FileTypeChoices = [new FilePickerFileType("JSON-Dateien") { Patterns = ["*.json"] }],
|
||||
});
|
||||
|
||||
if (file is null) return;
|
||||
await File.WriteAllTextAsync(file.Path.LocalPath, json);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user