Upload via GUI (267 Dateien)
This commit is contained in:
@@ -19,7 +19,7 @@ $pdo = get_db();
|
||||
|
||||
const RULE_FIELDS = ['subject' => 'Betreff', 'message' => 'Nachricht', 'requester_email' => 'Absender-E-Mail', 'requester_name' => 'Absender-Name', 'source' => 'Kanal (web/email)'];
|
||||
const RULE_OPERATORS = ['contains' => 'enthält', 'not_contains' => 'enthält nicht', 'equals' => 'ist genau', 'starts_with' => 'beginnt mit', 'ends_with' => 'endet mit'];
|
||||
const RULE_ACTIONS = ['set_department' => 'Abteilung setzen', 'set_priority' => 'Priorität setzen', 'set_help_topic' => 'Hilfe-Thema setzen', 'assign_staff' => 'Mitarbeiter zuweisen', 'add_tag' => 'Tag hinzufügen', 'auto_reply' => 'Auto-Antwort senden', 'reject' => 'Ticket verwerfen (z.B. Spam)'];
|
||||
const RULE_ACTIONS = ['set_department' => 'Abteilung setzen', 'set_priority' => 'Priorität setzen', 'set_help_topic' => 'Hilfe-Thema setzen', 'assign_staff' => 'Mitarbeiter zuweisen', 'add_tag' => 'Tag hinzufügen', 'auto_reply' => 'Auto-Antwort senden', 'close' => 'Ticket schließen', 'reject' => 'Ticket verwerfen (z.B. Spam)'];
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$departments = departments_for_select($pdo, array_map('intval', $pdo->query("SELECT action_value FROM ticket_rule_actions WHERE action_type = 'set_department'")->fetchAll(PDO::FETCH_COLUMN)));
|
||||
@@ -54,7 +54,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
'assign_staff' => $staffById[$value] ?? null,
|
||||
'auto_reply' => $cannedById[$value] ?? null,
|
||||
'add_tag' => $value,
|
||||
'reject' => null,
|
||||
'reject', 'close' => null,
|
||||
default => null,
|
||||
};
|
||||
$actionsOut[] = ['type' => $type, 'value' => $value, 'valueLabel' => $label];
|
||||
@@ -138,8 +138,9 @@ if ($action === 'save') {
|
||||
foreach ($rawActions as $a) {
|
||||
$type = (string) ($a['type'] ?? '');
|
||||
if (!isset(RULE_ACTIONS[$type])) continue;
|
||||
$value = $type === 'reject' ? '1' : trim((string) ($a['value'] ?? ''));
|
||||
if ($type !== 'reject' && $value === '') continue;
|
||||
$noValue = in_array($type, ['reject', 'close'], true);
|
||||
$value = $noValue ? '1' : trim((string) ($a['value'] ?? ''));
|
||||
if (!$noValue && $value === '') continue;
|
||||
$actionsToSave[] = ['type' => $type, 'value' => $value];
|
||||
}
|
||||
if (!$actionsToSave) api_error(422, 'ACTIONS_REQUIRED', 'Bitte mindestens eine Aktion festlegen.');
|
||||
|
||||
Reference in New Issue
Block a user