FaC: ToolTip von Abwesenheiten korrigiert; es wurde bisher ein Tag zu lang angezeigt.

This commit is contained in:
2023-06-12 17:27:53 +02:00
parent 870e46c49c
commit 5a9e9d7319
18 changed files with 263 additions and 80 deletions

View File

@@ -99,6 +99,7 @@
<HintPath>..\Lib\Blacklight.Wpf.Controls.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Charts.v17.1.Core, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v21.1, Version=21.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Pdf.v17.1.Core, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v17.1.Core, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
@@ -126,6 +127,7 @@
<Reference Include="DevExpress.Xpf.Themes.Office2010Black.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Themes.Office2013.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpf.Themes.Office2016White.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Xpo.v21.1, Version=21.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraBars.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraEditors.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraPrinting.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
@@ -807,6 +809,7 @@
<DependentUpon>ProxyLoginView.xaml</DependentUpon>
</Compile>
<Compile Include="Scheduler\Converter\AptToServRecsIconVisibilityConverter.cs" />
<Compile Include="Scheduler\Converter\ToolTipTimeConverter.cs" />
<Compile Include="Scheduler\Utils\AppointmentExtensions.cs" />
<Compile Include="Scheduler\Utils\Utils.cs" />
<Compile Include="Scheduler\ViewModel\CustomFieldStorage.cs" />

View File

