Settings > Modules) if (!moduleOn('trips')) { exit(json_encode(['error' => moduleOffText('trips')])); } $form_row = null; $form_mode = 'new'; $form_client_id = intval($_GET['client_id'] ?? 0); $form_location_id = intval($_GET['location_id'] ?? 0); $form_ticket_id = intval($_GET['ticket_id'] ?? 0); $form_purpose = ''; if ($form_ticket_id) { $ticket = ticketRow($form_ticket_id); if ($ticket && intval($ticket['ticket_client_id']) && hasClientAccess(intval($ticket['ticket_client_id']))) { $form_client_id = intval($ticket['ticket_client_id']); $form_location_id = $form_location_id ?: intval($ticket['ticket_location_id']); $form_purpose = mb_substr('Onsite - ' . $ticket['ticket_subject'], 0, 200); } else { $form_ticket_id = 0; } } if ($form_client_id) { $client_id = $form_client_id; enforceClientAccess(); } ob_start(); ?>