|
|
|
@ -39,7 +39,13 @@ mins.addEventListener('input', () => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
document.getElementById('sonstigesInput').addEventListener('input', () => {
|
|
|
|
document.getElementById('sonstigesInput').addEventListener('input', () => {
|
|
|
|
checkInput();
|
|
|
|
checkInput();
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Button-Status beim Öffnen des Modals einmal anhand der Standardwerte (z.B. Minuten = 0) setzen,
|
|
|
|
|
|
|
|
// da sonst ohne ein tatsächliches 'input'-Event der Button trotz gültiger Vorbelegung deaktiviert bleibt
|
|
|
|
|
|
|
|
document.getElementById('newEntryModal').addEventListener('show.bs.modal', () => {
|
|
|
|
|
|
|
|
checkInput();
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
// Einstellungen wenn Neuer Eintrag erstellt wird
|
|
|
|
// Einstellungen wenn Neuer Eintrag erstellt wird
|
|
|
|
NewEntryButton.addEventListener('click', () => {
|
|
|
|
NewEntryButton.addEventListener('click', () => {
|
|
|
|
@ -58,8 +64,8 @@ NewEntryButton.addEventListener('click', () => {
|
|
|
|
sonstigesText.style.display = 'none';
|
|
|
|
sonstigesText.style.display = 'none';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Berechnen der Duration
|
|
|
|
// Berechnen der Duration (Stunden sind optional -> ohne Eingabe wird 0 gespeichert)
|
|
|
|
const duration = (parseInt(hours.value)*60) + parseInt(mins.value)
|
|
|
|
const duration = ((parseInt(hours.value) || 0)*60) + parseInt(mins.value)
|
|
|
|
|
|
|
|
|
|
|
|
const newEntryData = {
|
|
|
|
const newEntryData = {
|
|
|
|
date: document.getElementById('datum').value,
|
|
|
|
date: document.getElementById('datum').value,
|
|
|
|
@ -326,7 +332,7 @@ document.getElementById('editEntrySubmitButton').addEventListener('click', () =>
|
|
|
|
|
|
|
|
|
|
|
|
updateEntry(parseInt(ToEditID), 'hours', {
|
|
|
|
updateEntry(parseInt(ToEditID), 'hours', {
|
|
|
|
date: document.getElementById('editDatum').value,
|
|
|
|
date: document.getElementById('editDatum').value,
|
|
|
|
duration: (parseInt(edithours.value)*60) + parseInt(editMins.value),
|
|
|
|
duration: ((parseInt(edithours.value) || 0)*60) + parseInt(editMins.value),
|
|
|
|
type: type,
|
|
|
|
type: type,
|
|
|
|
status: 1,
|
|
|
|
status: 1,
|
|
|
|
sondertext: document.getElementById('editsonstigesInput').value,
|
|
|
|
sondertext: document.getElementById('editsonstigesInput').value,
|
|
|
|
@ -438,7 +444,7 @@ function checkInput() {
|
|
|
|
if ((sonstigesCheck.checked && sonstigesInput.value !== "") || !(sonstigesCheck.checked)) {
|
|
|
|
if ((sonstigesCheck.checked && sonstigesInput.value !== "") || !(sonstigesCheck.checked)) {
|
|
|
|
// Debug Ausgabe für Bedingungsstufen
|
|
|
|
// Debug Ausgabe für Bedingungsstufen
|
|
|
|
// console.log("Erste Bedingung: TRUE")
|
|
|
|
// console.log("Erste Bedingung: TRUE")
|
|
|
|
if (hours.value && mins.value) {
|
|
|
|
if (mins.value) { // Stunden sind optional, Minuten bleiben Pflicht
|
|
|
|
// Debug Ausgabe für Bedingungsstufen
|
|
|
|
// Debug Ausgabe für Bedingungsstufen
|
|
|
|
// console.log("Zweite Bedingung: TRUE")
|
|
|
|
// console.log("Zweite Bedingung: TRUE")
|
|
|
|
if (!allowToSend) {
|
|
|
|
if (!allowToSend) {
|
|
|
|
@ -478,7 +484,7 @@ function checkEditInput() {
|
|
|
|
if ((editsonstigesCheck.checked && editsonstigesInput.value !== "") || !(editsonstigesCheck.checked)) {
|
|
|
|
if ((editsonstigesCheck.checked && editsonstigesInput.value !== "") || !(editsonstigesCheck.checked)) {
|
|
|
|
// Debug Ausgabe für Bedingungsstufen
|
|
|
|
// Debug Ausgabe für Bedingungsstufen
|
|
|
|
// console.log("Erste Bedingung: TRUE")
|
|
|
|
// console.log("Erste Bedingung: TRUE")
|
|
|
|
if (edithours.value && editMins.value) {
|
|
|
|
if (editMins.value) { // Stunden sind optional, Minuten bleiben Pflicht
|
|
|
|
// Debug Ausgabe für Bedingungsstufen
|
|
|
|
// Debug Ausgabe für Bedingungsstufen
|
|
|
|
// console.log("Zweite Bedingung: TRUE")
|
|
|
|
// console.log("Zweite Bedingung: TRUE")
|
|
|
|
if (!editallowToSend) {
|
|
|
|
if (!editallowToSend) {
|
|
|
|
|