@@ -0,0 +1,73 @@
using System;
using System.Globalization;
using System.Windows.Data;
using BeWo.Scheduler.ViewModel;
using BS.Shared.Extensions;
using DevExpress.Xpf.Scheduler.Drawing;
using DevExpress.XtraScheduler;
namespace BeWo.Scheduler.Converter
{
public class ToolTipTimeConverter : IMultiValueConverter
{
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;
}
if(values[0] is VisualAppointmentViewInfo visualAppointmentViewInfo && values[1] is TimeInterval timeInterval)
{
if(visualAppointmentViewInfo.CustomViewInfo is CustomFieldCollection customFieldCollection && customFieldCollection[nameof(CustomFieldStorage)] is CustomFieldStorage customFieldStorage)
{
var isAbsenceTime = customFieldStorage.IsAbsenceTime;
var isTask = customFieldStorage.IsTask;
// Bei Abwesenheit einen Tag abziehen
var start = visualAppointmentViewInfo.AppointmentStart;
var end = visualAppointmentViewInfo.AppointmentEnd; // Jahr ist 9999, wenn es in der Datenbank null ist
var noEnd = end.Year == 9999;
if(isAbsenceTime)
{
// Ende kann null sein
// Selber Tag? Hat Ende?
if(noEnd)
{
return start.GetIntervalDescription(end);
}
// Bei ganztägigen Abwesenheiten
if(start.IsTimeZero() && end.IsTimeZero() && end.AddDays(-1) > start)
{
end = end.AddDays(-1);
}
return start.GetIntervalDescription(end);
}
if(isTask)
{
return noEnd ? string.Empty : $"bis {end:dd.MM.yyyy HH:mm}";
}
return start.GetIntervalDescription(end).TrimStart();
}
}
return null;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -28,12 +28,11 @@
<view:NichtNochEinConverter x:Key="NichtNochEinConverter" />
<view:InformationButtonVisibilityConverter x:Key="InformationButtonVisibilityConverter" />
<localSchConv:AptToServRecsIconVisibilityConverter x:Key="AptToServRecsIconVisibilityConverter" />
<localSchConv:ToolTipTimeConverter x:Key="ToolTipTimeConverter" />
<!-- Region Appointment Templates -->
<!-- Region VerticalAppointmentTemplate -->
<ControlTemplate x:Key="{dxscht:SchedulerViewThemeKey ResourceKey=VerticalAppointmentTemplate, IsThemeIndependent=true}" TargetType="{x:Type dxschint:VisualVerticalAppointmentControl}">
<!--<dxschint:AppointmentColorConvertControl x:Name="clrConvCtrl" ControlColor="{TemplateBinding ViewInfo, Converter={StaticResource AppointmentBackgroundConverter}}" SnapsToDevicePixels="True">-->
<!-- TODO: ändern! -->
<dxschint:AppointmentColorConvertControl x:Name="clrConvCtrl" ControlColor="{Binding Path=ViewInfo.CustomViewInfo[CustomFieldStorage].BackgroundColor.GradientStops[0].Color, RelativeSource={RelativeSource TemplatedParent}}" SnapsToDevicePixels="True">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="DraggedStates">
@@ -67,7 +66,8 @@
<Grid x:Name="PART_ToolTipContainer" dxsch:SchedulerControl.HitTestType="AppointmentContent" dxsch:SchedulerControl.SelectableIntervalViewInfo="{TemplateBinding ViewInfo}" Tag="{TemplateBinding ViewInfo}">
<!-- Region AppointmentToolTip -->
<ToolTipService.ToolTip>
<ToolTip Content="{TemplateBinding ViewInfo}" ContentTemplate="{Binding ViewInfo.View.AppointmentToolTipContentTemplate, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"
<ToolTip Content="{TemplateBinding ViewInfo}"
ContentTemplate="{Binding ViewInfo.View.AppointmentToolTipContentTemplate, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding ViewInfo.View.AppointmentToolTipVisibility, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ToolTipVisibilityConverter}}">
</ToolTip>
</ToolTipService.ToolTip>
@@ -147,7 +147,6 @@
<TextBlock Grid.Row="1" Text="{Binding Location}" TextWrapping="Wrap" Margin="6,0,0,3" Foreground="{Binding Path=CustomViewInfo[CustomFieldStorage].ForegroundColor}" />
</Grid>
<dxschint:AppointmentImagesControl Grid.Column="1" Margin="0,0,4,0" ViewInfo="{Binding}" Orientation="Vertical" SnapsToDevicePixels="True" />
<!-- ToDo: Neuen Converter schreiben, der prüft, ob in der Liste ServiceRecords sind -->
<Image Grid.Row="0" Grid.Column="2" Margin="-4,-2,6,0"
Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage], Converter={StaticResource AptToServRecsIconVisibilityConverter}}" Source="/BeWoPlaner;component/Ressources/Icons/HistoryDisabled.png"
SnapsToDevicePixels="True" Height="20" Width="20" VerticalAlignment="Top" />
@@ -190,8 +189,9 @@
</dxschint:AppointmentColorConvertControl.BaseBrushColors>
<Grid x:Name="PART_ToolTipContainer" dxsch:SchedulerControl.HitTestType="AppointmentContent" dxsch:SchedulerControl.SelectableIntervalViewInfo="{TemplateBinding ViewInfo}">
<ToolTipService.ToolTip>
<ToolTip Content="{TemplateBinding ViewInfo}" ContentTemplate="{Binding ViewInfo.View.AppointmentToolTipContentTemplate, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding ViewInfo.View.AppointmentToolTipVisibility, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ToolTipVisibilityConverter}}">
<ToolTip Content="{TemplateBinding ViewInfo}"
ContentTemplate="{Binding ViewInfo.View.AppointmentToolTipContentTemplate, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding ViewInfo.View.AppointmentToolTipVisibility, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ToolTipVisibilityConverter}}">
</ToolTip>
</ToolTipService.ToolTip>
<dxschint:AppointmentBorder x:Name="back" DefaultCornerRadius="4" Opacity="1" ViewInfo="{TemplateBinding ViewInfo}"
@@ -336,12 +336,18 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Orientation="Horizontal" Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].ToolTipTimeVisibility}">
<TextBlock Text="{Binding Path=StartTimeText}" />
<TextBlock Text=" - " />
<TextBlock Text="{Binding Path=EndTimeText}" />
<TextBlock Text=" Uhr" Margin="0,0,4,0" />
</StackPanel>
<StackPanel Grid.Column="0"
Orientation="Horizontal"
Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].ToolTipTimeVisibility}">
<TextBlock Margin="0,0,4,0">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource ToolTipTimeConverter}">
<Binding />
<Binding Path="FetchingInterval" RelativeSource="{RelativeSource AncestorType={x:Type view:NewSchedulerView}}" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
<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

