Bis zu vier Ressourcenfarben werden im Kalender angezeigt.

This commit is contained in:
Lyndon Jetten
2021-10-15 19:18:15 +02:00
parent fc1b9c3be1
commit df976bd58b
6 changed files with 81 additions and 13 deletions

View File

@@ -200,6 +200,7 @@ namespace BeWo
bool dontShowSpitzabrechnung = false;
bool showDienstplanung = false;
var showEmployeeSignature = false;
var showMultipleResourceColors = false;
AppSettings.ShowAdvisedAttendedFlag = false;
@@ -429,6 +430,12 @@ namespace BeWo
showEmployeeSignature = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, SettingsKeys.ShowMultipleResourceColors);
if(val != null && val.Equals("1"))
{
showMultipleResourceColors = true;
}
switch (_Mandator.BeWoClientType)
{
case 1:
@@ -523,7 +530,7 @@ namespace BeWo
AppSettings.DontShowSpitzabrechnung = dontShowSpitzabrechnung;
AppSettings.ShowDienstplanung = showDienstplanung;
AppSettings.ShowEmployeeSignature = showEmployeeSignature;
AppSettings.ShowMultipleResourceColors = showMultipleResourceColors;
BS.Shared.Settings.ApplicationSettings.SupportConceptExpirationLimitInMonths = AppSettings.HilfeplanAuslaufAuswahl;
}

View File

@@ -356,6 +356,8 @@ namespace BeWo.Core.Config
public bool PrinterSettingsUseMargins { get; set; }
public bool ShowMultipleResourceColors { get; set; }
public bool ShowPivotGrid { get; set; }
public string ExpandedAdministrationItems { get; set; }

View File

@@ -151,7 +151,7 @@
</DataTemplate>
<!--Endregion-->
<!-- Region Horizontal -->
<!-- Region Horizontal (Monatsanzeige, etc.) -->
<!-- HorizontalAppointmentTemplate -->
<ControlTemplate x:Key="{dxscht:SchedulerViewThemeKey ResourceKey=HorizontalAppointmentTemplate, IsThemeIndependent=true}"
TargetType="{x:Type dxschint:VisualHorizontalAppointmentControl}">
@@ -211,6 +211,7 @@
</Border.Background>
</Border>
<Border SnapsToDevicePixels="True" Background="Transparent" Grid.Column="1" />
<!-- TODO: Mehrere Farben für Ressourcen anzeigen -->
<Border Width="10" CornerRadius="0,4,4,0" HorizontalAlignment="Right" SnapsToDevicePixels="True" Grid.Column="2">
<Border.Background>
<MultiBinding Converter="{StaticResource DickbuttConverter}">

View File

@@ -2909,18 +2909,35 @@ namespace BeWo.Scheduler.View
switch(farbKollektion.Count)
{
case 1:
var first = aptResources.FirstOrDefault();
if (BeWoApp.AppSettings.ShowMultipleResourceColors)
{
AddResourceColors(gradientCollection, aptResources, false);
}
else
{
var first = aptResources.FirstOrDefault();
gradientCollection.Add(first != null ? new GradientStop((Color) (ColorConverter.ConvertFromString(first.Color) ?? Color.FromRgb(4, 180, 208)), 1) : new GradientStop(farbKollektion[0], 1));
gradientCollection.Add(first != null ? new GradientStop((Color)(ColorConverter.ConvertFromString(first.Color) ?? Color.FromRgb(4, 180, 208)), 1) : new GradientStop(farbKollektion[0], 1));
}
break;
case 2:
// 1. Klientenfarbe
gradientCollection.Add(new GradientStop(farbKollektion[0], 0.5));
var first2 = aptResources.FirstOrDefault();
if(first2 != null)
// 2. Resourcenfarben
if(BeWoApp.AppSettings.ShowMultipleResourceColors)
{
gradientCollection.Add(new GradientStop((Color) (ColorConverter.ConvertFromString(first2.Color) ?? Color.FromRgb(4, 180, 208)), 0.5));
AddResourceColors(gradientCollection, aptResources, true);
}
else
{
var first2 = aptResources.FirstOrDefault();
if (first2 != null)
{
gradientCollection.Add(new GradientStop((Color)(ColorConverter.ConvertFromString(first2.Color) ?? Color.FromRgb(4, 180, 208)), 0.5));
}
}
break;
@@ -2941,6 +2958,43 @@ namespace BeWo.Scheduler.View
{
throw new NotImplementedException();
}
private static void AddResourceColors(GradientStopCollection gradientCollection, IReadOnlyList<ResourceDC> resourceList, bool hasCustomers)
{
var previousOffset = hasCustomers ? 0.5 : 0;
var numberOfResources = resourceList.Count;
if(numberOfResources == 0)
{
return;
}
if(numberOfResources > 4)
{
numberOfResources = 4;
}
var iterator = hasCustomers == false ? 1d / numberOfResources : previousOffset / numberOfResources;
for(var i = 0; i < numberOfResources; i++)
{
var resource = resourceList[i];
var currentOffset = previousOffset;
var nextOffset = currentOffset + iterator;
if(nextOffset > 1)
{
nextOffset = 1;
}
previousOffset = nextOffset;
gradientCollection.Add(new GradientStop((Color)(ColorConverter.ConvertFromString(resource.Color) ?? Color.FromRgb(4, 180, 208)), currentOffset));
gradientCollection.Add(new GradientStop((Color)(ColorConverter.ConvertFromString(resource.Color) ?? Color.FromRgb(4, 180, 208)), nextOffset));
}
}
}
public class AppointmentBorderZusageConverter : IValueConverter

View File

@@ -553,12 +553,15 @@ namespace BeWoPlanerMobil.Controllers
var statisticPeriod = new StatisticPeriod();
statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Bewilligungszeitraum:", "Gesamt"));
statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Geleistet diese Woche/gesamt:", $"{provided:0.00}/{providedTotal:0.00}"));
statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Bewilligt pro Woche/gesamt:", $"{approved:0.00}/{approvedTotal:0.00}"));
statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Frei pro Woche(Ø)/gesamt:", $"{freePerWeek:0.00}/{freePerWeekTotal:0.00}"));
if(supportConceptStatistics.PeriodStatistics.Count != 1)
{
statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Bewilligungszeitraum:", "Gesamt"));
statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Geleistet diese Woche/gesamt:", $"{provided:0.00}/{providedTotal:0.00}"));
statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Bewilligt pro Woche/gesamt:", $"{approved:0.00}/{approvedTotal:0.00}"));
statisticPeriod.Header2Values.AddIfNotIn(new Header2Values("Frei pro Woche(Ø)/gesamt:", $"{freePerWeek:0.00}/{freePerWeekTotal:0.00}"));
supportConceptStatisticsData.StatisticPeriods.Add(statisticPeriod);
supportConceptStatisticsData.StatisticPeriods.Add(statisticPeriod);
}
foreach(var periodStatistics in supportConceptStatistics.PeriodStatistics)
{

View File

@@ -60,6 +60,7 @@
public static string SchedulerViewType => "SchedulerViewType";
public static string SchedulerTimelineViewDayCount => "SchedulerTimelineViewDayCount";
public static string SchedulerDayViewDayCount => "SchedulerDayViewDayCount";
public static string ShowMultipleResourceColors => "ShowMultipleResourceColors";
// Keys Für die Web.config von Host