Add Activity Timeline feature and database migrations

- Add Activity Timeline tab to ticket view showing chronological history
- Create getTicketTimeline() method in AuditLogModel
- Update TicketController to load timeline data
- Add timeline UI with helper functions for formatting events
- Add comprehensive timeline CSS with dark mode support
- Create migrations 007-010 for upcoming features:
  - 007: Ticket assignment functionality
  - 008: Status workflow transitions
  - 009: Ticket templates
  - 010: Bulk operations tracking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-01 18:25:19 -05:00
parent 9a12a656aa
commit f9629f60b6
8 changed files with 264 additions and 1 deletions

View File

@@ -2,15 +2,18 @@
// Use absolute paths for model includes
require_once dirname(__DIR__) . '/models/TicketModel.php';
require_once dirname(__DIR__) . '/models/CommentModel.php';
require_once dirname(__DIR__) . '/models/AuditLogModel.php';
class TicketController {
private $ticketModel;
private $commentModel;
private $auditLogModel;
private $envVars;
public function __construct($conn) {
$this->ticketModel = new TicketModel($conn);
$this->commentModel = new CommentModel($conn);
$this->auditLogModel = new AuditLogModel($conn);
// Load environment variables for Discord webhook
$envPath = dirname(__DIR__) . '/.env';
@@ -55,6 +58,9 @@ class TicketController {
// Get comments for this ticket using CommentModel
$comments = $this->commentModel->getCommentsByTicketId($id);
// Get timeline for this ticket
$timeline = $this->auditLogModel->getTicketTimeline($id);
// Load the view
include dirname(__DIR__) . '/views/TicketView.php';
}