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); if (!isset($_GET['task_approval_id'], $_GET['url_key'])) { echo "

Oops, something went wrong! Please raise a ticket if you believe this is an error.

"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } // Company info $company_sql_row = mysqli_fetch_assoc(mysqli_query($mysqli, " SELECT company_phone, company_phone_country_code, company_website FROM companies, settings WHERE companies.company_id = settings.company_id AND companies.company_id = 1" )); $company_phone_country_code = escapeHtml($company_sql_row['company_phone_country_code']); $company_phone = escapeHtml(formatPhoneNumber($company_sql_row['company_phone'], $company_phone_country_code)); $company_website = escapeHtml($company_sql_row['company_website']); $approval_id = intval($_GET['task_approval_id']); $url_key = escapeSql($_GET['url_key']); $task_row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT approval_status, task_id, task_name, ticket_details, ticket_number, ticket_prefix, ticket_priority, ticket_status_name, ticket_subject FROM task_approvals LEFT JOIN tasks ON approval_task_id = task_id LEFT JOIN tickets on task_ticket_id = ticket_id LEFT JOIN ticket_statuses ON ticket_status = ticket_status_id WHERE approval_id = $approval_id AND approval_url_key = '$url_key' LIMIT 1" )); if (!$task_row) { // Invalid echo "

Oops, something went wrong! Please raise a ticket if you believe this is an error.

"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } $task_id = intval($task_row['task_id']); $task_name = escapeHtml($task_row['task_name']); $approval_status = escapeHtml($task_row['approval_status']); $ticket_prefix = escapeHtml($task_row['ticket_prefix']); $ticket_number = intval($task_row['ticket_number']); $ticket_status = escapeHtml($task_row['ticket_status_name']); $ticket_priority = escapeHtml($task_row['ticket_priority']); $ticket_subject = escapeHtml($task_row['ticket_subject']); $ticket_details = $purifier->purify($task_row['ticket_details']); // Same priority colours the agent ticket list uses, so a ticket reads the same // to the client as it does to the tech looking at it if ($ticket_priority == "Urgent") { $ticket_priority_color = "dark"; } elseif ($ticket_priority == "High") { $ticket_priority_color = "danger"; } elseif ($ticket_priority == "Medium") { $ticket_priority_color = "warning"; } else { $ticket_priority_color = "info"; } $approve_link = "guest_post.php?approve_ticket_task=$task_id&approval_id=$approval_id&approval_url_key=$url_key"; ?>

Task Approval

You have been asked to approve the following task

Ticket

Not expecting this? Get in touch using the details below.
Approved — nothing further is needed.
Declined — this task was not approved.
Ticket details

|