function _FlightPath::process_request_save_draft

4.x _FlightPath.php _FlightPath::process_request_save_draft()
5.x _FlightPath.php _FlightPath::process_request_save_draft()

This function will check to see if we are trying to save the draft from a tab change. It should be near the top of all of FP's "tab" pages, like Main, Comments, etc.

File

classes/_FlightPath.php, line 170

Class

_FlightPath

Code

function process_request_save_draft() 
 {

  /////////////////////////////////////
  ///  Are we trying to save the draft
  ///  from a tab change?
  /////////////////////////////////////
  if ($_REQUEST ["save_draft"] == "yes") 
   {
    $this->init(true, false, false);
    // If we are coming from the WhatIf tab, we need to save
    // as WhatIf.  Else, save as normal.
    if ($_REQUEST ["from_w_i"] == "yes") 
     {
      // Yes, we are coming from WhatIf mode, so
      // save under WhatIf.

      $GLOBALS ["advising_what_if"] = "yes";
      $this->init(false);

    }
    else {
      // NOT coming from WhatIf mode.  Save as a normal draft.
      $GLOBALS ["advising_what_if"] = "no";
      $this->init(true, true);

    }
    $this->save_advising_session_from_post(0, true);
  }

}