diff --git a/controllers/DashboardController.php b/controllers/DashboardController.php index 0b2908e..394c040 100644 --- a/controllers/DashboardController.php +++ b/controllers/DashboardController.php @@ -142,10 +142,12 @@ class DashboardController { $createdBy = $this->validateUserId($_GET['created_by'] ?? null); if ($createdBy !== null) $filters['created_by'] = $createdBy; - // assigned_to accepts a numeric user ID or the special string 'unassigned' + // assigned_to accepts a numeric user ID, 'unassigned', or the special string 'me' $assignedToRaw = $_GET['assigned_to'] ?? null; if ($assignedToRaw === 'unassigned') { $filters['assigned_to'] = 'unassigned'; + } elseif ($assignedToRaw === 'me' && $userId) { + $filters['assigned_to'] = (int)$userId; } else { $assignedTo = $this->validateUserId($assignedToRaw); if ($assignedTo !== null) $filters['assigned_to'] = $assignedTo; diff --git a/views/DashboardView.php b/views/DashboardView.php index 50a7991..61b607c 100644 --- a/views/DashboardView.php +++ b/views/DashboardView.php @@ -53,7 +53,7 @@ if (!empty($_GET['type'])) { $activeFilters[] = ['type' => 'type', 'value' => $_GET['type'], 'label' => 'Type: ' . htmlspecialchars($_GET['type'])]; } if (!empty($_GET['assigned_to'])) { - $label = $_GET['assigned_to'] === 'unassigned' ? 'Unassigned' : 'User #' . htmlspecialchars($_GET['assigned_to']); + $label = match($_GET['assigned_to']) { 'unassigned' => 'Unassigned', 'me' => 'Me', default => 'User #' . htmlspecialchars($_GET['assigned_to']) }; $activeFilters[] = ['type' => 'assigned_to', 'value' => $_GET['assigned_to'], 'label' => 'Assigned: ' . $label]; } if (!empty($_GET['created_from']) || !empty($_GET['created_to'])) {