Upload via GUI (267 Dateien)
This commit is contained in:
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
require_once __DIR__ . '/common.php';
|
||||
|
||||
api_require_method('POST');
|
||||
$staff = api_require_staff();
|
||||
$body = api_request_body();
|
||||
$number = trim((string) ($body['number'] ?? ''));
|
||||
$type = (string) ($body['type'] ?? '');
|
||||
$message = (string) ($body['message'] ?? '');
|
||||
$setStatus = isset($body['setStatus']) ? (string) $body['setStatus'] : null;
|
||||
if ($number === '') {
|
||||
api_error(422, 'TICKET_NUMBER_REQUIRED', 'Eine Ticketnummer ist erforderlich.');
|
||||
}
|
||||
$pdo = get_db();
|
||||
$ticket = api_find_ticket($pdo, $staff, $number);
|
||||
$threadId = api_add_ticket_message($pdo, $staff, $ticket, $type, $message, $setStatus);
|
||||
api_json(['threadId' => $threadId], 201);
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
require_once __DIR__ . '/common.php';
|
||||
|
||||
api_require_method('POST');
|
||||
$staff = api_require_staff();
|
||||
$body = api_request_body();
|
||||
$number = trim((string) ($body['number'] ?? ''));
|
||||
$type = (string) ($body['type'] ?? '');
|
||||
$message = (string) ($body['message'] ?? '');
|
||||
$setStatus = isset($body['setStatus']) ? (string) $body['setStatus'] : null;
|
||||
// Optional: welche Signatur angehängt wird (own = eigene, dept = Abteilung, none = keine); ohne Angabe eigene, ersatzweise Abteilung
|
||||
$signatureChoice = isset($body['signature']) && in_array($body['signature'], ['own', 'dept', 'none'], true) ? (string) $body['signature'] : null;
|
||||
if ($number === '') {
|
||||
api_error(422, 'TICKET_NUMBER_REQUIRED', 'Eine Ticketnummer ist erforderlich.');
|
||||
}
|
||||
$pdo = get_db();
|
||||
$ticket = api_find_ticket($pdo, $staff, $number);
|
||||
$threadId = api_add_ticket_message($pdo, $staff, $ticket, $type, $message, $setStatus, $signatureChoice);
|
||||
api_json(['threadId' => $threadId], 201);
|
||||
|
||||
Reference in New Issue
Block a user