Kalender: ToolTipConverter verbessert

MoK:
An Passwort ändern weitergemacht (noch nicht fertig und nur im Debug-Modus sichtbar)
This commit is contained in:
2023-07-03 21:05:05 +02:00
parent 95893e4ae6
commit ddc69825c4
9 changed files with 71 additions and 51 deletions

View File

@@ -149,7 +149,7 @@ namespace BeWo.PasswortSecurity
return score < 156 ? 3 : 4;
}
// Score, PreivousValue, Schalter, und LetzteWerte werden im Objekt gepeichert.
public Label ErmittleUndZeigePasswortStaerke(string passwordToValidate, Label passwordLabel)
{
if (!passwordToValidate.IsNullOrEmpty())
@@ -157,6 +157,7 @@ namespace BeWo.PasswortSecurity
var sx = "";
var passwordStrength = -1;
// Es wird durch jedes Zeichen des Passworts einzeln gegangen
foreach (var token in passwordToValidate)
{
sx += token.ToString();
@@ -212,7 +213,7 @@ namespace BeWo.PasswortSecurity
}
else
{
//Passwort Längen Bonuspunkte
//Passwortlängen Bonuspunkte
if (passwordToValidate.Length >= 6 && passwordToValidate.Length < 9)
{
score += 1;
@@ -330,6 +331,7 @@ namespace BeWo.PasswortSecurity
}
}
// Sonderzeichen 2
if (passwordToValidate.Any(x => specialCharacters2.Contains(x)))
{
score += 4;
@@ -340,7 +342,8 @@ namespace BeWo.PasswortSecurity
previousValue = 4;
}
if (passwordToValidate.Any(x => specialCharacters3.Contains(x)))
// Sonderzeichen 3
if(passwordToValidate.Any(x => specialCharacters3.Contains(x)))
{
score += 4;
@@ -354,7 +357,8 @@ namespace BeWo.PasswortSecurity
}
}
if (passwordToValidate.Any(x => specialCharacters4.Contains(x)))
// Sonderzeichen 4
if(passwordToValidate.Any(x => specialCharacters4.Contains(x)))
{
score += 4;
@@ -368,7 +372,8 @@ namespace BeWo.PasswortSecurity
}
}
if (passwordToValidate.Any(x => specialCharacters5.Contains(x)))
// Sonderzeichen 5
if(passwordToValidate.Any(x => specialCharacters5.Contains(x)))
{
score += 4;
@@ -418,9 +423,9 @@ namespace BeWo.PasswortSecurity
return passwordStrength;
}
private Label ZeigePwStaerke(int i, Label passwortprüfer)
private Label ZeigePwStaerke(int passwordStrength, Label passwortprüfer)
{
switch (i)
switch (passwordStrength)
{
case -1:
passwortprüfer.Visibility = Visibility.Hidden;

View File

@@ -12,10 +12,6 @@ namespace BeWo.Scheduler.Converter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
/*
* values[0] -> VisualAppointmentViewInfo
* values[1] -> Intervall
*/
if(values is null || values.Length != 2)
{
return null;
@@ -57,6 +53,11 @@ namespace BeWo.Scheduler.Converter
return noEnd ? string.Empty : $"bis {end:dd.MM.yyyy HH:mm}";
}
if(start.IsTimeZero() && end.IsTimeZero() && end.AddDays(-1) > start)
{
end = end.AddDays(-1);
}
return start.GetIntervalDescription(end).TrimStart();
}
}

View File

@@ -348,7 +348,9 @@
</TextBlock.Text>
</TextBlock>
</StackPanel>
<TextBlock Grid.Column="1" Text="{Binding Path=CustomViewInfo[CustomFieldStorage].ToolTip}" TextWrapping="Wrap" MaxWidth="{Binding Path=ActualWidth, Source={x:Reference Scheduler}}" />
<TextBlock Grid.Column="1" Text="{Binding Path=CustomViewInfo[CustomFieldStorage].ToolTip}"
TextWrapping="Wrap"
MaxWidth="{Binding Path=ActualWidth, Source={x:Reference Scheduler}}" />
</Grid>
<Separator Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Height="1" Background="DimGray" Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].ToolTipTrennstrichVisibility}" />

View File

