Upload via GUI (396 Dateien)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
require_once __DIR__ . '/common.php';
|
||||
require_once __DIR__ . '/../../../includes/mail_reload.php';
|
||||
|
||||
/**
|
||||
* Lädt Anhänge, eingebettete Bilder und die Formatierung der Original-E-Mail eines Tickets nach (wie der Knopf im Ticket der
|
||||
* Weboberfläche). POST {"number": "260101-0001"}.
|
||||
*/
|
||||
api_require_method('POST');
|
||||
$staff = api_require_staff();
|
||||
$body = api_request_body();
|
||||
$number = trim((string) ($body['number'] ?? ''));
|
||||
if ($number === '') api_error(422, 'TICKET_NUMBER_REQUIRED', 'Eine Ticketnummer ist erforderlich.');
|
||||
$pdo = get_db();
|
||||
$ticket = api_find_ticket($pdo, $staff, $number);
|
||||
api_require_permission($staff, 'reply_ticket', (int) $ticket['department_id']);
|
||||
if ($ticket['source'] !== 'email') api_error(422, 'EMAIL_TICKET_REQUIRED', 'Nur E-Mail-Tickets haben eine Original-E-Mail.');
|
||||
$r = reload_ticket_mail_attachments($pdo, $ticket, (int) $staff['id']);
|
||||
if ($r['error']) api_error(422, 'MAIL_RELOAD_FAILED', $r['error']);
|
||||
api_json([
|
||||
'added' => $r['added'],
|
||||
'inlineImages' => $r['inline'],
|
||||
'formatting' => $r['html'] > 0,
|
||||
'skipped' => $r['skipped'],
|
||||
'alreadyThere' => $r['existing'],
|
||||
'failed' => $r['failed'],
|
||||
]);
|
||||
Reference in New Issue
Block a user