From 79452aa505debdbfc49217edfd98b122f953a897 Mon Sep 17 00:00:00 2001 From: Lyndon Jetten Date: Thu, 17 Dec 2020 13:43:57 +0100 Subject: [PATCH] =?UTF-8?q?Entwicklerwerkzeug=20im=20Mobilklienten=20hinzu?= =?UTF-8?q?gef=C3=BCgt=20(noch=20keine=20Funktionalit=C3=A4t)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DevelopmentController.cs | 433 ++++++++++++++++++ BeWoPlanerMobil/Models/DevelopmentModel.cs | 13 + .../Views/Development/Development.cshtml | 235 ++++++++++ 3 files changed, 681 insertions(+) create mode 100644 BeWoPlanerMobil/Controllers/DevelopmentController.cs create mode 100644 BeWoPlanerMobil/Models/DevelopmentModel.cs create mode 100644 BeWoPlanerMobil/Views/Development/Development.cshtml diff --git a/BeWoPlanerMobil/Controllers/DevelopmentController.cs b/BeWoPlanerMobil/Controllers/DevelopmentController.cs new file mode 100644 index 000000000..76cb12140 --- /dev/null +++ b/BeWoPlanerMobil/Controllers/DevelopmentController.cs @@ -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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 + { + {TextbausteineAlleAnsehen,EnumTranslations.AllTranslations[TextbausteineAlleAnsehen]}, + {TextbausteineNurEigeneAnsehen,EnumTranslations.AllTranslations[TextbausteineNurEigeneAnsehen]}, + {TextbausteineAlleBearbeiten,EnumTranslations.AllTranslations[TextbausteineAlleBearbeiten]}, + {TextbausteineNurEigeneBearbeiten,EnumTranslations.AllTranslations[TextbausteineNurEigeneBearbeiten]} + }); + + // 21. + var cashManagingRightGroup = new UserRightGroup("Bargeldverwaltung", new Dictionary + { + {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 + { + {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 + { + {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 + { + {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 + { + {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 UserRightTypes { get; set; } + + public UserRightGroup(string title, Dictionary userRightTypes) + { + Title = title ?? "Unbenannt"; + UserRightTypes = userRightTypes ?? new Dictionary(); + } + } +} \ No newline at end of file diff --git a/BeWoPlanerMobil/Models/DevelopmentModel.cs b/BeWoPlanerMobil/Models/DevelopmentModel.cs new file mode 100644 index 000000000..d5900d729 --- /dev/null +++ b/BeWoPlanerMobil/Models/DevelopmentModel.cs @@ -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 UserRightGroups { get; set; } = new List(); + } +} \ No newline at end of file diff --git a/BeWoPlanerMobil/Views/Development/Development.cshtml b/BeWoPlanerMobil/Views/Development/Development.cshtml new file mode 100644 index 000000000..0ec7b9200 --- /dev/null +++ b/BeWoPlanerMobil/Views/Development/Development.cshtml @@ -0,0 +1,235 @@ +@using BeWoPlanerMobil.Models +@using DevExpress.DataProcessing + +@model DevelopmentModel +@{ + ViewBag.Title = "Development"; +} + + + + +
+ + @{ + 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++) + { +
+ @for(var j = 0; j < columnCount; j++) + { + var group = Model.UserRightGroups.ElementAt(groupIndex); + +
+
+
+
+ @group.Title +
+
+ @foreach(var right in group.UserRightTypes) + { +
+
+ + +
+
+ } +
+
+ + +
+
+
+
+ groupIndex++; + } +
+ } + + if(hasRest) + { +
+ @for(var i = 0; i < rest; i++) + { + var group = Model.UserRightGroups.ElementAt(groupIndex); + +
+
+
+
+ @group.Title +
+
+ @foreach(var right in group.UserRightTypes) + { +
+
+ + +
+
+ } +
+
+ + +
+
+
+
+ + groupIndex++; + } +
+ } + } + + @*for(var i = 0; i < Model.UserRightGroups.Count; i++) + { + var userRightGroup = Model.UserRightGroups.ElementAt(i); + + if(i == 0 || i % 5 == 0) + { +
+
+
+
+
+ @userRightGroup.Title +
+
+ + @foreach(var userRightType in userRightGroup.UserRightTypes) + { + var relIndex = userRightGroup.UserRightTypes.IndexOf(userRightType); +
+
+ + +
+
+ } +
+
+
+ + +
+
+
+
+
+
+ } + else + { + + } + }*@ + + @*@foreach(var userRightGroup in Model.UserRightGroups) + { + // TODO: In fünferpacks unterteilen + + var index = Model.UserRightGroups.IndexOf(userRightGroup); + + if(index == 0 || index % 5 == 0) + { +
+
+
+
+
+ @userRightGroup.Title +
+
+ + @foreach(var userRightType in userRightGroup.UserRightTypes) + { + var relIndex = userRightGroup.UserRightTypes.IndexOf(userRightType); +
+
+ + +
+
+ } +
+
+
+ + +
+
+
+
+
+
+ } + else + { + + } + }*@ + + @*
+
+
+
+
+ Universalrechte +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+
*@ +
\ No newline at end of file