Translate list action buttons; add debug logging for item updates
This commit is contained in:
parent
e1cf2a3e46
commit
3ff85b8143
@ -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"
|
||||
}
|
||||
@ -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"
|
||||
}
|
||||
@ -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) {
|
||||
|
||||
@ -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 %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user