Translate list action buttons; add debug logging for item updates

This commit is contained in:
Edwin Noorlander 2025-11-11 18:13:24 +01:00
parent e1cf2a3e46
commit 3ff85b8143
4 changed files with 10 additions and 5 deletions

View File

@ -63,5 +63,6 @@
"Are you sure you want to delete this part?": "Are you sure you want to delete this part?",
"Are you sure you want to delete this category?": "Are you sure you want to delete this category?",
"Image": "Image",
"Location": "Location"
"Location": "Location",
"Print QR": "Print QR"
}

View File

@ -63,5 +63,6 @@
"Are you sure you want to delete this part?": "Weet je zeker dat je dit onderdeel wilt verwijderen?",
"Are you sure you want to delete this category?": "Weet je zeker dat je deze categorie wilt verwijderen?",
"Image": "Afbeelding",
"Location": "Locatie"
"Location": "Locatie",
"Print QR": "Print QR"
}

View File

@ -234,9 +234,12 @@ class ItemController
}
$item = new Item($db, $id, $name, $description, $categoryId, null, $idCode, $imagePath, $location);
error_log("Updating item $id with image: $imagePath");
if ($item->save()) {
error_log("Item $id updated successfully");
echo json_encode(['success' => true, 'message' => 'Part updated successfully']);
} else {
error_log("Failed to update item $id");
throw new Exception('Failed to update part');
}
} catch (Exception $e) {

View File

@ -45,9 +45,9 @@
{% endif %}
</div>
<div>
<button class="btn btn-sm btn-warning me-2 edit-btn" data-id="{{ item.id }}">Edit</button>
<button class="btn btn-sm btn-info me-2" onclick="window.open('/print/{{ item.id }}', '_blank')">Print QR</button>
<button class="btn btn-sm btn-danger delete-btn" data-id="{{ item.id }}">Delete</button>
<button class="btn btn-sm btn-warning me-2 edit-btn" data-id="{{ item.id }}">{{ trans('Edit') }}</button>
<button class="btn btn-sm btn-info me-2" onclick="window.open('/print/{{ item.id }}', '_blank')">{{ trans('Print QR') }}</button>
<button class="btn btn-sm btn-danger delete-btn" data-id="{{ item.id }}">{{ trans('Delete') }}</button>
</div>
</li>
{% endfor %}