// Wird aufgerufen, wenn sich der Wert der CheckBox ändert. function changeItemListSelection(url, popupId, listId, itemIdPrefix, isCustomer, checkBoxIdSuffix, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids) { try { if (url === undefined || url === null) { logError("url ist undefined oder null"); return; } var oidStr = ""; var oids = []; var allChecked = true; $("#" + popupId + " input[type=checkbox]").each(function () { var id = $(this).attr("id").split("-")[1]; if($.isNumeric(id) === false) { return; } if ($(this).prop("checked")) { oids.push(id); oidStr += id + ","; } else { allChecked = false; } }); if(!isCustomer) { $("#my-teams-checkbox" + allItemsCheckBoxSuffix).prop("checked", arrayContainsAllItems(oids, teamMemberOids)); } if (allChecked === true) { $("#all-" + (isCustomer ? "customers" : "employees") + "-checkbox" + allItemsCheckBoxSuffix).prop("checked", true); } else { $("#all-" + (isCustomer ? "customers" : "employees") + "-checkbox" + allItemsCheckBoxSuffix).prop("checked", false); } $.get(url, { oidString: oidStr }).done(function (jsonResult) { updateSelectedList(jsonResult, listId, itemIdPrefix, isCustomer, popupId, checkBoxIdSuffix, url, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids); $("#one-day-scheduler-partial-container").load(filterAppointmentsUrl); }); } catch(error) { logError(error.message); } } // Wird aufgerufen, um die Liste mit den ausgewählten Objekten zu aktualisieren function updateSelectedList(jsonResult, listId, itemIdPrefix, isCustomer, popupId, checkBoxIdSuffix, url, filterAppointmentsUrl, allItemsCheckBoxSuffix, teamMemberOids) { try { if (isEmptyOrSpaces(jsonResult)) { return; } var listItems = $.parseJSON(jsonResult); var list = $("#" + listId); list.empty(); var colorClass = "text-bewo-employee"; if(isCustomer === true) { colorClass = "text-bewo-customers"; } $.each(listItems, function (index, item) { var oid; if(isCustomer === true) { oid = item.CustomerOid; } else { oid = item.EmployeeOid; } var id = itemIdPrefix + oid; var removeParams = oid + ", '" + checkBoxIdSuffix + "', " + isCustomer + ", '" + url + "', '" + popupId + "', '" + listId + "', '" + itemIdPrefix + "', '" + filterAppointmentsUrl + "', '" + allItemsCheckBoxSuffix + "', " + teamMemberOids; var html = "
" + item.LastName + ", " + item.FirstName + "
" + "