Termine mit ausgewählten Ressourcen werden anonymisiert angezeigt
This commit is contained in:
@@ -95,8 +95,13 @@ namespace BeWo.Scheduler.Utils
|
||||
return appointment.GetCustomFieldStorage()?.HasServiceRecordEntry ?? false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static bool CF_CanBeEdited(this Appointment appointment)
|
||||
{
|
||||
return appointment.GetCustomFieldStorage()?.CanBeEdited ?? false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void CF_IsTask(this Appointment appointment, bool pIsTask)
|
||||
{
|
||||
appointment.GetCustomFieldStorage().IsTask = pIsTask;
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
Visibility="{Binding ViewInfo.View.AppointmentToolTipVisibility, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ToolTipVisibilityConverter}}">
|
||||
</ToolTip>
|
||||
</ToolTipService.ToolTip>
|
||||
<!-- Endregion -->
|
||||
<!-- Endregion -->
|
||||
<dxschint:AppointmentBorder x:Name="back" DefaultCornerRadius="4" Opacity="1" ViewInfo="{TemplateBinding ViewInfo}" Background="{Binding Path=ViewInfo.CustomViewInfo, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource AppointmentBorderZusageConverter}}">
|
||||
<dxschint:AppointmentBorder DefaultCornerRadius="3" DefaultMargin="2" ViewInfo="{TemplateBinding ViewInfo}" Background="{Binding Path=ViewInfo.CustomViewInfo[CustomFieldStorage].BackgroundColor, RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="1" DefaultBorderThickness="1">
|
||||
<dxschint:AppointmentBorder x:Name="AppointmentBorder" DefaultCornerRadius="2" DefaultMargin="0" ViewInfo="{TemplateBinding ViewInfo}" Background="Transparent">
|
||||
@@ -310,6 +310,8 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@@ -353,7 +355,6 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<!--<Border Grid.Column="0" Background="{Binding Converter={StaticResource NichtNochEinConverter}}" BorderThickness="1" BorderBrush="DimGray" Width="5" Margin="0,0,3,0" />-->
|
||||
<Border Grid.Column="0" Background="{Binding Converter={StaticResource NichtNochEinConverter}}" BorderThickness="1" BorderBrush="DimGray" Width="5" Margin="0,0,3,0" Visibility="{Binding Path=DataContext.CustomViewInfo[CustomFieldStorage].ToolTipZusageVisibility, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListView}}}" />
|
||||
<TextBlock Grid.Column="1" Foreground="DimGray" Text="{Binding Converter={StaticResource NichtNochEinConverter}, ConverterParameter=GibName}" />
|
||||
</Grid>
|
||||
@@ -364,7 +365,11 @@
|
||||
<TextBlock Margin="0,0,3,0" Grid.Row="4" Grid.Column="0" Text="{markup:Translate Klienten:}" Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].ToolTipCustomersVisibility}" />
|
||||
<TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding Path=CustomViewInfo, Converter={StaticResource AppointmentToolTipConverter}, ConverterParameter=Klienten}"
|
||||
Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].ToolTipCustomersVisibility}" />
|
||||
</Grid>
|
||||
<!-- Separator und "Angelegt von: " mit dem Namen des Originators -->
|
||||
<Separator Grid.Row="5" Grid.ColumnSpan="2" Height="1" Background="DimGray" Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].CanBeEdited, Converter={StaticResource BoolVisibilityConverter}}" />
|
||||
<TextBlock Margin="0,0,3,0" Grid.Row="6" Grid.Column="0" Text="Angelegt von:" Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].CanBeEdited, Converter={StaticResource BoolVisibilityConverter}}" />
|
||||
<TextBlock Margin="0,0,3,0" Grid.Row="6" Grid.Column="1" Text="{Binding Path=CustomViewInfo[CustomFieldStorage].Originator}" Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].CanBeEdited, Converter={StaticResource BoolVisibilityConverter}}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- DragDropHoverTimeCellsStyle -->
|
||||
|
||||
@@ -1536,7 +1536,7 @@ namespace BeWo.Scheduler.View
|
||||
var mitarbeiterliste = appointment.CF_EmployeeList();
|
||||
var istErsteller = ersteller?.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) ?? false;
|
||||
|
||||
if(!istErsteller && appointment.CF_IsPrivate() && !mitarbeiterliste.Any(a => Equals(a.Employee, BeWoApp.CompactLoggedOnEmployee)))
|
||||
if(!istErsteller && appointment.CF_IsPrivate() && !mitarbeiterliste.Any(a => Equals(a.Employee, BeWoApp.CompactLoggedOnEmployee)) || !appointment.CF_CanBeEdited())
|
||||
{
|
||||
darfTerminDetailsSehen = false;
|
||||
}
|
||||
|
||||
@@ -73,6 +73,8 @@ namespace BeWo.Scheduler.ViewModel
|
||||
|
||||
public InternalInfo InternalInfo { get; set; }
|
||||
|
||||
public bool CanBeEdited { get; set; }
|
||||
|
||||
public CustomFieldStorage()
|
||||
{
|
||||
|
||||
@@ -107,6 +109,7 @@ namespace BeWo.Scheduler.ViewModel
|
||||
_AbsenceTimeEnd = pAppointment.AbsenceTimeEnd;
|
||||
|
||||
HasServiceRecordEntry = pAppointment.HasServiceRecordEntry;
|
||||
CanBeEdited = pAppointment.CanBeEdited;
|
||||
}
|
||||
|
||||
public CustomFieldStorage(SchedulerAppointmentDC pAppointment)
|
||||
@@ -135,6 +138,8 @@ namespace BeWo.Scheduler.ViewModel
|
||||
RecurrenceIndex = pAppointment.RecurrenceIndex;
|
||||
|
||||
HasServiceRecordEntry = pAppointment.HasServiceRecordEntry;
|
||||
|
||||
CanBeEdited = pAppointment.CanBeEdited;
|
||||
}
|
||||
|
||||
public CustomFieldStorage(ObservableCollection<Employee2SchedulerAppointmentDC> pEmployees, List<CompactCustomerDC> pCustomers, List<ResourceDC> pResources, CompactEmployeeDC pOriginator, bool pIsPrivate, bool pIsTask, string pTaskDescription, DateTime? pDueDate, DateTime? pCompletedDate, string pCompletedNotice, List<CompactSupportConceptDC> pSupportConcepts, string pSubject, bool pIsAllDay)
|
||||
|
||||
@@ -550,10 +550,14 @@ namespace BeWo.Scheduler.ViewModel
|
||||
|
||||
public int RecurrenceIndex => BS.Shared.Core.Utils.GetRecurrenceIndexFromRecurrenceInfo(RecurrenceInfo);
|
||||
|
||||
public SchedulerAppointmentVM(SchedulerAppointmentDC pDC) : base(pDC, pDC.SchedulerAppointmentOid == null)
|
||||
public bool CanBeEdited { get; set; } = true;
|
||||
|
||||
|
||||
public SchedulerAppointmentVM(SchedulerAppointmentDC pDC) : base(pDC, pDC.SchedulerAppointmentOid == null)
|
||||
{
|
||||
IsTeilnahmeBestaetigung = pDC.IsTeilnahmeBestaetigung;
|
||||
}
|
||||
CanBeEdited = pDC.CanBeEdited;
|
||||
}
|
||||
|
||||
// Wird für Abwesenheiten genutzt
|
||||
public SchedulerAppointmentVM(bool pAllDay, string pSubject, DateTime pStart, DateTime pEnd, CompactEmployeeDC pOriginator, DateTime? absenceTimeStart, DateTime? absenceTimeEnd)
|
||||
@@ -604,6 +608,7 @@ namespace BeWo.Scheduler.ViewModel
|
||||
_HasServiceRecordEntry = pDataContract.HasServiceRecordEntry;
|
||||
|
||||
_IsArchived = pDataContract.ActivationType == ActivationTypeId.Archived;
|
||||
CanBeEdited = pDataContract.CanBeEdited;
|
||||
|
||||
|
||||
if(pDataContract.DueDate.HasValue)
|
||||
|
||||
@@ -2631,6 +2631,7 @@ namespace BeWo.Data.Access
|
||||
return c.List<Customer2Person>();
|
||||
}
|
||||
|
||||
// KALENDER
|
||||
public IList<SchedulerAppointment> LoadFilteredAppointments(bool pHasRightToSeeAllEmployeeAppointments, long pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomers, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, bool pIncludeInactiveOnes)
|
||||
{
|
||||
var recurrenceBetween = Format("'{0:yyyy-MM-dd} 00:00:00' BETWEEN STR_TO_DATE(SUBSTRING({1}, 24, 19), '%m/%d/%Y %H:%i:%s') AND STR_TO_DATE(SUBSTRING({1}, 50, 19), '%m/%d/%Y %H:%i:%s')", pIntervalStart, SchedulerAppointment.PropertyName_RecurrenceInfo);
|
||||
@@ -2729,6 +2730,7 @@ namespace BeWo.Data.Access
|
||||
return criteria.List<SchedulerAppointment>();
|
||||
}
|
||||
|
||||
// KALENDER
|
||||
public IEnumerable<SchedulerAppointment> LoadFilteredAppointmentsForEmployee(bool pHasRightToSeeAllEmployeeAppointments, long? pEmployeeOid, DateTime pIntervalStart, DateTime pIntervalEnd, List<long> pSelectedEmployees, List<long> pSelectedCustomers, List<long> pSelectedResources, bool pEmployeesOnly, bool pCustomersOnly, bool pResourcesOnly, bool pPrivateAppointmentsOnly, bool pOnlyMyAppointments, bool pIncludeInactiveOnes)
|
||||
{
|
||||
var mainCriteria = CreateRecurrenceCriteria(pIntervalStart, pIntervalEnd, pIncludeInactiveOnes);
|
||||
|
||||
@@ -78,8 +78,8 @@ namespace BeWo.Data
|
||||
{
|
||||
//String path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SessionFactoryError.txt");
|
||||
//System.IO.File.AppendAllText(path, String.Format("{0:dd.MM.yyyy HH:mm:ss}", DateTime.Now) + "\n" + e.Message + "\n" + e.StackTrace);
|
||||
Debug.WriteLine("<<<<< " + e.StackTrace + (e.InnerException != null ? e.InnerException.Message : string.Empty));
|
||||
throw new FaultException(e.StackTrace + e.InnerException != null ? e.InnerException.Message : string.Empty);
|
||||
Debug.WriteLine("<<<<< " + e.StackTrace + e.InnerException?.Message ?? string.Empty);
|
||||
throw new FaultException(e.StackTrace + e.InnerException?.Message ?? string.Empty);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -170,7 +170,7 @@ namespace BeWo.Data
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new FaultException(e.StackTrace + e.InnerException != null ? e.InnerException.Message : string.Empty);
|
||||
throw new FaultException(e.StackTrace + e.InnerException?.Message ?? string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace BeWo.Data
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new FaultException(e.StackTrace + e.InnerException != null ? e.InnerException.Message : string.Empty);
|
||||
throw new FaultException(e.StackTrace + e.InnerException?.Message ?? string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace BeWo.Service.DCEntityMapper
|
||||
pDataContract.ActivationType = pEntity.IsActive;
|
||||
pDataContract.ValueListEntries = pEntity.ValueList.ToDictionary(i => i.Entry.Oid.Value, i => i.Entry.Type);
|
||||
pDataContract.EmployeeColor = pEntity.EmployeeColor;
|
||||
pDataContract.RelatedCustomerOIDList = pEntity.Employee2CustomerList.Where(w => w.CustomerOid.HasValue).Select(s => s.CustomerOid.Value).ToList();
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
pDataContract.ActivationType = pEntity.IsActive;
|
||||
|
||||
pDataContract.CanBeEdited = true;
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
|
||||
@@ -1236,13 +1236,29 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
if(user != null)
|
||||
{
|
||||
result = result.Where(w => BS.Shared.Core.Utils.CheckSchedulerRights(w, SchedulerRightsCheckType.View, user)).ToList();
|
||||
var appointmentsToCheckForAnonymization = pSelectedResources.Any() || pResourcesOnly ? result.Where(w => w.ResourceList.Any() && false == SUtils.CheckSchedulerRights(w, SchedulerRightsCheckType.View, user)).ToList() : new List<SchedulerAppointmentDC>();
|
||||
|
||||
if(appointmentsToCheckForAnonymization.Any())
|
||||
{
|
||||
foreach(var a in appointmentsToCheckForAnonymization)
|
||||
{
|
||||
a.Subject = "Anonymisiert";
|
||||
a.Location = "Anonymisiert";
|
||||
a.Description = "Anonymisiert";
|
||||
a.CanBeEdited = false;
|
||||
a.CustomerList.Clear();
|
||||
a.EmployeeList.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
result = result.Where(w => (!w.ResourceList.Any() || SUtils.CheckSchedulerRights(w, SchedulerRightsCheckType.View, user)) && !appointmentsToCheckForAnonymization.Any(a => a.SchedulerAppointmentOid == w.SchedulerAppointmentOid)).ToList();
|
||||
|
||||
result.AddRange(appointmentsToCheckForAnonymization);
|
||||
}
|
||||
|
||||
// Aufgaben laden
|
||||
ConvertOldTasks(pEmployeeOid);
|
||||
|
||||
|
||||
var taskAppointmentDCs = MapperFactory.SchedulerAppointmentDCSchedulerAppointment.MapToNewDCs(DAOFactory.SearchDAO.LoadTaskAppointmentsForEmployee(pEmployeeOid, true));
|
||||
|
||||
result.AddRangeIfElementsNotIn(taskAppointmentDCs);
|
||||
@@ -1410,10 +1426,12 @@ namespace BeWo.Service.ServiceImplementations
|
||||
private static List<SchedulerAppointmentDC> FilterAppointments(IEnumerable<SchedulerAppointmentDC> pAppointments, long pEmployeeOid, ICollection<long> pFilteredEmployeeOids, ICollection<long> pSelectedCustomers, ICollection<long> pSelectedResources, bool pCustomersOnly, bool pResourcesOnly, bool pShowTasks = false)
|
||||
{
|
||||
var result = new List<SchedulerAppointmentDC>();
|
||||
|
||||
|
||||
foreach(var app in pAppointments)
|
||||
{
|
||||
var add = true;
|
||||
|
||||
|
||||
if(app.Originator != null && app.Originator.EmployeeOid == pEmployeeOid)
|
||||
{
|
||||
if(app.EmployeeList != null && app.EmployeeList.Count > 0)
|
||||
@@ -1429,6 +1447,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
}
|
||||
|
||||
// ToDo: Nicht herausnehmen, wenn Ressource in SelectedResources vorhanden ist.
|
||||
//Prüfe Klientenfilter
|
||||
if(!add)
|
||||
{
|
||||
@@ -1478,6 +1497,11 @@ namespace BeWo.Service.ServiceImplementations
|
||||
add = false;
|
||||
}
|
||||
|
||||
if(app.SchedulerAppointmentOid == 21852)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if(add)
|
||||
{
|
||||
result.Add(app);
|
||||
|
||||
@@ -668,6 +668,8 @@ namespace BS.Shared.Core
|
||||
|
||||
public static bool CheckSchedulerRights(List<CompactCustomerDC> pCustomerList, List<ResourceDC> pResourceList, List<Employee2SchedulerAppointmentDC> pEmployeeList, CompactEmployeeDC pOriginator, bool pIsNew, SchedulerRightsCheckType pCheckType, UserDC pLoggedOnUser)
|
||||
{
|
||||
// ToDo: Ressourcentermine anzeigen und gegebenenfalls zensieren, falls eine Ressource daraus in der Auswahlliste ist.
|
||||
|
||||
var loggedInEmployee = pLoggedOnUser.Employee;
|
||||
|
||||
var isAllowedToViewEverything = pLoggedOnUser.HasRight(UserRightType.ViewAll);
|
||||
@@ -679,23 +681,24 @@ namespace BS.Shared.Core
|
||||
pLoggedOnUser.HasRight(UserRightType.Customer_ViewMyCustomers);
|
||||
|
||||
var isAllowedToViewAllCustomerAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderKliententermineAlleAnsehen);
|
||||
var isAllowedToCreateCustomerAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderKliententermineAnlegen);
|
||||
var isAllowedToEditCustomerAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderKliententermineAendern);
|
||||
var isAllowedToCreateCustomerAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderKliententermineAnlegen);
|
||||
var isAllowedToEditCustomerAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderKliententermineAendern);
|
||||
|
||||
var isAllowedToViewEmployeeAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen);
|
||||
var isAllowedToViewEmployeeAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen);
|
||||
var isAllowedToCreateEmployeeAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAnlegen);
|
||||
var isAllowedToEditEmployeeAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAendern);
|
||||
var isAllowedToEditEmployeeAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderMitarbeitertermineAendern);
|
||||
|
||||
var isAllowedToViewResourceAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnsehen);
|
||||
var isAllowedToCreateResourceAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnlegen);
|
||||
var isAllowedToEditResourceAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAendern);
|
||||
var isAllowedToViewResourceAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnsehen);
|
||||
var isAllowedToCreateResourceAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAnlegen);
|
||||
var isAllowedToEditResourceAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAendern);
|
||||
var isAllowedToEditOtherEmployeesResourceAppointments = pLoggedOnUser.HasRight(UserRightType.KalenderRessourcentermineAndererAendern);
|
||||
|
||||
var hasEmployees = pEmployeeList?.Count > 0;
|
||||
var hasCustomers = pCustomerList?.Count > 0;
|
||||
var hasResources = pResourceList?.Count > 0;
|
||||
|
||||
var hasOnlyOwnCustomers = pCustomerList?.All(c => c.IsRelatedToEmployee) ?? false;
|
||||
// Prüfen, ob die Klienten alle in der Liste des Employees sind!
|
||||
var hasOnlyOwnCustomers = pCustomerList?.All(c => loggedInEmployee.RelatedCustomerOIDList.Contains(c.CustomerOid)) ?? false;
|
||||
|
||||
var isOwnAppointment = Equals(pOriginator, loggedInEmployee);
|
||||
var employeeListOnlyContainsEmployee = pEmployeeList?.Count == 1 && pEmployeeList[0].Employee.Equals(loggedInEmployee);
|
||||
|
||||
@@ -101,6 +101,8 @@ namespace BS.Shared.DataContracts
|
||||
[DataMember]
|
||||
public bool HasServiceRecordEntry { get; set; }
|
||||
|
||||
[DataMember]
|
||||
public bool CanBeEdited { get; set; } = true;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user