Upload via GUI (290 Dateien)
This commit is contained in:
@@ -11,7 +11,8 @@ if ($number === '') {
|
||||
}
|
||||
$pdo = get_db();
|
||||
$ticket = api_find_ticket($pdo, $staff, $number);
|
||||
if ($ticket['source'] !== 'chat') {
|
||||
// Wiedervorlage und Beobachten sind unabhängig von der Bearbeitungssperre
|
||||
if ($ticket['source'] !== 'chat' && (array_key_exists('status', $body) || array_key_exists('assignedStaffId', $body))) {
|
||||
$lockedByName = ticket_locked_by_other($ticket, (int) $staff['id'], $pdo);
|
||||
if ($lockedByName) {
|
||||
api_error(409, 'TICKET_LOCKED', "Dieses Ticket wird gerade von \"$lockedByName\" bearbeitet.");
|
||||
@@ -63,8 +64,26 @@ if (array_key_exists('assignedStaffId', $body)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Wiedervorlage ("snoozeUntil": Datum/Uhrzeit oder null zum Aufheben) und Beobachten ("following": true/false)
|
||||
if (array_key_exists('snoozeUntil', $body)) {
|
||||
if ($body['snoozeUntil'] === null || $body['snoozeUntil'] === '') {
|
||||
ticket_snooze_clear($pdo, (int) $ticket['id'], (int) $staff['id'], 'Wiedervorlage aufgehoben (Mobile App)');
|
||||
} else {
|
||||
$until = date('Y-m-d H:i:s', (int) strtotime((string) $body['snoozeUntil']));
|
||||
$untilTs = strtotime($until);
|
||||
if ($untilTs <= time() + 30 || $untilTs > time() + 366 * 86400) {
|
||||
api_error(422, 'INVALID_SNOOZE', 'Die Wiedervorlage muss in der Zukunft liegen (höchstens 1 Jahr).');
|
||||
}
|
||||
ticket_snooze_set($pdo, (int) $ticket['id'], (int) $staff['id'], $until);
|
||||
}
|
||||
}
|
||||
if (array_key_exists('following', $body)) {
|
||||
if (!empty($body['following'])) ticket_follow($pdo, (int) $ticket['id'], (int) $staff['id']);
|
||||
else ticket_unfollow($pdo, (int) $ticket['id'], (int) $staff['id']);
|
||||
}
|
||||
|
||||
if (!$updates) {
|
||||
api_json(['ticket' => api_ticket_summary($ticket)]);
|
||||
api_json(['ticket' => api_ticket_summary(api_find_ticket($pdo, $staff, $number))]);
|
||||
}
|
||||
$updates[] = 'updated_at = ?';
|
||||
$params[] = $now;
|
||||
|
||||
Reference in New Issue
Block a user