@@ -499,7 +499,7 @@ namespace BeWo.Scheduler.View
var customFieldStorage = Appointment.GetCustomFieldStorage();
var serviceRecords = customFieldStorage?.ServiceRecordList ?? new List<ServiceRecordDC>();
ViewModel.ApplyChangesToChangedOccurencyCustomFields(employees, customers, resources, originator, isPrivate, Appointment.RecurrenceIndex.ToString(), new Guid(Appointment.RecurrenceInfo.Id.ToString()), isTask, taskDescription, completedDate, dueDate, completedNotice, supportConceptList, Appointment.Subject, Appointment.AllDay, serviceRecords);
ViewModel.ApplyChangesToChangedOccurencyCustomFields(employees, customers, resources, originator, isPrivate, Appointment.RecurrenceIndex.ToString(), new Guid(Appointment.RecurrenceInfo.Id.ToString()), isTask, taskDescription, completedDate, dueDate, completedNotice, supportConceptList, Appointment.Subject, Appointment.AllDay, serviceRecords, start, end);
var oldRecurrenceInfo = Appointment.RecurrenceInfo.ToXml();
var newRecurrenceInfo = ViewModel.NewVM.RecurrenceInfo;

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Media;
@@ -20,7 +21,7 @@ namespace BeWo.Scheduler.ViewModel
if(IsTask)
{
result = result ?? "";
result = result ?? string.Empty;
if(CompletedDate.HasValue)
{
@@ -39,14 +40,16 @@ namespace BeWo.Scheduler.ViewModel
var absenceTimeEnd = _AbsenceTimeEnd;
if(absenceTimeEnd.HasValue)
if(!absenceTimeEnd.HasValue)
{
var absenceTimeStart = _AbsenceTimeStart.Value;
return result += _AbsenceTimeStart.Value.GetIntervalDescription(absenceTimeEnd);
}
if(absenceTimeStart.IsTimeZero() && absenceTimeEnd.Value.IsTimeZero() && absenceTimeEnd.Value.AddDays(-1) > absenceTimeStart)
{
absenceTimeEnd = absenceTimeEnd.Value.AddDays(-1);
}
var absenceTimeStart = _AbsenceTimeStart.Value;
if(absenceTimeStart.IsTimeZero() && absenceTimeEnd.Value.IsTimeZero() && absenceTimeEnd.Value.AddDays(-1) > absenceTimeStart)
{
absenceTimeEnd = absenceTimeEnd.Value.AddDays(-1);
}
return result += _AbsenceTimeStart.Value.GetIntervalDescription(absenceTimeEnd);
@@ -187,7 +190,7 @@ namespace BeWo.Scheduler.ViewModel
Subject = pSubject;
}
public Visibility ToolTipTimeVisibility => IsTask || IsAbsenceTime || IsAllDay ? Visibility.Collapsed : Visibility.Visible;
public Visibility ToolTipTimeVisibility => IsTask || IsAbsenceTime ? Visibility.Collapsed : Visibility.Visible;
public Visibility ToolTipResourcesVisibility => ResourceList?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;

View File

@@ -435,7 +435,7 @@ namespace BeWo.Scheduler.ViewModel
return new SchedulerAppointmentEditForm(this, control, appointment, AllEmployees, AllCustomers, Categories2Resources, isTask);
}
public void ApplyChangesToChangedOccurencyCustomFields(ObservableCollection<Employee2SchedulerAppointmentDC> employees, List<CompactCustomerDC> customers, List<ResourceDC> resources, CompactEmployeeDC originator, bool isPrivate, string index, Guid id, bool isTask, string taskDescription, DateTime? completedDate, DateTime? dueDate, string completedNotice, List<CompactSupportConceptDC> supportConcepts, string subject, bool isAllDay, List<ServiceRecordDC> serviceRecords)
public void ApplyChangesToChangedOccurencyCustomFields(ObservableCollection<Employee2SchedulerAppointmentDC> employees, List<CompactCustomerDC> customers, List<ResourceDC> resources, CompactEmployeeDC originator, bool isPrivate, string index, Guid id, bool isTask, string taskDescription, DateTime? completedDate, DateTime? dueDate, string completedNotice, List<CompactSupportConceptDC> supportConcepts, string subject, bool isAllDay, List<ServiceRecordDC> serviceRecords, DateTime? start, DateTime? end)
{
if (!_ChangedOccurenceCustomFields.ContainsKey(id) || !_ChangedOccurenceCustomFields[id].ContainsKey(index))
{

View File

@@ -112,14 +112,12 @@ namespace BeWo.View
textblock_editFailures.Text = string.Empty;
}
PasswortSicherheit pwS = new PasswortSicherheit();
private readonly PasswortSicherheit _PasswortSicherheit = new PasswortSicherheit();
private void NeuesPwBox_OnPasswordChanged(object sender, RoutedEventArgs e)
{
passwortprüfer = pwS.ErmittleUndZeigePasswortStaerke(NeuesPwBox.Password, passwortprüfer);
passwortprüfer = _PasswortSicherheit.ErmittleUndZeigePasswortStaerke(NeuesPwBox.Password, passwortprüfer);
var fehlermeldung = string.Empty;

View File

@@ -16,6 +16,7 @@
}
<script>
// ToDo: Aus test.html übernehmen. Ist nicht korrekt!
function validatePasswordStrength() {
try {
var pw = $("#new-password").val();
@@ -53,22 +54,32 @@
var score = -1;
if(length < 6) {
score = -1;
} else if(length > 5 && length < 9) {
} else if (length > 5 && length < 9) {
score += 1;
} else if(length < 9) {
logInfo("score + 1 = " + score);
} else if (length < 9) {
score += 2;
} else if(length < 9) {
logInfo("score + 2 = " + score);
} else if (length < 9) {
score += 3;
logInfo("score + 3 = " + score);
} else {
score += 4;
logInfo("score + 4 = " + score);
}
score += numberCount * 3;
logInfo2("score + " + (numberCount * 3) + " = " + score);
score += lowercaseLetterCount * 2;
logInfo2("score + " + (lowercaseLetterCount * 3) + " = " + score);
score += uppercaseLetterCount * 3;
logInfo2("score + " + (uppercaseLetterCount * 3) + " = " + score);
score += lowercaseUmlautCount * 2;
logInfo2("score + " + (lowercaseUmlautCount * 3) + " = " + score);
score += uppercaseUmlautCount * 2;
logInfo2("score + " + (uppercaseUmlautCount * 3) + " = " + score);
score += specialCharacterCount * 4;
logInfo2("score + " + (specialCharacterCount * 3) + " = " + score);
var strength = 0;
@@ -88,26 +99,26 @@
var colorClass = "";
switch(strength) {
case 0:
strengthText += "sehr schwach";
colorClass = "text-danger";
break;
case 1:
strengthText += "schwach";
colorClass = "text-danger";
break;
case 2:
strengthText += "mittel";
colorClass = "text-warning";
break;
case 3:
strengthText += "stark";
colorClass = "text-success";
break;
case 4:
strengthText += "sehr stark";
colorClass = "text-success";
break;
case 0:
strengthText += "sehr schwach";
colorClass = "text-danger";
break;
case 1:
strengthText += "schwach";
colorClass = "text-danger";
break;
case 2:
strengthText += "mittel";
colorClass = "text-warning";
break;
case 3:
strengthText += "stark";
colorClass = "text-success";
break;
case 4:
strengthText += "sehr stark";
colorClass = "text-success";
break;
}
logInfo3("Password score: " + score);

View File

@@ -40,7 +40,7 @@ namespace BeWo.Service.Plugins
//t = "1378137009"; // BeWo Direkt+
//t = "3010479871"; // Aachener Verein
//t = "3849764093"; // Club 74
//t = "5805202339"; // Wegweiser Betreuungsdienst
t = "5805202339"; // Wegweiser Betreuungsdienst
//t = "2301474784"; // Hauskrankenpflege Leiendecker
//t = "8243565510"; // Der Karren
//t = "7709306800"; // Der Karren SBD
@@ -151,7 +151,7 @@ namespace BeWo.Service.Plugins
//t = "3607551608"; // Betreuungsbüro Scholz
//t = "3104936392"; // B.A.P. Bielefelder Ambulante Pflege
//t = "1106039294"; // Hph Bersenbrück ATZ
t = "5562845955"; // Praunheimer Werkstätten
//t = "5562845955"; // Praunheimer Werkstätten
//t = "4801617798"; // Severin
//t = "1172092025"; // Flingern
//t = "3852198843"; // LH Mannheim