ACN or Linking legs

From VPOIDS Documentation

Overview

The purpose of making a mission leg into an ACN leg is to assign it to another ACN organization. So, the values for this selection should come from the afa_org table. There will not be that many records in that table, so a combo box/drop-down box should work fine. There does need to be a null option, as not all mission legs will have an ACN organization attached.

However, when a mission leg becomes an ACN leg, it changes the nature of the mission leg. The mission leg is being coordinated by another organization. The pilot will come from the organization, and therefore, there will be no record in the database for the pilot who is assigned. (The linking ACN organization typically calls when they have found a pilot to give this organization the information about the pilot.)

Technical implementation

There is also a table called afa_leg. This is really the record that is attached to the leg. So, when the user chooses an ACN organization from the drop down, a new record is created in the afa_leg table and the afa_org_id is set to the afa_org that the user chose in the drop down. I believe that the record id for the afa_leg record needs to be the same as the mission_leg id in order to keep them in synch.

Now, you'll notice that the afa_leg table has fields for the pilot's name, aircraft and so forth. These fields should replace the fields that would be filled in from the pilot record when a pilot is attached to the mission leg, and in fact, the user should not be able to add a pilot to a mission leg that has an afa_leg record attached. The options for backup pilot and mission assistant should also be hidden for legs that have an afa_leg record attached.