feat: duplicate link action, watcher migration, fulltext search migration
- CreateTicketView: "Link as duplicate" button on each duplicate result; stores chosen ticket ID in hidden field, auto-creates duplicates dependency after ticket is saved (TicketController) - migrations/004: ticket_watchers table (ticket_id, user_id primary key) - migrations/005: FULLTEXT index on tickets(title, description) for fast relevance search replacing LIKE scan Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -125,6 +125,17 @@ class TicketController {
|
||||
$GLOBALS['auditLog']->logTicketCreate($userId, $result['ticket_id'], $ticketData);
|
||||
}
|
||||
|
||||
// Auto-link as duplicate if requested from create form
|
||||
$linkDupOf = isset($_POST['link_duplicate_of']) ? (int)$_POST['link_duplicate_of'] : 0;
|
||||
if ($linkDupOf > 0) {
|
||||
$depSql = "INSERT IGNORE INTO ticket_dependencies (ticket_id, depends_on_ticket_id, dependency_type, created_by)
|
||||
VALUES (?, ?, 'duplicates', ?)";
|
||||
$depStmt = $this->conn->prepare($depSql);
|
||||
$depStmt->bind_param("iii", $result['ticket_id'], $linkDupOf, $userId);
|
||||
$depStmt->execute();
|
||||
$depStmt->close();
|
||||
}
|
||||
|
||||
// Send Matrix notification for new ticket
|
||||
NotificationHelper::sendTicketNotification($result['ticket_id'], $ticketData, 'manual');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user