Kostenpositionen im Durchführungsdrawer bearbeiten

This commit is contained in:
gitea_admin committed 2026-09-20 11:58:25 +02:00
1 parent 2a09401600
commit 6226f2a037
4 files changed
+19 -14

No files matched your search

+16
View File
@@ -63,6 +63,22 @@ if ($requestMethod === 'POST') {
$day = market_management_delete_day($pdo, $id);
echo json_encode(['ok' => true, 'day' => $day]);
exit;
} elseif (($payload['action'] ?? '') === 'create_cost_item') {
$fields['occurrence_id'] = $id;
$costItem = market_management_create_cost_item($pdo, $fields);
echo json_encode(['ok' => true, 'cost_item' => $costItem], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
exit;
} elseif (($payload['action'] ?? '') === 'update_cost_item') {
$costItem = market_management_update_cost_item($pdo, $id, $fields);
echo json_encode(['ok' => true, 'cost_item' => $costItem], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
exit;
} elseif (($payload['action'] ?? '') === 'delete_cost_item') {
if (($payload['confirmation'] ?? '') !== 'DELETE') {
throw new InvalidArgumentException('Bestätigung muss exakt DELETE lauten.');
}
$costItem = market_management_delete_cost_item($pdo, $id);
echo json_encode(['ok' => true, 'cost_item' => $costItem], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
exit;
} elseif ($scope === 'day') {
market_management_update_day($pdo, $id, $fields);
} elseif (in_array($scope, ['occurrence', 'status', 'overview', 'participation', 'infrastructure', 'travel', 'notes'], true)) {