Upload via GUI (452 Dateien)
This commit is contained in:
@@ -18,12 +18,16 @@ $resolutionReasons = ticket_resolution_reasons();
|
||||
require_once __DIR__ . '/../includes/mail_fetch_manual.php';
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['action'] ?? '') === 'fetch_mail_now') {
|
||||
verify_csrf();
|
||||
if (!has_permission($staff, 'fetch_mail')) {
|
||||
flash('error', 'Für den E-Mail-Abruf fehlt die erforderliche Berechtigung.');
|
||||
redirect('/staff/tickets.php');
|
||||
}
|
||||
$fetch = mail_fetch_manual($pdo);
|
||||
flash($fetch['level'], $fetch['message']);
|
||||
audit_log((int) $staff['id'], 'E-Mail-Abruf von Hand gestartet (' . $fetch['processed'] . ' E-Mail(s))');
|
||||
redirect('/staff/tickets.php' . (($_POST['return_query'] ?? '') !== '' ? '?' . ltrim((string) $_POST['return_query'], '?') : ''));
|
||||
}
|
||||
$fetchAvailable = mail_fetch_available($pdo);
|
||||
$fetchAvailable = mail_fetch_available($pdo) && has_permission($staff, 'fetch_mail');
|
||||
$fetchLastRun = (string) get_setting('cron_fetch_emails_last_run', '');
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
@@ -35,7 +39,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && in_array($_POST['queue_action'] ??
|
||||
try {
|
||||
if ($_POST['queue_action'] === 'save') {
|
||||
parse_str((string) ($_POST['return_query'] ?? ''), $currentGet);
|
||||
queue_create($pdo, (int) $staff['id'], (string) ($_POST['queue_name'] ?? ''), queue_filters_from_web($currentGet), !empty($_POST['queue_shared']));
|
||||
queue_create($pdo, (int) $staff['id'], (string) ($_POST['queue_name'] ?? ''), queue_filters_from_web($currentGet), !empty($_POST['queue_shared']) && has_permission($staff, 'share_views'));
|
||||
flash('success', 'Ansicht gespeichert.');
|
||||
} else {
|
||||
$qid = (int) ($_POST['queue_id'] ?? 0);
|
||||
@@ -123,6 +127,12 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['bulk_action'] ?? '') !== '
|
||||
$movedCount++;
|
||||
continue;
|
||||
}
|
||||
// Rechte je Ticket (in der Abteilung des Tickets): Sammelaktionen dürfen nicht mehr als die Einzelaktionen im Ticket
|
||||
$needPerm = ['assign' => 'assign_ticket', 'status' => in_array((string) ($_POST['bulk_status'] ?? ''), ['resolved', 'closed'], true) ? 'close_ticket' : 'reply_ticket',
|
||||
'delete' => 'delete_ticket', 'ban' => 'manage_banlist'][$bulkAction] ?? null;
|
||||
if ($bulkAction === 'priority') $needPerm = 'assign_ticket';
|
||||
if ($needPerm !== null && !has_permission($staff, $needPerm, (int) $t['department_id'])) { $bulkDenied = ($bulkDenied ?? 0) + 1; continue; }
|
||||
if ($bulkAction === 'ban' && !has_permission($staff, 'close_ticket', (int) $t['department_id'])) { $bulkDenied = ($bulkDenied ?? 0) + 1; continue; }
|
||||
if ($bulkAction === 'assign') {
|
||||
$newAgent = $_POST['bulk_assigned_staff_id'] !== '' ? (int) $_POST['bulk_assigned_staff_id'] : null;
|
||||
$pdo->prepare('UPDATE tickets SET assigned_staff_id=?, updated_at=? WHERE id=?')->execute([$newAgent, $now, $t['id']]);
|
||||
@@ -179,7 +189,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['bulk_action'] ?? '') !== '
|
||||
flash($movedCount > 0 ? 'success' : 'error', $msg);
|
||||
} elseif (!$bulkErrors) {
|
||||
$verb = ['assign' => 'zugewiesen', 'priority' => 'Priorität geändert', 'status' => 'Status geändert', 'delete' => 'gelöscht'][$bulkAction] ?? 'aktualisiert';
|
||||
flash('success', count($allowedTickets) . ' Ticket(s) ' . $verb . '.');
|
||||
$okCount = count($allowedTickets) - (int) ($bulkDenied ?? 0);
|
||||
if ($okCount > 0) flash('success', $okCount . ' Ticket(s) ' . $verb . '.');
|
||||
if (!empty($bulkDenied)) flash('error', (int) $bulkDenied . ' Ticket(s) übersprungen: Dafür fehlt die Berechtigung.');
|
||||
} else {
|
||||
foreach ($bulkErrors as $e) flash('error', $e);
|
||||
}
|
||||
@@ -513,7 +525,7 @@ document.getElementById('qf-panel')?.addEventListener('click', function(e){ e.st
|
||||
<input type="hidden" name="return_query" value="<?= e($__currentQuery) ?>">
|
||||
<label for="queue_name" style="margin-top:0">Name der Ansicht</label>
|
||||
<input type="text" id="queue_name" name="queue_name" maxlength="80" placeholder="z. B. Meine überfälligen" required>
|
||||
<label style="display:flex;align-items:center;gap:8px;font-weight:400;margin-top:10px"><input type="checkbox" name="queue_shared" value="1" style="width:auto"> Für alle Mitarbeiter sichtbar</label>
|
||||
<label style="display:<?= has_permission($staff, 'share_views') ? 'flex' : 'none' ?>;align-items:center;gap:8px;font-weight:400;margin-top:10px"><input type="checkbox" name="queue_shared" value="1" style="width:auto"> Für alle Mitarbeiter sichtbar</label>
|
||||
<p class="muted" style="font-size:.76rem;margin:8px 0 0">Gespeichert werden: <?= e($__currentFilters ? implode(', ', array_keys($__currentFilters)) : 'keine Filter (alle Tickets)') ?></p>
|
||||
<div class="btn-row"><button type="submit" class="btn">Speichern</button></div>
|
||||
</form>
|
||||
@@ -607,7 +619,7 @@ document.getElementById('qf-panel')?.addEventListener('click', function(e){ e.st
|
||||
Auch Nachrichten durchsuchen
|
||||
</label>
|
||||
<div style="flex:1"></div>
|
||||
<?php if ($staff['role'] === 'admin'): ?>
|
||||
<?php if (has_permission($staff, 'export_tickets')): ?>
|
||||
<a href="/staff/export.php?type=tickets&<?= http_build_query($_GET) ?>" class="btn secondary" style="font-size:.8rem;padding:5px 12px">↓ CSV exportieren</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($search || $filterStatus || $filterDept || $filterPrio || $filterAssign || $filterTag || $filterSpam): ?>
|
||||
@@ -660,10 +672,14 @@ document.getElementById('qf-panel')?.addEventListener('click', function(e){ e.st
|
||||
</div>
|
||||
|
||||
<div style="margin-left:auto;display:flex;gap:8px">
|
||||
<?php if (has_permission($staff, 'manage_banlist') && has_permission($staff, 'close_ticket')): ?>
|
||||
<button type="button" class="btn secondary" style="border-color:#f59e0b;color:#92400e;white-space:nowrap"
|
||||
onclick="if(confirm('Alle Absender der markierten Tickets sperren und Tickets schließen?')) submitBulk('ban')">⛔ Absender sperren</button>
|
||||
<?php endif; ?>
|
||||
<?php if (has_permission($staff, 'delete_ticket')): ?>
|
||||
<button type="button" class="btn danger" style="white-space:nowrap"
|
||||
onclick="if(confirm('Markierte Tickets wirklich unwiderruflich löschen?')) submitBulk('delete')">Löschen</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user