feat(tickets): make ticket title/content/reply length limits configurable

Add ticket_title_max / ticket_content_max / ticket_reply_max to the
users/ticket schema (PHP + SPA) with clamped TicketSettings readers.
All write paths (front REST, admin REST, note REST, native admin page)
and front-end maxlength/counters now read the configured limits.
Remove the hardcoded TICKET_CONTENT_MAX constant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-27 23:06:28 +08:00
1 parent 6681b0c306
commit 63ab8b8fc9
13 files changed
+71 -28

No files matched your search

+5 -2
View File
@@ -498,10 +498,10 @@ trait ScriptsPart1c {
'desc' => (string) ($report['desc'] ?? ''),
];
})(),
// 工单配置(ticket-center.js):附件开关与上限、提交公告、催单冷却。
// 工单配置(ticket-center.js):附件开关与上限、提交公告、催单冷却、字数上限。
'ticket' => (function () {
if (!class_exists('\AKSRT\Ticket\TicketSettings')) {
return ['enabled' => false, 'attachmentEnabled' => false, 'attachmentMax' => 5, 'notice' => ['open' => false, 'text' => ''], 'urgeInterval' => 15];
return ['enabled' => false, 'attachmentEnabled' => false, 'attachmentMax' => 5, 'notice' => ['open' => false, 'text' => ''], 'urgeInterval' => 15, 'titleMax' => 200, 'contentMax' => 5000, 'replyMax' => 3000];
}
return [
'enabled' => \AKSRT\Ticket\TicketSettings::enabled(),
@@ -512,6 +512,9 @@ trait ScriptsPart1c {
'text' => \AKSRT\Ticket\TicketSettings::notice_text(),
],
'urgeInterval' => \AKSRT\Ticket\TicketSettings::urge_interval(),
'titleMax' => \AKSRT\Ticket\TicketSettings::title_max(),
'contentMax' => \AKSRT\Ticket\TicketSettings::content_max(),
'replyMax' => \AKSRT\Ticket\TicketSettings::reply_max(),
];
})(),
'stickyEnabled' => class_exists('\AKSRT\Settings\Settings') ? !empty(\AKSRT\Settings\Settings::get_post_list_style_settings()['sticky_s']) : true,