Merge branch 'master' of ssh://float.ownsoft.de/git/beyondSoft/BeWo into master

This commit is contained in:
2023-02-24 08:22:18 +01:00
30 changed files with 1631 additions and 1033 deletions

View File

@@ -145,9 +145,11 @@
<TextBlock Grid.Row="0" Text="{Binding Subject}" TextWrapping="NoWrap" Margin="6,0,0,3" Foreground="{Binding Path=CustomViewInfo[CustomFieldStorage].ForegroundColor}" />
<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" ViewInfo="{Binding}" Orientation="Vertical" SnapsToDevicePixels="True" />
<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" Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].ServiceRecordList, Converter={StaticResource AptToServRecsIconVisibilityConverter}}" Source="/BeWoPlaner;component/Ressources/Icons/HistoryDisabled.png" SnapsToDevicePixels="True" Height="20" Width="20" VerticalAlignment="Top" />
<Image Grid.Row="0" Grid.Column="2" Margin="-4,-2,6,0"
Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].ServiceRecordList, Converter={StaticResource AptToServRecsIconVisibilityConverter}}" Source="/BeWoPlaner;component/Ressources/Icons/HistoryDisabled.png"
SnapsToDevicePixels="True" Height="20" Width="20" VerticalAlignment="Top" />
</Grid>
</DataTemplate>
<!--Endregion-->
@@ -188,7 +190,7 @@
<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}}">
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}"
@@ -259,6 +261,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -272,7 +275,11 @@
dxschint:VerticalAppointmentContentPanel.AlwaysOnNewRow="True" TextWrapping="Wrap" Margin="11,6,0,0"
Foreground="{Binding Path=CustomViewInfo[CustomFieldStorage].ForegroundColor}" />
<dxschint:AppointmentImagesControl Grid.Row="0" Grid.Column="4" Margin="0,4,10,0" ViewInfo="{Binding}" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" />
<dxschint:AppointmentImagesControl Grid.Row="0" Grid.Column="4" Margin="0,4,10,0" ViewInfo="{Binding}"
Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" />
<Image Grid.Row="0" Grid.Column="5" Margin="0,4,10,0"
Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].ServiceRecordList, Converter={StaticResource AptToServRecsIconVisibilityConverter}}"
Source="/BeWoPlaner;component/Ressources/Icons/HistoryDisabled.png" SnapsToDevicePixels="True" Height="20" Width="20" VerticalAlignment="Top" />
</Grid>
</dxschint:HorizontalAppointmentContentPanel>
</DataTemplate>
@@ -284,6 +291,7 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center">
<dxschint:AppointmentContinueStartDateControl ViewInfo="{Binding}" Margin="12, 4, 0, 2" Foreground="{Binding Path=CustomViewInfo[CustomFieldStorage].ForegroundColor}" VerticalAlignment="Center" />
@@ -292,12 +300,15 @@
<dxschint:HorizontalAppointmentContentPanel Grid.Column="1" ClipToBounds="True" VerticalAlignment="Center" Margin="2,0,2,0">
<dxschint:AppointmentImagesControl HorizontalAlignment="Center" ViewInfo="{Binding}" Orientation="Horizontal" />
<TextBlock Text="{Binding Subject}" VerticalAlignment="Center" TextWrapping="Wrap" Foreground="{Binding Path=CustomViewInfo[CustomFieldStorage].ForegroundColor}" Margin="8, 2, 0, 0" />
</dxschint:HorizontalAppointmentContentPanel>
</dxschint:HorizontalAppointmentContentPanel>
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
<dxschint:HorizontalAppointmentEndClockControl ViewInfo="{Binding}" Margin="0, 4, 12, 2" VerticalAlignment="Center" />
<dxschint:AppointmentContinueEndDateControl ViewInfo="{Binding}" Margin="0, 4, 12, 2" Foreground="{Binding Path=CustomViewInfo[CustomFieldStorage].ForegroundColor}" VerticalAlignment="Center" />
</StackPanel>
</Grid>
<Image Grid.Column="3" Grid.Row="0" Margin="0,0,4,0"
Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].ServiceRecordList, Converter={StaticResource AptToServRecsIconVisibilityConverter}}"
Source="/BeWoPlaner;component/Ressources/Icons/HistoryDisabled.png" SnapsToDevicePixels="True" Height="17" Width="17" VerticalAlignment="Center" />
</Grid>
</DataTemplate>
<!-- Endregion-->

View File

@@ -343,6 +343,7 @@ namespace BeWo.Scheduler.ViewModel
vm.TaskDescription = app.CF_TaskDescription();
vm.SupportConceptList = app.CF_SupportConceptList();
vm.HasServiceRecordEntry = app.CF_HasServiceRecordEntry();
vm.ServiceRecordList = app.CF_ServiceRecordList();
if(vm.IsTask)
{

View File

@@ -477,6 +477,8 @@ namespace BeWo.View
Login _login = new Login(kundennummer, "kihqx-PiGka", "cb", "bewo", "0b50c09aff87f20d9ced75340e04e5ccaa11dd3e7bcf25e9c4f94dc20d3cbb97");
_login = new Login("4368658436", "B7x0b-FhhJA", "jettenl", "n8-yR+3Q=6nX#", "0000");
var x1 = _login.AnmeldevorgangDurchFuehren();
ServiceChatView = new ChatView(x1);

View File

@@ -153,13 +153,10 @@ namespace BeWo.ownChat
stringBuilder.Append($"{m.SendTime:dd.MM.yyyy HH:mm} - {m.Username}: {m.UserMessage}");
}
var utf8 = Encoding.UTF8;
var encodedBytes = utf8.GetBytes(stringBuilder.ToString());
var convertedBytes = Encoding.Convert(Encoding.UTF8, Encoding.ASCII, encodedBytes);
var ascii = Encoding.ASCII;
var finalString = stringBuilder.ToString();
finalString = finalString.Replace("ẞ", "ß");
var finalString = ascii.GetString(convertedBytes);
var firstTime = messages.Min(r =>
{
var dt = r.SendTime;

View File

@@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<ProjectView>ShowAllFiles</ProjectView>
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>

View File

@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Web.Mvc;
using System.Web.Security;
using BeWo.Service.ServiceContracts;
@@ -22,7 +23,7 @@ namespace BeWoPlanerMobil.Controllers
protected readonly IDownloadService DownloadService = new MobileSessionFacade().DownloadService;
protected readonly IReportService ReportService = new MobileSessionFacade().ReportService;
protected const string _LeerzeichenFuerGetMethoden = " ";
protected const string LeerzeichenFuerGetMethoden = " ";
protected static readonly log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
@@ -31,7 +32,11 @@ namespace BeWoPlanerMobil.Controllers
protected ActionResult Logout()
{
MobileSessionFacade.LogUserOut();
#if DEBUG
Debug.WriteLine($"+++>Logout aufrufende Methode: {(new StackTrace()).GetFrame(1).GetMethod().Name}");
#endif
MobileSessionFacade.LogUserOut();
FormsAuthentication.SignOut();
AbstractModel.TimeOfLastAction = null;

View File

@@ -8,6 +8,7 @@ using BeWoPlanerMobil.Service;
using BeWoPlanerMobil.Util;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using DevExpress.XtraReports.UI;
@@ -86,6 +87,8 @@ namespace BeWoPlanerMobil.Controllers
Model.Customers = new List<CompactCustomerDC>();
}
// ReportTypes laden! Erstmal nur Medikamentenansicht
if(AbstractModel.IsAllowedToSeeMedikamentenliste)
{
@@ -187,7 +190,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model == null || !MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer"))
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var isAllowedToEdit = MobileSessionFacade.LoggedInUser.CheckForAtLeastOneRight(new List<UserRightType> { UserRightType.CustomerView_Edit, UserRightType.EditAll });
@@ -200,7 +203,7 @@ namespace BeWoPlanerMobil.Controllers
Model.SelectedCustomer = CustomerService.LoadCustomer(customerOid);
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -246,6 +249,108 @@ namespace BeWoPlanerMobil.Controllers
}
}
}
public ActionResult UpdateCustomer(FormCollection formCollection)
{
if(Model is null)
{
return Logout();
}
// ToDo: Stammdaten aus formCollection holen, validieren und Customer-Objekt aktualisieren.
var firstname = formCollection["vorname"];
var lastname = formCollection["nachname"];
var geburtdatum = formCollection["geburtstag"];
var geschlecht = formCollection["geschlecht"];
var adresszusatz = formCollection["adresszusatz"];
var street = formCollection["strasse"];
var postalCode = formCollection["plz"];
var city = formCollection["ort"];
var nameInvoiceAddress = formCollection["name-rechnungsadresse"];
var streetInvoiceAddress = formCollection["strasse-rechnungsadresse"];
var postalCodeInvoiceAddress = formCollection["plz-rechnungsadresse"];
var cityInvoiceAddress = formCollection["ort-rechnungsadresse"];
var mobile = formCollection["handy"];
var phone = formCollection["telefon"];
var fax = formCollection["fax"];
var eMailAddress = formCollection["mail"];
var notice = formCollection["notiz"];
var customer = Model.SelectedCustomer;
if(customer is null)
{
return RedirectToActionPermanent("Customer");
}
customer.FirstName = firstname;
customer.LastName = lastname;
if(DateTime.TryParse(geburtdatum, out var dateOfBirth))
{
customer.DateOfBirth = dateOfBirth;
}
if(int.TryParse(geschlecht, out var sexIndex))
{
var castSex = sexIndex >= 0 ? (Sex?)sexIndex : null;
customer.Sex = castSex;
}
customer.AddressLine1 = adresszusatz;
customer.Street = street;
customer.PostalCode = postalCode;
customer.Town = city;
customer.InvoiceAddressLine1 = nameInvoiceAddress;
customer.InvoiceAddressStreet = streetInvoiceAddress;
customer.InvoiceAddressPostalCode = postalCodeInvoiceAddress;
customer.InvoiceAddressTown = cityInvoiceAddress;
var mobileContactInfo = customer.ContactInformations.FirstOrDefault(contactInformation => contactInformation.ContactType == ContactType.business_MobilePhone) ?? new ContactDC { ContactType = ContactType.business_MobilePhone };
mobileContactInfo.ContactValue = mobile;
if(customer.ContactInformations.All(a => a.ContactType != ContactType.business_MobilePhone))
{
customer.ContactInformations.Add(mobileContactInfo);
}
var phoneContactInfo = customer.ContactInformations.FirstOrDefault(contactInformation => contactInformation.ContactType == ContactType.business_Phone) ?? new ContactDC { ContactType = ContactType.business_Phone };
phoneContactInfo.ContactValue = phone;
if(customer.ContactInformations.All(a => a.ContactType != ContactType.business_Phone))
{
customer.ContactInformations.Add(phoneContactInfo);
}
var faxContactInfo = customer.ContactInformations.FirstOrDefault(contactInformation => contactInformation.ContactType == ContactType.business_Fax) ?? new ContactDC { ContactType = ContactType.business_Fax };
faxContactInfo.ContactValue = fax;
if(customer.ContactInformations.All(a => a.ContactType != ContactType.business_Fax))
{
customer.ContactInformations.Add(faxContactInfo);
}
var eMailContactInfo = customer.ContactInformations.FirstOrDefault(contactInformation => contactInformation.ContactType == ContactType.business_Mail) ?? new ContactDC { ContactType = ContactType.business_Mail };
eMailContactInfo.ContactValue = eMailAddress;
if(customer.ContactInformations.All(a => a.ContactType != ContactType.business_Mail))
{
customer.ContactInformations.Add(eMailContactInfo);
}
customer.Notice = notice;
CustomerService.UpdateCustomer(customer);
return RedirectToActionPermanent("PreselectCustomer", new { customerOid = customer.CustomerOid });
}
}
public enum CustomerReportType

