87 lines
4.0 KiB
Plaintext
87 lines
4.0 KiB
Plaintext
@using BS.Shared.Extensions
|
|
@model BeWoPlanerMobil.Models.DevExpressSchedulerModel
|
|
|
|
<script type="text/javascript">
|
|
function selectAllResourcesOnChange() {
|
|
const isChecked = $("#all-resources-checkbox").prop("checked");
|
|
|
|
$("#resource-input-container").load("@Url.Action("SelectAllResourcesForFiltering")", { isChecked: isChecked }, () => { scheduler.Refresh(); });
|
|
}
|
|
|
|
function removeSelectedResource(resourceOid) {
|
|
const checkbox = $(`#resource-${resourceOid}-checkbox`);
|
|
|
|
if(checkbox.length) {
|
|
checkbox.prop("checked", false);
|
|
}
|
|
|
|
changeResourceListSelection();
|
|
}
|
|
|
|
function changeResourceListSelection() {
|
|
const selectedResourceOids = $("#resource-input-container input:checked").map(function() {return $(this).attr("id").split("-")[1];}).get();
|
|
const allResourcesCount = $("#resource-input-container input[type=checkbox]").map(function () {return $(this).attr("id").split("-")[1];}).get().length;
|
|
const selectedResourcesCount = selectedResourceOids.length;
|
|
|
|
$("#all-resources-checkbox").prop("checked", (allResourcesCount === selectedResourcesCount));
|
|
|
|
showSpinner();
|
|
$("#resource-input-container").load(
|
|
"@Url.Action("UpdateResourceSelection")",
|
|
{
|
|
selectedResourceOids: selectedResourceOids
|
|
},
|
|
() => {
|
|
scheduler.Refresh();
|
|
hideSpinner();
|
|
}
|
|
);
|
|
}
|
|
</script>
|
|
|
|
<div class="modal" tabindex="-1" role="dialog" id="resources-popup-apt-flt">
|
|
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h6 class="modal-title text-center w-100 font-weight-bold">
|
|
<span class="fas fa-cubes text-bewo-resource"></span>
|
|
Ressourcen
|
|
</h6>
|
|
<button type="button" class="close" data-dismiss="modal" onclick="resetTreeSearch('resource-search-input', 'resource-text', 'category-card')">
|
|
<span>×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="container-fluid">
|
|
<div class="input-group mb-3">
|
|
<div class="input-group-prepend">
|
|
<div class="input-group-text">
|
|
<div class="custom-control custom-checkbox custom-control-inline mx-auto">
|
|
@{
|
|
var allResourcesCheckedVal = Model.PossibleResources.AreListEqual(Model.SelectedResources) ? "checked" : string.Empty;
|
|
}
|
|
|
|
<input type="checkbox" class="custom-control-input" id="all-resources-checkbox" @allResourcesCheckedVal onchange="selectAllResourcesOnChange()" />
|
|
<label class="custom-control-label" for="all-resources-checkbox">Alle</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<input class="form-control w-100" type="text" placeholder="Suchen..." oninput="treeSearchOnChange('resource-search-input', 'resource-text', 'category-card', 'resource-name-label', 'resource-list')" id="resource-search-input" />
|
|
<div class="input-group-append">
|
|
<button class="btn btn-outline-secondary" type="button" onclick="resetTreeSearch('resource-search-input', 'resource-text', 'category-card')">
|
|
<span class="fas fa-times-circle"></span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="resource-input-container">
|
|
@Html.Partial("AptFltResourcePopupListPartial")
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-primary" data-dismiss="modal">Übernehmen</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> |