Das Unterschriftenfeld befindet sich jetzt unter den Buttons und ist größer. Ca. 80% des Browserfensters.
Der Kommentar wird jetzt im Klientenfeld angezeigt.
1856 lines
66 KiB
JavaScript
1856 lines
66 KiB
JavaScript
var breitenGrad, langenGrad, date;
|
|
var dataURL = "";
|
|
var blob, newday, longrider;
|
|
var xinner = $("#GeoLocSaveXCOOR");
|
|
var yinner = $("#GeoLocSaveYCOOR");
|
|
|
|
var ZeiterfassungDatakonstrukt = [];
|
|
var KlientDatakonstrukt = [];
|
|
|
|
var klientzwischenspeicher = [];
|
|
|
|
var timeOut = 10000;
|
|
|
|
function buildCollapsibleSet(jsonString) {
|
|
try {
|
|
if(jsonString.length === 0) {
|
|
return;
|
|
}
|
|
|
|
var kollektion = $.parseJSON(jsonString);
|
|
|
|
actuallyBuildCollapsibleSet(kollektion, null);
|
|
} catch(exception) {
|
|
console.log('Fehler(BuildCollapsibleSet): ' + exception.message);
|
|
}
|
|
}
|
|
|
|
function actuallyBuildCollapsibleSet(kollektion, selectedGoalOids) {
|
|
$("#kollabierbar1").empty();
|
|
|
|
collapsibleHtml = "";
|
|
|
|
$.each(kollektion, function (index) {
|
|
buildGoalTreeItem(kollektion[index], selectedGoalOids);
|
|
});
|
|
|
|
$("#kollabierbar1").append(collapsibleHtml);
|
|
}
|
|
|
|
var level = 0;
|
|
|
|
var collapsibleHtml;
|
|
function buildGoalTreeItem(goalItem, selectedGoalOids) {
|
|
var goalOid = goalItem.ValueListEntryOid;
|
|
var goalHeader = goalItem.Header;
|
|
var isChecked = selectedGoalOids != null && isElementInArray(selectedGoalOids, goalOid) ? "checked" : "";
|
|
|
|
if (!goalItem.IsLeaf) {
|
|
//collapsibleHtml += '<input type="checkbox" style="width: auto;" onclick="updateGoals(' + goalOid + ')" id="' + goalOid + '" value="' + goalHeader + '" ' + isChecked + '/><label class="toggle-btnLabel" for="' + goalHeader + '">' + goalHeader + '</label>';
|
|
collapsibleHtml += '<div onclick="toggleOnclick(this);" class="toggle-btn-div" style="margin-right: 0; padding-right: 0;display: block;"><input type="checkbox" style="width: auto;" onclick="updateChildGoals(' + goalOid + ');event.stopPropagation();" id="goal' + goalOid + '" value="' + goalOid + '" ' + isChecked + ' />' + goalHeader + '</div>';
|
|
//collapsibleHtml += '<input onclick="toggleOnclick(this);" type="button" class="toggle-btn" value="' + goalHeader + '" style="margin-right: 0; padding-right: 0;" />';
|
|
collapsibleHtml += '<div style="margin-right: 0; padding-right: 0;display: none;" class="kollabierbar">';
|
|
|
|
try {
|
|
$.each(goalItem.Children,
|
|
function(index) {
|
|
|
|
buildGoalTreeItem(goalItem.Children[index], selectedGoalOids);
|
|
});
|
|
|
|
} catch(exception) {
|
|
console.log('Fehler bei der Baumkonstruktion: ' + exception.message);
|
|
}
|
|
collapsibleHtml += "</div>";
|
|
} else {
|
|
|
|
collapsibleHtml += '<div style="margin-right: 0; padding-right: 0;display: block;"><input type="checkbox" style="width: auto;" onclick="updateGoals(' + goalOid + ')" id="' + goalOid + '" value="' + goalHeader + '" ' + isChecked + ' />' + goalHeader + '</div>';
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function loadGoalsOnSuccess(json) {
|
|
if (json === "SessionTimeout") {
|
|
window.location.href = redirectLink;
|
|
return;
|
|
}
|
|
|
|
buildCollapsibleSet(json);
|
|
}
|
|
|
|
function loadServiceDescriptionsOnSuccess(json) {
|
|
if (json === "SessionTimeout") {
|
|
window.location.href = redirectLink;
|
|
return;
|
|
}
|
|
|
|
var liste = $.parseJSON(json);
|
|
|
|
$("#leistungen_select").empty();
|
|
$("#leistungen_select").val("");
|
|
|
|
$.each(liste, function(index, leistung) {
|
|
$("#leistungen_select").append('<option value="' + leistung.ServiceDescriptionOid + '">' + leistung.Name + '</option>');
|
|
});
|
|
|
|
if(liste[0] !== undefined) {
|
|
if(isInEditingMode() === false) {
|
|
$("#leistungen_select").val(liste[0].ServiceDescriptionOid);
|
|
|
|
makeAjaxCall("GET", setServiceDescriptionUrl, null, { pServiceDescriptionOid: liste[0].ServiceDescriptionOid }, null);
|
|
} else {
|
|
makeAjaxCall("GET",
|
|
loadCategoryAndDescriptionUrl,
|
|
function(result) {
|
|
var arr = result.split("/");
|
|
var descriptionOid = arr[0];
|
|
var categoryOid = arr[1];
|
|
|
|
$("#kategorien_select").val(categoryOid);
|
|
|
|
$("#leistungen_select").val(descriptionOid);
|
|
|
|
$("#leistungen_select").trigger("change");
|
|
},
|
|
{},
|
|
null);
|
|
}
|
|
}
|
|
}
|
|
|
|
function showAjaxError(jqXHR, textStatus, errorThrown) {
|
|
hideSanduhr();
|
|
//if (jqXHR.status == 0) {
|
|
//toggleErrorPopup("Es besteht zurzeit keine Internetverbindung." +
|
|
// " Die Daten werden zwischengespeichert und beim nächsten Login an den Server gesendet. " + errorThrown,2);
|
|
//setTimeout(function () {
|
|
//showServiceRecords();
|
|
//}, timeOut);
|
|
//}
|
|
//else
|
|
|
|
if(jqXHR.status === 0) {
|
|
console.log("status is 0; ajax call aborted");
|
|
return;
|
|
}
|
|
|
|
toggleErrorPopup(jqXHR.status + " " + errorThrown);
|
|
}
|
|
|
|
function showErrorMsg(message) {
|
|
toggleErrorPopup(message);
|
|
}
|
|
|
|
function resizeLabelColumns() {
|
|
$("#tabLbl").css("width", $("#zieleLbl").css("width"));
|
|
}
|
|
|
|
zeitRegEx = /^(2[0-3]|[01]?[0-9])(:|,|\.|#|;)?([0-5][0-9])$/;
|
|
|
|
function loadGoals(actionPath) {
|
|
var selectedServiceRecord = $($("#scDropDown")).find(":selected").val();
|
|
|
|
makeAjaxCall("GET", actionPath, loadGoalsOnSuccess, { pCostbearer2SupportConceptOid: selectedServiceRecord }, null);
|
|
}
|
|
|
|
function toggleMenu() {
|
|
var menuDiv = $("#menu-div");
|
|
$(menuDiv).fadeToggle("fast");
|
|
}
|
|
|
|
function loadServiceDescriptions() {
|
|
var selectedCategory = $("#kategorien_select").find(":selected").val();
|
|
|
|
makeAjaxCall("GET", loadServiceCategoriesUrl, loadServiceDescriptionsOnSuccess, { pServiceCategoryOid: selectedCategory }, null);
|
|
|
|
loadTextbausteineForServiceCategory(selectedCategory);
|
|
}
|
|
|
|
function loadTextbausteineForServiceCategory(serviceCategoryOid) {
|
|
makeAjaxCall("GET", loadTextbausteineForCategoryUrl, loadTextbausteineForCategoryOnSuccess, { pServiceCategoryOid: serviceCategoryOid }, null);
|
|
}
|
|
|
|
function loadTextbausteineForCategoryOnSuccess(json) {
|
|
if (json == null) {
|
|
return;
|
|
}
|
|
|
|
buildTextModuleTree(json);
|
|
}
|
|
|
|
var collapsibleHtml2;
|
|
var textModules = new Array();
|
|
var allTextModules = new Array();
|
|
function buildTextModuleTree(jsonString) {
|
|
try {
|
|
if (jsonString.length === 0) {
|
|
return;
|
|
}
|
|
|
|
textModules = $.parseJSON(jsonString);
|
|
|
|
$("#kollabierbar2").empty();
|
|
collapsibleHtml2 = "";
|
|
|
|
$.each(textModules, function(index) {
|
|
buildTreeRecursively(textModules[index]);
|
|
});
|
|
|
|
$("#kollabierbar2").append(collapsibleHtml2);
|
|
} catch (exception) {
|
|
console.log("Fehler(BuildCollapsibleSet2): " + exception.message);
|
|
}
|
|
}
|
|
|
|
function buildTreeRecursively(textmodule) {
|
|
allTextModules[textmodule.Oid] = textmodule;
|
|
|
|
if (textmodule.IsParent) {
|
|
collapsibleHtml2 += '<input onclick="toggleOnclick(this);" type="button" class="toggle-btn" value="' + textmodule.Name + '" style="font-weight: bold;" />';
|
|
collapsibleHtml2 += '<div style="display: none; margin-right: 0; padding-right: 0;" class="kollabierbar">';
|
|
} else {
|
|
collapsibleHtml2 += '<div style="display: block; padding-top: .1em;"><input type="button" style="width: 100%; text-align: left;" onclick="setTextModule(' + textmodule.Oid + ')" value="' + textmodule.Name + '" /></div>';
|
|
}
|
|
|
|
$.each(textmodule.Children,
|
|
function(index) {
|
|
buildTreeRecursively(textmodule.Children[index]);
|
|
}
|
|
);
|
|
|
|
if (textmodule.IsParent) {
|
|
collapsibleHtml2 += "</div>";
|
|
}
|
|
}
|
|
|
|
function setTextModule(moduleOid) {
|
|
if(window.focusedDokuTextarea == null) {
|
|
if($("#trnormalDoku").css("display") !== "none") {
|
|
window.focusedDokuTextarea = $("#notiz_textbox");
|
|
} else {
|
|
window.focusedDokuTextarea = $("#notiz_textbox1");
|
|
}
|
|
}
|
|
|
|
window.focusedDokuTextarea.val(window.focusedDokuTextarea.val() + allTextModules[moduleOid].Text);
|
|
|
|
hideTextModulePopup();
|
|
}
|
|
|
|
function setTextbaustein() {
|
|
var selectedTextbausteinOid = $("#textbausteine_select").find(":selected").val();
|
|
|
|
if (selectedTextbausteinOid > 0) {
|
|
makeAjaxCall("GET", loadCompleteTextbausteinByOidUrl, loadTextbausteinContentOnSuccess, { pTextbausteinOid: selectedTextbausteinOid }, null);
|
|
}
|
|
}
|
|
|
|
function loadTextbausteinContentOnSuccess(textbausteintext) {
|
|
if (focusedDokuTextarea != null) {
|
|
var cursorPosition = focusedDokuTextarea.prop("selectionStart");
|
|
var v = focusedDokuTextarea.val();
|
|
var textBefore = v.substring(0, cursorPosition);
|
|
var textAfter = v.substring(cursorPosition, v.length);
|
|
|
|
focusedDokuTextarea.val(textBefore + textbausteintext + textAfter);
|
|
} else {
|
|
console.log("focusedDokuTextarea ist null!");
|
|
}
|
|
}
|
|
|
|
function updateGoals(cbId) {
|
|
makeAjaxCall("GET", updateGoalsUrl, null, { pGoalOid: cbId }, null);
|
|
}
|
|
|
|
var goalOidArray = new Array();
|
|
function updateChildGoals(goalOid) {
|
|
goalOidArray = new Array();
|
|
|
|
var parent = document.getElementById("goal" + goalOid);
|
|
alert("start");
|
|
CheckChildGoalNodes(parent);
|
|
//makeAjaxCall("GET", updateGoalsUrl, null, { pGoalOid: cbId }, null);
|
|
}
|
|
|
|
function CheckChildGoalNodes(parent) {
|
|
goalOidArray = new Array();
|
|
|
|
var next = parent.parentNode;
|
|
alert(next);
|
|
alert(next.nextSibling);
|
|
var nodeList = next.childNodes;
|
|
|
|
alert(nodeList.length);
|
|
for (var i = 0; i < nodeList.length; i++) {
|
|
var node = nodeList[i];
|
|
|
|
alert(node.nodeName);
|
|
CheckChildGoalNodes(node);
|
|
}
|
|
|
|
//makeAjaxCall("GET", updateGoalsUrl, null, { pGoalOid: cbId }, null);
|
|
}
|
|
|
|
function setServiceDescription() {
|
|
var sdOid = $("#leistungen_select").find(":selected").val();
|
|
|
|
makeAjaxCall("GET", setServiceDescriptionUrl, function(kek) { }, { pServiceDescriptionOid: sdOid }, function(kek) { });
|
|
}
|
|
|
|
function selectServiceRecord(oid) {
|
|
$("#versteckt").val("Speichern");
|
|
$("html, body").animate({ scrollTop: 0 }, "fast");
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
url: setSelectedServiceRecordUrl,
|
|
data: { recordOid: oid },
|
|
success: function () {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: getSelectedRecordInformationUrl,
|
|
success: function (jsonServiceRecord) {
|
|
try {
|
|
if(jsonServiceRecord === "SessionTimeout") {
|
|
window.location.href = redirectLink;
|
|
return;
|
|
}
|
|
|
|
var record = $.parseJSON(jsonServiceRecord);
|
|
|
|
var goals = record.Goals;
|
|
|
|
var idArray = new Array();
|
|
var meinGoalsArray = new Array();
|
|
|
|
var j = 0;
|
|
for(var i = 0; i < goals.length; i++) {
|
|
if(goals[i].ValueListEntryOid !== undefined) {
|
|
idArray[j] = goals[i].ValueListEntryOid;
|
|
j++;
|
|
}
|
|
}
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
url: loadGoalsUrl,
|
|
data: { pCostbearer2SupportConceptOid: $($("#scDropDown")).find(":selected").val() },
|
|
success: function (goalsJson) {
|
|
if (goalsJson === "SessionTimeout") {
|
|
window.location.href = redirectLink;
|
|
return;
|
|
}
|
|
|
|
try {
|
|
meinGoalsArray = goalsJson !== "" ? $.parseJSON(goalsJson) : "";
|
|
} catch (exception) {
|
|
console.log('Fehler beim JSON Parsing von selectServiceRecord(' + oid + '): ' + exception.message);
|
|
}
|
|
|
|
var rawStartDateStr = record.Start[18] === "1" ? "" : record.Start.slice(11, 16);
|
|
var rawEndDateStr = record.End[18] === "1" ? "" : record.End.slice(11, 16);
|
|
var startDateYearStr = record.Start.slice(0, 4);
|
|
var startDateMonthStr = record.Start.slice(5, 7);
|
|
var startDateDayStr = record.Start.slice(8, 10);
|
|
var dateStr = startDateDayStr + "." + startDateMonthStr + "." + startDateYearStr;
|
|
|
|
var endDateYearStr = record.End.slice(0, 4);
|
|
var endDateMonthStr = record.End.slice(5, 7);
|
|
var endDateDayStr = record.End.slice(8, 10);
|
|
var endDateDateStr = endDateDayStr + "." + endDateMonthStr + "." + endDateYearStr;
|
|
|
|
$("#start_textbox").val(rawStartDateStr);
|
|
$("#ende_textbox").val(rawEndDateStr);
|
|
$("#datum_textbox").val(dateStr);
|
|
$("#notiz_textbox").val(record.Notice);
|
|
|
|
$("#enddatum_textbox").val(endDateDateStr);
|
|
$("#notiz_textbox1").val(record.Notice);
|
|
$("#notiz_textbox2").val(record.Notice2);
|
|
$("#notiz_textbox3").val(record.Notice3);
|
|
$("#notiz_textbox4").val(record.Notice4);
|
|
$("#notiz_textbox5").val(record.Notice5);
|
|
|
|
$("#duration_textbox").val(record.RoundedDuration);
|
|
|
|
$("#distance_textbox").val(record.DistanceInMeter);
|
|
|
|
$("#employeesDropDown").val(record.Employee.EmployeeOid);
|
|
|
|
window.serviceRecordEmployeeOid = record.Employee.EmployeeOid;
|
|
|
|
actuallyBuildCollapsibleSet(meinGoalsArray, idArray);
|
|
|
|
$("#anlegenEditierenBtn").val("Speichern");
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
url: loadServiceCategoriesUrl,
|
|
success: function (result) {
|
|
if (result === "SessionTimeout") {
|
|
window.location.href = redirectLink;
|
|
return;
|
|
}
|
|
|
|
$("#kategorien_select").val(record.ServiceDescription.Category.ServiceCategoryOid);
|
|
|
|
var liste = $.parseJSON(result);
|
|
$("#leistungen_select").empty();
|
|
$("#leistungen_select").val("");
|
|
|
|
$.each(liste, function (index, leistung) {
|
|
$("#leistungen_select").append('<option value="' + leistung.ServiceDescriptionOid + '">' + leistung.Name + '</option>');
|
|
});
|
|
|
|
$("#leistungen_select").val(record.ServiceDescription.ServiceDescriptionOid);
|
|
makeAjaxCall("GET", setServiceDescriptionUrl, null, { pServiceDescriptionOid: record.ServiceDescription.ServiceDescriptionOid }, null);
|
|
|
|
toggleLabel("distance_textbox");
|
|
toggleLabel("duration_textbox");
|
|
toggleLabel("start_textbox");
|
|
toggleLabel("ende_textbox");
|
|
|
|
$("input").prop("disabled", false);
|
|
$("#abbrechenBtn").prop("disabled", true);
|
|
$("select").prop("disabled", false);
|
|
|
|
toggleSelectClassesForElement("#kategorien_select", "#kategorien-select-container");
|
|
toggleSelectClassesForElement("#leistungen_select", "#leistungen-select-container");
|
|
toggleSelectClassesForElement("#recordLoader_select", "#record-loader-select-container");
|
|
toggleSelectClassesForElement("#textbausteine_select", "#textbausteine-select-container");
|
|
|
|
$("#abbrechenBtn").prop("disabled", false);
|
|
|
|
hideSanduhr();
|
|
},
|
|
error: showErrorMsg,
|
|
data: { pServiceCategoryOid: record.ServiceDescription.Category.ServiceCategoryOid }
|
|
});
|
|
},
|
|
error: showAjaxError,
|
|
complete: hideSanduhr
|
|
});
|
|
|
|
} catch (exception1) {
|
|
console.log('Fehler beim JSON Parsing von selectServiceRecord(' + oid + '): ' + exception1.message);
|
|
}
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function activateForm(actionPath) {
|
|
$("input").prop("disabled", false);
|
|
$("textarea").prop("disabled", false);
|
|
$("#kategorien_select, #leistungen_select, #recordLoader_select, #textbausteine_select").prop("disabled", false);
|
|
toggleSelectClassesForElement("#kategorien_select", "#kategorien-select-container");
|
|
toggleSelectClassesForElement("#leistungen_select", "#leistungen-select-container");
|
|
toggleSelectClassesForElement("#recordLoader_select", "#record-loader-select-container");
|
|
toggleSelectClassesForElement("#textbausteine_select", "#textbausteine-select-container");
|
|
|
|
loadGoals(actionPath);
|
|
|
|
$("#kategorien_select").val($("#kategorien_select option").eq(0).val());
|
|
|
|
loadServiceDescriptions();
|
|
}
|
|
|
|
function resetRecordForm() {
|
|
showSanduhr();
|
|
|
|
$("#versteckt").val("Anlegen");
|
|
$("#anlegenEditierenBtn").val("Anlegen");
|
|
|
|
clearZED();
|
|
|
|
$("#start_textbox").val("").trigger("change");
|
|
$("#ende_textbox").val("").trigger("change");
|
|
$("#notiz_textbox").val("").trigger("change");
|
|
$("#duration_textbox").val("").trigger("change");
|
|
$("#distance_textbox").val("").trigger("change");
|
|
|
|
$("#datum_textbox").val(getDateStringWithLeadingZeros(new Date()));
|
|
$("#enddatum_textbox").val(getDateStringWithLeadingZeros(new Date()));
|
|
|
|
$("#kategorien_select").val($("#kategorien_select option").eq(0).val());
|
|
|
|
for(var i = 0; i < numberOfDocumentationTypes; i++) {
|
|
$('#notiz_textbox' + (i + 1)).val("");
|
|
}
|
|
|
|
var selectedCategory = $("#kategorien_select").find(":selected").val();
|
|
|
|
if(isInEditingMode()) {
|
|
console.log('making ajax call to reset the editing mode');
|
|
makeAjaxCall("POST", resetEditingModeUrl, function(response) { window.location.reload(); }, { pFormCollection: null }, null);
|
|
}
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
url: loadServiceCategoriesUrl,
|
|
data: { pServiceCategoryOid: selectedCategory },
|
|
success: function (json) {
|
|
loadServiceDescriptionsOnSuccess(json);
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
url: setSelectedServiceRecordUrl,
|
|
data: { recordOid: null },
|
|
success: function () {
|
|
loadGoals(loadGoalsUrl);
|
|
|
|
hideSanduhr();
|
|
},
|
|
error: showAjaxError
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function toggleOnclick(element) {
|
|
var collapsedDiv = $(element).next("div");
|
|
var isHidden = "none" === $(collapsedDiv).css("display");
|
|
var newIcon = "url('";
|
|
newIcon += isHidden ? toggleIconUContentUrl : toggleIconDContentUrl;
|
|
newIcon += "')";
|
|
|
|
$(element).css("background-image", newIcon);
|
|
$(collapsedDiv).fadeToggle("fast");
|
|
}
|
|
|
|
$(document).mouseup(function(e) {
|
|
var menu = $("#menu-div");
|
|
var menuBtn = $("#menu-btn");
|
|
|
|
if(!menu.is(e.target) && !menuBtn.is(e.target) && menu.has(e.target).length === 0) {
|
|
menu.fadeOut("fast");
|
|
}
|
|
});
|
|
|
|
function saveCreateServicerecod() {
|
|
showSanduhr();
|
|
|
|
//if (validateTimeField("#start_textbox") && validateTimeField("#ende_textbox")) {
|
|
validateServiceRecordBeforeSubmit();
|
|
//} else {
|
|
// hideSanduhr();
|
|
// }
|
|
}
|
|
|
|
function validateTimeField(id) {
|
|
var timeStr = $(id).val();
|
|
var zeitStr = id === "#start_textbox" ? "Start" : "End";
|
|
|
|
if (timeStr !== "" && !zeitRegEx.test(timeStr)) {
|
|
showZeiterfassungsError('Bitte geben Sie eine ' + + 'xxx-Zeit in einem gültigen Format (HH:MM oder HHMM) an.');
|
|
return false;
|
|
} else {
|
|
clearZED();
|
|
return true;
|
|
}
|
|
}
|
|
|
|
recordToDelete = 0;
|
|
function togglePopup(serviceRecordOid) {
|
|
window.recordToDelete = serviceRecordOid;
|
|
|
|
var isShowing = $(".modalWrapper").css("display") === "none";
|
|
var displayValue = $(".modalWrapper").css("display") === "block" ? "none" : "block";
|
|
|
|
toggleModalWrapper();
|
|
$("#popupDiv").css("display", displayValue);
|
|
|
|
if (isShowing) {
|
|
var titleOuterHeight = $("#popupTitle").outerHeight();
|
|
var textOuterHeight = $("#popupText").outerHeight();
|
|
var buttonDivOuterHeight = $("#popupBtnDiv").outerHeight();
|
|
var btnOuterHeight = $(".popupBtn").outerHeight();
|
|
|
|
var newHeight = titleOuterHeight + textOuterHeight + buttonDivOuterHeight + btnOuterHeight + btnOuterHeight;
|
|
|
|
$("#popupDiv").css("height", newHeight + "px");
|
|
|
|
$("#popupDiv").css("top", window.pageYOffset + window.innerHeight / 2 - newHeight / 2);
|
|
$("#popupDiv").css("margin-top", "0");
|
|
} else {
|
|
$("#popupDiv").css("margin-top", "auto");
|
|
}
|
|
}
|
|
|
|
function toggleModalWrapper() {
|
|
var displayValue = $(".modalWrapper").css("display") === "block" ? "none" : "block";
|
|
|
|
$(".modalWrapper").css("display", displayValue);
|
|
$(".modalWrapper").css("height", $(document).height());
|
|
}
|
|
|
|
$(function () {
|
|
$("#deletionForm").submit(function () {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: setRecordForDeletionUrl,
|
|
data: { serviceRecordOid: recordToDelete },
|
|
success: function () {
|
|
return true;
|
|
},
|
|
error: function () {
|
|
showAjaxError();
|
|
return false;
|
|
}
|
|
});
|
|
|
|
return true;
|
|
});
|
|
});
|
|
|
|
function validateServiceRecordBeforeSubmit() {
|
|
function getLocation() {
|
|
if (navigator.geolocation) {
|
|
navigator.geolocation.getCurrentPosition(showPosition, showError);
|
|
} else {
|
|
console.log("Ortung wird von diesem Browser nicht unterstützt");
|
|
showPosition(null);
|
|
}
|
|
}
|
|
|
|
var dateStr = $("#datum_textbox").val();
|
|
var startStr = $("#start_textbox").val();
|
|
var endStr = $("#ende_textbox").val();
|
|
|
|
var x = getDateObj(true);
|
|
|
|
var y;
|
|
|
|
if ($("#enddatum_textbox").val() !== "") {
|
|
y = getEndDateObj();
|
|
} else {
|
|
y = getDateObj(false);
|
|
}
|
|
|
|
var vonDatum = getDateTimeStringWithLeadingZeros(x);
|
|
var bisDatum = getDateTimeStringWithLeadingZeros(y);
|
|
|
|
var isValidRecord = true;
|
|
|
|
makeAjaxCall("POST", checkRightsUrl, function(json) {
|
|
if (json === "SessionTimeout") {
|
|
window.location.href = redirectLink;
|
|
return;
|
|
}
|
|
|
|
if (json === "StartGreaterEnd") {
|
|
hideSanduhr();
|
|
writeFatalErrorMessage("Die Startzeit darf nicht größer als die Endzeit sein!");
|
|
return;
|
|
}
|
|
|
|
var meldungen = $.parseJSON(json);
|
|
|
|
var results = meldungen.ValidationResults;
|
|
var allowOverlappingFLS = false;
|
|
var allowMoreFLSThanApproved = false;
|
|
var bookAfterSettlementInvoice = false;
|
|
|
|
$.each(meldungen.Rights, function(position) {
|
|
var value = meldungen.Rights[position];
|
|
var key = parseInt(position);
|
|
|
|
switch (key) {
|
|
case 0:
|
|
allowOverlappingFLS = value;
|
|
break;
|
|
case 1:
|
|
allowMoreFLSThanApproved = value;
|
|
break;
|
|
case 2:
|
|
bookAfterSettlementInvoice = value;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
});
|
|
|
|
var exitLoop = false;
|
|
for (var i = 0; i < results.length; i++) {
|
|
if (exitLoop)
|
|
break;
|
|
switch (results[i].ResultType) {
|
|
case 0:
|
|
var msg1 = 'An dem gewählten Datum \'' + vonDatum + '\' existiert bereits ein Eintrag (' + results[i].Message + ' bei Klient/in ' + results[i].CustomerName + '). Speichern nicht möglich.';
|
|
if (allowOverlappingFLS === true) {
|
|
var r = confirm('An dem gewählten Datum \'' + vonDatum + '\' existiert bereits ein Eintrag (' + results[i].Message + ' bei Klient/in ' + results[i].CustomerName + '). Möchten Sie trotzdem speichern?');
|
|
isValidRecord = r;
|
|
exitLoop = !isValidRecord;
|
|
} else {
|
|
writeFatalErrorMessage(msg1);
|
|
isValidRecord = false;
|
|
exitLoop = true;
|
|
}
|
|
break;
|
|
case 1:
|
|
var msg2 = 'An dem gewählten Datum ' + vonDatum + ' existiert bereits ein Eintrag für den ausgewählten Mitarbeiter(' + results[i].EmployeeName + '). Speichern nicht möglich.';
|
|
if (allowOverlappingFLS === true) {
|
|
var r2 = confirm('An dem gewählten Datum ' + vonDatum + ' existiert bereits ein Eintrag für den ausgewählten Mitarbeiter(' + results[i].EmployeeName + '). Möchten Sie trotzdem speichern?');
|
|
isValidRecord = r2;
|
|
exitLoop = !isValidRecord;
|
|
} else {
|
|
writeFatalErrorMessage(msg2);
|
|
isValidRecord = false;
|
|
exitLoop = true;
|
|
}
|
|
break;
|
|
case 2:
|
|
writeFatalErrorMessage('Das gewählte Datum ' + vonDatum.slice(0, 10) + ' liegt außerhalb des Zeitraumes des gewählten Hilfeplans. Speichern nicht möglich.');
|
|
|
|
isValidRecord = false;
|
|
exitLoop = true;
|
|
break;
|
|
case 3:
|
|
var msg3 = 'Die für diesen Hilfeplan genehmigten FLS (' + results[i].ApprovedHours + ') werden mit diesem Eintrag überschritten. (' + results[i].HoursNew + ').';
|
|
if (allowMoreFLSThanApproved === true) {
|
|
var r3 = confirm(msg3 + " Möchten Sie trotzdem speichern?");
|
|
isValidRecord = r3;
|
|
exitLoop = !isValidRecord;
|
|
} else {
|
|
writeFatalErrorMessage(msg3);
|
|
isValidRecord = false;
|
|
exitLoop = true;
|
|
}
|
|
break;
|
|
case 4:
|
|
writeFatalErrorMessage('Sie können keine neuen Leistungen für den ' + vonDatum + ' dokumentieren, da bereits der ' + meldungen.MaxDaysEditServiceRecordsAllowed + '. des nachfolgenden Monats überschritten ist.');
|
|
isValidRecord = false;
|
|
exitLoop = true;
|
|
break;
|
|
case 5:
|
|
writeFatalErrorMessage("Beim Speichern ist ein Fehler aufgetreten. Speichern nicht möglich.");
|
|
isValidRecord = false;
|
|
exitLoop = true;
|
|
break;
|
|
case 6:
|
|
var msg6 = "Es existiert bereits eine Spitzabrechnung. Um diesen Eintrag zu berücksichtigen, muss eventuell eine neue Spitzabrechnung erstellt werden. Das Speichern ist nicht möglich.";
|
|
if (bookAfterSettlementInvoice === true) {
|
|
msg6 = "Sie können den Eintrag nicht bearbeiten, da bereits eine Spitzabrechnung für diesen Hilfeplan erstellt wurde. Speichern nicht möglich.";
|
|
}
|
|
writeFatalErrorMessage(msg6);
|
|
isValidRecord = false;
|
|
exitLoop = true;
|
|
break;
|
|
case 7:
|
|
var msg7 = "Sie können keine neuen Leistungen dokumentieren, da die Frist zur Bearbeitung abgelaufen ist. Das Speichern ist nicht möglich.";
|
|
writeFatalErrorMessage(msg7);
|
|
isValidRecord = false;
|
|
exitLoop = true;
|
|
break;
|
|
default:
|
|
writeFatalErrorMessage(results[i].Message);
|
|
isValidRecord = false;
|
|
exitLoop = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
$("#URLSave").val(dataURL);
|
|
$("#TimeStampSave").val(newday);
|
|
$("#GeoLocSaveXCOOR").val(langenGrad);
|
|
$("#GeoLocSaveYCOOR").val(breitenGrad);
|
|
|
|
if (isValidRecord) {
|
|
$("#createSRForm").submit();
|
|
} else {
|
|
hideSanduhr();
|
|
}
|
|
},
|
|
{ von: vonDatum, bis: bisDatum, inEditMode: $("#anlegenEditierenBtn").val() === "Speichern", dateString: dateStr, startString: startStr, endString: endStr });
|
|
}
|
|
|
|
function ErfolgteSpx() {
|
|
if (document.getElementById("SaveSignature").value == "True") {
|
|
|
|
toggleSuccessPopup("Eintrag wurde gespeichert." + "\n" + "Möchte Sie diesen unterschreiben lassen?", 4);
|
|
document.getElementById("SaveSignature").value = "False";
|
|
|
|
$.ajax({
|
|
type: "GET",
|
|
url: SetSaveSignatureUrl,
|
|
data: { save: false }
|
|
});
|
|
}
|
|
}
|
|
|
|
function initSignatureInfo(serviceRecordOid){
|
|
$.ajax({
|
|
type: "GET",
|
|
url: getSelectedRecordInformationUrlWithOid,
|
|
data: {oid: serviceRecordOid},
|
|
success: function(jsonServiceRecord) {
|
|
try {
|
|
if(jsonServiceRecord === "SessionTimeout") {
|
|
window.location.href = redirectLink;
|
|
return;
|
|
}
|
|
|
|
var record = $.parseJSON(jsonServiceRecord);
|
|
|
|
var startDate = record.Start[18] === "1" ? "" : record.Start.slice(11, 16);
|
|
var endDate = record.End[18] === "1" ? "" : record.End.slice(11, 16);
|
|
var jahr = record.Start.slice(0, 4);
|
|
var monat = record.Start.slice(5, 7);
|
|
var tag = record.Start.slice(8, 10);
|
|
var datum = tag + "." + monat + "." + jahr;
|
|
var serviceDescriptionName = record.ServiceDescription.Name;
|
|
var serviceCategoryName = record.ServiceDescription.Category.Name;
|
|
|
|
var zahl2 = $("#scDropDown").val();
|
|
|
|
$("#UnterschriftHilfeplan").val('HilfePlan: ' + $("#scDropDown option[value='" + zahl2 + "']").text());
|
|
$("#UnterschriftEmployee").val('Mitarbeiter: ' + record.Employee.FirstName + ' ' + record.Employee.LastName);
|
|
$("#UnterschriftKategorie").val('Kategorie: ' + serviceCategoryName);
|
|
$("#UnterschriftLeistung").val('Leistungen: ' + serviceDescriptionName);
|
|
$("#UnterschriftDatum").val('Datum / Uhrzeit: ' + datum + ' / ' + startDate + ' - ' + endDate);
|
|
|
|
$("#SaveRecordOID").val(serviceRecordOid);
|
|
|
|
console.log('Loading data for service record: ' + $("#SaveRecordOID").value);
|
|
} catch(exception) {
|
|
console.log('Error: ' + + '');
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function writeFatalErrorMessage(msg, i) {
|
|
toggleErrorPopup(msg, i);
|
|
}
|
|
|
|
function showZeiterfassungsError(msg) {
|
|
$("#zeiterfassungsErrorTableRow").css("display", "table-row");
|
|
$("#zeiterfassungsErrorTableCell").css("display", "table-cell");
|
|
$("#zeiterfassungsErrorDisplay").html(msg + "<br />");
|
|
}
|
|
|
|
function clearZED() {
|
|
$("#zeiterfassungsErrorTableRow").css("display", "none");
|
|
$("#zeiterfassungsErrorDisplay").empty();
|
|
}
|
|
|
|
function showCustomers() {
|
|
$("#customersDropDown").val($("#customersDropDown option").eq(0).val());
|
|
|
|
preselectCustomer();
|
|
|
|
$("#zeiterfassung").css("display", "none");
|
|
$("#klienten").css("display", "block");
|
|
$("#KalenderNavigation").css("display", "none");
|
|
$("#Kalender").css("display", "none");
|
|
$("#map-canvas").css("width", $("#klientenTabelle").width());
|
|
$("#map-canvas").css("height", "500px");
|
|
$("#UnterschriftBereich").css("display", "none");
|
|
|
|
$("#Statistics").css("display", "none");
|
|
$("#SupportStatistik").css("display", "none");
|
|
|
|
$("#colorRibbon").css("background-color", "#3b7799");
|
|
toggleMenu();
|
|
}
|
|
|
|
function showKalender() {
|
|
$("#customersDropDown").val($("#customersDropDown option").eq(0).val());
|
|
$("#zeiterfassung").css("display", "none");
|
|
$("#KalenderNavigation").css("display", "block");
|
|
$("#Kalender").css("display", "block");
|
|
$("#klienten").css("display", "none");
|
|
$("#colorRibbon").css("background-color", "#04b4d0");
|
|
$("#UnterschriftBereich").css("display", "none");
|
|
|
|
$("#Statistics").css("display", "none");
|
|
$("#SupportStatistik").css("display", "none");
|
|
|
|
toggleMenu();
|
|
initCalendar();
|
|
}
|
|
|
|
function showUsAendern() {
|
|
$("#TerminSpeichern").prop('disabled', false);
|
|
$("#AenderePopupDivSchalter").val("true");
|
|
}
|
|
|
|
function showUsVerwerfen() {
|
|
if ($("#AenderePopupDivSchalter").val() === "true") {
|
|
toggleUpdateAppointmentPopup("Wollen Sie wirklich abbrechen und Ihre Änderungen verwerfen?");
|
|
$("#AenderePopupDivSchalter").val("false");
|
|
} else {
|
|
hideEditForm();
|
|
}
|
|
}
|
|
|
|
function initCalendar() {
|
|
$("#versteckt").val("Speichern");
|
|
$("html, body").animate({ scrollTop: 0 }, "fast");
|
|
|
|
var newtoday;
|
|
var datumStr = $("#KalenderDatum").val();
|
|
var nextdatum;
|
|
|
|
if(datumStr === "") {
|
|
nextdatum = new Date();
|
|
|
|
var ddi0 = nextdatum.getDate();
|
|
var mmi0 = nextdatum.getMonth() + 1;
|
|
var yyyyi0 = nextdatum.getFullYear();
|
|
|
|
var ddStri0 = ddi0 < 10 ? "0" + ddi0 : ddi0;
|
|
var mmStri0 = mmi0 < 10 ? "0" + mmi0 : mmi0;
|
|
|
|
$("#KalenderDatum").val(yyyyi0 + "-" + mmStri0 + "-" + ddStri0);
|
|
|
|
newtoday = ddStri0 + '.' + mmStri0 + "." + yyyyi0;
|
|
|
|
$("#KalenderDatumFormat").val(newtoday);
|
|
|
|
loadAppointments(newtoday);
|
|
}
|
|
}
|
|
|
|
function initAppointmentEditForm() {
|
|
var currTime = new Date();
|
|
|
|
if (currTime.getMinutes() <= 30) {
|
|
var k = 30 - currTime.getMinutes();
|
|
currTime.setMinutes(currTime.getMinutes() + k);
|
|
}
|
|
|
|
if (currTime.getMinutes() > 30) {
|
|
var j = 60 - currTime.getMinutes();
|
|
currTime.setMinutes(currTime.getMinutes() + j);
|
|
}
|
|
|
|
$("#AppointmentEditForm").css("display", "block");
|
|
$("#KalenderTable").css("display", "none");
|
|
$("#KalenderNavigation").css("display", "none");
|
|
$("#KalenderTableTask").css("display", "none");
|
|
$("#StartDate").val($("#KalenderDatumFormat").val());
|
|
$("#EndDate").val($("#KalenderDatumFormat").val());
|
|
$("#TerminStartZeit").val(getHoursAndMinutesWithLeadingZeros(currTime));
|
|
$("#TerminEndZeit").val("");
|
|
$("#TerminBetreff").val("");
|
|
$("#TerminNotiz").val("");
|
|
$("#TerminBetreffLabel").val("Betreff");
|
|
|
|
$("#StartDate").prop("readonly", false);
|
|
$("#EndDate").prop("readonly", false);
|
|
$("#TerminStartZeit").prop("readonly", false);
|
|
$("#TerminEndZeit").prop("readonly", false);
|
|
$("#TerminBetreff").prop('readonly', false);
|
|
$("#TerminNotiz").prop("readonly", false);
|
|
|
|
$("#TerminSpeichern").val("Speichern");
|
|
$("#TerminSpeichernAbbrechen").val("Abbrechen");
|
|
$("#TerminSpeichern").css("display", "none");
|
|
|
|
$("#InsertAppointmentButton").css("display", "inline");
|
|
}
|
|
|
|
function hideEditForm() {
|
|
$("#AppointmentEditForm").css("display", "none");
|
|
$("#KalenderTable").css("display", "block");
|
|
$("#KalenderNavigation").css("display", "block");
|
|
$("#KalenderTableTask").css("display", "block");
|
|
$("#StartDate").val("");
|
|
}
|
|
|
|
function nextDayButtonClick() {
|
|
var nextdatum = new Date($("#KalenderDatum").val());
|
|
nextdatum.setDate((nextdatum.getDate() + 1));
|
|
|
|
$("#KalenderDatum").val(toDateStringYearMonthDay(nextdatum));
|
|
|
|
var newtoday = getDateStringWithLeadingZeros(nextdatum);
|
|
|
|
$("#KalenderDatumFormat").val(newtoday);
|
|
|
|
loadAppointments(newtoday);
|
|
}
|
|
|
|
|
|
|
|
|
|
var canvas, ctx;
|
|
var mouseX, mouseY, mouseDown = 0;
|
|
var lastpositionx = 0;
|
|
var lastpositiony = 0;
|
|
var newpositionx = 0;
|
|
var newpositiony = 0;
|
|
var minuswert = -20;
|
|
var maxwert = 20;
|
|
var posix = 0;
|
|
var posiy = 0;
|
|
var r, g, b = 0;
|
|
var a = 255;
|
|
|
|
function loadUnterschriftFeldFunktion() {
|
|
function drawDot(ctx, x, y, size) {
|
|
ctx.fillStyle = "rgba(" + r + "," + g + "," + b + "," + (a / 255) + ")";
|
|
|
|
if(lastpositionx !== 0) {
|
|
ctx.beginPath();
|
|
ctx.arc(x, y, size, 1, Math.PI * 0.25, true);
|
|
newpositionx = x;
|
|
newpositiony = y;
|
|
posix = newpositionx - lastpositionx;
|
|
posiy = newpositiony - lastpositiony;
|
|
|
|
if(posiy > minuswert && posix > minuswert && posiy < maxwert && posix < maxwert) {
|
|
ctx.lineTo(lastpositionx + 2, lastpositiony + 2);
|
|
ctx.lineWidth = 2;
|
|
ctx.lineCap = "butt";
|
|
ctx.lineJoin = "round";
|
|
ctx.stroke();
|
|
|
|
lastpositionx = x;
|
|
lastpositiony = y;
|
|
} else {
|
|
lastpositionx = 0;
|
|
lastpositiony = 0;
|
|
}
|
|
|
|
ctx.closePath();
|
|
ctx.fill();
|
|
|
|
} else {
|
|
ctx.beginPath();
|
|
ctx.arc(x, y, size, 1, Math.PI * 0.25, true);
|
|
ctx.closePath();
|
|
ctx.fill();
|
|
|
|
lastpositionx = x;
|
|
lastpositiony = y;
|
|
}
|
|
}
|
|
|
|
function sketchpadMouseDown() {
|
|
mouseDown = 1;
|
|
drawDot(ctx, mouseX, mouseY, 3);
|
|
}
|
|
|
|
function sketchpadMouseUp() {
|
|
mouseDown = 0;
|
|
}
|
|
|
|
function sketchpadMouseMove(e) {
|
|
getMousePos(e);
|
|
|
|
if(mouseDown === 1) {
|
|
drawDot(ctx, mouseX, mouseY, 3);
|
|
}
|
|
}
|
|
|
|
function getMousePos(e) {
|
|
if(!e) {
|
|
e = event;
|
|
}
|
|
|
|
if(e.offsetX) {
|
|
mouseX = e.offsetX;
|
|
mouseY = e.offsetY;
|
|
}
|
|
else if(e.layerX) {
|
|
mouseX = e.layerX;
|
|
mouseY = e.layerY;
|
|
}
|
|
}
|
|
|
|
function sketchpadTouchStart() {
|
|
getTouchPos();
|
|
drawDot(ctx, touchX, touchY, 3);
|
|
event.preventDefault();
|
|
}
|
|
|
|
function sketchpadTouchMove(e) {
|
|
getTouchPos(e);
|
|
drawDot(ctx, touchX, touchY, 3);
|
|
event.preventDefault();
|
|
}
|
|
|
|
function getTouchPos(e) {
|
|
if (!e) {
|
|
e = event;
|
|
}
|
|
|
|
if (e.touches) {
|
|
if (e.touches.length === 1) {
|
|
var touch = e.touches[0];
|
|
touchX = touch.pageX - touch.target.offsetLeft;
|
|
touchY = touch.pageY - touch.target.offsetTop;
|
|
}
|
|
}
|
|
}
|
|
|
|
function init() {
|
|
canvas = document.getElementById("sketchpad");
|
|
|
|
if (canvas.getContext) {
|
|
ctx = canvas.getContext("2d");
|
|
}
|
|
|
|
if (ctx) {
|
|
canvas.addEventListener("mousedown", sketchpadMouseDown, false);
|
|
canvas.addEventListener("mousemove", sketchpadMouseMove, false);
|
|
window.addEventListener("mouseup", sketchpadMouseUp, false);
|
|
|
|
canvas.addEventListener("touchstart", sketchpadTouchStart, false);
|
|
canvas.addEventListener("touchmove", sketchpadTouchMove, false);
|
|
}
|
|
}
|
|
|
|
init();
|
|
}
|
|
|
|
function showUnterschrift(serviceRecordOid, zahl) {
|
|
$("#customersDropDown").val($("#customersDropDown option").eq(0).val());
|
|
$("#zeiterfassung").css("display", "none");
|
|
$("#KalenderNavigation").css("display", "none");
|
|
$("#Kalender").css("display", "none");
|
|
$("#klienten").css("display", "none");
|
|
$("#colorRibbon").css("background-color", "#04b4d0");
|
|
$("#UnterschriftBereich").css("display", "block");
|
|
|
|
$("#Statistics").css("display", "none");
|
|
$("#SupportStatistik").css("display", "none");
|
|
|
|
if (zahl === 1) {
|
|
serviceRecordOid = document.getElementById("ServiceRecordOIDSave").value;
|
|
|
|
toggleSuccessPopup("");
|
|
|
|
loadUnterschriftFeldFunktion();
|
|
preloadData(serviceRecordOid);
|
|
} else {
|
|
loadUnterschriftFeldFunktion();
|
|
|
|
preloadData(serviceRecordOid);
|
|
}
|
|
}
|
|
|
|
function backToZeiterfassung() {
|
|
$("#customersDropDown").val($("#customersDropDown option").eq(0).val());
|
|
$("#zeiterfassung").css("display", "block");
|
|
$("#KalenderNavigation").css("display", "none");
|
|
$("#Kalender").css("display", "none");
|
|
$("#klienten").css("display", "none");
|
|
$("#colorRibbon").css("background-color", "#c80000");
|
|
$("#UnterschriftBereich").css("display", "none");
|
|
|
|
$("#Statistics").css("display", "none");
|
|
$("#SupportStatistik").css("display", "none");
|
|
|
|
loescheUnterschrift(canvas, ctx);
|
|
}
|
|
|
|
function speichereUnterschrift() {
|
|
date = "";
|
|
date = new Date();
|
|
|
|
dataURL = "";
|
|
dataURL = canvas.toDataURL();
|
|
|
|
blob = new Blob([dataURL], { type: "URL/String" });
|
|
|
|
lastpositionx = 0;
|
|
lastpositiony = 0;
|
|
|
|
var dd = date.getDate();
|
|
var mm = date.getMonth() + 1;
|
|
var yyyy = date.getFullYear();
|
|
var hh = date.getHours();
|
|
var Min = date.getMinutes();
|
|
var Sec = date.getSeconds();
|
|
|
|
var ddStr = dd < 10 ? "0" + dd : dd;
|
|
var mmStr = mm < 10 ? "0" + mm : mm;
|
|
var hhStr = hh < 10 ? "0" + hh : hh;
|
|
var MnStr = Min < 10 ? "0" + Min : Min;
|
|
var ScStr = Sec < 10 ? "0" + Sec : Sec;
|
|
|
|
newday = "";
|
|
newday = ddStr + '.' + mmStr + '.' + yyyy + " " + hhStr + ":" + MnStr + ":" + ScStr;
|
|
|
|
var serviceRecordOid = $("#SaveRecordOID").val();
|
|
//console.log(ServRecord + " das ist die Oid");
|
|
|
|
function getLocation() {
|
|
if(navigator.geolocation) {
|
|
navigator.geolocation.getCurrentPosition(showPosition, showError);
|
|
} else {
|
|
x.innerHTML = "Geolocation is not supported by this browser.";
|
|
}
|
|
}
|
|
|
|
function showPosition(position) {
|
|
var breitenGrad = "";
|
|
var langenGrad = "";
|
|
//var breitenGrad = position.coords.latitude;
|
|
//var langenGrad = position.coords.longitude;
|
|
|
|
longrider = "";
|
|
//longrider = langenGrad.toString();
|
|
//console.log(ServRecord);
|
|
$.ajax({
|
|
type: "POST",
|
|
url: setSelectedUnterschriftUrl,
|
|
data: { breitengrad: breitenGrad, langengrad: langenGrad, blob: dataURL, zeitstempel: newday, ServiceRecord: serviceRecordOid },
|
|
success: function () {
|
|
loescheUnterschrift(canvas, ctx);
|
|
backToZeiterfassung();
|
|
toggleSuccessPopup("Die Unterschrift wurde erfolgreich gespeichert.", 2);
|
|
},
|
|
error: function () {
|
|
toggleSuccessPopup("Ein Fehler ist aufgetreten. Bitte wenden Sie sich an den Support", 3);
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
function showError(error) {
|
|
var message = "Fehler";
|
|
switch(error.code) {
|
|
case error.PERMISSION_DENIED:
|
|
message = "Ortungsanfrage abgelehnt.";
|
|
break;
|
|
case error.POSITION_UNAVAILABLE:
|
|
message = "Ortsangabe ist nicht verfügbar.";
|
|
break;
|
|
case error.TIMEOUT:
|
|
message = "Timeout.";
|
|
break;
|
|
case error.UNKNOWN_ERROR:
|
|
message = "Ein unbekannter Fehler ist aufgetreten.";
|
|
break;
|
|
}
|
|
|
|
//console.log(message);
|
|
showPosition(null);
|
|
}
|
|
|
|
//getLocation();
|
|
showPosition(null);
|
|
}
|
|
|
|
function loescheUnterschrift(canvas, ctx) {
|
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
lastpositionx = 0;
|
|
lastpositiony = 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
function preloadData(serviceRecordOid) {
|
|
initSignatureInfo(serviceRecordOid);
|
|
}
|
|
|
|
function showServiceRecords() {
|
|
location.reload();
|
|
$("#customersDropDown").val($("#customersDropDown option").eq(0).val());
|
|
$("#klientenTabelle").css("display", "none");
|
|
$("#zeiterfassung").css("display", "block");
|
|
$("#KalenderNavigation").css("display", "none");
|
|
$("#klienten").css("display", "none");
|
|
$("#Kalender").css("display", "none");
|
|
$("#colorRibbon").css("background-color", "#c80000");
|
|
$("#UnterschriftBereich").css("display", "none");
|
|
|
|
$("#Statistics").css("display", "block");
|
|
$("#SupportStatistik").css("display", "none");
|
|
|
|
toggleMenu();
|
|
}
|
|
|
|
function goBackToZeiterfassung() {
|
|
showSanduhr();
|
|
$("#customersDropDown").val($("#customersDropDown option").eq(0).val());
|
|
$("#klientenTabelle").css("display", "none");
|
|
$("#zeiterfassung").css("display", "block");
|
|
$("#KalenderNavigation").css("display", "none");
|
|
$("#klienten").css("display", "none");
|
|
$("#Kalender").css("display", "none");
|
|
$("#colorRibbon").css("background-color", "#c80000");
|
|
$("#UnterschriftBereich").css("display", "none");
|
|
|
|
$("#Statistics").css("display", "block");
|
|
$("#SupportStatistik").css("display", "none");
|
|
}
|
|
|
|
function klientenLaden() {
|
|
$("#map-canvas").fadeOut();
|
|
|
|
showSanduhr();
|
|
|
|
var oid = parseInt($("#customersDropDown").find(":selected").val());
|
|
|
|
if(oid === -1) {
|
|
$("#klientenTabelle").css("display", "none");
|
|
$("#umfeldContainer").css("display", "none");
|
|
$("#kommentarContainer").css("display", "none");
|
|
|
|
hideSanduhr();
|
|
|
|
return;
|
|
}
|
|
|
|
makeAjaxCall("GET", getSelectedCustomerUrl, function (json) {
|
|
$("#klientenTabelle").css("display", "block");
|
|
$("#umfeldContainer").css("display", "block");
|
|
$("#kommentarContainer").css("display", "block");
|
|
|
|
if(json === "SessionTimeout") {
|
|
window.location.href = redirectLink;
|
|
return;
|
|
}
|
|
|
|
vm.update($.parseJSON(json));
|
|
|
|
$(".toggle-btn2").click(function () {
|
|
toggleOnclick(this);
|
|
});
|
|
|
|
},
|
|
{
|
|
customerOid: oid
|
|
},
|
|
hideSanduhr);
|
|
}
|
|
|
|
function KlientenVM() {
|
|
this.vorname = ko.observable("");
|
|
this.nachname = ko.observable("");
|
|
this.geburtstag = ko.observable("");
|
|
this.geschlecht = ko.observable("");
|
|
this.adresszusatz = ko.observable("");
|
|
this.strasse = ko.observable("");
|
|
this.plz = ko.observable("");
|
|
this.ort = ko.observable("");
|
|
this.rechnungsadressename = ko.observable("");
|
|
this.rechnungsadressestrasse = ko.observable("");
|
|
this.rechnungsadressepostleitzahl = ko.observable("");
|
|
this.rechnungsadresseort = ko.observable("");
|
|
this.email = ko.observable("");
|
|
this.pureemail = ko.observable("");
|
|
this.fax = ko.observable("");
|
|
this.telefon = ko.observable("");
|
|
this.handy = ko.observable("");
|
|
this.umfeldpersonen = ko.observableArray([]);
|
|
this.Wohnheim = ko.observable("");
|
|
this.mobileLink = ko.observable("");
|
|
this.landLineLink = ko.observable("");
|
|
this.kommentar = ko.observable("");
|
|
|
|
this.update = function (data) {
|
|
this.vorname(data.Vorname);
|
|
this.nachname(data.Nachname);
|
|
this.geburtstag(data.Geburtstag);
|
|
this.geschlecht(data.Geschlecht);
|
|
|
|
this.adresszusatz(data.Adresszusatz);
|
|
this.strasse(data.Strasse);
|
|
this.plz(data.Postleitzahl);
|
|
this.ort(data.Ort);
|
|
|
|
this.rechnungsadressename(data.RechnungsadresseName);
|
|
this.rechnungsadressestrasse(data.RechnungsadresseStrasse);
|
|
this.rechnungsadressepostleitzahl(data.RechnungsadressePostleitzahl);
|
|
this.rechnungsadresseort(data.RechnungsadresseOrt);
|
|
|
|
this.email('mailto:'+data.EMail);
|
|
this.pureemail(data.EMail);
|
|
this.fax(data.Fax);
|
|
this.telefon(data.Telefon);
|
|
this.handy(data.Handy);
|
|
this.mobileLink('tel:' + data.Handy);
|
|
this.landLineLink('tel:' + data.Telefon);
|
|
this.kommentar(data.Kommentar);
|
|
|
|
var mappedUmfeldpersonen = $.map(data.Umfeldpersonen, function (item) { return new UmfPers(item); });
|
|
|
|
if (mappedUmfeldpersonen.length === 0) {
|
|
$("#WohnheimContainer").css("display", "none");
|
|
}
|
|
|
|
this.umfeldpersonen(mappedUmfeldpersonen);
|
|
|
|
calcPropFieldMinSizes();
|
|
updateEigenschaftsfelder();
|
|
}
|
|
}
|
|
|
|
function UmfPers(initdata) {
|
|
var self = this;
|
|
|
|
self.umfvorname = ko.observable(initdata.Vorname);
|
|
self.umfnachname = ko.observable(initdata.Nachname);
|
|
self.umfstrnr = ko.observable(initdata.StrNameNr);
|
|
self.umfplzort = ko.observable(initdata.PLZOrt);
|
|
self.umftelnr = ko.observable("tel:" + initdata.TelNr);
|
|
self.nurtelnr = ko.observable(initdata.TelNr);
|
|
self.nurmobil = ko.observable(initdata.Mobil);
|
|
self.umfmobil = ko.observable("tel:" + initdata.Mobil);
|
|
self.umfemail = ko.observable("mailto:" + initdata.EMail);
|
|
self.nuremail = ko.observable(initdata.EMail);
|
|
self.umffax = ko.observable(initdata.Fax);
|
|
self.umfrolle = ko.observable(initdata.Rolle);
|
|
self.umftitel = ko.observable(initdata.Titel);
|
|
|
|
self.formattedName = ko.computed(function () {
|
|
var titel = self.umftitel() ? self.umftitel() + " " : "";
|
|
return titel + self.umfvorname() + " " + self.umfnachname();
|
|
});
|
|
|
|
self.update = function (updatedata) {
|
|
self.umfvorname(updatedata.Vorname);
|
|
self.umfnachname(updatedata.Nachname);
|
|
self.umfstrnr(updatedata.StrNameNr);
|
|
self.umfplzort(updatedata.PLZOrt);
|
|
self.umfmobil("tel:" + updatedata.Mobil);
|
|
self.nurmobil(updatedata.Mobil);
|
|
self.umfemail("mailto:" + updatedata.EMail);
|
|
self.nuremail(ko.observable(updatedata.EMail));
|
|
self.umffax(updatedata.Fax);
|
|
self.umfrolle(updatedata.Rolle);
|
|
self.umftitel(updatedata.Titel);
|
|
self.umftelnr("tel:" + updatedata.TelNr);
|
|
self.nurtelnr(updatedata.TelNr);
|
|
}
|
|
}
|
|
|
|
minSizes = undefined;
|
|
function calcPropFieldMinSizes() {
|
|
var width = 0;
|
|
var height = 0;
|
|
var elementCount = 0;
|
|
|
|
$(".eigenschaftsdiv").each(
|
|
function (index, element) {
|
|
var x = $(element).clone().css({ "height": "auto", "width": "auto" }).appendTo("body");
|
|
|
|
var temporaryWidth = x.outerWidth(true);
|
|
var temporaryHeight = x.outerHeight(true);
|
|
|
|
x.remove();
|
|
|
|
elementCount++;
|
|
|
|
if(temporaryWidth > width) {
|
|
width = temporaryWidth;
|
|
}
|
|
|
|
if(temporaryHeight > height) {
|
|
height = temporaryHeight;
|
|
}
|
|
}
|
|
);
|
|
|
|
window.minSizes = { minWidth: width, minHeight: height, divCount: elementCount };
|
|
}
|
|
|
|
function updateEigenschaftsfelder() {
|
|
var customerTableWidth = $("#klientenTabelle").width();
|
|
|
|
$("#map-canvas").css("width", customerTableWidth - 16);
|
|
$("#map-canvas").css("height", customerTableWidth - 16);
|
|
|
|
if(minSizes == undefined) {
|
|
return;
|
|
}
|
|
|
|
var mitPadding = minSizes.minWidth;
|
|
var maxAnzahl = parseInt(customerTableWidth / mitPadding);
|
|
|
|
if(maxAnzahl > minSizes.divCount) {
|
|
maxAnzahl = minSizes.divCount;
|
|
}
|
|
|
|
var width = parseInt(customerTableWidth / maxAnzahl) - 16;
|
|
|
|
if(minSizes !== undefined) {
|
|
$(".eigenschaftsdiv").each(
|
|
function (index, element) {
|
|
$(element).css("width", width + "px");
|
|
$(element).css("height", (minSizes.minHeight - 16) + "px");
|
|
}
|
|
);
|
|
}
|
|
}
|
|
|
|
$(window).resize(function () {
|
|
if($("#klientenTabelle").css("display") === "block") {
|
|
updateEigenschaftsfelder();
|
|
}
|
|
});
|
|
|
|
function showSanduhr() {
|
|
$(".modalWrapper").css("display", "block");
|
|
$(".modalWrapper").css("height", $(document).height());
|
|
$(".warte-animation").css("display", "inline-block");
|
|
|
|
}
|
|
|
|
function hideSanduhr() {
|
|
if($("#errorPopupDiv").css("display") === "none" && $("#popupDiv").css("display") === "none") {
|
|
$(".modalWrapper").css("display", "none");
|
|
$(".modalWrapper").css("height", "0");
|
|
}
|
|
|
|
if($("#SuccessPopupDiv").css("display") === "none" && $("#popupDiv").css("display") === "none") {
|
|
$(".modalWrapper").css("display", "none");
|
|
$(".modalWrapper").css("height", "0");
|
|
}
|
|
|
|
if($("#AendernPopupDiv").css("display") === "none" && $("#popupDiv").css("display") === "none") {
|
|
$(".modalWrapper").css("display", "none");
|
|
$(".modalWrapper").css("height", "0");
|
|
}
|
|
|
|
$(".warte-animation").css("display", "none");
|
|
}
|
|
|
|
function submitDeletionForm() {
|
|
showSanduhr();
|
|
$("#deletionForm").submit();
|
|
}
|
|
|
|
function toggleErrorPopup(errorMessage, i) {
|
|
var isDisplayNone = $("#errorPopupDiv").css("display") === "none";
|
|
var displayValue = isDisplayNone ? "block" : "none";
|
|
|
|
$("#errorPopupDiv").css("display", displayValue);
|
|
$(".modalWrapper").css("display", displayValue);
|
|
$(".modalWrapper").css("height", $(document).height());
|
|
|
|
if(isDisplayNone ) {
|
|
$("#errorPopupText").text(errorMessage);
|
|
|
|
if(i === 1) {
|
|
$("#errorPopupTitle").text("Info");
|
|
$("#errorPopupOkBtn").onclick = "toggleErrorPopup('')";
|
|
} else if(i === 2) {
|
|
$("#errorPopupTitle").text("Fehler");
|
|
$("#errorPopupOkBtn").onclick = "toggleErrorPopup('')";
|
|
|
|
clearLocalStorage(1);
|
|
//SaveOnly(); // Speichere Daten bei absturz
|
|
}
|
|
else {
|
|
$("#errorPopupTitle").text("Fehler");
|
|
$("#errorPopupOkBtn").onclick = "toggleErrorPopup('')";
|
|
}
|
|
|
|
var errorPopupTitleOuterHeight = $("#errorPopupTitle").outerHeight();
|
|
var errorPopupTextOuterHeight = $("#errorPopupText").outerHeight();
|
|
var errorPopupButtonOuterHeight = $("#errorPopupBtnDiv").outerHeight();
|
|
var errorPopupOkButtonOuterHeight = $("#errorPopupOkBtn").outerHeight();
|
|
|
|
var height = errorPopupTitleOuterHeight + errorPopupTextOuterHeight + errorPopupButtonOuterHeight + errorPopupOkButtonOuterHeight + errorPopupOkButtonOuterHeight;
|
|
|
|
$("#errorPopupDiv").css("height", height + "px");
|
|
|
|
$("#errorPopupDiv").css("top", window.pageYOffset + window.innerHeight / 2 - height / 2);
|
|
$("#errorPopupDiv").css("margin-top", "0");
|
|
} else {
|
|
$("#errorPopupDiv").css("margin-top", "auto");
|
|
}
|
|
}
|
|
|
|
function toggleSuccessPopup(message, i) {
|
|
var isDisplayNone = $("#SuccessPopupDiv").css("display") === "none";
|
|
var displayValue = isDisplayNone ? "block" : "none";
|
|
|
|
$("#SuccessPopupDiv").css("display", displayValue);
|
|
$(".modalWrapper").css("display", displayValue);
|
|
$(".modalWrapper").css("height", $(document).height());
|
|
|
|
$("#SuccessPopupOkBtn").val("OK");
|
|
|
|
if(i === 2) {
|
|
$(".SuccessPopupUSchrift").css("display", "none");
|
|
}
|
|
else if(i === 3) {
|
|
$(".SuccessPopupUSchrift").css("display", "none");
|
|
$("#SuccessPopupTitle").text("Es ist leider ein Fehler aufgetreten!");
|
|
}
|
|
else if(i === 4) {
|
|
$(".SuccessPopupUSchrift").css("display", "inline");
|
|
$("#SuccessPopupOkBtn").val("Nein");
|
|
}
|
|
else {
|
|
$(".SuccessPopupUSchrift").css("display", "inline");
|
|
}
|
|
|
|
if(isDisplayNone) {
|
|
$("#SuccessPopupText").text(message);
|
|
|
|
var successPopupTitleOuterHeight = $("#SuccessPopupTitle").outerHeight();
|
|
var successPopupTextOuterHeight = $("#SuccessPopupText").outerHeight();
|
|
var successPopupButtonOuterHeight = $("#SuccessPopupBtnDiv").outerHeight();
|
|
var successPopupOkButtonOuterHeight = $(".SuccessPopupOkBtn").outerHeight();
|
|
var successPopupSignatureButtonOuterHeight = $(".SuccessPopupUSchrift").outerHeight();
|
|
|
|
var height = successPopupTitleOuterHeight + successPopupTextOuterHeight + successPopupButtonOuterHeight + successPopupOkButtonOuterHeight + successPopupSignatureButtonOuterHeight;
|
|
|
|
$("#SuccessPopupDiv").css("height", height + "px");
|
|
|
|
$("#SuccessPopupDiv").css("top", window.pageYOffset + window.innerHeight / 2 - height / 2);
|
|
$("#SuccessPopupDiv").css("margin-top", "0");
|
|
} else {
|
|
$("#SuccessPopupDiv").css("margin-top", "auto");
|
|
}
|
|
}
|
|
|
|
function toggleUpdateAppointmentPopup(message) {
|
|
var isDisplayNone = $("#AendernPopupDiv").css("display") === "none";
|
|
var displayValue = isDisplayNone ? "block" : "none";
|
|
|
|
$("#AendernPopupDiv").css("display", displayValue);
|
|
$(".modalWrapper").css("display", displayValue);
|
|
$(".modalWrapper").css("height", $(document).height());
|
|
|
|
if(isDisplayNone) {
|
|
$("#AendernPopupText").text(message);
|
|
|
|
var aendernPopupTitleOuterHeight = $("#AendernPopupTitle").outerHeight();
|
|
var aenderPopupTextOuterHeight = $("#AendernPopupText").outerHeight();
|
|
var aendernPopupButtonDivOuterHeight = $("#AendernPopupBtnDiv").outerHeight();
|
|
var aendernPopupOkButtonOuterHeight = $(".AendernPopupOkBtn").outerHeight();
|
|
var aendernPopupSignatureOuterHeight = $(".AendernPopupUSchrift").outerHeight();
|
|
|
|
var height = aendernPopupTitleOuterHeight + aenderPopupTextOuterHeight + aendernPopupButtonDivOuterHeight + aendernPopupOkButtonOuterHeight + aendernPopupSignatureOuterHeight;
|
|
|
|
$("#AendernPopupDiv").css("height", height + "px");
|
|
|
|
$("#AendernPopupDiv").css("top", window.pageYOffset + window.innerHeight / 2 - height / 2);
|
|
$("#AendernPopupDiv").css("margin-top", "0");
|
|
} else {
|
|
$("#AendernPopupDiv").css("margin-top", "auto");
|
|
}
|
|
}
|
|
|
|
function confirmErrorPopup() {
|
|
toggleErrorPopup("");
|
|
}
|
|
|
|
function clearRecords() {
|
|
$("#serviceRecords").empty();
|
|
}
|
|
|
|
function preselectCustomer() {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: getSupportConceptCustomerUrl,
|
|
success: function (json) {
|
|
if(json === "NoSupportConceptSelected") {
|
|
return;
|
|
}
|
|
|
|
var valueToSelect = $.parseJSON(json);
|
|
|
|
$("#customersDropDown option").each(function () {
|
|
if(this.value === valueToSelect === true) {
|
|
$("#customersDropDown").val(valueToSelect);
|
|
$("#customersDropDown").trigger("change");
|
|
|
|
return false;
|
|
} else {
|
|
return true;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
function setSelectedEmployee() {
|
|
var oid = parseInt($("#employeesDropDown").find(":selected").val());
|
|
|
|
console.log('selected employee oid: ' + oid);
|
|
|
|
if(isNaN(oid)) {
|
|
return;
|
|
}
|
|
|
|
window.serviceRecordEmployeeOid = oid;
|
|
|
|
makeAjaxCall("GET", setServiceRecordEmployeeUrl, null, { employeeOid: window.serviceRecordEmployeeOid }, null);
|
|
}
|
|
|
|
function SaveOnly() {
|
|
if(typeof(Storage) != "undefined") {
|
|
clearLocalStorage(1);
|
|
|
|
var costBearer2SupportConceptOid = $("#scDropDown").val();
|
|
var hilfeplan = $("#scDropDown option[value='" + zahl + "']").text();
|
|
var mitarbeiter = $("#employeesDropDown option:selected").text();
|
|
var kategorie = $("#kategorien_select option:selected").text();
|
|
var leistung = $("#leistungen_select option:selected").val();
|
|
var duration = $("#duration_textbox").val();
|
|
var notiz = $("#notiz_textbox").val();
|
|
|
|
var notiz2, notiz3, notiz4, notiz5;
|
|
|
|
if($("#notiz_textbox1").val() !== "") {
|
|
notiz = $("#notiz_textbox1").val();
|
|
}
|
|
|
|
if($("#notiz_textbox2").val() !== "") {
|
|
notiz2 = $("#notiz_textbox2").val();
|
|
}
|
|
|
|
if($("#notiz_textbox3").val() !== "") {
|
|
notiz3 = $("#notiz_textbox3").val();
|
|
}
|
|
|
|
if($("#notiz_textbox4").val() !== "") {
|
|
notiz4 = $("#notiz_textbox4").val();
|
|
}
|
|
|
|
if($("#notiz_textbox5").val() !== "") {
|
|
notiz5 = $("#notiz_textbox5").val();
|
|
}
|
|
|
|
localStorage.setItem("Zeitdaten", new LocalServiceRecord(costBearer2SupportConceptOid, hilfeplan, mitarbeiter, kategorie, leistung, $("#datum_textbox").val(), $("#start_textbox").val(), $("#ende_textbox").val(), duration, notiz, notiz2, notiz3, notiz4, notiz5, $("#enddatum_textbox").val()));
|
|
}
|
|
}
|
|
|
|
function clearLocalStorage(i) {
|
|
if(i === 1) {
|
|
localStorage.removeItem("Zeitdaten");
|
|
}
|
|
|
|
if(i === 2) {
|
|
localStorage.removeItem("Kalenderdaten");
|
|
}
|
|
}
|
|
|
|
function saveZeiterfassungAfterCrash(datum, startd, endd, dauer, doku, leistung, costBearer2SupportConceptOid, doku2, doku3, doku4, doku5, enddatum) {
|
|
var x = getDateObj(true);
|
|
var y = getDateObj(false);
|
|
|
|
var vonDatum = getDateTimeStringWithLeadingZeros(x);
|
|
var bisDatum = getDateTimeStringWithLeadingZeros(y);
|
|
|
|
if (costBearer2SupportConceptOid === -2) {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: saveZeiterfassungAfterCrashUrl,
|
|
data: {
|
|
pDatum: datum,
|
|
pStartDate: startd,
|
|
pEndDate: endd,
|
|
pDuration: dauer,
|
|
pNotice: doku,
|
|
pServiceDescription: leistung,
|
|
pNotice2: doku2,
|
|
pNotice3: doku3,
|
|
pNotice4: doku4,
|
|
pNotice5: doku5,
|
|
pEndDate2: enddatum
|
|
}, success: null, error: null
|
|
});
|
|
} else {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: CheckRightsAfterCrashUrl,
|
|
data: { von: vonDatum, bis: bisDatum, inEditMode: false, dateString: datum, startString: startd, endString: endd, costbearerOId: costBearer2SupportConceptOid, leistung:leistung},
|
|
success: function (json) {
|
|
|
|
var hasSufficientRights = json;
|
|
|
|
if (hasSufficientRights === "True") {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: saveZeiterfassungAfterCrashUrl,
|
|
data: { Datum: datum, StartD: startd, EndeD: endd, Dauer: dauer, Doku: doku, Leistungen: leistung, Doku2: doku2, Doku3: doku3, Doku4: doku4, Doku5: doku5, EndDatum: enddatum }, success: function () { }, error: function () { writeFatalErrorMessage("Es konnte keine verbindung zum Server aufgebaut werden. Bitte überprüfen sie ihre Internet Verbindung."); /*$("#scDropDown option[value='" + oid + "']").attr('selected', true).trigger("change");*/ }
|
|
});
|
|
|
|
} else {
|
|
clearLocalStorage(1);
|
|
|
|
setTimeout(function () {
|
|
$("#scDropDown option[value='" + costBearer2SupportConceptOid + "']").attr("selected", true).trigger("change");
|
|
}, 4500);
|
|
|
|
}
|
|
}, error: function () {
|
|
clearLocalStorage(1);
|
|
writeFatalErrorMessage("Es konnte keine Verbindung zum Server aufgebaut werden. Bitte überprüfen Sie Ihre Internetverbindung.");
|
|
// $("#scDropDown option[value='" + costBearer2SupportConceptOid + "']").attr('selected', true).trigger("change");
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function showErrorAfterCrash() {
|
|
var errorAfterCrashSwitch = $("#ErrorZeiterfassungAfterCrashSchalter");
|
|
var switchValue = errorAfterCrashSwitch.val();
|
|
var errorMessage = "";
|
|
|
|
if(switchValue === 2 || switchValue === 3) {
|
|
errorMessage = "Es konnte keine Verbindung zum Server aufgebaut werden. Bitte überprüfen sie ihre Internet Verbindung.";
|
|
} else if(switchValue === 4) {
|
|
errorMessage = "Das Datum liegt außerhalb des Zeitraumes des gewählten Hilfeplans. Der Eintrag kann nicht gespeichert werden.";
|
|
} else if(switchValue === 5) {
|
|
errorMessage = "Die eingegebene Uhrzeit ist ungültig. Der Eintrag kann nicht gespeichert werden.";
|
|
}
|
|
|
|
if(errorAfterCrashSwitch.val() > 1) {
|
|
writeFatalErrorMessage(errorMessage);
|
|
|
|
errorAfterCrashSwitch.val(1);
|
|
clearLocalStorage(1);
|
|
setTimeout(function() {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: ErrorZeiterfassungAnzeigenUrl,
|
|
data: { errorwert: 1 }
|
|
});
|
|
}, timeOut);
|
|
}
|
|
}
|
|
|
|
function focusOnTab(tabIdentifier) {
|
|
setTimeout(function() {
|
|
var displayValue;
|
|
|
|
for(var i = 0; i < window.numberOfDocumentationTypes; i++) {
|
|
var idNumber = i + 1;
|
|
displayValue = idNumber === tabIdentifier ? "block" : "none";
|
|
|
|
$('#notiz_textbox' + idNumber).css("display", displayValue);
|
|
}
|
|
|
|
$('#notiz_textbox' + tabIdentifier).get(0).focus();
|
|
window.focusedDokuTextarea = $('#notiz_textbox' + tabIdentifier);
|
|
}, 100);
|
|
}
|
|
|
|
function showTextModulesPopup() {
|
|
$("#kollabierbar2").css("display", "block");
|
|
|
|
$("#textModulePopupDivContainer").css("display", "block");
|
|
$("#textModulePopupDivContainer").css("height", $("body").css("height"));
|
|
$("#textModulePopupDiv").css("display", "block");
|
|
|
|
var destination = $("#textModulesTr").offset();
|
|
var outerHeight = $("#textModulePopupDiv").outerHeight();
|
|
|
|
$("#textModulePopupDiv").css({ top: destination.top - outerHeight });
|
|
}
|
|
|
|
function hideTextModulePopup() {
|
|
$("#textModulePopupDivContainer").css("display", "none");
|
|
$("#textModulePopupDiv").css("display", "none");
|
|
|
|
$("#kollabierbar2").css("display", "none");
|
|
}
|