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
if (!isset($_GET['status'])) {
// If nothing is set, assume we only want to see open tickets
if (!isset($_GET['status']) || ($_GET['status']) == 'Open') {
// Default to showing open
$status = 'Open';
$ticket_status_snippet = "ticket_status != 5";
$ticket_status_snippet = "ticket_closed_at IS NULL";
} elseif (isset($_GET['status']) && ($_GET['status']) == 'Closed') {
$status = 'Closed';
$ticket_status_snippet = "ticket_status = 5";
$ticket_status_snippet = "ticket_closed_at IS NOT NULL";
} else {
$status = '%';
$ticket_status_snippet = "ticket_status LIKE '%'";

View File

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