Unknown type supprt
This commit is contained in:
+37
-3
@@ -1494,6 +1494,12 @@
|
||||
openNewPPRModal();
|
||||
}
|
||||
|
||||
// Press 'g' to book out local flight starting with G
|
||||
if (e.key === 'g' || e.key === 'G') {
|
||||
e.preventDefault();
|
||||
openLocalFlightModal('LOCAL', 'G');
|
||||
}
|
||||
|
||||
// Press 'l' to book out local flight (LOCAL type)
|
||||
if (e.key === 'l' || e.key === 'L') {
|
||||
e.preventDefault();
|
||||
@@ -2624,6 +2630,9 @@
|
||||
document.getElementById('ppr-form').reset();
|
||||
document.getElementById('ppr-id').value = '';
|
||||
|
||||
// Clear the unsaved aircraft flag
|
||||
document.getElementById('ppr-form').removeAttribute('data-unsaved-aircraft');
|
||||
|
||||
// Set default ETA and ETD
|
||||
const now = new Date();
|
||||
const eta = new Date(now.getTime() + 60 * 60 * 1000); // +1 hour
|
||||
@@ -3040,6 +3049,9 @@
|
||||
|
||||
if (!accessToken) return;
|
||||
|
||||
// Auto-save any unsaved aircraft types
|
||||
await autoSaveUnsavedAircraft(this);
|
||||
|
||||
const formData = new FormData(this);
|
||||
const pprData = {};
|
||||
|
||||
@@ -3531,22 +3543,29 @@
|
||||
});
|
||||
|
||||
// Local Flight (Book Out) Modal Functions
|
||||
function openLocalFlightModal(flightType = 'LOCAL') {
|
||||
function openLocalFlightModal(flightType = 'LOCAL', prefillReg = '') {
|
||||
document.getElementById('local-flight-form').reset();
|
||||
document.getElementById('local-flight-id').value = '';
|
||||
document.getElementById('local-flight-modal-title').textContent = 'Book Out';
|
||||
document.getElementById('local_flight_type').value = flightType;
|
||||
document.getElementById('localFlightModal').style.display = 'block';
|
||||
|
||||
// Clear the unsaved aircraft flag
|
||||
document.getElementById('local-flight-form').removeAttribute('data-unsaved-aircraft');
|
||||
|
||||
// Clear aircraft lookup results
|
||||
clearLocalAircraftLookup();
|
||||
|
||||
// Update destination field visibility based on flight type
|
||||
handleFlightTypeChange(flightType);
|
||||
|
||||
// Auto-focus on registration field
|
||||
// Auto-focus on registration field and prefill if provided
|
||||
setTimeout(() => {
|
||||
document.getElementById('local_registration').focus();
|
||||
const regField = document.getElementById('local_registration');
|
||||
regField.focus();
|
||||
if (prefillReg) {
|
||||
regField.value = prefillReg;
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
@@ -3555,6 +3574,9 @@
|
||||
document.getElementById('book-in-id').value = '';
|
||||
document.getElementById('bookInModal').style.display = 'block';
|
||||
|
||||
// Clear the unsaved aircraft flag
|
||||
document.getElementById('book-in-form').removeAttribute('data-unsaved-aircraft');
|
||||
|
||||
// Clear aircraft lookup results
|
||||
clearBookInAircraftLookup();
|
||||
clearBookInArrivalAirportLookup();
|
||||
@@ -3573,6 +3595,9 @@
|
||||
document.getElementById('overflight-id').value = '';
|
||||
document.getElementById('overflightModal').style.display = 'block';
|
||||
|
||||
// Clear the unsaved aircraft flag
|
||||
document.getElementById('overflight-form').removeAttribute('data-unsaved-aircraft');
|
||||
|
||||
// Clear aircraft lookup results
|
||||
clearOverflightAircraftLookup();
|
||||
clearOverflightDepartureAirportLookup();
|
||||
@@ -4502,6 +4527,9 @@
|
||||
|
||||
if (!accessToken) return;
|
||||
|
||||
// Auto-save any unsaved aircraft types
|
||||
await autoSaveUnsavedAircraft(this);
|
||||
|
||||
const formData = new FormData(this);
|
||||
const flightType = formData.get('flight_type');
|
||||
const flightData = {};
|
||||
@@ -4585,6 +4613,9 @@
|
||||
|
||||
if (!accessToken) return;
|
||||
|
||||
// Auto-save any unsaved aircraft types
|
||||
await autoSaveUnsavedAircraft(this);
|
||||
|
||||
const formData = new FormData(this);
|
||||
const arrivalData = {};
|
||||
|
||||
@@ -4664,6 +4695,9 @@
|
||||
|
||||
if (!accessToken) return;
|
||||
|
||||
// Auto-save any unsaved aircraft types
|
||||
await autoSaveUnsavedAircraft(this);
|
||||
|
||||
const formData = new FormData(this);
|
||||
const overflightData = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user