View File

@@ -6,6 +6,7 @@ using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Windows.Forms;
using BeWo.Service.Plugins;
using BeWo.Service.ServiceImplementations;
using BeWo.View.Navigation.Filter;
using BeWoPlanerMobil.Models;
@@ -21,6 +22,7 @@ using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Services;
using Newtonsoft.Json;
using NHibernate.Criterion;
using static BS.Shared.ServiceRecordValidationResult;
using FormCollection = System.Web.Mvc.FormCollection;
using ServiceRecordDC = BS.Shared.DataContracts.ServiceRecordDC;
@@ -98,6 +100,7 @@ namespace BeWoPlanerMobil.Controllers
Model.ShowExpiredSupportConcepts = UserSettingsUtils.GetSettingValueAsBool(userSettings, SettingsKeys.ShowExpiredSupportConcepts);
Model.ShowOnlyOwnSupportConcepts = UserSettingsUtils.GetSettingValueAsBool(userSettings, SettingsKeys.ShowOnlyMySupportConcepts);
Model.IsOnlyYearMonthVisible = UserSettingsUtils.GetSettingValueAsBool(userSettings, SettingsKeys.IsOnlyYearMonthVisible);
InitializeInterval(userSettings);
@@ -289,7 +292,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model is null || ratingTypeOid is null || goalOid is null || !AbstractModel.HasRightToRateGoals)
{
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
if(!Model.IsInGroupBookingMode)
@@ -369,7 +372,7 @@ namespace BeWoPlanerMobil.Controllers
[HttpPost]
public new ActionResult Logout()
{
{
return base.Logout();
}
@@ -515,7 +518,7 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var isLoaded = false;
@@ -661,7 +664,7 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
using (var signatureBitmap = SignatureUtils.Base64StringToBitmap(blob.Split(',')[1]))
@@ -683,7 +686,7 @@ namespace BeWoPlanerMobil.Controllers
});
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
catch (Exception e)
{
@@ -740,7 +743,7 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
try
@@ -767,7 +770,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var textModule = Model.AllTextModules.FirstOrDefault(f => f.Oid == pTextbausteinOid);
@@ -1492,14 +1495,7 @@ namespace BeWoPlanerMobil.Controllers
long? cb2ScOid = Convert.ToInt64(formCollection[FormCollectionConstants.CostBearer2SupportConceptOidKey]);
Log.Info($"SelectSupportConcept: {cb2ScOid}");
LoadServiceCategoriesToModel(cb2ScOid);
LoadRecordsToModel();
LoadGoalRatings();
// ToDo: Hier LoadGoals aufrufen!
LoadGoals();
LoadSupportConceptThings(cb2ScOid);
return ResetEditingMode();
}
@@ -1610,20 +1606,20 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var sc = Model.SelectedSupportConcept;
if (sc is null)
{
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
if(string.IsNullOrEmpty(pGoalOids))
{
Model.SelectedGoals.Clear();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var splitOids = pGoalOids.Trim(';').Split(';');
@@ -1646,7 +1642,7 @@ namespace BeWoPlanerMobil.Controllers
//Model.SelectedGoals = goals;
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -1655,11 +1651,11 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Model.SelectedServiceDescriptionOid = pServiceDescriptionOid;
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[HttpPost]
@@ -1888,10 +1884,10 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var result = _LeerzeichenFuerGetMethoden;
var result = LeerzeichenFuerGetMethoden;
if (Model.SelectedServiceRecordOid.HasValue)
{
@@ -1907,7 +1903,7 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
LoadRecordsToModel();
@@ -1921,7 +1917,7 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Log.Info($"CheckRights: von:{von};bis:{bis};inEditMode:{inEditMode};dateString:{dateString};startString:{startString};endString:{endString}");
@@ -2263,7 +2259,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var isSuccessful = long.TryParse(serviceRecordOidString, out var serviceRecordOid);
@@ -2279,7 +2275,7 @@ namespace BeWoPlanerMobil.Controllers
if(serviceRecord is null)
{
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var allowDeleteAfterEmployeeSignature = MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowDeleteAfterEmployeeSignature);
@@ -2317,11 +2313,11 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Model.SelectedEmployee = Model.AllEmployees.First(f => f.EmployeeOid.Equals(employeeOid));
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
catch (Exception e)
{
@@ -2362,7 +2358,7 @@ namespace BeWoPlanerMobil.Controllers
return SerializeObject("localhost;demo");
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
// Menünavigation
@@ -2580,7 +2576,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var rawRelOids = string.IsNullOrEmpty(pRelOids) ? new string[0] : pRelOids.Split(',');
@@ -2650,7 +2646,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
long.TryParse(pRelOid, out var supportConceptCostBearerRelationOid);
@@ -2677,7 +2673,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
if(string.IsNullOrEmpty(pEmployeeOids))
@@ -2705,7 +2701,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var signatureServiceRecord = Model.GetServiceRecord(serviceRecordOid);
@@ -2992,16 +2988,170 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Model.IsShowingDurationInHours = isInHoursMode;
UpdateUserSettingsWithoutReload(SettingsKeys.LetzteZeiterfassungsDauer, Model.IsShowingDurationInHours ? "1" : "0");
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
public void LoadSupportConceptThings(long? cb2ScOid)
{
if(Model is null)
{
Logout();
return;
}
LoadServiceCategoriesToModel(cb2ScOid);
LoadRecordsToModel();
LoadGoalRatings();
LoadGoals();
}
[Authorize]
public ActionResult PrepareServiceRecordInsert()
{
if(Model is null)
{
return Logout();
}
// Nach dem Speichern das SchedulerAppointmentDC-Objekt updaten!
if(TempData["AppointmentListItem"] is AppointmentListItem appointmentListItem && Model.Employee.EmployeeOid.HasValue)
{
var appointment = appointmentListItem.SchedulerAppointment;
var start = appointment.StartDate;
var end = appointment.EndDate;
var customerOids = appointment.CustomerList.Select(customer => customer.CustomerOid).ToList();
var employeeOids = appointment.EmployeeList.Select(e2a => e2a.Employee.EmployeeOid).ToList();
var notice = appointment.Description;
if(start is null || end is null)
{
// ToDo: Fehler anzeigen!
return View("Main", Model);
}
var customerService = PluginLoader.FindClass<CustomerService>();
var supportConcepts = customerService.GetAllActiveSupportConceptCostbearer(false, true, Model.Employee.EmployeeOid.Value);
supportConcepts = supportConcepts.Where(sc => customerOids.Contains(sc.Customer.CustomerOid) && sc.StartDate.HasValue && sc.EndDate.HasValue && start.Value.AreInBetweenDates(end.Value, sc.StartDate.Value, sc.EndDate.Value)).ToList();
var supportConceptList = new List<CompactSupportConceptDC>();
foreach(var customerOid in customerOids)
{
var supportConcept = supportConcepts.FirstOrDefault(sc => sc.Customer.CustomerOid.Equals(customerOid));
if(supportConcept is null)
{
continue;
}
supportConceptList.AddIfNotIn(supportConcept);
}
// ToDo: Hier weitermachen: Update des Termins durchführen. In TempData speichern/belassen und beim Speichern dann Updaten?
// Ohne Hilfeplan
if(supportConceptList.Count == 0)
{
Model.IsInGroupBookingMode = false;
Model.SelectedEmployee = Model.AllEmployees.FirstOrDefault(e => e.EmployeeOid.Equals(Model.Employee.EmployeeOid.Value));
LoadSupportConceptThings(-2);
var serviceCategory = Model.ServiceCategories.FirstOrDefault();
var serviceDescription = serviceCategory?.ServiceDescriptions.FirstOrDefault();
if(!(serviceDescription is null))
{
Model.SelectedServiceCategoryOid = serviceDescription.Category.ServiceCategoryOid;
var serviceRecord = CreateServiceRecordFromScratch(start.Value, end.Value, null, Model.SelectedEmployee, notice);
serviceRecord.ServiceDescription = serviceDescription;
Model.SelectedServiceRecord = serviceRecord;
}
}
// Einzelbuchung
else if(supportConceptList.Count == 1 && employeeOids.Count == 1)
{
Model.IsInGroupBookingMode = false;
Model.SelectedEmployee = Model.AllEmployees.FirstOrDefault(e => e.EmployeeOid.Equals(Model.Employee.EmployeeOid.Value));
// ToDo: Beim Wählen des CostBearers den nehmen, der aktiv ist?
var compactSupportConcept = supportConceptList.First();
var supportConcept = Model.SupportConcepts.FirstOrDefault(f => f.SupportConceptOid.HasValue && f.SupportConceptOid.Value.Equals(compactSupportConcept.SupportConceptOid));
var serviceRecord = CreateServiceRecordFromScratch(start.Value, end.Value, supportConcept?.Customer, Model.SelectedEmployee, notice);
var costBearer2SupportConcept = supportConcept.CostBearerRelations.FirstOrDefault();
Model.SelectedServiceRecord = serviceRecord;
}
// Gruppenbuchung
else
{
Model.IsInGroupBookingMode = true;
Model.GroupBookingSelectedEmployees = Model.AllEmployees.Where(w => employeeOids.Contains(w.EmployeeOid)).ToList();
}
}
return View("Main", Model);
}
private ServiceRecordDC CreateServiceRecordFromScratch(DateTime start, DateTime end, CompactCustomerDC customer, CompactEmployeeDC employee, string notice)
{
var serviceRecord = new ServiceRecordDC
{
Employee = employee,
Customer = customer,
Notice = notice,
InsertedOn = DateTime.Now,
InsUser = employee?.ToString(),
IsCreatedInMobileClient = true
};
if(start.Date != end.Date)
{
serviceRecord.Start = end;
serviceRecord.End = end;
serviceRecord.RoundedDuration = 0;
}
else
{
serviceRecord.Start = start;
serviceRecord.End = end;
serviceRecord.RoundedDuration = (decimal)end.Subtract(start).TotalMinutes;
}
if(Model.IsEndDateVisible)
{
serviceRecord.ServiceRecordFormat = ServiceRecordFormate.ZeiterfassungMitEndDatum;
}
else if(Model.IsOnlyYearMonthVisible)
{
serviceRecord.ServiceRecordFormat = ServiceRecordFormate.ZeiterfassungMitMonatJahr;
}
else
{
serviceRecord.ServiceRecordFormat = ServiceRecordFormate.OriginaleZeiterfassung;
}
serviceRecord.DurationInStunden = Model.IsShowingDurationInHours ? ZeiterfassungsDauer.Stunden : ZeiterfassungsDauer.Minuten;
return serviceRecord;
}
#region Mehrfachbuchung
@@ -3196,7 +3346,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var rawRelOids = string.IsNullOrEmpty(pRelOids) ? Array.Empty<string>() : pRelOids.Split(',');
@@ -3266,7 +3416,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
long.TryParse(pRelOid, out var supportConceptCostBearerRelationOid);
@@ -3293,7 +3443,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
if(string.IsNullOrEmpty(pEmployeeOids))

View File

@@ -462,12 +462,12 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model == null)
{
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Model.SelectedCustomer = Model.Customers.FirstOrDefault(customer => customer.CustomerOid == customerOid);
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -476,7 +476,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var isParsingSuccessful1 = int.TryParse(startDayString, out var startDay);
@@ -495,7 +495,7 @@ namespace BeWoPlanerMobil.Controllers
Model.SelectedYear = year;
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -504,7 +504,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var isParsingSuccessful2 = long.TryParse(organisationOidStr, out var organisationOid);
@@ -514,7 +514,7 @@ namespace BeWoPlanerMobil.Controllers
Model.SelectedServiceCategory = isParsingSuccessful3 ? OperationsService.LoadServiceCategory(categoryOid) : null;
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -523,13 +523,13 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Model.IsForSelectedEmployeesOnly = isForSelectedEmployeeOnly ?? false;
Model.SelectedEmployee = employeeOid.HasValue ? Model.Employees.FirstOrDefault(employee => employee.EmployeeOid.Equals(employeeOid.Value)) : null;
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -538,12 +538,12 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Model.SelectedEmployee = employeeOid.HasValue ? Model.Employees.FirstOrDefault(employee => employee.EmployeeOid.Equals(employeeOid)) : null;
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -552,13 +552,13 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Model.IsForSelectedCostbearersOnly = isForSelectedOrganisationOnly ?? false;
Model.SelectedOrganisation = organisationOid.HasValue ? Model.Organisations.FirstOrDefault(organisation => organisation.OrganisationOid.Equals(organisationOid)) : null;
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -567,12 +567,12 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Model.SelectedOrganisation = organisationOid.HasValue ? Model.Organisations.FirstOrDefault(organisation => organisation.OrganisationOid.Equals(organisationOid)) : null;
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -581,7 +581,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Model.IsForSelectedCategoryOnly = isForSelectedServiceCategoryOnly ?? false;
@@ -590,7 +590,7 @@ namespace BeWoPlanerMobil.Controllers
Model.SelectedServiceCategory = Model.ServiceCategories.FirstOrDefault(serviceCategory => serviceCategory.ServiceCategoryOid == serviceCategoryOid);
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -599,7 +599,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
if(serviceCategoryOid.HasValue)
@@ -607,7 +607,7 @@ namespace BeWoPlanerMobil.Controllers
Model.SelectedServiceCategory = Model.ServiceCategories.FirstOrDefault(serviceCategory => serviceCategory.ServiceCategoryOid == serviceCategoryOid);
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
/// <summary>
@@ -621,7 +621,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model == null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var isParsingSuccessful = int.TryParse(filterEnumString, out var filterEnumValue);
@@ -643,7 +643,7 @@ namespace BeWoPlanerMobil.Controllers
}
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -653,7 +653,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model == null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var shouldOverwrite = overwrite.HasValue && overwrite.Value;
@@ -735,7 +735,7 @@ namespace BeWoPlanerMobil.Controllers
OperationsService.InsertConfirmationReceiptSignature(confirmationReceiptSignature);
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -746,7 +746,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model == null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
if(!string.IsNullOrWhiteSpace(oidsAsString))
@@ -775,7 +775,7 @@ namespace BeWoPlanerMobil.Controllers
return MobileUtils.SerializeObject(imageStrings);
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
catch(Exception exception)
{

View File

@@ -524,7 +524,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var oidList = ConvertOidStringToList(resourceOids);
@@ -544,7 +544,7 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var oidList = ConvertOidStringToList(oidString);
@@ -560,7 +560,7 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var oidList = ConvertOidStringToList(oidString);
@@ -575,7 +575,7 @@ namespace BeWoPlanerMobil.Controllers
{
if(!AbstractModel.HasRightToInsertRessourceAppointments)
{
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
if(!string.IsNullOrWhiteSpace(start) && !string.IsNullOrWhiteSpace(end) && !string.IsNullOrWhiteSpace(resourceOids) && Model != null)
@@ -597,7 +597,7 @@ namespace BeWoPlanerMobil.Controllers
return JsonConvert.SerializeObject(unavailableResources);
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -659,7 +659,7 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var employeeOids = ConvertOidStringToList(oidString);
@@ -675,7 +675,7 @@ namespace BeWoPlanerMobil.Controllers
if (Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var customerOids = ConvertOidStringToList(oidString);
@@ -691,7 +691,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var resourceOidList = ConvertOidStringToList(resourceOids);
@@ -784,14 +784,14 @@ namespace BeWoPlanerMobil.Controllers
{
if(Model is null)
{
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Model.SelectedCustomersForIntervalFinder.Clear();
Model.SelectedEmployeesForIntervalFinder.Clear();
Model.SelectedResourcesForIntervalFinder.Clear();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -808,7 +808,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var oidList = ConvertOidStringToList(resourceOids);
@@ -828,7 +828,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var oidList = ConvertOidStringToList(oidString);
@@ -844,7 +844,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var oidList = ConvertOidStringToList(oidString);
@@ -872,19 +872,20 @@ namespace BeWoPlanerMobil.Controllers
if(Model?.Employee?.EmployeeOid is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
if(long.TryParse(teamOidString, out var teamOid))
{
var team = EmployeeService.FindTeamByOid(teamOid, Model.Employee.EmployeeOid.Value);
if(!(team is null))
{
Model.SelectedEmployeesForFiltering.AddRangeIfElementsNotIn(team.Member);
}
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -893,7 +894,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model?.Employee?.EmployeeOid is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var teamMemberOids = new List<long>();
@@ -931,19 +932,19 @@ namespace BeWoPlanerMobil.Controllers
if(Model is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
Model.ShouldLoadTasks = isChecked;
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
catch(Exception exception)
{
Log.Error(exception.Message, exception);
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
@@ -952,7 +953,7 @@ namespace BeWoPlanerMobil.Controllers
if(Model?.Employee?.EmployeeOid is null)
{
Logout();
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
var appointment = Model.Appointments.FirstOrDefault(app => app.SchedulerAppointmentOid?.Equals(appointmentOid) ?? false);
@@ -979,7 +980,76 @@ namespace BeWoPlanerMobil.Controllers
}
}
return _LeerzeichenFuerGetMethoden;
return LeerzeichenFuerGetMethoden;
}
[Authorize]
public string SelectTeamForIntervalFinder(string teamOidString)
{
if(Model?.Employee?.EmployeeOid is null)
{
Logout();
return LeerzeichenFuerGetMethoden;
}
if(long.TryParse(teamOidString, out var teamOid))
{
var team = EmployeeService.FindTeamByOid(teamOid, Model.Employee.EmployeeOid.Value);
if(!(team is null))
{
var memberOids = team.Member.Select(member => member.EmployeeOid).ToList();
return JsonConvert.SerializeObject(memberOids);
}
}
return LeerzeichenFuerGetMethoden;
}
[Authorize]
[HttpPost]
public ActionResult TransformAppointmentToServiceRecord(FormCollection formCollection)
{
if(Model is null)
{
return Logout();
}
// ToDo Serienausnahme erstellen möglich machen? Wenn ja, dann auch für das Bearbeiten und Löschen.
if(Guid.TryParse(formCollection["appointment-id-input"], out var identifier))
{
var ids = Model.AppointmentListItems.Select(s => s.Identifier).ToList();
var appointmentListItem = Model.AppointmentListItems.FirstOrDefault(f => f.Identifier.Equals(identifier));
if(!(appointmentListItem is null))
{
var appointment = appointmentListItem.SchedulerAppointment;
var employeeOids = appointment.EmployeeList.Select(e2a => e2a.Employee.EmployeeOid).ToList();
if(employeeOids.Count == 0)
{
employeeOids.Add(appointment.Originator.EmployeeOid);
}
var employeeOids2 = employeeOids.ToArray();
var customerOids = appointment.CustomerList.Select(c => c.CustomerOid).ToArray();
var notice = appointment.Description;
var start = appointment.StartDate;
var end = appointment.EndDate;
// ToDo: Appointment aktualisieren, bzw. eine Serienausnahme erstellen!
TempData["AppointmentListItem"] = appointmentListItem;
return RedirectToActionPermanent("PrepareServiceRecordInsert", "Main");
}
}
return RedirectToActionPermanent("PrepareServiceRecordInsert", "Main");
}
}
}

View File

@@ -52,7 +52,6 @@ namespace BeWoPlanerMobil.Models
public static bool IsAllowedToSeeSupportConceptFilter
{
get
{
var user = MobileSessionFacade.LoggedInUser;

View File

@@ -651,6 +651,8 @@ namespace BeWoPlanerMobil.Models
public int SelectedDayCount { get; set; }
public NullableDateTimeSpan SelectedZeitraum { get; set; }
public bool IsOnlyYearMonthVisible { get; set; }
#region Mehrfachbuchung

View File

@@ -19,19 +19,37 @@ namespace BeWoPlanerMobil.Models
public SchedulerAppointmentDC SelectedAppointment { get; set; }
public List<SchedulerAppointmentDC> Appointments { get; set; } = new List<SchedulerAppointmentDC>();
private List<SchedulerAppointmentDC> _Appointments;
public List<AppointmentListItem> AppointmentListItems
public List<SchedulerAppointmentDC> Appointments
{
get
get => _Appointments ?? (_Appointments = new List<SchedulerAppointmentDC>());
set
{
var result = new List<AppointmentListItem>();
var oldAppointments = AppointmentListItems.Select(li => li.SchedulerAppointment).ToList();
Appointments.DoForEach(app => result.AddIfNotIn(new AppointmentListItem(app)));
_Appointments = value ?? new List<SchedulerAppointmentDC>();
return result;
if(_Appointments.AreListEqual(oldAppointments))
{
return;
}
_AppointmentListItems = new List<AppointmentListItem>();
foreach(var appointment in _Appointments)
{
var listItem = new AppointmentListItem(appointment);
listItem.GenerateIdentifier(_AppointmentListItems.Select(a => a.Identifier).ToList());
_AppointmentListItems.Add(listItem);
}
}
}
private List<AppointmentListItem> _AppointmentListItems;
public List<AppointmentListItem> AppointmentListItems => _AppointmentListItems ?? (_AppointmentListItems = new List<AppointmentListItem>());
public bool HasRightToEditAppointment(long? appointmentOid)
{

View File

@@ -10,15 +10,14 @@ function getDateFromPicker(pickerId) {
try {
var picker = $("#" + pickerId);
if (picker.length > 0) {
if(picker.length > 0) {
picker.datetimepicker("show");
picker.datetimepicker("hide");
var unixTime = picker.datetimepicker("date");
var targetDate = new Date(unixTime);
if (isValidDate(targetDate)) {
logError(dateToShortDateString(targetDate));
if(isValidDate(targetDate)) {
return targetDate;
}
}
@@ -62,6 +61,8 @@ function getTimeFromPicker(pickerId) {
function dateToShortDateString(date) {
try {
logInfo2("Konvertiere Datum zu kurzem Datum: " + date);
if (isValidDate(date)) {
var ddNum = date.getDate();
var mmNum = date.getMonth();
@@ -90,7 +91,7 @@ function dateToShortDateString(date) {
return dd + "." + mm + "." + yyyy;
}
} catch (error) {
logError(error.message);
logError("Fehler in dateToShortDateString:" + error.message);
}
}
@@ -114,6 +115,7 @@ function mergeDateAndTime(date, time) {
}
}
// ToDo: Löst Exception aus bei einem Wert von z.B. "06.02.2023".
function isValidDate(date) {
return Object.prototype.toString.call(date) === "[object Date]" && !isNaN(date);
}

View File

@@ -1,54 +1,34 @@
// Wird aufgerufen, wenn sich der Wert der CheckBox ändert.
function changeItemListSelection(url, popupId, listId, itemIdPrefix, isCustomer, checkBoxIdSuffix, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids) {
function changeItemListSelection(url, popupId, listId, itemIdPrefix, isCustomer, checkBoxIdSuffix, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids, allItemsCheckBoxId) {
try {
if (url === undefined || url === null) {
if(url === undefined || url === null) {
logError("url ist undefined oder null");
return;
}
var oidStr = "";
var oids = [];
var allChecked = true;
$("#" + popupId + " input[type=checkbox]").each(function () {
var id = $(this).attr("id").split("-")[1];
if($.isNumeric(id) === false) {
return;
}
if ($(this).prop("checked")) {
oids.push(id);
oidStr += id + ",";
} else {
allChecked = false;
}
});
var selectedItemOids = $("#" + popupId + " .popup-list-item-container input:checked").map(function () { return $(this).attr("id").split("-")[1]; }).get();
var allItemOids = $("#" + popupId + " .popup-list-item-container input[type=checkbox]").map(function () { return $(this).attr("id").split("-")[1]; }).get();
if(!isCustomer) {
$("#my-teams-checkbox" + allItemsCheckBoxSuffix).prop("checked", arrayContainsAllItems(oids, teamMemberOids));
$("#my-teams-checkbox" + allItemsCheckBoxSuffix).prop("checked", arrayContainsAllItems(selectedItemOids, teamMemberOids));
}
if (allChecked === true) {
$("#all-" + (isCustomer ? "customers" : "employees") + "-checkbox" + allItemsCheckBoxSuffix).prop("checked", true);
} else {
$("#all-" + (isCustomer ? "customers" : "employees") + "-checkbox" + allItemsCheckBoxSuffix).prop("checked", false);
}
$("#" + allItemsCheckBoxId).prop("checked", arrayContainsAllItems(selectedItemOids, allItemOids));
$.get(url, { oidString: oidStr }).done(function (jsonResult) {
$.get(url, { oidString: selectedItemOids.toString() }).done(function (jsonResult) {
updateSelectedList(jsonResult, listId, itemIdPrefix, isCustomer, popupId, checkBoxIdSuffix, url, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids);
$("#one-day-scheduler-partial-container").load(filterAppointmentsUrl);
});
} catch(error) {
logError(error.message);
logError("Fehler in changeItemListSelection: " + error.message);
}
}
// Wird aufgerufen, um die Liste mit den ausgewählten Objekten zu aktualisieren
function updateSelectedList(jsonResult, listId, itemIdPrefix, isCustomer, popupId, checkBoxIdSuffix, url, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids) {
function updateSelectedList(jsonResult, listId, itemIdPrefix, isCustomer, popupId, checkBoxIdSuffix, url, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids, allItemsCheckBoxId) {
try {
if (isEmptyOrSpaces(jsonResult)) {
if(isEmptyOrSpaces(jsonResult)) {
return;
}
@@ -98,11 +78,11 @@ function updateSelectedList(jsonResult, listId, itemIdPrefix, isCustomer, popupI
list.append(html);
});
} catch(error) {
logError(error.message);
logError("Fehler in updateSelectedList: " + error.message);
}
}
function removeSelectedItem(itemOid, itemSuffix, isCustomer, url, popupId, listId, itemIdPrefix, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids) {
function removeSelectedItem(itemOid, itemSuffix, isCustomer, url, popupId, listId, itemIdPrefix, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids, allItemsCheckBoxId) {
try {
var prefix = isCustomer ? "customer-" : "employee-";
@@ -112,8 +92,8 @@ function removeSelectedItem(itemOid, itemSuffix, isCustomer, url, popupId, listI
checkBox.prop("checked", false);
}
changeItemListSelection(url, popupId, listId, itemIdPrefix, isCustomer, itemSuffix, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids);
changeItemListSelection(url, popupId, listId, itemIdPrefix, isCustomer, itemSuffix, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids, allItemsCheckBoxId);
} catch(error) {
logError(error);
logError("Fehler in removeSelectedItem: " + error);
}
}

View File

@@ -1,21 +1,21 @@
function logInfo(message) {
logColorfulMessage(message, "purple");
logColorfulMessage(message, "#FF0094");
}
function logWarning(message) {
logColorfulMessage(message, "darkorange");
logColorfulMessage(message, "#FF5A00");
}
function logError(message) {
console.error("%c" + message, "font-size: 16px; font-weight:bold; color: red");
console.error("%c" + message, "font-size: 14px; font-family: monospace; color: red");
}
function logDebug(message) {
logColorfulMessage(message, "green");
logColorfulMessage(message, "#AAF500");
}
function logColorfulMessage(message, color) {
console.log("%c" + message, "font-size: 16px; font-weight: bold; color: " + color);
console.log("%c" + message, "font-size: 14px; font-family: monospace; color: " + color);
}
function logInfo2(message) {

View File

@@ -199,18 +199,15 @@ function insertOrUpdateAppointment(formattedStartDate, formattedEndDate, formatt
}
function hideAppointmentForm() {
logDebug("hiding appointment form");
$("#form-container").addClass("d-none d-sm-none");
}
function showAppointmentForm() {
logDebug("showing appointment form");
$("#form-container").removeClass("d-none d-sm-none");
calcPrependTextSizes();
}
function toggleAppointmentForm() {
logError("toggling appointment form");
var isVisible = $("#form-container").css("display") === "block";
if (isVisible) {

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using BS.Shared.DataContracts;
@@ -8,7 +9,7 @@ namespace BeWoPlanerMobil.Util
{
public class AppointmentListItem
{
public Guid Identifier { get; }
public Guid Identifier { get; private set; }
public long? Oid { get; }
@@ -62,10 +63,27 @@ namespace BeWoPlanerMobil.Util
public bool HasEmployeesCustomersOrResources => !string.IsNullOrWhiteSpace(EmployeeListInfo + CustomerListInfo + ResourceListInfo);
public bool AllDay { get; }
public bool HasServiceRecord { get; }
public SchedulerAppointmentDC SchedulerAppointment { get; }
public void GenerateIdentifier(List<Guid> existingIdentifiers)
{
var identifier = Guid.NewGuid();
while(existingIdentifiers.Contains(identifier))
{
identifier = Guid.NewGuid();
}
Identifier = identifier;
}
public AppointmentListItem(SchedulerAppointmentDC schedulerAppointment)
{
Identifier = Guid.NewGuid();
SchedulerAppointment = schedulerAppointment;
CanBeEdited = schedulerAppointment.CanBeEdited;
Oid = schedulerAppointment.SchedulerAppointmentOid;
@@ -81,6 +99,8 @@ namespace BeWoPlanerMobil.Util
var customerColor = string.Empty;
var resourceColor = string.Empty;
HasServiceRecord = schedulerAppointment.ServiceRecordList?.Any() ?? false;
if(string.IsNullOrWhiteSpace(employeeColor) && schedulerAppointment.EmployeeList.Count == 0 && !string.IsNullOrWhiteSpace(schedulerAppointment.Originator?.EmployeeColor))
{
employeeColor = schedulerAppointment.Originator.EmployeeColor;

View File

@@ -1,6 +1,8 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BS.Shared;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
@@ -48,6 +50,8 @@ namespace BeWoPlanerMobil.Util
public List<JsonAbsenceTime> AbsenceTimes { get; set; } = new List<JsonAbsenceTime>();
public List<JsonOrganisation> Organisations { get; set; } = new List<JsonOrganisation>();
public Sex? CustomerSex { get; set; }
public JsonCustomer(CustomerDC customer, List<BeWoFolderDC> folderTree)
{
@@ -71,6 +75,8 @@ namespace BeWoPlanerMobil.Util
break;
}
CustomerSex = customer.Sex;
Adresszusatz = customer.AddressLine1;
Strasse = customer.Street;
Postleitzahl = customer.PostalCode;

File diff suppressed because it is too large Load Diff

View File

@@ -38,12 +38,14 @@
var isLeaf = $(item).parent().prop("class").includes("goal-text");
// ToDo: Auch die Ziele beachten!
if(goalText.toLowerCase().includes(text)) {
$.each($($(item).parents(".goal-card")), function(cardIndex, card) {
$(card).show();
$(card).find(".collapse").collapse("show");
});
} else if (isLeaf) {
} else if(isLeaf) {
var parent1 = $($(item).parent());
if(parent1 !== undefined && parent1 !== null) {

View File

@@ -136,31 +136,7 @@
break;
}
}
<!--
Alt:
<div class="input-group-prepend">
<i class="fas fa-chevron-down h-100 text-primary" id="chevron-@result.Identifier"></i>
</div>
<p class="form-control text-primary border-0 bg-transparent" style="user-select: none !important;">
@result.CustomerName
</p>
<div class="input-group-append">
<button class="btn btn-bewo-customers rounded mr-1" type="button" onclick="@methodName">
<span class="fas fa-signature"></span>
<span class="fas fa-@customerIcon" style="color: @customerBtnColor !important"></span>
K
</button>
<button class="btn btn-bewo-employee rounded" type="button" onclick="@employeeMethodName">
<span class="fas fa-signature"></span>
<span class="fas fa-@employeeIcon" style="color: @employeeBtnColor !important"></span>
M
</button>
</div>
-->
<div class="row">
<div class="col-sm-auto mr-auto">
<div class="input-group">

View File

@@ -11,9 +11,22 @@
}
$("#insert-appointment-form").ready(function() {
var width = getMaxWidth("scheduler-form-prepend-text");
$(".scheduler-form-prepend-text").width(width);
calcPrependTextSizes();
});
function calcPrependTextSizes() {
try {
var width = getMaxWidth("scheduler-form-prepend-text");
if(width <= 0) {
return;
}
$(".scheduler-form-prepend-text").width(width);
} catch(error) {
logError(error);
}
}
</script>
@using(Html.BeginForm("InsertOrUpdateAppointment", "Scheduler", FormMethod.Post, new { id = "insert-appointment-form" }))
{
@@ -373,30 +386,22 @@
$.each(entries, function (index, item) {
var employee = $(item);
if (employee.find(".employee-name-label").text().toLowerCase().includes(text)) {
if(employee.find(".employee-name-label").text().toLowerCase().includes(text)) {
employee.show();
} else {
employee.hide();
}
});
} catch (error) {
} catch(error) {
logError(error.message);
}
}
function selectAllEmployeesOnChange() {
try {
var value = $("#all-employees-checkbox").prop("checked");
var allChecked = $("#all-employees-checkbox").prop("checked");
$("#employees-popup input[type=checkbox]").each(function() {
var id = $(this).attr("id").split("-")[1];
if($.isNumeric(id) === false) {
return;
}
$(this).prop("checked", value);
});
$("#employees-popup .employee-input-container input[type=checkbox]").map(function() { $(this).prop("checked", allChecked); });
changeEmployeeListSelection();
} catch(error) {
@@ -406,32 +411,17 @@
function changeEmployeeListSelection() {
try {
var oidStr = "";
var oids = [];
var allChecked = true;
var selectedEmployeeOids = $("#employees-popup .employee-input-container input:checked").map(function() { return $(this).attr("id").split("-")[1]; }).get();
var allEmployeesCount = $("#employees-popup .employee-input-container input[type=checkbox]").map(function () { return $(this).attr("id").split("-")[1]; }).get().length;
var selectedEmployeesCount = selectedEmployeeOids.length;
$("#employees-popup input[type=checkbox]").each(function () {
var id = $(this).attr("id").split("-")[1];
$("#all-employees-checkbox").prop("checked", (allEmployeesCount === selectedEmployeesCount));
if ($.isNumeric(id) === false) {
return;
}
if ($(this).prop("checked")) {
oids.push(id);
oidStr += id + ",";
} else {
allChecked = false;
}
});
$("#all-employees-checkbox").prop("checked", allChecked);
$.get('@Url.Action("SelectEmployeesForAppointment")', {oidString: oidStr}).done(function(jsonResult) {
$.get('@Url.Action("SelectEmployeesForAppointment")', { oidString: selectedEmployeeOids.toString()}).done(function(jsonResult) {
updateSelectedEmployees(jsonResult);
$("#one-day-scheduler-partial-container").load('@Url.Action("FetchAppointments", "Scheduler")');
});
} catch (error) {
} catch(error) {
logError(error);
}
}
@@ -494,7 +484,7 @@
$.get('@Url.Action("SelectTeamForAppointment")', { teamOidString: teamOid }).done(function(jsonResult) {
var oids = $.parseJSON(jsonResult);
$("#employees-popup input[type=checkbox]").each(function () {
$("#employees-popup .employee-input-container input[type=checkbox]").each(function () {
var id = $(this).attr("id").split("-")[1];
if ($.isNumeric(id) === false) {
@@ -569,16 +559,18 @@
<hr />
}
<div class="employee-input-container">
@foreach(var employee in Model.AllEmployees)
{
var checkedValue = Model.SelectedEmployees.Contains(employee) ? "checked" : string.Empty;
@foreach(var employee in Model.AllEmployees)
{
var checkedValue = Model.SelectedEmployees.Contains(employee) ? "checked" : string.Empty;
<div class="custom-control custom-checkbox employee-text">
<input type="checkbox" class="custom-control-input" id="employee-@employee.EmployeeOid-checkbox" @checkedValue onchange="changeEmployeeListSelection()" />
<label class="custom-control-label employee-name-label" for="employee-@employee.EmployeeOid-checkbox">@employee.DetailDescription</label>
</div>
}
<div class="custom-control custom-checkbox employee-text">
<input type="checkbox" class="custom-control-input" id="employee-@employee.EmployeeOid-checkbox" @checkedValue onchange="changeEmployeeListSelection()" />
<label class="custom-control-label employee-name-label" for="employee-@employee.EmployeeOid-checkbox">@employee.DetailDescription</label>
</div>
}
</div>
</div>
</div>
<div class="modal-footer">
@@ -622,16 +614,19 @@
</button>
</div>
</div>
<div class="popup-list-item-container">
@foreach(var customer in Model.AllCustomers)
{
var checkedValue = Model.SelectedCustomers.Contains(customer) ? "checked" : string.Empty;
@foreach(var customer in Model.AllCustomers)
{
var checkedValue = Model.SelectedCustomers.Contains(customer) ? "checked" : string.Empty;
<div class="custom-control custom-checkbox customer-text">
<input type="checkbox" class="custom-control-input" id="customer-@customer.CustomerOid-checkbox" @checkedValue onchange="changeItemListSelection('@Url.Action("SelectCustomersForAppointment", "Scheduler")', 'customers-popup', 'selected-customers-list', 'related-customer-', true, '-checkbox', '@Url.Action("FetchAppointments", "Scheduler")', '', getTeamMemberOids())" />
<label class="custom-control-label customer-name-label" for="customer-@customer.CustomerOid-checkbox">@customer.DetailDescription</label>
</div>
}
<div class="custom-control custom-checkbox customer-text">
<input type="checkbox" class="custom-control-input" id="customer-@customer.CustomerOid-checkbox" @checkedValue onchange="changeItemListSelection('@Url.Action("SelectCustomersForAppointment", "Scheduler")', 'customers-popup', 'selected-customers-list', 'related-customer-', true, '-checkbox', '@Url.Action("FetchAppointments", "Scheduler")', '', getTeamMemberOids(), 'all-customers-checkbox')" />
<label class="custom-control-label customer-name-label" for="customer-@customer.CustomerOid-checkbox">@customer.DetailDescription</label>
</div>
}
</div>
</div>
</div>
<div class="modal-footer">

View File

@@ -35,21 +35,22 @@
$("#selected-resources-interval-finder-list, #selected-employees-interval-finder-list, #selected-customers-interval-finder-list").empty();
var url = '@Url.Action("ResetIntervalFinder", "Scheduler")';
$.get(url);
$.get('@Url.Action("ResetIntervalFinder", "Scheduler")');
}
function submitIntervalFinderForm() {
try {
showSpinner();
var isValid = validateIntervalFinderForm();
$("#interval-finder-validation-alert").html("");
$("#interval-finder-validation-alert").collapse("hide");
$("#hidden-submit-btn").click();
var isValid = validateIntervalFinderForm();
if(isValid === false) {
hideSpinner();
} else {
$("#hidden-submit-btn").click();
}
} catch(error) {
logError(error.message);
@@ -60,18 +61,49 @@
var isValid = false;
try {
var validationAlert = $("#interval-finder-validation-alert");
validationAlert.html("");
var duration = parseInt($("#interval-duration").val());
var startDate = getDateFromPicker("scheduler-interval-start");
var startTime = getTimeFromPicker("scheduler-interval-start-time");
var endDate = getDateFromPicker("scheduler-interval-end");
var endTime = getTimeFromPicker("scheduler-interval-end-time");
var start = getDateTimeFromPicker("scheduler-interval-start", "scheduler-interval-start-time");
var end = getDateTimeFromPicker("scheduler-interval-end", "scheduler-interval-end-time");
var start = mergeDateAndTime(startDate, startTime);
var end = mergeDateAndTime(endDate, endTime);
if(isValidDate(startDate) && isValidDate(startTime) && isValidDate(endDate) && isValidDate(endTime) && duration > 0 && end > start) {
isValid = end > start;
var isStartValid = start !== null && isValidDate(new Date(start));
var isEndValid = end !== null && isValidDate(new Date(end));
isValid = isStartValid && isEndValid && duration > 0 && (start !== null && start !== undefined && start.isBefore(end));
if(isValid === false) {
var validationMessage = "";
if(isStartValid === false && isEndValid === false) {
validationMessage = "Das Start- und Endwerte sind ungültig!";
} else if(isStartValid === true && isEndValid === false) {
validationMessage = "Das Enddatum ist ungültig!";
} else if(isStartValid === false && isEndValid === true) {
validationMessage = "Das Startdatum ist ungültig!";
}
if(start !== null && start !== undefined && start.isBefore(end) === false) {
if(validationMessage.length === 0) {
validationMessage += "Das Enddatum darf nicht vor dem Startdatum liegen!";
} else {
validationMessage += "<br/>Das Enddatum darf nicht vor dem Startdatum liegen!";
}
}
if($.isNumeric(duration) === false || duration <= 0) {
if(validationMessage.length === 0) {
validationMessage += "Die Dauer ist ungültig!";
} else {
validationMessage += "<br/>Die Dauer ist ungültig!";
}
}
validationAlert.html(validationMessage);
validationAlert.collapse("show");
}
} catch(error) {
logError(error.message);
@@ -80,280 +112,299 @@
}
}
(function() {
'use strict';
window.addEventListener('load', function() {
var forms = document.getElementsByClassName('needs-validation');
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
hideSpinner();
}
form.classList.add('was-validated');
}, false);
});
}, false);
})();
function getDateTimeFromPicker(datePickerId, timePickerId) {
try {
var dateVal = $("#" + datePickerId).datetimepicker("viewDate");
var timeVal = $("#" + timePickerId).val();
var timeRegEx = new RegExp('^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$');
if(isValidDate(new Date(dateVal)) && timeRegEx.test(timeVal)) {
var hm = timeVal.split(":");
if(hm.length === 2 && $.isNumeric(hm[0]) && $.isNumeric(hm[1])) {
dateVal.hours(parseInt(hm[0]));
dateVal.minutes(parseInt(hm[1]));
return dateVal;
}
}
return null;
} catch (error) {
logError(error);
}
}
$("#interval-form-container").ready(function() {
var width = getMaxWidth("prepend-text");
$(".prepend-text").width(width);
});
function selectTeamForIntervalFinder(teamOid) {
try {
$.get('@Url.Action("SelectTeamForIntervalFinder")', { teamOidString: teamOid }).done(
function(jsonResult) {
var employeeOids = $.parseJSON(jsonResult);
$("#employees-interval-finder-popup .popup-list-item-container input[type=checkbox]").map(function() {
var employeeOid = $(this).attr("id").split("-")[1];
if($.isNumeric(employeeOid) === false) {
return;
}
var numericEmployeeOid = parseInt(employeeOid);
if(employeeOids.includes(numericEmployeeOid)) {
$(this).prop("checked", true);
}
});
changeItemListSelection('@Url.Action("SelectEmployeesForIntervalFinder", "Scheduler")', 'employees-interval-finder-popup', 'selected-employees-interval-finder-list', 'related-employee-interval-finder-', false, '-interval-finder-checkbox', '@Url.Action("FetchAppointments", "Scheduler")');
});
} catch(error) {
logError(error);
}
}
</script>
<div id="interval-form-container">
@using (Html.BeginForm("FindFreeIntervals", "Scheduler", FormMethod.Post, new { id = "find-appointment-intervals-form", @class = "needs-validation", novalidate = true }))
{
<div class="mt-3">
<div class="form-row">
<div class="col-7 mx-0 pr-1">
<div class="form-group mb-1 mr-0 pr-0">
<div class="input-group date" id="scheduler-interval-start-picker" data-target-input="nearest">
<div class="input-group-prepend">
<span class="input-group-text prepend-text px-2">
Von
</span>
</div>
<input required value="@Model.IntervalStartDateStr" type="text" id="scheduler-interval-start" name="IntervalStart" class="form-control datetimepicker-input" data-target="#scheduler-interval-start-picker" data-toggle="datetimepicker" />
<div class="input-group-append" data-target="#scheduler-interval-start-picker" data-toggle="datetimepicker">
<div class="input-group-text px-2">
<i class="fas fa-calendar-alt"></i>
</div>
<div class="invalid-feedback">
Bitte wählen Sie ein Datum, das vor dem Enddatum liegt
</div>
</div>
</div>
</div>
<div class="alert alert-danger collapse" role="alert" id="interval-finder-validation-alert"></div>
@using(Html.BeginForm("FindFreeIntervals", "Scheduler", FormMethod.Post, new { id = "find-appointment-intervals-form", @class = "needs-validation", novalidate = true }))
{
<div class="mt-3">
<div class="form-row">
<div class="col-7 mx-0 pr-1">
<div class="form-group mb-1 mr-0 pr-0">
<div class="input-group date" id="scheduler-interval-start-picker" data-target-input="nearest">
<div class="input-group-prepend">
<span class="input-group-text prepend-text px-2">
Von
</span>
</div>
<div class="col-5 mx-0 pl-0">
<div class="form-group mb-1 ml-0 pl-0">
<div class="input-group date" id="scheduler-interval-start-time-picker" data-target-input="nearest">
<input required value="@Model.IntervalStartTimeStr" type="text" id="scheduler-interval-start-time" name="IntervalStartTime" class="form-control datetimepicker-input" data-target="#scheduler-interval-start-time-picker" />
<div class="input-group-append" data-target="#scheduler-interval-start-time-picker" data-toggle="datetimepicker">
<div class="input-group-text px-2">
<i class="fas fa-clock"></i>
</div>
</div>
<div class="invalid-feedback">
Bitte wählen Sie eine Startuhrzeit
</div>
</div>
<input value="@Model.IntervalStartDateStr" type="text" id="scheduler-interval-start" name="IntervalStart" class="form-control datetimepicker-input" data-target="#scheduler-interval-start-picker" data-toggle="datetimepicker"/>
<div class="input-group-append" data-target="#scheduler-interval-start-picker" data-toggle="datetimepicker">
<div class="input-group-text px-2">
<i class="fas fa-calendar-alt"></i>
</div>
</div>
</div>
<div class="form-row">
<div class="col-7 mx-0 pr-1">
<div class="form-group mb-1 ml-0 pl-0">
<div class="input-group date" id="scheduler-interval-end-picker" data-target-input="nearest">
<div class="input-group-prepend">
<div class="input-group-text prepend-text px-2">
Bis
</div>
</div>
<input required value="@Model.IntervalEndDateStr" type="text" id="scheduler-interval-end" name="IntervalEnd" class="form-control datetimepicker-input" data-target="#scheduler-interval-end-picker" data-toggle="datetimepicker"/>
<div class="input-group-append" data-target="#scheduler-interval-end-picker" data-toggle="datetimepicker">
<div class="input-group-text px-2">
<i class="fas fa-calendar-alt"></i>
</div>
</div>
<div class="invalid-feedback">
Bitte wählen Sie ein Datum, das nach dem Startdatum liegt
</div>
</div>
</div>
</div>
<div class="col-5 mx-0 pl-0">
<div class="form-group mb-1 ml-0 pl-0">
<div class="input-group date" id="scheduler-interval-end-time-picker" data-target-input="nearest">
<input required value="@Model.IntervalEndTimeStr" type="text" id="scheduler-interval-end-time" name="IntervalEndTime" class="form-control datetimepicker-input" data-target="#scheduler-interval-end-time-picker"/>
<div class="input-group-append" data-target="#scheduler-interval-end-time-picker" data-toggle="datetimepicker">
<div class="input-group-text px-2">
<i class="fas fa-clock"></i>
</div>
</div>
<div class="invalid-feedback">
Bitte wählen Sie eine Enduhrzeit
</div>
</div>
</div>
</div>
<div class="col-5 mx-0 pl-0">
<div class="form-group mb-1 ml-0 pl-0">
<div class="input-group date" id="scheduler-interval-start-time-picker" data-target-input="nearest">
<input value="@Model.IntervalStartTimeStr" type="text" id="scheduler-interval-start-time" name="IntervalStartTime" class="form-control datetimepicker-input" data-target="#scheduler-interval-start-time-picker"/>
<div class="input-group-append" data-target="#scheduler-interval-start-time-picker" data-toggle="datetimepicker">
<div class="input-group-text px-2">
<i class="fas fa-clock"></i>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md">
<div class="form-group mb-1">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text prepend-text px-2">
Dauer
</div>
</div>
<input required value="@Model.IntervalDurationStr" type="number" min="10" id="interval-duration" name="Duration" class="form-control" />
</div>
<div class="invalid-feedback">
Bitte wählen Sie eine Dauer von mindestens 10 Minuten
</div>
</div>
</div>
</div>
@if(Model.HasResourcesEmployeesOrCustomers)
{
<!-- Hinzufügen-Buttons -->
<div class="form-row">
@if(AbstractModel.HasRightToViewEmployeeAppointments)
{
<div class="col-md">
<div class="form-group my-1">
<button type="button" class="btn btn-bewo-employee w-100" data-toggle="modal" data-target="#employees-interval-finder-popup">Mitarbeiter</button>
</div>
</div>
}
@if(AbstractModel.HasRightToViewCustomerAppointments)
{
<div class="col-md">
<div class="form-group my-1">
<button type="button" class="btn btn-bewo-customers w-100" data-toggle="modal" data-target="#customers-interval-finder-popup">Klienten</button>
</div>
</div>
}
@if(AbstractModel.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
{
<div class="col-md">
<div class="form-group my-1">
<button type="button" class="btn btn-bewo-resource w-100" data-toggle="modal" data-target="#resources-interval-finder-popup">Ressourcen</button>
</div>
</div>
}
</div>
<div class="form-row">
@if(AbstractModel.HasRightToViewEmployeeAppointments)
{
<div class="col-12">
<div class="form-group my-1">
<div class="list-group" id="selected-employees-interval-finder-list">
@foreach(var selectedEmployee in Model.SelectedEmployeesForIntervalFinder)
{
<div class="list-group-item my-auto" id="related-employee-interval-finder-@selectedEmployee.EmployeeOid">
<div class="row">
<div class="input-group">
<div class="input-group-prepend">
<i class="fas fa-user text-bewo-employee h-100"></i>
</div>
<p class="form-control border-0 bg-transparent text-truncate">
@selectedEmployee.DetailDescription
</p>
<div class="input-group-append">
@{
var url = Url.Action("SelectEmployeesForIntervalFinder", "Scheduler");
var oid = selectedEmployee.EmployeeOid;
var filterAppointmentsUrl = Url.Action("FetchAppointments", "Scheduler");
var onClickParams = $"{oid}, '-interval-finder-checkbox', false, '{url}', 'employees-interval-finder-popup', 'employees-interval-finder-popup', 'related-employee-interval-finder-', '{filterAppointmentsUrl}'";
}
<button type="button" class="btn btn-primary" onclick="removeSelectedItem(@onClickParams)">
<span class="fas fa-times-circle"></span>
</button>
</div>
</div>
</div>
</div>
}
</div>
</div>
</div>
}
@if(AbstractModel.HasRightToViewCustomerAppointments)
{
<div class="col-12">
<div class="form-group my-1">
<div class="list-group" id="selected-customers-interval-finder-list">
@foreach(var selectedCustomer in Model.SelectedCustomersForIntervalFinder)
{
<div class="list-group-item my-auto" id="related-customer-interval-finder-@selectedCustomer.CustomerOid">
<div class="row">
<div class="input-group">
<div class="input-group-prepend">
<i class="fas fa-user text-bewo-customers h-100"></i>
</div>
<p class="form-control border-0 bg-transparent text-truncate">
@selectedCustomer.DetailDescription
</p>
<div class="input-group-append">
@{
var url = Url.Action("SelectCustomersForIntervalFinder", "Scheduler");
var oid = selectedCustomer.CustomerOid;
var filterAppointmentsUrl = Url.Action("FetchAppointments", "Scheduler");
var onClickParams = $"{oid}, '-interval-finder-checkbox', false, '{url}', 'customers-interval-finder-popup', 'customers-interval-finder-popup', 'related-customer-interval-finder-', '{filterAppointmentsUrl}'";
}
<button type="button" class="btn btn-primary" onclick="removeSelectedItem(@onClickParams)">
<span class="fas fa-times-circle"></span>
</button>
</div>
</div>
</div>
</div>
}
</div>
</div>
</div>
}
@if(AbstractModel.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
{
<div class="col-12">
<div class="form-group my-1">
<div class="list-group" id="selected-resources-interval-finder-list">
@foreach(var selectedResource in Model.SelectedResourcesForIntervalFinder)
{
<div class="list-group-item my-auto" id="related-resource-interval-finder-item-@selectedResource.ResourceOid">
<div class="row">
<div class="input-group">
<div class="input-group-prepend">
<i class="fas fa-cubes text-bewo-resource h-100"></i>
</div>
<p class="form-control border-0 bg-transparent text-truncate">
@selectedResource.Name
</p>
<div class="input-group-append">
<button type="button" class="btn btn-primary" onclick="removeSelectedResource('related-resource-interval-finder-item-@selectedResource.ResourceOid', 'resource-@selectedResource.ResourceOid-interval-finder-checkbox', 'resources-interval-finder-popup', '@Url.Action("SelectResourcesForIntervalFinder", "Scheduler")', 'selected-resources-interval-finder-list', '@Url.Action("FetchAppointments", "Scheduler")', 'related-resource-interval-finder-item-', '-interval-finder-checkbox', 'all-resources-for-interval-finder-checkbox')"><span class="fas fa-times-circle"></span>
</button>
</div>
</div>
</div>
</div>
}
</div>
</div>
</div>
}
</div>
}
</div>
<button type="submit" class="d-none" id="hidden-submit-btn"></button>
}
<div class="d-flex bd-highlight mt-3">
<div class="mr-auto bd-highlight">
@using(Html.BeginForm("SetIsInIntervalFinderMode", "Scheduler", FormMethod.Post))
{
<button type="submit" onclick="showSpinner()" class="btn btn-primary">Zurück</button>
}
</div>
<div class="ml-3 bd-highlight">
<button type="button" class="btn btn-primary" id="reset-interval-finder-button" onclick="resetIntervalFinderForm()">Abbrechen</button>
</div>
<div class="ml-3 bd-highlight">
<button type="button" class="btn btn-primary" id="find-interval-finder-button" onclick="submitIntervalFinderForm()">Intervalle Prüfen</button>
</div>
</div>
</div>
<div class="form-row">
<div class="col-7 mx-0 pr-1">
<div class="form-group mb-1 ml-0 pl-0">
<div class="input-group date" id="scheduler-interval-end-picker" data-target-input="nearest">
<div class="input-group-prepend">
<div class="input-group-text prepend-text px-2">
Bis
</div>
</div>
<input value="@Model.IntervalEndDateStr" type="text" id="scheduler-interval-end" name="IntervalEnd" class="form-control datetimepicker-input" data-target="#scheduler-interval-end-picker" data-toggle="datetimepicker"/>
<div class="input-group-append" data-target="#scheduler-interval-end-picker" data-toggle="datetimepicker">
<div class="input-group-text px-2">
<i class="fas fa-calendar-alt"></i>
</div>
</div>
</div>
</div>
</div>
<div class="col-5 mx-0 pl-0">
<div class="form-group mb-1 ml-0 pl-0">
<div class="input-group date" id="scheduler-interval-end-time-picker" data-target-input="nearest">
<input value="@Model.IntervalEndTimeStr" type="text" id="scheduler-interval-end-time" name="IntervalEndTime" class="form-control datetimepicker-input" data-target="#scheduler-interval-end-time-picker"/>
<div class="input-group-append" data-target="#scheduler-interval-end-time-picker" data-toggle="datetimepicker">
<div class="input-group-text px-2">
<i class="fas fa-clock"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md">
<div class="form-group mb-1">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text prepend-text px-2">
Dauer
</div>
</div>
<input value="@Model.IntervalDurationStr" type="number" min="10" id="interval-duration" name="Duration" class="form-control"/>
</div>
</div>
</div>
</div>
@if(Model.HasResourcesEmployeesOrCustomers)
{
<!-- Hinzufügen-Buttons -->
<div class="form-row">
@if(AbstractModel.HasRightToViewEmployeeAppointments)
{
<div class="col-md">
<div class="form-group my-1">
<button type="button" class="btn btn-bewo-employee w-100" data-toggle="modal" data-target="#employees-interval-finder-popup">Mitarbeiter</button>
</div>
</div>
}
@if(AbstractModel.HasRightToViewCustomerAppointments)
{
<div class="col-md">
<div class="form-group my-1">
<button type="button" class="btn btn-bewo-customers w-100" data-toggle="modal" data-target="#customers-interval-finder-popup">Klienten</button>
</div>
</div>
}
@if(AbstractModel.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
{
<div class="col-md">
<div class="form-group my-1">
<button type="button" class="btn btn-bewo-resource w-100" data-toggle="modal" data-target="#resources-interval-finder-popup">Ressourcen</button>
</div>
</div>
}
</div>
<div class="form-row">
@if(AbstractModel.HasRightToViewEmployeeAppointments)
{
<div class="col-12">
<div class="form-group my-1">
<div class="list-group" id="selected-employees-interval-finder-list">
@foreach(var selectedEmployee in Model.SelectedEmployeesForIntervalFinder)
{
<div class="list-group-item my-auto" id="related-employee-interval-finder-@selectedEmployee.EmployeeOid">
<div class="row">
<div class="input-group">
<div class="input-group-prepend">
<i class="fas fa-user text-bewo-employee h-100"></i>
</div>
<p class="form-control border-0 bg-transparent text-truncate">
@selectedEmployee.DetailDescription
</p>
<div class="input-group-append">
@{
var url = Url.Action("SelectEmployeesForIntervalFinder", "Scheduler");
var oid = selectedEmployee.EmployeeOid;
var filterAppointmentsUrl = Url.Action("FetchAppointments", "Scheduler");
var onClickParams = $"{oid}, '-interval-finder-checkbox', false, '{url}', 'employees-interval-finder-popup', 'employees-interval-finder-popup', 'related-employee-interval-finder-', '{filterAppointmentsUrl}'";
}
<button type="button" class="btn btn-primary" onclick="removeSelectedItem(@onClickParams)">
<span class="fas fa-times-circle"></span>
</button>
</div>
</div>
</div>
</div>
}
</div>
</div>
</div>
}
@if(AbstractModel.HasRightToViewCustomerAppointments)
{
<div class="col-12">
<div class="form-group my-1">
<div class="list-group" id="selected-customers-interval-finder-list">
@foreach(var selectedCustomer in Model.SelectedCustomersForIntervalFinder)
{
<div class="list-group-item my-auto" id="related-customer-interval-finder-@selectedCustomer.CustomerOid">
<div class="row">
<div class="input-group">
<div class="input-group-prepend">
<i class="fas fa-user text-bewo-customers h-100"></i>
</div>
<p class="form-control border-0 bg-transparent text-truncate">
@selectedCustomer.DetailDescription
</p>
<div class="input-group-append">
@{
var url = Url.Action("SelectCustomersForIntervalFinder", "Scheduler");
var oid = selectedCustomer.CustomerOid;
var filterAppointmentsUrl = Url.Action("FetchAppointments", "Scheduler");
var onClickParams = $"{oid}, '-interval-finder-checkbox', false, '{url}', 'customers-interval-finder-popup', 'customers-interval-finder-popup', 'related-customer-interval-finder-', '{filterAppointmentsUrl}'";
}
<button type="button" class="btn btn-primary" onclick="removeSelectedItem(@onClickParams)">
<span class="fas fa-times-circle"></span>
</button>
</div>
</div>
</div>
</div>
}
</div>
</div>
</div>
}
@if(AbstractModel.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
{
<div class="col-12">
<div class="form-group my-1">
<div class="list-group" id="selected-resources-interval-finder-list">
@foreach(var selectedResource in Model.SelectedResourcesForIntervalFinder)
{
<div class="list-group-item my-auto" id="related-resource-interval-finder-item-@selectedResource.ResourceOid">
<div class="row">
<div class="input-group">
<div class="input-group-prepend">
<i class="fas fa-cubes text-bewo-resource h-100"></i>
</div>
<p class="form-control border-0 bg-transparent text-truncate">
@selectedResource.Name
</p>
<div class="input-group-append">
<button type="button" class="btn btn-primary" onclick="removeSelectedResource('related-resource-interval-finder-item-@selectedResource.ResourceOid', 'resource-@selectedResource.ResourceOid-interval-finder-checkbox', 'resources-interval-finder-popup', '@Url.Action("SelectResourcesForIntervalFinder", "Scheduler")', 'selected-resources-interval-finder-list', '@Url.Action("FetchAppointments", "Scheduler")', 'related-resource-interval-finder-item-', '-interval-finder-checkbox', 'all-resources-for-interval-finder-checkbox')"><span class="fas fa-times-circle"></span>
</button>
</div>
</div>
</div>
</div>
}
</div>
</div>
</div>
}
</div>
}
</div>
<button type="submit" class="d-none" id="hidden-submit-btn"></button>
}
<div class="d-flex bd-highlight mt-3">
<div class="mr-auto bd-highlight">
@using(Html.BeginForm("SetIsInIntervalFinderMode", "Scheduler", FormMethod.Post))
{
<button type="submit" onclick="showSpinner()" class="btn btn-primary">Zurück</button>
}
</div>
<div class="ml-3 bd-highlight">
<button type="button" class="btn btn-primary" id="reset-interval-finder-button" onclick="resetIntervalFinderForm()">Abbrechen</button>
</div>
<div class="ml-3 bd-highlight">
<button type="button" class="btn btn-primary" id="find-interval-finder-button" onclick="submitIntervalFinderForm()">Intervalle Prüfen</button>
</div>
</div>
</div>
@if(AbstractModel.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
{
@@ -376,9 +427,6 @@
var allResourcesCheckedVal = Model.AllResources.AreListEqual(Model.SelectedResourcesForIntervalFinder) ? "checked" : string.Empty;
}
<!-- ToDo: am 30.01.2023 hier weitermachen! Alle auswählen funktioniert noch nicht!
checkboxId, url, popupId, listId, itemIdPrefix, isCustomer, checkBoxIdSuffix, filterAppointmentsUrl, AllItemsCheckBoxSuffix
-->
<input type="checkbox" class="custom-control-input" id="all-resources-for-interval-finder-checkbox" @allResourcesCheckedVal onchange="selectAllCheckboxOnChange('all-resources-for-interval-finder-checkbox', '@Url.Action("SelectResourcesForIntervalFinder")', 'resources-interval-finder-popup', 'selected-resources-interval-finder-list', 'related-resource-interval-finder-item-', false, '-interval-finder-checkbox', null, 'all-resources-for-interval-finder-checkbox')" />
<label class="custom-control-label" for="all-resources-for-interval-finder-checkbox">Alle</label>
</div>
@@ -442,29 +490,68 @@
<div class="modal-body">
<div class="container-fluid">
<div class="input-group mb-3">
<input class="form-control w-100" type="text" placeholder="Suchen..." oninput="listSearchOnChange('interval-finder-employee-search-input', 'interval-finder-employee-text', 'interval-finder-employee-name-label')" id="interval-finder-employee-search-input" />
<div class="input-group-prepend">
<div class="input-group-text">
<div class="custom-control custom-checkbox custom-control-inline mx-auto">
@{
var allEmployeesCheckedVal = Model.AllEmployees.AreListEqual(Model.SelectedEmployeesForIntervalFinder) ? "checked" : string.Empty;
}
<input type="checkbox" class="custom-control-input" id="all-employees-for-interval-finder-checkbox" @allEmployeesCheckedVal
onchange="selectAllCheckboxOnChange('all-employees-for-interval-finder-checkbox', '@Url.Action("SelectEmployeesForIntervalFinder", "Scheduler")', 'employees-interval-finder-popup', 'selected-employees-interval-finder-list', 'related-employee-interval-finder-', false, '-interval-finder-checkbox', '@Url.Action("FetchAppointments", "Scheduler")', '')" />
<label class="custom-control-label" for="all-employees-for-interval-finder-checkbox">Alle</label>
</div>
</div>
</div>
<input class="form-control w-100" type="text" placeholder="Suchen..." oninput="listSearchOnChange('interval-finder-employee-search-input', 'interval-finder-employee-text', 'interval-finder-employee-name-label')" id="interval-finder-employee-search-input"/>
<div class="input-group-append">
<button type="button" class="btn btn-outline-secondary" onclick="resetSearch('interval-finder-employee-search-input', 'interval-finder-employee-text')">
<span class="fas fa-times-circle"></span>
</button>
</div>
</div>
@foreach(var employee in Model.AllEmployees)
@if(AbstractModel.HasRightToViewTeams)
{
var checkedValue = Model.SelectedEmployeesForIntervalFinder.Contains(employee) ? "checked" : string.Empty;
var url = Url.Action("SelectEmployeesForIntervalFinder", "Scheduler");
var filterAppointmentsUrl = Url.Action("FetchAppointments", "Scheduler");
var onClickParams = $"'{url}', 'employees-interval-finder-popup', 'selected-employees-interval-finder-list', 'related-employee-interval-finder-', false, '-interval-finder-checkbox', '{filterAppointmentsUrl}'";
<div class="custom-control custom-checkbox interval-finder-employee-text">
<input type="checkbox" class="custom-control-input" id="employee-@employee.EmployeeOid-interval-finder-checkbox" @checkedValue onchange="changeItemListSelection(@onClickParams)" />
<label class="custom-control-label interval-finder-employee-name-label" for="employee-@employee.EmployeeOid-interval-finder-checkbox">@employee.DetailDescription</label>
<div class="card w-100 mb-3">
<div class="card-header" data-toggle="collapse" data-target="#collapsable-teams-selection">
<div class="d-flex align-items-center">
<h5 class="mr-auto">Meine Teams</h5>
<div class="btn-group" role="group">
<span class="fas fa-chevron-down text-primary"></span>
</div>
</div>
</div>
<div class="collapse" id="collapsable-teams-selection">
<div class="card-body">
@foreach(var team in Model.MyTeams)
{
<button type="button" class="btn btn-bewo-teams w-100 my-2" onclick="selectTeamForIntervalFinder(@team.TeamOid)">@team.Name</button>
}
</div>
</div>
</div>
<hr />
}
<div class="popup-list-item-container">
@foreach(var employee in Model.AllEmployees)
{
var checkedValue = Model.SelectedEmployeesForIntervalFinder.Contains(employee) ? "checked" : string.Empty;
var url = Url.Action("SelectEmployeesForIntervalFinder", "Scheduler");
var filterAppointmentsUrl = Url.Action("FetchAppointments", "Scheduler");
var onClickParams = $"'{url}', 'employees-interval-finder-popup', 'selected-employees-interval-finder-list', 'related-employee-interval-finder-', false, '-interval-finder-checkbox', '{filterAppointmentsUrl}', '', getTeamMemberOids(), 'all-employees-for-interval-finder-checkbox'";
<div class="custom-control custom-checkbox interval-finder-employee-text">
<input type="checkbox" class="custom-control-input" id="employee-@employee.EmployeeOid-interval-finder-checkbox" @checkedValue onchange="changeItemListSelection(@onClickParams)" />
<label class="custom-control-label interval-finder-employee-name-label" for="employee-@employee.EmployeeOid-interval-finder-checkbox">@employee.DetailDescription</label>
</div>
}
</div>
</div>
</div>
<div class="modal-footer">
@@ -489,6 +576,19 @@
<div class="modal-body">
<div class="container-fluid">
<div class="input-group mb-3">
<div class="input-group-prepend">
<div class="input-group-text">
@{
var allCustomersCheckedVal = Model.AllCustomers.AreListEqual(Model.SelectedCustomersForIntervalFinder) ? "checked" : string.Empty;
}
<div class="custom-control custom-checkbox custom-control-inline mx-auto">
<input type="checkbox" class="custom-control-input" id="all-customers-for-interval-finder-checkbox" @allCustomersCheckedVal
onchange="selectAllCheckboxOnChange('all-customers-for-interval-finder-checkbox', '@Url.Action("SelectCustomersForIntervalFinder")', 'customers-interval-finder-popup', 'selected-customers-interval-finder-list', 'related-customer-interval-finder-', true, '-interval-finder-checkbox', '@Url.Action("FetchAppointments")', '')" />
<label class="custom-control-label" for="all-customers-for-interval-finder-checkbox">Alle</label>
</div>
</div>
</div>
<input class="form-control w-100" type="text" placeholder="Suchen..." oninput="listSearchOnChange('interval-finder-customer-search-input', 'interval-finder-customer-text', 'interval-finder-customer-name-label')" id="interval-finder-customer-search-input"/>
<div class="input-group-append">
<button type="button" class="btn btn-outline-secondary" onclick="resetSearch('interval-finder-customer-search-input', 'interval-finder-customer-text')">
@@ -496,22 +596,24 @@
</button>
</div>
</div>
<div class="popup-list-item-container">
@foreach(var customer in Model.AllCustomers)
{
var checkedValue = Model.SelectedCustomersForIntervalFinder.Contains(customer) ? "checked" : string.Empty;
@foreach(var customer in Model.AllCustomers)
{
var checkedValue = Model.SelectedCustomersForIntervalFinder.Contains(customer) ? "checked" : string.Empty;
var url = Url.Action("SelectCustomersForIntervalFinder", "Scheduler");
var url = Url.Action("SelectCustomersForIntervalFinder", "Scheduler");
var filterAppointmentsUrl = Url.Action("FetchAppointments", "Scheduler");
var filterAppointmentsUrl = Url.Action("FetchAppointments", "Scheduler");
var onClickParams = $"'{url}', 'customers-interval-finder-popup', 'selected-customers-interval-finder-list', 'related-customer-interval-finder-', true, '-interval-finder-checkbox', '{filterAppointmentsUrl}', '', getTeamMemberOids(), 'all-customers-for-interval-finder-checkbox'";
var onClickParams = $"'{url}', 'customers-interval-finder-popup', 'selected-customers-interval-finder-list', 'related-customer-interval-finder-', true, '-interval-finder-checkbox', '{filterAppointmentsUrl}'";
<div class="custom-control custom-checkbox interval-finder-customer-text">
<input type="checkbox" class="custom-control-input" id="customer-@customer.CustomerOid-interval-finder-checkbox" @checkedValue onchange="changeItemListSelection(@onClickParams)"/>
<label class="custom-control-label interval-finder-customer-name-label" for="customer-@customer.CustomerOid-interval-finder-checkbox">@customer.DetailDescription</label>
</div>
}
<div class="custom-control custom-checkbox interval-finder-customer-text">
<input type="checkbox" class="custom-control-input" id="customer-@customer.CustomerOid-interval-finder-checkbox" @checkedValue onchange="changeItemListSelection(@onClickParams)"/>
<label class="custom-control-label interval-finder-customer-name-label" for="customer-@customer.CustomerOid-interval-finder-checkbox">@customer.DetailDescription</label>
</div>
}
</div>
</div>
</div>
<div class="modal-footer">

View File

@@ -50,7 +50,13 @@
}
</div>
</div>
}
else if(Model.IntervalStartDate.HasValue && Model.IntervalEndDate.HasValue)
{
<div class="container-fluid mx-0 px-0">
<div class="alert alert-warning" role="alert" id="interval-finder-validation-alert">
Im ausgewählten Zeitraum zwischen dem @Model.IntervalStartDateStr @Model.IntervalStartTimeStr Uhr und dem @Model.IntervalEndDateStr @Model.IntervalEndTimeStr Uhr wurden keine freien Intervalle gefunden.
</div>
</div>
}

View File

@@ -10,6 +10,16 @@
logError(error);
}
}
function copyToServiceRecord(appointmentOid) {
try {
showSpinner();
$("#transformAppToServiceRecForm").submit();
} catch(error) {
hideSpinner();
logError(error);
}
}
</script>
@* Ganztagestermine in eine Liste mit weniger Margin und Padding *@
@@ -41,11 +51,16 @@
@if(appointment.IsException)
{
<span class="fa-stack ml-2" style="display: inline;">
<span class="fa-stack ml-2 mr-4" style="display: inline;">
<i class="fas fa-sync-alt fa-stack-1x text-secondary"></i>
<i class="fas fa-slash fa-stack-1x text-secondary"></i>
</span>
}
@if(appointment.HasServiceRecord)
{
<i class="ml-2 fas fa-clock text-bewo-service-records"></i>
}
</button>
</div>
</div>
@@ -129,11 +144,16 @@
@if(appointment.IsException)
{
<span class="fa-stack ml-2" style="display: inline;">
<span class="fa-stack ml-2 mr-4" style="display: inline;">
<i class="fas fa-sync-alt fa-stack-1x text-secondary"></i>
<i class="fas fa-slash fa-stack-1x text-secondary"></i>
</span>
}
@if(appointment.HasServiceRecord)
{
<i class="ml-1 fas fa-clock text-bewo-service-records"></i>
}
</button>
</div>
</div>
@@ -184,8 +204,20 @@
<span class="fas fa-trash-alt"></span>
</button>
</div>
@*<div class="col-auto">
<button type="button" class="btn btn-bewo-service-records" onclick="copyToServiceRecord(@appointment.Oid)">
<span>
<i class="fas fa-external-link-alt"></i>
<i class="fas fa-clock"></i>
</span>
</button>
</div>*@
</div>
}
using(Html.BeginForm("TransformAppointmentToServiceRecord", "Scheduler", FormMethod.Post, new {id="transformAppToServiceRecForm"}))
{
<input type="hidden" value="@appointment.Identifier" name="appointment-id-input" />
}
}
<p>@appointment.Description</p>
</div>

View File

@@ -62,7 +62,6 @@
}
});
// ToDo: Muss beim Selektieren/Deselektieren der Checkboxen und der Liste ausgeführt werden!
function selectAllCheckboxOnChange(checkboxId, url, popupId, listId, itemIdPrefix, isCustomer, checkBoxIdSuffix, filterAppointmentsUrl, allItemsCheckBoxSuffix) {
try {
if(checkboxId === null || checkboxId === undefined || checkboxId.length === 0 || checkboxId.split("-").length < 3) {
@@ -72,7 +71,7 @@
var value = $("#" + checkboxId).prop("checked");
var selectionPrefix = checkboxId.split("-")[1];
$("#" + selectionPrefix + "-popup input[type=checkbox]").each(function () {
$("#" + popupId + " input[type=checkbox]").each(function () {
var id = $(this).attr("id").split("-")[1];
if($.isNumeric(id) === false) {
@@ -83,7 +82,7 @@
});
if(selectionPrefix === "employees" || selectionPrefix === "customers") {
changeItemListSelection(url, popupId, listId, itemIdPrefix, isCustomer, checkBoxIdSuffix, filterAppointmentsUrl, allItemsCheckBoxSuffix, getTeamMemberOids());
changeItemListSelection(url, popupId, listId, itemIdPrefix, isCustomer, checkBoxIdSuffix, filterAppointmentsUrl, allItemsCheckBoxSuffix, getTeamMemberOids(), checkboxId);
} else {
changeResourceSelection(popupId, url, listId, itemIdPrefix, checkBoxIdSuffix, filterAppointmentsUrl, checkboxId);
}
@@ -209,17 +208,19 @@
</button>
</div>
</div>
<div class="row d-flex justify-content-center">
<div class="col-auto justify-content-center mx-1 px-0">
<div class="custom-control custom-checkbox d-inline mx-auto">
<input type="checkbox" class="custom-control-input" id="tasks-checkbox" onchange="toggleBetweenTasksAndAppointments()" />
<label for="tasks-checkbox" class="custom-control-label">Aufgaben anzeigen</label>
@if(!Model.IsInIntervalFinderMode)
{
<div class="row d-flex justify-content-center">
<div class="col-auto justify-content-center mx-1 px-0">
<div class="custom-control custom-checkbox d-inline mx-auto">
<input type="checkbox" class="custom-control-input" id="tasks-checkbox" onchange="toggleBetweenTasksAndAppointments()" />
<label for="tasks-checkbox" class="custom-control-label">Aufgaben anzeigen</label>
</div>
</div>
</div>
</div>
@if(Model.HasResourcesEmployeesOrCustomers)
if(Model.HasResourcesEmployeesOrCustomers)
{
<div class="row justify-content-center m-0 p-0 mt-1">
@if(AbstractModel.HasRightToViewEmployeeAppointments)
@@ -248,7 +249,8 @@
}
</div>
}
</div>
}
</div>
<div class="container-fluid">
<hr />
@@ -263,7 +265,7 @@
listCol = "col-md-12";
}
}
<div class="col col-12 @editorCol id="test-container">
<div class="col col-12 @editorCol" id="test-container">
@if(Model.IsInIntervalFinderMode)
{
<!-- Intervallfinder -->

View File

@@ -43,10 +43,11 @@
<script src="~/Scripts/utils/trimCanvas.js?v=1.17"></script>
<script src="~/Scripts/utils/resources-list-utils.js?v=1.17"></script>
<script src="~/Scripts/utils/list-utils.js?v=1.17"></script>
<script src="~/Scripts/utils/service-record-time-calc.js?v=1.17"></script>
<script src="~/Scripts/utils/service-record-time-calc.js?v=1.5"></script>
<script src="~/Scripts/utils/js-helper.js?v=1.17"></script>
<script src="~/Scripts/utils/logging.js?v=1.17"></script>
@*@Html.DevExpress().GetStyleSheets(
new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
new StyleSheet { ExtensionSuite = ExtensionSuite.Editors },

View File

@@ -3644,7 +3644,6 @@ namespace BeWo.Data.Access
return resources;
}
// ToDo: Alle geänderten und gelöschten Termine der Serien laden?
var changedOccurrencesCriteria = CreateCriteriaIsActive<SchedulerAppointment>().Add(Restrictions.Eq(nameof(SchedulerAppointment.Type), 3));
var deletedOccurrencesCriteria = CreateCriteria<SchedulerAppointment>().Add(Restrictions.Eq(nameof(SchedulerAppointment.Type), 4));

View File

@@ -210,7 +210,7 @@
<add key="ContractStateUrl" value="https://support.bewoplaner.de/api/getcontractstate.php?CustomerID=[TENANT]" />
<!--<add key="MaxDocumentSize" value="20971520" />-->
<add key="MaxDocumentSize" value="20971520" />
<add key="ICD10File" value="icd10.xml" />
<add key="ICD10File" value="ICD10\icd10.xml" />
<add key="FileRootDirectory" value="\BWP-Files" />
</appSettings>
<devExpress>