Merge pull request #929 from wrongecho/portal-ticket-list-fix

Client Portal Tickets - Adjust bad SQL query that shows ticket subjects for other contacts
This commit is contained in:
wrongecho 2024-04-02 00:38:48 +01:00 committed by GitHub
commit ed87ddc2dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View File

@ -13,13 +13,13 @@ if ($session_contact_primary == 0 && !$session_contact_is_technical_contact) {
} }
// Ticket status from GET // Ticket status from GET
if (!isset($_GET['status'])) { if (!isset($_GET['status']) || ($_GET['status']) == 'Open') {
// If nothing is set, assume we only want to see open tickets // Default to showing open
$status = 'Open'; $status = 'Open';
$ticket_status_snippet = "ticket_status != 5"; $ticket_status_snippet = "ticket_closed_at IS NULL";
} elseif (isset($_GET['status']) && ($_GET['status']) == 'Closed') { } elseif (isset($_GET['status']) && ($_GET['status']) == 'Closed') {
$status = 'Closed'; $status = 'Closed';
$ticket_status_snippet = "ticket_status = 5"; $ticket_status_snippet = "ticket_closed_at IS NOT NULL";
} else { } else {
$status = '%'; $status = '%';
$ticket_status_snippet = "ticket_status LIKE '%'"; $ticket_status_snippet = "ticket_status LIKE '%'";

View File

@ -10,13 +10,13 @@ require_once "inc_portal.php";
// Ticket status from GET // Ticket status from GET
if (!isset($_GET['status'])) { if (!isset($_GET['status']) || ($_GET['status']) == 'Open') {
// If nothing is set, assume we only want to see open tickets // Default to showing open
$status = 'Open'; $status = 'Open';
$ticket_status_snippet = "ticket_status != 5 AND ticket_status != 'Closed'"; $ticket_status_snippet = "ticket_closed_at IS NULL";
} elseif (isset($_GET['status']) && ($_GET['status']) == 'Closed') { } elseif (isset($_GET['status']) && ($_GET['status']) == 'Closed') {
$status = 'Closed'; $status = 'Closed';
$ticket_status_snippet = "ticket_status = 5 OR ticket_status = 'Closed'"; $ticket_status_snippet = "ticket_closed_at IS NOT NULL";
} else { } else {
$status = '%'; $status = '%';
$ticket_status_snippet = "ticket_status LIKE '%'"; $ticket_status_snippet = "ticket_status LIKE '%'";