set('Cache.DefinitionImpl', null); // Disable cache by setting a non-existent directory or an invalid one
$purifier_config->set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'http' => true, 'https' => true]);
$purifier = new HTMLPurifier($purifier_config);
$company = billingCompany();
$company_phone = (string) ($company['phone_display'] ?? '');
$company_tel = phoneDialNumber($company['company_phone'] ?? '', $company['company_phone_country_code'] ?? '');
$company_website = trim((string) ($company['company_website'] ?? ''));
$support_email = (string) ticketEmailFrom()['email'];
// The company's logo, or its initials and name, as the client portal's top bar shows them - so the page is plainly yours
$brand_html = $company['logo_url'] !== ''
? ''
: ''
. '' . escapeHtml($session_company_name) . '';
$found = ticketByGuestKey($_GET['ticket_id'] ?? 0, $_GET['url_key'] ?? '');
$ticket_id = $found ? intval($found['ticket_id']) : 0;
$ticket = $ticket_id ? mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT " . portalTicketColumnsSql() . ", tickets.ticket_details, tickets.ticket_feedback, tickets.ticket_url_key,
tickets.ticket_client_id, tickets.ticket_assigned_to, tickets.ticket_schedule, tickets.ticket_onsite, tickets.ticket_first_response_at, tickets.ticket_response_due_at,
user_name, user_avatar, category_name, contact_name, contact_photo, asset_name, asset_type,
location_name, location_address, location_city, location_state, location_zip
FROM tickets
LEFT JOIN users ON ticket_assigned_to = user_id
LEFT JOIN ticket_statuses ON ticket_status = ticket_status_id
LEFT JOIN categories ON ticket_category = category_id
LEFT JOIN contacts ON contact_id = tickets.ticket_contact_id
LEFT JOIN assets ON asset_id = tickets.ticket_asset_id AND asset_client_id = tickets.ticket_client_id
LEFT JOIN locations ON location_id = IF(tickets.ticket_location_id > 0, tickets.ticket_location_id, contacts.contact_location_id) AND location_client_id = tickets.ticket_client_id
WHERE tickets.ticket_id = $ticket_id LIMIT 1")) : null;
if (!$ticket) {
?>
= escapeHtml($number) ?> · opened = portalDateTime($ticket['ticket_created_at']) ?> by = escapeHtml($requester) ?>
We aim to reply by = portalDateTime($reply_by) ?>
Our last message needs an answer before we can carry on. Reply to any of our emails about this ticket - it goes straight onto it. Screenshots and files can go with it. Sign in to the client portal to reply - screenshots and files can go with it. Give us a call on = escapeHtml($company_phone) ?>.
Sorry this one didn't go the way it should have. Call us on = escapeHtml($company_phone) ?> and we will put it right.
Need more help with this? Replies to a closed ticket don't reach us - raise a new one= $portal_url ? ' in the client portal' : '' ?>= $portal_url && $support_email !== '' ? ' or' : '' ?>= $support_email !== '' ? ' by emailing ' . escapeHtml($support_email) . '' : '' ?>.