@@ -2002,6 +2002,8 @@ namespace BeWo.Scheduler.View
private bool _ReloadingViewModel;
private DateTime? _LastFetchingDateTime;
public TimeInterval FetchingInterval { get; set; }
private void ReloadVM(bool shouldForceReload = false)
{
if(_ReloadingViewModel)
@@ -2021,7 +2023,7 @@ namespace BeWo.Scheduler.View
var start = range.Start;
var end = range.End;
var newFetchingInterval = new TimeInterval(start - FetchPadding, end + FetchPadding);
FetchingInterval = new TimeInterval(start - FetchPadding, end + FetchPadding);
var selectedEmployeeOids = SelectedEmployees.Select(s => s.EmployeeOid).ToList();
var selectedCustomerOids = SelectedCustomers.Select(s => s.CustomerOid).ToList();
@@ -2033,13 +2035,13 @@ namespace BeWo.Scheduler.View
var showOnlyMyAppointments = ZeigeNurMeineTermine;
var showAbsenceTimes = AbwesenheitenEinAusCheckBox.IsChecked != null && AbwesenheitenEinAusCheckBox.IsChecked.Value;
if(!shouldForceReload && newFetchingInterval.Equals(_LastFetchedInterval))
if(!shouldForceReload && FetchingInterval.Equals(_LastFetchedInterval))
{
_ReloadingViewModel = false;
return;
}
_LastFetchedInterval = newFetchingInterval;
_LastFetchedInterval = FetchingInterval;
ReloadAppointmentViewModel(start, end, selectedEmployeeOids, selectedCustomerOids, selectedResourceOids, employeesOnly, customersOnly, resourcesOnly, onlyPrivateAppointments, showOnlyMyAppointments, showAbsenceTimes);
}
@@ -2906,7 +2908,7 @@ namespace BeWo.Scheduler.View
{
var customFields = (CustomFieldCollection) value;
if(customFields == null)
if(customFields is null)
{
return string.Empty;
}
@@ -2919,7 +2921,7 @@ namespace BeWo.Scheduler.View
var tooltip = string.Empty;
var seperator = "; ";
if(parameter == null)
if(parameter is null)
{
return tooltip;
}

View File

@@ -31,12 +31,24 @@ namespace BeWo.Scheduler.ViewModel
}
}
if(IsAbsenceTime && _AbsenceTimeStart.HasValue)
if(!IsAbsenceTime || !_AbsenceTimeStart.HasValue)
{
result += _AbsenceTimeStart.Value.GetIntervalDescription(_AbsenceTimeEnd);
return result;
}
return result;
var absenceTimeEnd = _AbsenceTimeEnd;
if(absenceTimeEnd.HasValue)
{
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);
}
}

View File

