Entwicklerwerkzeug im Mobilklienten hinzugefügt (noch keine Funktionalität)

This commit is contained in:
Lyndon Jetten
2020-12-17 13:43:57 +01:00
parent e10555e6b2
commit 79452aa505
3 changed files with 681 additions and 0 deletions

View File

@@ -0,0 +1,433 @@
using System.Collections.Generic;
using System.Web.Mvc;
using BeWoPlanerMobil.Models;
using BeWoPlanerMobil.Service;
using BeWoPlanerMobil.Util;
using BS.Shared;
using BS.Shared.Core;
using static BS.Shared.UserRightType;
namespace BeWoPlanerMobil.Controllers
{
// TODO: Rechte einstellen ungeachtet der Rechte das zu dürfen
// TODO: Termine erstellen (alle möglichen Kombinationen)
// TODO: Zeiterfassungseinträge erstellen
// TODO: Dokumentationsfelder anlegen
// TODO:
// TODO:
// TODO:
// TODO:
public class DevelopmentController : AbstractBaseController
{
private DevelopmentModel _Model;
public DevelopmentModel Model
{
get
{
if(!MobileSessionFacade.IsUserLoggedIn())
{
RedirectToActionPermanent("Index", "Login");
return null;
}
if(((DevelopmentModel) Session[ModelSessionConstants.DevelopmentModelKey])?.Employee == null)
{
_Model = new DevelopmentModel {Employee = MobileSessionFacade.LoggedInEmployee};
Session[ModelSessionConstants.DevelopmentModelKey] = _Model;
}
else
{
_Model = (DevelopmentModel) Session[ModelSessionConstants.DevelopmentModelKey];
}
return _Model;
}
}
[Authorize]
public ActionResult Development()
{
#if !DEBUG
return RedirectToActionPermanent("Main", "Main");
#endif
if(!MobileSessionFacade.IsUserLoggedIn() || Model == null)
{
return RedirectToActionPermanent("Index", "Login");
}
// 1. Universalrechte
var universalRechteGroup = new UserRightGroup("Universalrechte", new Dictionary<UserRightType, string>
{
{ViewAll, EnumTranslations.AllTranslations[ViewAll]},
{CreateAll, EnumTranslations.AllTranslations[CreateAll]},
{EditAll, EnumTranslations.AllTranslations[EditAll]},
{DeleteAll, EnumTranslations.AllTranslations[DeleteAll]}
});
// 2. Zeiterfassung
var serviceRecordRightGroup = new UserRightGroup("Zeiterfassung", new Dictionary<UserRightType, string>
{
{ServiceRecordView_View, EnumTranslations.AllTranslations[ServiceRecordView_View]},
{ServiceRecordView_Edit, EnumTranslations.AllTranslations[ServiceRecordView_Edit]},
{ServiceRecordView_Create, EnumTranslations.AllTranslations[ServiceRecordView_Create]},
{ServiceRecordView_Delete, EnumTranslations.AllTranslations[ServiceRecordView_Delete]},
{ServiceRecord_AllowChangeWithin24Hours, EnumTranslations.AllTranslations[ServiceRecord_AllowChangeWithin24Hours]},
{ServiceRecord_AllowCreateServiceRecordsForAllClients, EnumTranslations.AllTranslations[ServiceRecord_AllowCreateServiceRecordsForAllClients]},
{ServiceRecord_AllowCreationForOtherEmployees, EnumTranslations.AllTranslations[ServiceRecord_AllowCreationForOtherEmployees]},
{ServiceRecord_AllowEditAfterMaxDaysInNextMonth, EnumTranslations.AllTranslations[ServiceRecord_AllowEditAfterMaxDaysInNextMonth]},
{ServiceRecord_AllowCreateMoreFLSThanApproved, EnumTranslations.AllTranslations[ServiceRecord_AllowCreateMoreFLSThanApproved]},
{ServiceRecord_AllowCreateOverlappingFLS, EnumTranslations.AllTranslations[ServiceRecord_AllowCreateOverlappingFLS]},
{ServiceRecord_AllowCreationForOtherTeamMember, EnumTranslations.AllTranslations[ServiceRecord_AllowCreationForOtherTeamMember]},
{BookServiceRecordOutOfSupportConcept, EnumTranslations.AllTranslations[BookServiceRecordOutOfSupportConcept]},
{BookServiceRecordAfterSettlementInvoice, EnumTranslations.AllTranslations[BookServiceRecordAfterSettlementInvoice]},
{ServiceRecord_ShowHistory, EnumTranslations.AllTranslations[ServiceRecord_ShowHistory]},
{ServiceRecord_AllowCreateOverlappingFLSForEmployee, EnumTranslations.AllTranslations[ServiceRecord_AllowCreateOverlappingFLSForEmployee]},
{ServiceRecord_AllowCreatingGroupBooking, EnumTranslations.AllTranslations[ServiceRecord_AllowCreatingGroupBooking]},
{ServiceRecord_AllowCreatingMultiBooking, EnumTranslations.AllTranslations[ServiceRecord_AllowCreatingMultiBooking]},
{ServiceRecord_AllowEditForOtherEmployees, EnumTranslations.AllTranslations[ServiceRecord_AllowEditForOtherEmployees]},
{ServiceRecordAllowRebooking, EnumTranslations.AllTranslations[ServiceRecordAllowRebooking]},
{ServiceRecordAllowEditAfterMindays, EnumTranslations.AllTranslations[ServiceRecordAllowEditAfterMindays]},
{ServiceRecord_AllowCreateAfterEmployeeSignature, EnumTranslations.AllTranslations[ServiceRecord_AllowCreateAfterEmployeeSignature]},
{ServiceRecord_AllowEditAfterEmployeeSignature, EnumTranslations.AllTranslations[ServiceRecord_AllowEditAfterEmployeeSignature]},
{ServiceRecord_AllowDeleteAfterEmployeeSignature, EnumTranslations.AllTranslations[ServiceRecord_AllowDeleteAfterEmployeeSignature]},
{BewertenInZeiterfassung, EnumTranslations.AllTranslations[BewertenInZeiterfassung]}
});
// 3. Finanzen
var financeRightGroup = new UserRightGroup("Finanzen", new Dictionary<UserRightType, string>
{
{AccountingTransactionView_View, EnumTranslations.AllTranslations[AccountingTransactionView_View] },
{AccountingTransactionView_Edit, EnumTranslations.AllTranslations[AccountingTransactionView_Edit] },
{AccountingTransactionView_Create, EnumTranslations.AllTranslations[AccountingTransactionView_Create] },
{AccountingTransactionView_Delete, EnumTranslations.AllTranslations[AccountingTransactionView_Delete] }
});
// 4. Ressourcen
var resourceRightGroup = new UserRightGroup("Ressourcen", new Dictionary<UserRightType, string>
{
{ResourceBookingView_View, EnumTranslations.AllTranslations[ResourceBookingView_View] },
{ResourceBookingView_Edit, EnumTranslations.AllTranslations[ResourceBookingView_Edit] },
{ResourceBookingView_Create, EnumTranslations.AllTranslations[ResourceBookingView_Create] },
{ResourceBookingView_Delete, EnumTranslations.AllTranslations[ResourceBookingView_Delete] }
});
// 5. Berichte
var reportRightView = new UserRightGroup("Berichte", new Dictionary<UserRightType, string>
{
{QueryView_View, EnumTranslations.AllTranslations[QueryView_View] },
{QueryView_Edit, EnumTranslations.AllTranslations[QueryView_Edit] },
{QueryView_Create, EnumTranslations.AllTranslations[QueryView_Create] },
{QueryView_Delete, EnumTranslations.AllTranslations[QueryView_Delete] }
});
// 6. Hilfepläne
var supportConceptRightGroup = new UserRightGroup("Hilfepläne", new Dictionary<UserRightType, string>
{
{SupportConceptView_View, EnumTranslations.AllTranslations[SupportConceptView_View] },
{SupportConceptView_Edit, EnumTranslations.AllTranslations[SupportConceptView_Edit] },
{SupportConceptView_Create, EnumTranslations.AllTranslations[SupportConceptView_Create] },
{SupportConceptView_Delete, EnumTranslations.AllTranslations[SupportConceptView_Delete] },
{SupportConcept_ViewAllSupportConcepts, EnumTranslations.AllTranslations[SupportConcept_ViewAllSupportConcepts] },
{SupportConcept_AllowGoalOrientedSupportConcepts, EnumTranslations.AllTranslations[SupportConcept_AllowGoalOrientedSupportConcepts] },
{SupportConceptView_AllowArchiving, EnumTranslations.AllTranslations[SupportConceptView_AllowArchiving] },
{SupportConcept_ViewMyTeams, EnumTranslations.AllTranslations[SupportConcept_ViewMyTeams] },
{SupportConcept_AllowEditGoals, EnumTranslations.AllTranslations[SupportConcept_AllowEditGoals] },
{SupportConcept_AllowEditTasks, EnumTranslations.AllTranslations[SupportConcept_AllowEditTasks] },
{SupportConceptAllowReactivation, EnumTranslations.AllTranslations[SupportConceptAllowReactivation] },
{CostbearerAllowChange, EnumTranslations.AllTranslations[CostbearerAllowChange] }
});
// 7. Klienten
var customerRightGroup = new UserRightGroup("Klienten", new Dictionary<UserRightType, string>
{
{CustomerView_View,EnumTranslations.AllTranslations[CustomerView_View]},
{CustomerView_Edit,EnumTranslations.AllTranslations[CustomerView_Edit]},
{CustomerView_Create,EnumTranslations.AllTranslations[CustomerView_Create]},
{CustomerView_Delete,EnumTranslations.AllTranslations[CustomerView_Delete]},
{Customer_ViewMyCustomers,EnumTranslations.AllTranslations[Customer_ViewMyCustomers]},
{Customer_AllowArchiving,EnumTranslations.AllTranslations[Customer_AllowArchiving]},
{Customer_ViewMyTeams,EnumTranslations.AllTranslations[Customer_ViewMyTeams]},
{CustomerAllowReactivation,EnumTranslations.AllTranslations[CustomerAllowReactivation]},
{Customer_ViewMedication,EnumTranslations.AllTranslations[Customer_ViewMedication]},
{Customer_ViewDiagnosis,EnumTranslations.AllTranslations[Customer_ViewDiagnosis]},
{CustomerTeam_View,EnumTranslations.AllTranslations[CustomerTeam_View]},
{CustomerTeam_Edit,EnumTranslations.AllTranslations[CustomerTeam_Edit]},
{CustomerTeam_Delete,EnumTranslations.AllTranslations[CustomerTeam_Delete]},
{CustomerTeam_Create,EnumTranslations.AllTranslations[CustomerTeam_Create]},
{Customer_Anonymization,EnumTranslations.AllTranslations[Customer_Anonymization]},
{Customer_Full_Delete,EnumTranslations.AllTranslations[Customer_Full_Delete]}
});
// 8. Organisationen
var organisationRightGroup = new UserRightGroup("Organisationen", new Dictionary<UserRightType, string>
{
{OrganisationView_View,EnumTranslations.AllTranslations[OrganisationView_View]},
{OrganisationView_Edit,EnumTranslations.AllTranslations[OrganisationView_Edit]},
{OrganisationView_Create,EnumTranslations.AllTranslations[OrganisationView_Create]},
{OrganisationView_Delete,EnumTranslations.AllTranslations[OrganisationView_Delete]},
{OrganisationView_AllowEditCostBearer,EnumTranslations.AllTranslations[OrganisationView_AllowEditCostBearer]},
{Organisation_AllowArchiving,EnumTranslations.AllTranslations[Organisation_AllowArchiving]},
{OrganisationAllowReactivation,EnumTranslations.AllTranslations[OrganisationAllowReactivation]}
});
// 9. Personen
var personRightGroup = new UserRightGroup("Personen", new Dictionary<UserRightType, string>
{
{PersonView_View,EnumTranslations.AllTranslations[PersonView_View]},
{PersonView_Edit,EnumTranslations.AllTranslations[PersonView_Edit]},
{PersonView_Create,EnumTranslations.AllTranslations[PersonView_Create]},
{PersonView_Delete,EnumTranslations.AllTranslations[PersonView_Delete]},
{Person_AllowArchiving,EnumTranslations.AllTranslations[Person_AllowArchiving]},
{PersonAllowReactivation,EnumTranslations.AllTranslations[PersonAllowReactivation]},
{Person_Full_Delete,EnumTranslations.AllTranslations[Person_Full_Delete]}
});
// 10. Mitarbeiter
var employeeRightGroup = new UserRightGroup("Mitarbeiter", new Dictionary<UserRightType, string>
{
{EmployeeView_View,EnumTranslations.AllTranslations[EmployeeView_View]},
{EmployeeView_Edit,EnumTranslations.AllTranslations[EmployeeView_Edit]},
{EmployeeView_Create,EnumTranslations.AllTranslations[EmployeeView_Create]},
{EmployeeView_Delete,EnumTranslations.AllTranslations[EmployeeView_Delete]},
{Employee_AllowEditExtendedProperties,EnumTranslations.AllTranslations[Employee_AllowEditExtendedProperties]},
{Employee_AllowEditContracts,EnumTranslations.AllTranslations[Employee_AllowEditContracts]},
{Employee_AllowEditOwnEmployees,EnumTranslations.AllTranslations[Employee_AllowEditOwnEmployees]},
{Employee_AllowArchiving,EnumTranslations.AllTranslations[Employee_AllowArchiving]},
{Employee_AllowViewOwnEmployees,EnumTranslations.AllTranslations[Employee_AllowViewOwnEmployees]},
{Employee_AllowViewOwnTeam,EnumTranslations.AllTranslations[Employee_AllowViewOwnTeam]},
{Employee_ShowFinance,EnumTranslations.AllTranslations[Employee_ShowFinance]},
{EmployeeAllowReactivation,EnumTranslations.AllTranslations[EmployeeAllowReactivation]},
{Employee_Full_Delete,EnumTranslations.AllTranslations[Employee_Full_Delete]},
{Employee_Anonymization,EnumTranslations.AllTranslations[Employee_Anonymization]}
});
// 11. Teams
var teamRightGroup = new UserRightGroup("Teams", new Dictionary<UserRightType, string>
{
{TeamView_ViewAll,EnumTranslations.AllTranslations[TeamView_ViewAll]},
{TeamView_Edit,EnumTranslations.AllTranslations[TeamView_Edit]},
{TeamView_Create,EnumTranslations.AllTranslations[TeamView_Create]},
{TeamView_Delete,EnumTranslations.AllTranslations[TeamView_Delete]},
{TeamView_ViewMyTeams,EnumTranslations.AllTranslations[TeamView_ViewMyTeams]}
});
// 12. Benutzer
var userRightGroup = new UserRightGroup("Benutzer", new Dictionary<UserRightType, string>
{
{UserView_View,EnumTranslations.AllTranslations[UserView_View]},
{UserView_Edit,EnumTranslations.AllTranslations[UserView_Edit]},
{UserView_Create,EnumTranslations.AllTranslations[UserView_Create]},
{UserView_Delete,EnumTranslations.AllTranslations[UserView_Delete]},
{User_AllowOrderLicense,EnumTranslations.AllTranslations[User_AllowOrderLicense]},
{UserView_AllowChangePassword,EnumTranslations.AllTranslations[UserView_AllowChangePassword]},
{AllowChangeOwnPassword,EnumTranslations.AllTranslations[AllowChangeOwnPassword]}
});
// 13. Benutzergruppen
var userGroupRightGroup = new UserRightGroup("Benutzergruppen", new Dictionary<UserRightType, string>
{
{UserGroupView_View, EnumTranslations.AllTranslations[UserGroupView_View]},
{UserGroupView_Edit, EnumTranslations.AllTranslations[UserGroupView_Edit]},
{UserGroupView_Create, EnumTranslations.AllTranslations[UserGroupView_Create]},
{UserGroupView_Delete, EnumTranslations.AllTranslations[UserGroupView_Delete]}
});
// 14. Verwaltung
var administrationRightGroup = new UserRightGroup("Verwaltung", new Dictionary<UserRightType, string>
{
{AdministrationView_View, EnumTranslations.AllTranslations[AdministrationView_View]},
{AdministrationView_Edit, EnumTranslations.AllTranslations[AdministrationView_Edit]},
{AdministrationView_Create, EnumTranslations.AllTranslations[AdministrationView_Create]},
{AdministrationView_Delete, EnumTranslations.AllTranslations[AdministrationView_Delete]}
});
// 15. Auswertungen
var analysisRightGroup = new UserRightGroup("Auswertungen", new Dictionary<UserRightType, string>
{
{Analysis_Settlement_View, EnumTranslations.AllTranslations[Analysis_Settlement_View]},
{Analysis_EmployeeOverviewAll_View, EnumTranslations.AllTranslations[Analysis_EmployeeOverviewAll_View]},
{Analysis_ServiceOverview_View, EnumTranslations.AllTranslations[Analysis_ServiceOverview_View]},
{Analysis_SupportConceptOverviewAll_View, EnumTranslations.AllTranslations[Analysis_SupportConceptOverviewAll_View]},
{Analysis_AllowFLSOverviewForCostbearer, EnumTranslations.AllTranslations[Analysis_AllowFLSOverviewForCostbearer]},
{Analysis_AuslastungAllEmployee_View, EnumTranslations.AllTranslations[Analysis_AuslastungAllEmployee_View]},
{Analysis_AuslastungTeam_View, EnumTranslations.AllTranslations[Analysis_AuslastungTeam_View]},
{Analysis_Auslastung_View, EnumTranslations.AllTranslations[Analysis_Auslastung_View]},
{Analysis_AllowFLSOverviewForTeam, EnumTranslations.AllTranslations[Analysis_AllowFLSOverviewForTeam]},
{Analysis_AllowFLSOverviewForAllTeams, EnumTranslations.AllTranslations[Analysis_AllowFLSOverviewForAllTeams]},
{Kilometerauswertung_View, EnumTranslations.AllTranslations[Kilometerauswertung_View]},
{BewertungAuswertung_View, EnumTranslations.AllTranslations[BewertungAuswertung_View]},
{PivotTabelleAnsehen, EnumTranslations.AllTranslations[PivotTabelleAnsehen]},
{ResourceBookingView_AllowEditResourcesFromOtherEmployees, EnumTranslations.AllTranslations[ResourceBookingView_AllowEditResourcesFromOtherEmployees]},
{Jahresbericht, EnumTranslations.AllTranslations[Jahresbericht]}
});
// 16. AssessmentSheet
var assessmentSheetRightGroup = new UserRightGroup("AssessmentSheet", new Dictionary<UserRightType, string>
{
{AssessmentSheet_View, EnumTranslations.AllTranslations[AssessmentSheet_View]},
{AssessmentSheet_Edit, EnumTranslations.AllTranslations[AssessmentSheet_Edit]},
{AssessmentSheet_Create, EnumTranslations.AllTranslations[AssessmentSheet_Create]},
{AssessmentSheet_Delete, EnumTranslations.AllTranslations[AssessmentSheet_Delete]}
});
// 17. Gruppen
var groupOfPeopleRightGroup = new UserRightGroup("Gruppen", new Dictionary<UserRightType, string>
{
{GroupOfPeopleView_Edit, EnumTranslations.AllTranslations[GroupOfPeopleView_Edit]},
{GroupOfPeopleView_Create, EnumTranslations.AllTranslations[GroupOfPeopleView_Create]},
{GroupOfPeopleView_Delete, EnumTranslations.AllTranslations[GroupOfPeopleView_Delete]}
});
// 18. Mitarbeiterstundenkonto
var mitarbeiterstundenkontoRightGroup = new UserRightGroup("Mitarbeiterstundenkonto", new Dictionary<UserRightType, string>
{
{Mitarbeiterstundenkonto_ViewSelf, EnumTranslations.AllTranslations[Mitarbeiterstundenkonto_ViewSelf]},
{Mitarbeiterstundenkonto_ViewAll, EnumTranslations.AllTranslations[Mitarbeiterstundenkonto_ViewAll]},
{Mitarbeiterstundenkonto_ViewTeams, EnumTranslations.AllTranslations[Mitarbeiterstundenkonto_ViewTeams]}
});
// 19.
var schedulerRightGroup = new UserRightGroup("Kalender", new Dictionary<UserRightType, string>
{
{KalenderAnsehen,EnumTranslations.AllTranslations[KalenderAnsehen]},
{KalenderMitarbeitertermineAnsehen,EnumTranslations.AllTranslations[KalenderMitarbeitertermineAnsehen]},
{KalenderMitarbeitertermineAnlegen,EnumTranslations.AllTranslations[KalenderMitarbeitertermineAnlegen]},
{KalenderMitarbeitertermineAendern,EnumTranslations.AllTranslations[KalenderMitarbeitertermineAendern]},
{KalenderKliententermineAlleAnsehen,EnumTranslations.AllTranslations[KalenderKliententermineAlleAnsehen]},
{KalenderKliententermineAnlegen,EnumTranslations.AllTranslations[KalenderKliententermineAnlegen]},
{KalenderKliententermineAendern,EnumTranslations.AllTranslations[KalenderKliententermineAendern]},
{KalenderRessourcentermineAnsehen,EnumTranslations.AllTranslations[KalenderRessourcentermineAnsehen]},
{KalenderRessourcentermineAnlegen,EnumTranslations.AllTranslations[KalenderRessourcentermineAnlegen]},
{KalenderRessourcentermineAendern,EnumTranslations.AllTranslations[KalenderRessourcentermineAendern]},
{KalenderRessourcentermineAndererAendern,EnumTranslations.AllTranslations[KalenderRessourcentermineAndererAendern]},
{KalenderInZeiterfassungUebernehmen,EnumTranslations.AllTranslations[KalenderInZeiterfassungUebernehmen]},
{Termine_IntervalDelete,EnumTranslations.AllTranslations[Termine_IntervalDelete]}
});
// 20.
var textModuleRightGroup = new UserRightGroup("Textbausteine", new Dictionary<UserRightType, string>
{
{TextbausteineAlleAnsehen,EnumTranslations.AllTranslations[TextbausteineAlleAnsehen]},
{TextbausteineNurEigeneAnsehen,EnumTranslations.AllTranslations[TextbausteineNurEigeneAnsehen]},
{TextbausteineAlleBearbeiten,EnumTranslations.AllTranslations[TextbausteineAlleBearbeiten]},
{TextbausteineNurEigeneBearbeiten,EnumTranslations.AllTranslations[TextbausteineNurEigeneBearbeiten]}
});
// 21.
var cashManagingRightGroup = new UserRightGroup("Bargeldverwaltung", new Dictionary<UserRightType, string>
{
{BargeldverwaltungAnsehen,EnumTranslations.AllTranslations[BargeldverwaltungAnsehen]},
{BargeldverwaltungNurEigeneAnsehen,EnumTranslations.AllTranslations[BargeldverwaltungNurEigeneAnsehen]},
{BargeldverwaltungBearbeiten,EnumTranslations.AllTranslations[BargeldverwaltungBearbeiten]},
{BargeldverwaltungAnlegen,EnumTranslations.AllTranslations[BargeldverwaltungAnlegen]},
{BargeldverwaltungLoeschen,EnumTranslations.AllTranslations[BargeldverwaltungLoeschen]},
{BargeldverwaltungFinanzenAnsehen,EnumTranslations.AllTranslations[BargeldverwaltungFinanzenAnsehen]},
{BargeldverwaltungFinanzenAnlegen,EnumTranslations.AllTranslations[BargeldverwaltungFinanzenAnlegen]},
{BargeldverwaltungFinanzenBearbeiten,EnumTranslations.AllTranslations[BargeldverwaltungFinanzenBearbeiten]},
{BargeldverwaltungFinanzenLoeschen,EnumTranslations.AllTranslations[BargeldverwaltungFinanzenLoeschen]}
});
// 22.
var wohnheimRightGroup = new UserRightGroup("Wohnheime", new Dictionary<UserRightType, string>
{
{WohnheimView_View,EnumTranslations.AllTranslations[WohnheimView_View]},
{WohnheimView_Edit,EnumTranslations.AllTranslations[WohnheimView_Edit]},
{WohnheimView_Create,EnumTranslations.AllTranslations[WohnheimView_Create]},
{WohnheimView_Delete,EnumTranslations.AllTranslations[WohnheimView_Delete]},
{Wohnheim_AllowArchiving,EnumTranslations.AllTranslations[Wohnheim_AllowArchiving]}
});
// 23.
var assistanceKeyRightGroup = new UserRightGroup("Betreuungsschlüssel", new Dictionary<UserRightType, string>
{
{Betreuungsschluessel_View,EnumTranslations.AllTranslations[Betreuungsschluessel_View]},
{Betreuungsschluessel_Edit,EnumTranslations.AllTranslations[Betreuungsschluessel_Edit]},
{Betreuungsschluessel_Delete,EnumTranslations.AllTranslations[Betreuungsschluessel_Delete]},
{Betreuungsschluessel_Create,EnumTranslations.AllTranslations[Betreuungsschluessel_Create]}
});
// 24.
var documentRightGroup = new UserRightGroup("Dokumente", new Dictionary<UserRightType, string>
{
{DocumentsAllowViewAll,EnumTranslations.AllTranslations[DocumentsAllowViewAll]},
{DocumentsDownloadAll,EnumTranslations.AllTranslations[DocumentsDownloadAll]},
{DokumenteFinanzen,EnumTranslations.AllTranslations[DokumenteFinanzen]},
{DokumenteKlienten,EnumTranslations.AllTranslations[DokumenteKlienten]},
{DokumenteMitarbeiter,EnumTranslations.AllTranslations[DokumenteMitarbeiter]},
{DokumenteOrganisationen,EnumTranslations.AllTranslations[DokumenteOrganisationen]},
{DokumentePersonen,EnumTranslations.AllTranslations[DokumentePersonen]},
{DokumenteHilfeplaene,EnumTranslations.AllTranslations[DokumenteHilfeplaene]},
{DokumenteTeams,EnumTranslations.AllTranslations[DokumenteTeams]}
});
// 25. Sonstige
var sonstigeRightGroup = new UserRightGroup("Sonstige", new Dictionary<UserRightType, string>
{
{Support_View,EnumTranslations.AllTranslations[Support_View]},
{AdditionalService_View,EnumTranslations.AllTranslations[AdditionalService_View]},
{OvertimeView,EnumTranslations.AllTranslations[OvertimeView]},
{ChatSettings,EnumTranslations.AllTranslations[ChatSettings]},
{ChatAdminSettings,EnumTranslations.AllTranslations[ChatAdminSettings]},
{VertretungenView_View,EnumTranslations.AllTranslations[VertretungenView_View]}
});
Model.UserRightGroups.Clear();
Model.UserRightGroups.Add(universalRechteGroup);
Model.UserRightGroups.Add(serviceRecordRightGroup);
Model.UserRightGroups.Add(financeRightGroup);
Model.UserRightGroups.Add(resourceRightGroup);
Model.UserRightGroups.Add(reportRightView);
Model.UserRightGroups.Add(supportConceptRightGroup);
Model.UserRightGroups.Add(customerRightGroup);
Model.UserRightGroups.Add(organisationRightGroup);
Model.UserRightGroups.Add(personRightGroup);
Model.UserRightGroups.Add(employeeRightGroup);
Model.UserRightGroups.Add(teamRightGroup);
Model.UserRightGroups.Add(userRightGroup);
Model.UserRightGroups.Add(userGroupRightGroup);
Model.UserRightGroups.Add(administrationRightGroup);
Model.UserRightGroups.Add(analysisRightGroup);
Model.UserRightGroups.Add(assessmentSheetRightGroup);
Model.UserRightGroups.Add(groupOfPeopleRightGroup);
Model.UserRightGroups.Add(mitarbeiterstundenkontoRightGroup);
Model.UserRightGroups.Add(schedulerRightGroup);
Model.UserRightGroups.Add(textModuleRightGroup);
Model.UserRightGroups.Add(cashManagingRightGroup);
Model.UserRightGroups.Add(wohnheimRightGroup);
Model.UserRightGroups.Add(assistanceKeyRightGroup);
Model.UserRightGroups.Add(documentRightGroup);
Model.UserRightGroups.Add(sonstigeRightGroup);
return View(Model);
}
[Authorize]
public string UpdateSelectedRights(string indices)
{
// Format: UserRightGroups-Index;Dictionary-Index
// Bei alle? UserRightGroup-Index;0
return _LeerzeichenFuerGetMethoden;
}
}
public class UserRightGroup
{
public string Title { get; set; }
public Dictionary<UserRightType, string> UserRightTypes { get; set; }
public UserRightGroup(string title, Dictionary<UserRightType, string> userRightTypes)
{
Title = title ?? "Unbenannt";
UserRightTypes = userRightTypes ?? new Dictionary<UserRightType, string>();
}
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using BeWoPlanerMobil.Controllers;
namespace BeWoPlanerMobil.Models
{
public class DevelopmentModel : AbstractModel
{
public List<UserRightGroup> UserRightGroups { get; set; } = new List<UserRightGroup>();
}
}

View File

@@ -0,0 +1,235 @@
@using BeWoPlanerMobil.Models
@using DevExpress.DataProcessing
@model DevelopmentModel
@{
ViewBag.Title = "Development";
}
<script>
function changeRightSelection(indecesString) {
// TODO: Methode aufrufen.
}
</script>
<!-- TODO: Liste mit Rechtegruppenobjekten, die jeweils eine Liste für die UserRightTypes haben -->
<div class="container-fluid mt-3">
@{
var count = Model.UserRightGroups.Count;
var columnCount = 4;
var fullRows = count / columnCount;
var hasRest = (count % columnCount) > 0;
var rest = count % columnCount;
var groupIndex = 0;
for(var i = 0; i < fullRows; i++)
{
<div class="row my-3">
@for(var j = 0; j < columnCount; j++)
{
var group = Model.UserRightGroups.ElementAt(groupIndex);
<div class="col-md-3">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
@group.Title
</div>
<hr />
@foreach(var right in group.UserRightTypes)
{
<div class="row ml-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="cb-@right.Key" />
<label class="custom-control-label" for="cb-@right.Key">@right.Value</label>
</div>
</div>
}
<hr />
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="all-@group.Title" />
<label class="custom-control-label" for="all-@group.Title">Alle</label>
</div>
</div>
</div>
</div>
groupIndex++;
}
</div>
}
if(hasRest)
{
<div class="row my-3">
@for(var i = 0; i < rest; i++)
{
var group = Model.UserRightGroups.ElementAt(groupIndex);
<div class="col-md-3">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
@group.Title
</div>
<hr/>
@foreach(var right in group.UserRightTypes)
{
<div class="row ml-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="cb-@right.Key"/>
<label class="custom-control-label" for="cb-@right.Key">@right.Value</label>
</div>
</div>
}
<hr/>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="all-@group.Title"/>
<label class="custom-control-label" for="all-@group.Title">Alle</label>
</div>
</div>
</div>
</div>
groupIndex++;
}
</div>
}
}
@*for(var i = 0; i < Model.UserRightGroups.Count; i++)
{
var userRightGroup = Model.UserRightGroups.ElementAt(i);
if(i == 0 || i % 5 == 0)
{
<div class="row my-3">
<div class="col-md-2">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
@userRightGroup.Title
</div>
<hr/>
@foreach(var userRightType in userRightGroup.UserRightTypes)
{
var relIndex = userRightGroup.UserRightTypes.IndexOf(userRightType);
<div class="row ml-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="cb-@i-@relIndex" onchange="changeRightSelection()"/>
<label for="cb-@i-@relIndex" class="custom-control-label">@userRightType.Value</label>
</div>
</div>
}
<hr/>
<div class="row ml-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="all-@i" onchange="changeRightSelection()"/>
<label for="all-@i" class="custom-control-label">Alle</label>
</div>
</div>
</div>
</div>
</div>
</div>
}
else
{
}
}*@
@*@foreach(var userRightGroup in Model.UserRightGroups)
{
// TODO: In fünferpacks unterteilen
var index = Model.UserRightGroups.IndexOf(userRightGroup);
if(index == 0 || index % 5 == 0)
{
<div class="row my-3">
<div class="col-md-2">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
@userRightGroup.Title
</div>
<hr/>
@foreach(var userRightType in userRightGroup.UserRightTypes)
{
var relIndex = userRightGroup.UserRightTypes.IndexOf(userRightType);
<div class="row ml-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="cb-@index-@relIndex" onchange="changeRightSelection('@index;@relIndex')"/>
<label for="cb-@index-@relIndex" class="custom-control-label">@userRightType.Value</label>
</div>
</div>
}
<hr/>
<div class="row ml-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="all-@index" onchange="changeRightSelection('0;@index')"/>
<label for="all-@index" class="custom-control-label">Alle</label>
</div>
</div>
</div>
</div>
</div>
</div>
}
else
{
}
}*@
@*<div class="row my-3">
<div class="col-md-2">
<div class="card">
<div class="card-body">
<div class="card-title text-bewo-customer-card-header">
Universalrechte
</div>
<hr/>
<div class="row ml-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="checkbox-view-all-universal-rights"/>
<label for="checkbox-view-all-universal-rights" class="custom-control-label">Alles ansehen</label>
</div>
</div>
<div class="row ml-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="checkbox-create-all-universal-rights"/>
<label for="checkbox-create-all-universal-rights" class="custom-control-label">Alles anlegen</label>
</div>
</div>
<div class="row ml-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="checkbox-edit-all-universal-rights"/>
<label for="checkbox-edit-all-universal-rights" class="custom-control-label">Alles ändern</label>
</div>
</div>
<div class="row ml-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="checkbox-delete-all-universal-rights"/>
<label for="checkbox-delete-all-universal-rights" class="custom-control-label">Alles löschen</label>
</div>
</div>
<hr/>
<div class="row ml-1">
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="checkbox-all-universal-rights"/>
<label for="checkbox-all-universal-rights" class="custom-control-label">Alle</label>
</div>
</div>
</div>
</div>
</div>
</div>*@
</div>