536 lines
27 KiB
Plaintext
536 lines
27 KiB
Plaintext
@using BeWoPlanerMobil.Models
|
|
|
|
@model DevelopmentModel
|
|
@{
|
|
ViewBag.Title = "Development";
|
|
}
|
|
|
|
<script>
|
|
$(function() {
|
|
$("#start-date-picker").datetimepicker({
|
|
locale: "de",
|
|
format: "L"
|
|
});
|
|
|
|
$("#end-date-picker").datetimepicker({
|
|
locale: "de",
|
|
format: "L"
|
|
});
|
|
});
|
|
|
|
function changeRightSelection(checkbox) {
|
|
// TODO: Methode aufrufen.
|
|
|
|
var rootElement = $("#rightsContainer");
|
|
|
|
var selectedRights = "";
|
|
|
|
var boxxxy = $(checkbox);
|
|
var boxxxyId = boxxxy.attr("id");
|
|
|
|
if (boxxxyId.includes("all-")) {
|
|
var groupName = boxxxyId.split("-")[1];
|
|
|
|
checkWholeRightGroupCheckBoxes(groupName);
|
|
}
|
|
|
|
var cbs = rootElement.find("input");
|
|
|
|
$.each(cbs, function(index, checkbox) {
|
|
var box = $(checkbox);
|
|
var id = box.attr("id");
|
|
|
|
if (!id.includes("all-") && box.prop("checked") === true) {
|
|
selectedRights += id + ";";
|
|
}
|
|
});
|
|
|
|
$.get("@Url.Action("UpdateSelectedRights")", { indicesString: selectedRights });
|
|
}
|
|
|
|
function checkWholeRightGroupCheckBoxes(groupContainerId) {
|
|
var allCheckBoxes = $("#" + groupContainerId + "-container").find("input");
|
|
|
|
var allCheckBox = $("#all-" + groupContainerId);
|
|
var isChecked = allCheckBox.prop("checked");
|
|
|
|
$.each(allCheckBoxes,
|
|
function(index, checkBox) {
|
|
var id = $(checkBox).prop("id");
|
|
|
|
if (!id.includes("all-")) {
|
|
$(checkBox).prop("checked", isChecked);
|
|
}
|
|
});
|
|
}
|
|
|
|
function updateAppointmentResources() {
|
|
var container = $("#resource-container");
|
|
|
|
var selectedResources = "";
|
|
|
|
var checkboxes = container.find("input");
|
|
|
|
$.each(checkboxes, function(index, checkbox) {
|
|
var isChecked = $(checkbox).prop("checked") === true;
|
|
|
|
if(isChecked) {
|
|
var id = $(checkbox).attr("id");// -> 17-checkbox
|
|
|
|
var splitId = id.split("-");
|
|
|
|
if(splitId.length === 2) {
|
|
selectedResources += splitId[0] + ";";
|
|
}
|
|
}
|
|
});
|
|
|
|
$.get("@Url.Action("UpdateAppointmentResources")", { selectedResourceOids: selectedResources }).done(function(numberOfSelectedResources) {
|
|
$("#selected-resources-count-badge").text(numberOfSelectedResources);
|
|
});
|
|
}
|
|
|
|
function addEmployeeToAppointment() {
|
|
var selectedEmployees = [];
|
|
|
|
var oidString = "";
|
|
|
|
$("#employee-list input:checked").each(function() {
|
|
var oid = $(this).val();
|
|
|
|
selectedEmployees.push(oid);
|
|
});
|
|
|
|
for (var i = 0; i < selectedEmployees.length; i++) {
|
|
oidString += selectedEmployees[i];
|
|
|
|
if (i < selectedEmployees.length - 1) {
|
|
oidString += ",";
|
|
}
|
|
}
|
|
|
|
$.get("@Url.Action("AddEmployeeToAppointment")", { employeeOids: oidString }).done(function(numberOfSelectedEmployees) {
|
|
$("#selected-employees-count-badge").text(numberOfSelectedEmployees);
|
|
});
|
|
}
|
|
|
|
function addCustomerToAppointment() {
|
|
var selectedCustomers = [];
|
|
|
|
var oidString = "";
|
|
|
|
$("#customer-list input:checked").each(function() {
|
|
var oid = $(this).val();
|
|
|
|
selectedCustomers.push(oid);
|
|
});
|
|
|
|
for(var i = 0; i < selectedCustomers.length; i++) {
|
|
oidString += selectedCustomers[i];
|
|
|
|
if(i < selectedCustomers.length - 1) {
|
|
oidString += ",";
|
|
}
|
|
}
|
|
|
|
$.get("@Url.Action("AddCustomerToAppointment")", { customerOids: oidString }).done(function(numberOfSelectedCustomers) {
|
|
$("#selected-customers-count-badge").text(numberOfSelectedCustomers);
|
|
});
|
|
}
|
|
|
|
function deleteTestAppointments() {
|
|
try {
|
|
showSpinner();
|
|
|
|
$("#deleteAppointmentsForm").submit();
|
|
} catch (error) {
|
|
hideSpinner();
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<!--
|
|
TODO: Liste mit Rechtegruppenobjekten, die jeweils eine Liste für die UserRightTypes haben
|
|
TODO: Zugewiesene Rechte anhaken!
|
|
|
|
TODO: Einstellungen für Standartwerte?
|
|
TODO: Notiz und Betreff automatisch einfügen. Mit spezieller Notiz anhand derer man die Testtermine identifizieren und wieder löschen kann.
|
|
-->
|
|
<div class="container-fluid mt-3 w-50" id="rightsContainer">
|
|
<div class="form-row">
|
|
<div class="col-md-12">
|
|
<ul class="nav nav-tabs" role="tab-list">
|
|
<li class="nav-item">
|
|
<a href="#rights-tab" data-toggle="tab" role="tab" class="nav-link">
|
|
Rechte
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a href="#scheduler-tab" data-toggle="tab" role="tab" class="nav-link active">
|
|
Kalender
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a href="#service-records-tab" data-toggle="tab" role="tab" class="nav-link">
|
|
Zeiterfassung
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
<div class="tab-content mt-3">
|
|
<div class="tab-pane show" id="rights-tab" role="tabpanel">
|
|
@{
|
|
var count = Model.UserRightGroups.Count;
|
|
const int 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);
|
|
|
|
var areAllCheckedValue = group.AreAllChecked ? "checked=\"checked\"" : "";
|
|
|
|
<div class="col-md-3">
|
|
<div class="card">
|
|
<div class="card-body" id="@group.Title-container">
|
|
<div class="card-title text-bewo-customer-card-header">
|
|
@group.Title
|
|
</div>
|
|
<hr />
|
|
@foreach(var right in group.UserRightTypes)
|
|
{
|
|
var checkedValue = right.Value.IsAssigned ? "checked=\"checked\"" : "";
|
|
|
|
<div class="row ml-1">
|
|
<div class="custom-control custom-checkbox">
|
|
<input type="checkbox" class="custom-control-input" id="cb-@right.Key" onchange="changeRightSelection(this)" @checkedValue />
|
|
<label class="custom-control-label" for="cb-@right.Key">@right.Value.Translation</label>
|
|
</div>
|
|
</div>
|
|
}
|
|
<hr />
|
|
<div class="custom-control custom-checkbox">
|
|
<input type="checkbox" class="custom-control-input" id="all-@group.Title" onchange="changeRightSelection(this)" @areAllCheckedValue />
|
|
<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);
|
|
|
|
var areAllCheckedValue = group.AreAllChecked ? "checked=\"checked\"" : "";
|
|
|
|
<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)
|
|
{
|
|
var checkedValue = right.Value.IsAssigned ? "checked=\"checked\"" : "";
|
|
|
|
<div class="row ml-1">
|
|
<div class="custom-control custom-checkbox">
|
|
<input type="checkbox" class="custom-control-input" id="cb-@right.Key" onchange="changeRightSelection(this)" @checkedValue />
|
|
<label class="custom-control-label" for="cb-@right.Key">@right.Value.Translation</label>
|
|
</div>
|
|
</div>
|
|
}
|
|
<hr />
|
|
<div class="custom-control custom-checkbox">
|
|
<input type="checkbox" class="custom-control-input" id="all-@group.Title" onchange="changeRightSelection(this)" @areAllCheckedValue />
|
|
<label class="custom-control-label" for="all-@group.Title">Alle</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
groupIndex++;
|
|
}
|
|
</div>
|
|
}
|
|
}
|
|
</div>
|
|
<div class="tab-pane show active" id="scheduler-tab" role="tabpanel">
|
|
<div class="row">
|
|
<div class="col col-12">
|
|
@using(Html.BeginForm("InsertTestAppointments", "Development", FormMethod.Post))
|
|
{
|
|
// Start, Ende, unendliche serientermine?, Mitarbeiter, Ersteller, Klienten, Ressourcen, Titel, Kommentar
|
|
|
|
/*
|
|
* Was soll passieren?
|
|
*
|
|
* Es sollen Termine erstellt werden mit dem angemeldeten Mitarbeiter als Originator, private Termine, ganztägige Termine und mehrtägige Termine dieser Konfiguration
|
|
* Das ganze dann nochmal mit einem anderen, ausgewählten Mitarbeiter als Originator.
|
|
*
|
|
* Mögliche Konfigurationen:
|
|
* Nur Originator (4):
|
|
* Normal
|
|
* Privat
|
|
* Ganztägig
|
|
* Mehrtägig
|
|
*
|
|
* Originator und Mitarbeiter (4)
|
|
* Originator und Ressourcen (4)
|
|
* Originator und Klienten (4)
|
|
* Originator und Mitarbeiter und Ressourcen (4)
|
|
* Originator und Mitarbeiter und Klienten (4)
|
|
* Originator und Ressourcen und Klienten (4)
|
|
* Originator und Mitarbeiter und Ressourcen und Klienten (4)
|
|
*
|
|
* Insgesamt also 28 Termine
|
|
*
|
|
*
|
|
* All das nochmal als private Termine
|
|
* All das mit einem anderen, ausgewählten Mitarbeiter als Originator als der angemeldete Mitarbeiter.
|
|
*
|
|
* Serientermine (616 mögliche Kombinationen) [alle realisieren und per Checkboxen konfigurierbar machen]
|
|
*
|
|
* Täglich, Wöchentlich, Monatlich, Jährlich ()
|
|
*
|
|
* Täglich (6) * 28 = 168
|
|
* Alle x Tage
|
|
* Kein Ende
|
|
* Ende nach x Terminen
|
|
* Ende am dd.mm.yyyy
|
|
*
|
|
* Werktäglich
|
|
* Kein Ende
|
|
* Ende nach x Terminen
|
|
* Ende am dd.mm.yyyy
|
|
*
|
|
* Wöchentlich (3) * 28 = 84
|
|
* Alle x Wochen am:
|
|
* Sonntag | Montag | Dienstag | Mittwoch | Donnerstag | Freitag | Samstag
|
|
*
|
|
* Kein Ende
|
|
* Ende nach x Terminen
|
|
* Ende am dd.mm.yyyy
|
|
*
|
|
* Monatlich (6) * 28 = 168
|
|
* X-ter Tag jedes x. Monats
|
|
* Kein Ende
|
|
* Ende nach x Terminen
|
|
* Ende am dd.mm.yyyy
|
|
*
|
|
* Jeden x. [Wochentag] jedes x. Monats
|
|
* Kein Ende
|
|
* Ende nach x Terminen
|
|
* Ende am dd.mm.yyyy
|
|
*
|
|
* Jährlich (6) * 28 = 168
|
|
* Am xx.yy.
|
|
* Kein Ende
|
|
* Ende nach x Terminen
|
|
* Ende am dd.mm.yyyy
|
|
*
|
|
* Am [ersten, zweiten, dritten, vierten, letzten] [Wochentag] im [Monat]
|
|
* Kein Ende
|
|
* Ende nach x Terminen
|
|
* Ende am dd.mm.yyyy
|
|
*
|
|
* Insgesamt 616 mögliche Kombinationen
|
|
*/
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<div class="form-group mb-1">
|
|
<label for="start-date">Start</label>
|
|
<div class="input-group date" id="start-date-picker" data-target-input="nearest">
|
|
<input type="text" id="start-date" name="interval-start-date" class="form-control datetimepicker-input" data-target="#start-date-picker" data-toggle="datetimepicker" value="@DateTime.Today.ToShortDateString()" />
|
|
<div class="input-group-append" data-target="#start-date-picker" data-toggle="datetimepicker">
|
|
<div class="input-group-text"><i class="fas fa-calendar-alt"></i></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group mb-1">
|
|
<label for="start-date">Ende</label>
|
|
<div class="input-group date" id="end-date-picker" data-target-input="nearest">
|
|
<input type="text" id="end-date" name="interval-end-date" class="form-control datetimepicker-input" data-target="#end-date-picker" data-toggle="datetimepicker" value="@DateTime.Today.AddYears(1).ToShortDateString()" />
|
|
<div class="input-group-append" data-target="#end-date-picker" data-toggle="datetimepicker">
|
|
<div class="input-group-text"><i class="fas fa-calendar-alt"></i></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="form-group mb-1">
|
|
@Html.LabelFor(m => m.SelectedEmployeeOid)
|
|
@Html.DropDownListFor(m => m.SelectedEmployeeOid, Model.AvailableEmployees, new { id = "employeesDropDown", @class = "custom-select" })
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<label for="employees-button">Mitarbeiter</label>
|
|
<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#appointment-employee-selection-popup" id="employees-button">
|
|
Mitarbeiter hinzufügen <span class="badge badge-light text-primary" id="selected-employees-count-badge">@Model.SelectedEmployees.Count</span>
|
|
</button>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label for="customers-button">Klienten</label>
|
|
<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#appointment-customer-selection-popup" id="customers-button">
|
|
Klienten hinzufügen <span class="badge badge-light text-primary" id="selected-customers-count-badge">@Model.SelectedCustomers.Count</span>
|
|
</button>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label for="resources-button">Ressourcen</label>
|
|
<button type="button" class="btn btn-primary btn-block" data-toggle="modal" data-target="#resources-popup" id="resources-button">
|
|
Ressourcen hinzufügen <span class="badge badge-light text-primary" id="selected-resources-count-badge">@Model.SelectedResources.Count</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div class="row mt-3">
|
|
<div class="col-auto mr-auto">
|
|
<button type="submit" class="btn btn-primary">Termine erzeugen</button>
|
|
</div>
|
|
<div class="col-auto">
|
|
<button type="button" class="btn btn-danger" onclick="deleteTestAppointments()">
|
|
Termine löschen
|
|
<span class="fas fa-trash"></span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tab-pane show" id="service-records-tab" role="tabpanel">
|
|
Hilfeplanauswahl bzw. CostbearerRelations
|
|
Zeitraum
|
|
Anzahl Stunden pro Woche (fest, keine andere Auswahl zunächst)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
@using(Html.BeginForm("DeleteTestAppointments", "Development", FormMethod.Post, new { id = "deleteAppointmentsForm" } )) { }
|
|
|
|
<div class="modal" tabindex="-1" role="dialog" id="resources-popup">
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h6 class="modal-title">Ressourcen</h6>
|
|
<button type="button" class="close" data-dismiss="modal">
|
|
<span>×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="container-fluid" id="resource-container">
|
|
@foreach(var category2Resources in Model.ResourceCategories2Resources)
|
|
{
|
|
<div class="card w-100 mb-3" id="resource-category-@category2Resources.Key.ValueListEntryOid">
|
|
<div class="card-header" data-toggle="collapse" data-target="#collapsable-resource-category-@category2Resources.Key.ValueListEntryOid">
|
|
<div class="d-flex align-items-center">
|
|
<h5 class="mr-auto">@category2Resources.Key.DisplayName</h5>
|
|
<div class="btn-group" role="group">
|
|
<span class="fas fa-chevron-down text-primary"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="collapse" id="collapsable-resource-category-@category2Resources.Key.ValueListEntryOid">
|
|
<div class="card-body">
|
|
@foreach(var resource in category2Resources.Value)
|
|
{
|
|
var checkedValue = Model.SelectedResources.Contains(resource) ? "checked" : string.Empty;
|
|
|
|
<div class="custom-control custom-checkbox">
|
|
<input type="checkbox" class="custom-control-input" id="@resource.ResourceOid-checkbox" @checkedValue onchange="updateAppointmentResources()" />
|
|
<label class="custom-control-label" for="@resource.ResourceOid-checkbox">@resource.Name</label>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary" data-dismiss="modal">Übernehmen</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal" tabindex="-1" role="dialog" id="appointment-employee-selection-popup">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Mitarbeiter hinzufügen</h5>
|
|
<button type="button" class="close" data-dismiss="modal">
|
|
<span>×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<ul class="list-group" id="employee-list">
|
|
@foreach(var employee in Model.AllEmployees)
|
|
{
|
|
<li class="list-group-item">
|
|
@{
|
|
var checkedValue = Model.SelectedEmployees.Contains(employee) ? "checked=\"checked\"" : string.Empty;
|
|
}
|
|
|
|
<div class="custom-control custom-checkbox custom-control-inline">
|
|
<input type="checkbox" @checkedValue class="custom-control-input" id="appointment-employee-@employee.EmployeeOid" onchange="addEmployeeToAppointment()" value="@employee.EmployeeOid" />
|
|
<label for="appointment-employee-@employee.EmployeeOid" class="custom-control-label">@employee.DetailDescription</label>
|
|
</div>
|
|
</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal" tabindex="-1" role="dialog" id="appointment-customer-selection-popup">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Klienten hinzufügen</h5>
|
|
<button type="button" class="close" data-dismiss="modal">
|
|
<span>×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<ul class="list-group" id="customer-list">
|
|
@foreach(var customer in Model.AllCustomers)
|
|
{
|
|
<li class="list-group" id="customer-list">
|
|
@{
|
|
var checkedValue = Model.SelectedCustomers.Contains(customer) ? "checked=\"checked\"" : string.Empty;
|
|
}
|
|
|
|
<div class="custom-control custom-checkbox custom-control-inline">
|
|
<input type="checkbox" @checkedValue class="custom-control-input" id="appointment-customer-@customer.CustomerOid" onchange="addCustomerToAppointment()" value="@customer.CustomerOid"/>
|
|
<label for="appointment-customer-@customer.CustomerOid" class="custom-control-label">@customer.DetailDescription</label>
|
|
</div>
|
|
</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> |