@@ -24,14 +24,16 @@ namespace BeWo.Scheduler.ViewModel
get => _ActiveAppointmentViewModel;
set
{
if(value != null)
{
if(value is null)
{
_ActiveAppointmentViewModel = value;
ViewModelChanged?.Invoke(this, new EventArgs<ISchedulerViewModel>(value));
return;
}
}
_ActiveAppointmentViewModel = value;
ViewModelChanged?.Invoke(this, new EventArgs<ISchedulerViewModel>(value));
}
}
public AbstractAppointmentEditForm GetEditAppointmentForm(DevExpress.Xpf.Scheduler.SchedulerControl control, Appointment appointment)
@@ -53,7 +55,7 @@ namespace BeWo.Scheduler.ViewModel
public SchedulerSettings GetActiveSettings()
{
return ActiveAppointmentViewModel == null ? null : SchedulerSettings ?? ActiveAppointmentViewModel.GetDefaultSchedulerSettings();
return ActiveAppointmentViewModel is null ? null : SchedulerSettings ?? ActiveAppointmentViewModel.GetDefaultSchedulerSettings();
}
public IEnumerable<SchedulerAppointmentVM> ConvertAbsenceTimesToAppointments(IEnumerable<AbsenceTimeDC> pAbsenceTimes, DateTime pIntervalEnd, List<CompactEmployeeDC> allEmployees, List<CompactCustomerDC> allCustomers)
@@ -79,8 +81,36 @@ namespace BeWo.Scheduler.ViewModel
subject += $" ({dc.SimpleDescription})";
}
var absenceTimeEnd = abwesenheit.End?.AddTicks(1);
var absenceTimeEnd = abwesenheit.End;
// Ist nicht genau
if(abwesenheit.End.HasValue)
{
var allDay = abwesenheit.Start.Value.Hour == 0 && abwesenheit.Start.Value.Minute == 0 && abwesenheit.Start.Value.Second == 0 &&
abwesenheit.End.Value.Hour == 0 && abwesenheit.End.Value.Minute == 0 && abwesenheit.End.Value.Second == 0;
var end = abwesenheit.End.Value;
var isMultipleDayAbsenceTime = abwesenheit.End is null || abwesenheit.Start.Value.Date != abwesenheit.End.Value.Date;
if(isMultipleDayAbsenceTime && allDay)
{
absenceTimeEnd = end.AddDays(1);
}
// Wenn die Abwesenheit über mehrere Tage geht, muss ein Tag draufaddiert werden
//if(end.Hour == 0 && end.Minute == 0 && end.Second == 0)
//{
// absenceTimeEnd = end.AddSeconds(1);
//}
//else
//{
// absenceTimeEnd = end.AddTicks(1);
//}
}
if(originator is null)
{
originator = BeWoApp.CompactLoggedOnEmployee;
@@ -89,8 +119,8 @@ namespace BeWo.Scheduler.ViewModel
return new SchedulerAppointmentVM(
true,
subject,
abwesenheit.Start.Value,
abwesenheit.End ?? pIntervalEnd,
abwesenheit.Start.Value,
absenceTimeEnd ?? pIntervalEnd,
originator,
abwesenheit.Start,
absenceTimeEnd,

View File

@@ -36,7 +36,7 @@
<SQLDebugging>False</SQLDebugging>
<ExternalProgram>
</ExternalProgram>
<StartExternalURL>http://localhost/BeWoPlanerMobil/Main/Main</StartExternalURL>
<StartExternalURL>http://localhost/BeWoPlanerMobil/Login/demo</StartExternalURL>
<StartCmdLineArguments>
</StartCmdLineArguments>
<StartWorkingDirectory>

View File

@@ -401,7 +401,6 @@ namespace BeWoPlanerMobil.Controllers
[HttpPost]
public ActionResult DeleteMedListFromHistoryList(FormCollection formCollection)
{
// ToDo: Nachfragen, ob gelöscht werden soll
if(long.TryParse(formCollection["med-list-oid"], out var medListOid))
{
Model.SelectedReportType = CustomerReportType.Historie;

View File

@@ -949,6 +949,12 @@ namespace BeWoPlanerMobil.Controllers
int.TryParse(collection[FormCollectionConstants.DurationKey], out dauer);
}
// Wenn die Dauer in Stunden ist
if(Model.SelectedDurationUnit == "Stunden" || Model.EinheitZeiterfassung == 1)
{
dauer *= 60;
}
var doku2 = collection[FormCollectionConstants.Dokumentation2Key]?.RemoveUppercaseEsszett();
var doku3 = collection[FormCollectionConstants.Dokumentation3Key]?.RemoveUppercaseEsszett();
var doku4 = collection[FormCollectionConstants.Dokumentation4Key]?.RemoveUppercaseEsszett();

View File

@@ -47,6 +47,11 @@ namespace BeWoPlanerMobil.Controllers
public ActionResult ReportViewer()
{
if(Model is null)
{
return Logout();
}
Model.Report = null;
var month = DateTime.Today.Month;

View File

@@ -246,7 +246,7 @@ namespace BeWoPlanerMobil.Models
var allCostBearerRelations = new List<SupportConceptListObject> {new SupportConceptListObject("Hilfeplan auswählen", "", "-1", false, false), new SupportConceptListObject("Ohne Hilfeplan", "", "-2", false, false) };
foreach(var sc in SupportConcepts.OrderBy(sc => sc.Customer.LastName))
{
allCostBearerRelations.AddRange(sc.CostBearerRelations.Where(w => ShowExpiredSupportConcepts || w.EndDate == null || w.EndDate.Value >= DateTime.Now.Date).Select(
allCostBearerRelations.AddRange(sc.CostBearerRelations.Where(w => ShowExpiredSupportConcepts || w.EndDate is null || w.EndDate.Value >= DateTime.Now.Date).Select(
cb => new SupportConceptListObject(
$"{sc.Customer.LastNameFirstName} {(sc.Customer.DateOfBirth.HasValue ? "*" + sc.Customer.DateOfBirth.Value.ToString("dd.MM.yyyy") : string.Empty)}",
$"{cb.StartDate?.ToShortDateString().Remove(6, 2) ?? string.Empty}-{cb.EndDate?.ToShortDateString().Remove(6, 2) ?? string.Empty} {cb.CostBearer.Name}{GetIsNotApproved(cb)}",

View File

@@ -84,6 +84,7 @@ function onDurationChange(startTimeId, endTimeId, startDateId, endDateId, durati
}
}
// ToDo: Erst Dauer, dann Start- oder Endzeit führt dazu, dass die Dauer in Stunden benutzt wird!
function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTimeId, durationId, hoursMinutesDropdownBtnId, startDatePickerId, endDatePickerId, isInvokedByStartElement, isInvokedByEndElement) {
var startTime = $("#" + startTimeId).val();
var endTime = $("#" + endTimeId).val();
@@ -98,23 +99,30 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
isInMin = hoursMinutesDropdownButton.text().replaceAll(/\s/g, "") === "Minuten";
}
logInfo2("calculateDuration aufgerufen:\r\n" +
"isInvocatedByHoursMinutesButton: " + isInvocatedByHoursMinutesButton + "\r\n" +
"isInvokedByStartElement: " + isInvokedByStartElement + "\r\n" +
"isInvokedByEndElement: " + isInvokedByEndElement + "\r\n" +
"Format der Dauer: " + (isInMin ? "Minuten" : "Stunden"));
var durationFormat = isInMin ? "m" : "h";
if((startTime.length > 0 && startTime.length < 5) || (endTime.length > 0 && endTime.length < 5)) {
return;
}
var startTimeCondition = startTime !== undefined && startTime !== null && startTime.length > 0;
var endTimeCondition = endTime !== undefined && endTime !== null && endTime.length > 0;
var isStartTimeValid = startTime !== undefined && startTime !== null && startTime.length > 0;
var isEndTimeValid = endTime !== undefined && endTime !== null && endTime.length > 0;
var durationNumber = parseFloat(duration.replace(",", "."));
var durationCondition = !isNaN(durationNumber);
var isDurationValid = !isNaN(durationNumber);
var startDateString = $("#" + startDatePickerId).datetimepicker("date");
var endDate = moment(new Date());
var startDate = moment(new Date());
// Das Startdatum hat einen Wert
if(startDateString !== null && startDateString.length !== 0) {
startDate = moment(startDateString);
endDate = startDate.clone();
@@ -123,7 +131,7 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
// Es gibt ein Enddatumsfeld
if($("#" + endDatePickerId).length !== 0) {
var endDateString = $("#" + endDatePickerId).datetimepicker("date");
// Das Enddatum hat einen Wert
if(endDateString !== null && endDateString.length !== 0) {
endDate = moment(endDateString);
}
@@ -132,7 +140,7 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
var newDurationValue = 0;
// Start- und Enddatum sind vorhanden und das Event wurde nicht vom Stunden/Minuten-Dropdown aufgerufen
if(startTimeCondition && endTimeCondition && isInvocatedByHoursMinutesButton === false) {
if(isStartTimeValid && isEndTimeValid && isInvocatedByHoursMinutesButton === false) {
var startHHmm = parseTimeInputToIntegerArray(startTime);
var endHHmm = parseTimeInputToIntegerArray(endTime);
@@ -165,22 +173,29 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
$("#" + durationId).val(newDurationValue);
// Startdatum und Dauer sind vorhanden
} else if(startTimeCondition && durationCondition) {
if (hoursMinutesDropdownButton.length) {
} else if(isStartTimeValid && isDurationValid) {
if (isInvocatedByHoursMinutesButton) {
durationNumber = isInMin ? durationNumber *= 60 : durationNumber /= 60;
$("#" + durationId).val(durationNumber);
}
calculateTimeWithDuration(startTime, $("#" + endTimeId), startDate, durationNumber, hoursMinutesDropdownBtnId);
// Enddatum und Dauer sind vorhanden
} else if(endTimeCondition && durationCondition) {
if (hoursMinutesDropdownButton.length) {
} else if(isEndTimeValid && isDurationValid) {
if (isInvocatedByHoursMinutesButton) {
durationNumber = isInMin ? durationNumber *= 60 : durationNumber /= 60;
$("#" + durationId).val(durationNumber);
}
calculateTimeWithDuration(endTime, $("#" + startTimeId), startDate, durationNumber * -1, hoursMinutesDropdownBtnId);
} else if (isInvocatedByHoursMinutesButton) {
// Wurde von Min zu Std oder Std zu Min
if (isInvocatedByHoursMinutesButton && isDurationValid) {
// Das jetzige Format ist das Gegenteil des vorherigen
// Ist es jetzt Minuten, war es vorher Stunden; es muss also mit 60 multipliziert werden.
// Ist es jetzt Stunden, war es vorher Minuten; es muss also durch 60 geteilt werden.
durationNumber = isInMin ? durationNumber * 60 : durationNumber / 60;
$("#" + durationId).val(durationNumber);
}
}
}

View File

@@ -82,20 +82,16 @@
function changeReportTypeSelection() {
try {
var selectedReportType = $("#report-type-select").find(":selected").val();
var medListReportConteiner = $("#med-list-report-container");
var historyList = $("#med-list-history-list");
$("#show-med-list-btn").prop("disabled", selectedReportType === "2");
if (selectedReportType !== "2") {
historyList.hide();
//medListReportConteiner.show();
return;
}
historyList.removeClass("d-none");
//medListReportConteiner.hide();
historyList.show();
} catch (error) {
showErrorPopup(error);
@@ -112,11 +108,13 @@
}
}
function deleteHistoryMedList(oid) {
function deleteHistoryMedList(oid, name) {
try {
showSpinner();
$("#med-list-oid-delete").val(oid);
$("#delete-history-med-list").submit();
showMessagePopupWithCallback("Löschen","Sind Sie sicher, dass Sie die " + name + " löschen wollen?", function() {
showSpinner();
$("#med-list-oid-delete").val(oid);
$("#delete-history-med-list").submit();
});
} catch (error) {
showErrorPopup(error);
}
@@ -150,8 +148,6 @@
</div>
<div class="container-fluid mt-3">
@Html.Partial("CustomerReportPartial", Model)
@if(Model?.SelectedJsonCustomer != null)
{
using(Html.BeginForm("UpdateCustomer", "Customer", FormMethod.Post, new { id = "stammdaten-form", @class = "needs-validation", novalidate = "novalidate" }))
@@ -743,6 +739,7 @@
@foreach(var list in Model.SelectedCustomer.Medikamentenverordnungslisten.Where(w => !w.Gueltig))
{
var listName = $"{(list.MedListType ? "Medikamentenverordnungsliste" : "Bedarfsmedikamentenverordnungsliste")} vom {list.ErstellDatum}";
var name = $"{listName} von {list.Ersteller}";
<tr>
<td class="px-0">
@listName
@@ -754,7 +751,7 @@
<button type="button" class="btn btn-primary" onclick="viewHistoryMedList(@list.MedikamentenverordnungslistenOid)">
<i class="far fa-eye"></i>
</button>
<button type="button" class="btn btn-bewo-service-records" onclick="deleteHistoryMedList(@list.MedikamentenverordnungslistenOid)">
<button type="button" class="btn btn-bewo-service-records" onclick="deleteHistoryMedList(@list.MedikamentenverordnungslistenOid, @name)">
<i class="fas fa-trash-alt"></i>
</button>
</td>
@@ -764,11 +761,11 @@
</table>
}
@*@if(!(Model.Report is null))
{
// ToDo: Ist viel zu hoch auf kleinen Bildschirmen!*@
@Html.Partial("CustomerReportPartial", Model)
@*}*@
@if(!(Model.Report is null))
{
// ToDo: Ist viel zu hoch auf kleinen Bildschirmen!
@Html.Partial("CustomerReportPartial", Model)
}
</div>
</div>
</div>

View File

@@ -10,6 +10,5 @@
settings.MobileMode = true;
settings.SettingsMobile.ReaderMode = true;
settings.SettingsMobile.AnimationEnabled = false;
settings.Height= Unit.Percentage(100);
}).Bind(Model.Report).Render();
}

View File

@@ -1,10 +1,36 @@
@model BeWoPlanerMobil.Models.ReportViewerModel
<script type="text/javascript">
function objectToString(obj) {
try {
var str = '';
for (var p in obj) {
if (Object.prototype.hasOwnProperty.call(obj, p)) {
str += p + '::' + obj[p] + '\n';
}
}
return str;
} catch (error) {
showErrorPopup(error);
return null;
}
}
function initEvent(s, e) {
// ToDo: Höhe des containers anpassen?
var container = $("#msk-report-container");
logInfo3(objectToString(s));
}
</script>
@Html.DevExpress().WebDocumentViewer(settings =>
{
settings.MobileMode = true;
settings.Name = "webDocumentViewer1";
settings.SettingsMobile.ReaderMode = true;
settings.Height = Unit.Percentage(100);
settings.ClientSideEvents.Init = "initEvent";
}).Bind(Model.Report).GetHtml()

View File

@@ -47,7 +47,7 @@
}
</script>
<div class="container-fluid my-3">
<div class="container-fluid my-3 bg-secondary">
<div class="row">
<div class="col-sm-12 col-md-4 col-lg-4 col-xl-3">
<div class="row">
@@ -62,12 +62,18 @@
</div>
</div>
</div>
<div class="col-sm-12 col-md-8 col-lg-8 col-xl-9" id="msk-report-container">
@*
ToDo: Hier am Montag weitermachen! Die Spalte ist viel zu klein!
*@
<div class="col-sm-12 col-md-8 col-lg-8 col-xl-9 h-auto" id="msk-report-container">
@if(!(Model.Report is null))
{
@Html.Partial("DocumentWebViewerPartial", Model)
}
else if(Html.IsInDebugMode())
{
<h5 class="text-warning">Kein Report vorhanden</h5>
}
</div>
</div>
</div>

View File

@@ -2688,19 +2688,23 @@ namespace BeWo.Service.ServiceImplementations
var employees = DAOFactory.SearchDAO.GetAllActiveEmployeesForEmployee(employeeOid);
var employeeOids = employees.Where(employee => employee.Oid.HasValue).Select(employee => employee.Oid.Value).ToList();
employeeOids = employeeOids.Where(oid => selectedEmployeeOids.Contains(oid)).ToList();
employeeOids = employeeOids.Where(selectedEmployeeOids.Contains).ToList();
var absenceTimes = DAOFactory.SearchDAO.GetAllEmployeeAbsenceTimesInIntervalForEmployee(start, end, employeeOids);
var dcList = MapperFactory.AbsenceTimeDC_AbsenceTime.MapToNewDCs(absenceTimes);
foreach(var at in dcList)
{
if(at.End.HasValue)
{
at.End = at.End.Value.Date.AddDays(1).AddTicks(-1);
}
}
//foreach(var at in dcList)
//{
// // Das betrifft doch nur ganztägige Abwesenheiten
// if(at.End.HasValue)
// {
// if(at.End.Value.Hour == 0 && at.End.Value.Minute == 0 && at.End.Value.Second == 0)
// {
// at.End = at.End.Value.Date.AddDays(1).AddTicks(-1);
// }
// }
//}
return dcList.OrderBy(a => a.Start).ToList();
}

View File

@@ -512,12 +512,12 @@ namespace BS.Shared.Extensions
{
var result = string.Empty;
var isAllDay = start.IsTimeZero() && (end == null || end.Value.IsTimeZero());
var isAllDay = start.IsTimeZero() && (end is null || end.Value.IsTimeZero());
var endTimeHasValue = end.HasValue;
if (isAllDay)
if(isAllDay)
{
if (endTimeHasValue)
if(endTimeHasValue)
{
if (start.Date.Equals(end.Value.Date))
{
@@ -535,9 +535,9 @@ namespace BS.Shared.Extensions
}
else
{
if (endTimeHasValue)
if(endTimeHasValue)
{
if (start.Date.Equals(end.Value.Date))
if(start.Date.Equals(end.Value.Date))
{
result += $" {start:dd.MM.yyyy HH:mm} - {end.Value:HH:mm}";
}