Fix of an missing parethasys
Release Inventarsystem / release-docker (push) Has been cancelled

This commit is contained in:
2026-08-11 00:38:48 +02:00
parent a11bce17c5
commit e9006f5a07
+17 -10
View File
@@ -1049,7 +1049,7 @@
const resp = await fetch('/api/library_return_by_code', { const resp = await fetch('/api/library_return_by_code', {
method: 'POST', method: 'POST',
headers: {'Content-Type': 'application/json'}, headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ item_code: code }) body: JSON.stringify({item_code: code})
}); });
const result = await resp.json(); const result = await resp.json();
if (!resp.ok || !result.ok) { if (!resp.ok || !result.ok) {
@@ -1068,6 +1068,7 @@
return false; return false;
} }
} }
try { try {
setScanStatus('Verarbeite Mediencode...', 'warn'); setScanStatus('Verarbeite Mediencode...', 'warn');
const response = await fetch('/api/library_scan_action', { const response = await fetch('/api/library_scan_action', {
@@ -1119,9 +1120,9 @@
scanEditBtn.textContent = 'Scanner schließen'; scanEditBtn.textContent = 'Scanner schließen';
startScanner(function(decodedText) { startScanner(function (decodedText) {
editCodeInput.value = decodedText; editCodeInput.value = decodedText;
if(typeof validateCodeField === "function") { if (typeof validateCodeField === "function") {
validateCodeField(editCodeInput, document.getElementById('edit-item-id')?.value || null); validateCodeField(editCodeInput, document.getElementById('edit-item-id')?.value || null);
} }
scanEditBtn.textContent = 'Barcode scannen'; scanEditBtn.textContent = 'Barcode scannen';
@@ -1207,7 +1208,7 @@
if (kind) el.classList.add(kind); if (kind) el.classList.add(kind);
} }
function showSmallConfirm(message, kind='ok') { function showSmallConfirm(message, kind = 'ok') {
// Append the small helper text in German // Append the small helper text in German
const helper = 'Sie können fortfahren. Dies ist nur eine kleine Benachrichtigung.'; const helper = 'Sie können fortfahren. Dies ist nur eine kleine Benachrichtigung.';
const el = document.createElement('div'); const el = document.createElement('div');
@@ -1219,7 +1220,12 @@
if (el && el.parentNode) el.parentNode.removeChild(el); if (el && el.parentNode) el.parentNode.removeChild(el);
}); });
// auto remove after 3 seconds // auto remove after 3 seconds
setTimeout(() => { try { if (el && el.parentNode) el.parentNode.removeChild(el); } catch(e){} }, 3000); setTimeout(() => {
try {
if (el && el.parentNode) el.parentNode.removeChild(el);
} catch (e) {
}
}, 3000);
} }
function setActiveStudentCard(cardId) { function setActiveStudentCard(cardId) {
@@ -1233,7 +1239,7 @@
} }
function getItemTypeLabel(type) { function getItemTypeLabel(type) {
const labels = { 'book': 'Buch', 'cd': 'CD', 'dvd': 'DVD', 'other': 'Sonstige', 'schoolbook': 'Schulbuch' }; const labels = {'book': 'Buch', 'cd': 'CD', 'dvd': 'DVD', 'other': 'Sonstige', 'schoolbook': 'Schulbuch'};
return labels[type] || type; return labels[type] || type;
} }
@@ -1276,7 +1282,7 @@
} }
// Closes the modal if the user clicks the dark background overlay // Closes the modal if the user clicks the dark background overlay
window.onclick = function(event) { window.onclick = function (event) {
const modal = document.getElementById('detailModal'); const modal = document.getElementById('detailModal');
// If the click happened directly on the dark overlay (not the white box) // If the click happened directly on the dark overlay (not the white box)
if (event.target === modal) { if (event.target === modal) {
@@ -1365,7 +1371,7 @@
document.getElementById('filterISBN').value = ''; document.getElementById('filterISBN').value = '';
document.getElementById('filterType').value = ''; document.getElementById('filterType').value = '';
document.getElementById('filterStatus').value = ''; document.getElementById('filterStatus').value = '';
activeFilters = { isbn: '', type: '', status: '' }; activeFilters = {isbn: '', type: '', status: ''};
applyFiltersAndSearch(true); applyFiltersAndSearch(true);
}); });
} }
@@ -1401,7 +1407,7 @@
const editForm = document.getElementById('editLibraryForm'); const editForm = document.getElementById('editLibraryForm');
if (editForm) { if (editForm) {
editForm.addEventListener('submit', async function(e) { editForm.addEventListener('submit', async function (e) {
e.preventDefault(); e.preventDefault();
const itemId = document.getElementById('editLibraryItemId').value; const itemId = document.getElementById('editLibraryItemId').value;
@@ -1562,7 +1568,7 @@
}).join(''); }).join('');
} }
window.openEditLibraryItem = async function(itemId) { window.openEditLibraryItem = async function (itemId) {
const item = libraryItems.find(i => i._id === itemId); const item = libraryItems.find(i => i._id === itemId);
if (!item) return; if (!item) return;
@@ -1592,6 +1598,7 @@
function closeEditLibraryModal() { function closeEditLibraryModal() {
document.getElementById('editLibraryModal').style.display = 'none'; document.getElementById('editLibraryModal').style.display = 'none';
} }
}
</script> </script>
<div id="editLibraryModal" class="modal" style="display:none;"> <div id="editLibraryModal" class="modal" style="display:none;">