Settings > Modules) if (!moduleOn('trips')) { exit(json_encode(['error' => moduleOffText('trips')])); } $form_row = tripRow(intval($_GET['id'] ?? 0)); if (!$form_row) { exit(json_encode(['error' => 'That trip no longer exists, or is not one you can see.'])); } if (!tripCanEdit($form_row)) { exit(json_encode(['error' => "That is someone else's trip - changing it needs write access to Financial."])); } $form_mode = 'edit'; ob_start(); ?>