';
// 工单正文
$html .= '
';
// 沟通记录
$html .= '
' . esc_html__('沟通记录', 'aksrt') . '
';
if ($replies === []) {
$html .= '
' . esc_html__('暂无沟通记录', 'aksrt') . '
';
}
$html .= '
';
foreach ($replies as $reply) {
$who = (string) $reply['author_type'] === 'admin'
? sprintf(
/* translators: %s admin name */
__('管理员 %s', 'aksrt'),
(string) $reply['author_name']
)
: (string) $reply['author_name'];
$html .= '- ';
$html .= '
' . esc_html($who) . ''
. '
';
if (is_array($reply['quote'] ?? null)) {
$quote = $reply['quote'];
$html .= ''
. esc_html(!empty($quote['is_deleted']) ? __('原回复已删除', 'aksrt') : (string) $quote['content'])
. '
';
}
$html .= '' . nl2br(esc_html((string) $reply['content'])) . '
';
$html .= ' ';
}
$html .= '
';
// 管理员回复:已完结工单不再给回复框,只提示已关闭。
if (!empty($ticket['is_closed'])) {
$html .= '
' . esc_html__('工单已关闭,无法继续回复。', 'aksrt') . '
';
} else {
$html .= '
';
}
// 状态迁移 / 部门 / 跟进人
$html .= '
';
// 后台备注
$html .= '
' . esc_html__('后台备注', 'aksrt') . '
';
if ($notes === []) {
$html .= '
' . esc_html__('暂无备注', 'aksrt') . '
';
}
$html .= '
';
$html .= '
';
$html .= '
';
return $html;
}
}