Ejemplo n.º 1
0
 /**
  * missionRequests UserStep4 - MissionReququestForm4
  * @TODO : Need to do php validation on
  *	     Appointment date
  *	     Mission Date
  *	     Return Date
  */
 public function executeUserStep4(sfWebRequest $request)
 {
     $this->setTemplate('userStep1');
     if (!$this->getUser()->getAttribute('miss_temp')) {
         return $this->forward('missionRequest', 'userStep3');
     } else {
         $temp_session = $this->getUser()->getAttribute('miss_temp');
     }
     if (isset($temp_session)) {
         $mission_temp = $temp_session;
     } else {
         $mission_temp = new MissionRequest();
     }
     $this->form4 = new MissionRequestForm4($mission_temp);
     $this->mission_request_temp = $mission_temp;
     $this->back = $request->getReferer();
     if ($request->isMethod('post')) {
         $this->referer = $request->getReferer();
         $this->form4->bind($request->getParameter('miss_req_temp4'));
         if ($this->form4->isValid()) {
             $mission_temp->fromArray($request->getParameter('miss_req_temp4'));
             //step4
             $mission_temp->setApptDate($request->getParameter('miss_req_temp4[appt_date]'));
             $mission_temp->setMissionDate($request->getParameter('miss_req_temp4[mission_date]'));
             $mission_temp->setReturnDate($request->getParameter('miss_req_temp4[return_date]'));
             $mission_temp->setPassEnglish($request->getParameter('miss_req_temp4[pass_english]'));
             $mission_temp->setPassLanguage($request->getParameter('miss_req_temp4[pass_language]'));
             $mission_temp->setReleasingPhysician($request->getParameter('miss_req_temp4[releasing_physician]'));
             $mission_temp->setReleasePhone($request->getParameter('miss_req_temp4[release_phone]'));
             $mission_temp->setReleasePhoneComment($request->getParameter('miss_req_temp4[release_phone_comment]'));
             $mission_temp->setReleaseFax($request->getParameter('miss_req_temp4[release_fax]'));
             $mission_temp->setReleaseFaxComment($request->getParameter('miss_req_temp4[release_fax_comment]'));
             $mission_temp->setReleaseEmail($request->getParameter('miss_req_temp4[release_email]'));
             $mission_temp->setTreatingPhysician($request->getParameter('miss_req_temp4[treating_physician]'));
             $mission_temp->setTreatingPhone($request->getParameter('miss_req_temp4[treating_phone]'));
             $mission_temp->setTreatingPhoneComment($request->getParameter('miss_req_temp4[treating_phone_comment]'));
             $mission_temp->setTreatingFax($request->getParameter('miss_req_temp4[treating_fax]'));
             $mission_temp->setTreatingFaxComment($request->getParameter('miss_req_temp4[treating_fax_comment]'));
             $mission_temp->setTreatingEmail($request->getParameter('miss_req_temp4[treating_email]'));
             $mission_temp->setFacilityName($request->getParameter('miss_req_temp4[facility_name]'));
             $mission_temp->setFacilityPhone($request->getParameter('miss_req_temp4[facility_phone]'));
             $mission_temp->setFacilityPhoneComment($request->getParameter('miss_req_temp4[facility_phone_comment]'));
             $mission_temp->setLodgingName($request->getParameter('miss_req_temp4[lodging_name]'));
             $mission_temp->setLodgingPhone($request->getParameter('miss_req_temp4[lodging_phone]'));
             $mission_temp->setLodgingPhoneComment($request->getParameter('miss_req_temp4[lodging_phone_comment]'));
             $mission_temp->setEmergencyName($request->getParameter('miss_req_temp4[emergency_name]'));
             $mission_temp->setEmergencyPhone1($request->getParameter('miss_req_temp4[emergency_phone1]'));
             $mission_temp->setEmergencyPhone1Comment($request->getParameter('miss_req_temp4[emergency_phone1_comment]'));
             $mission_temp->setIllness($request->getParameter('miss_req_temp4[illness]'));
             $mission_temp->setFinancial($request->getParameter('miss_req_temp4[financial]'));
             $mission_temp->setPassMedical($request->getParameter('miss_req_temp4[pass_medical]'));
             $mission_temp->setReferralSourceId($request->getParameter('miss_req_temp4[referral_source_id]'));
             $this->getUser()->setAttribute('miss_temp', $mission_temp);
             return $this->redirect('missionRequest/userStep5');
         }
     } else {
         $this->referer = $request->getReferer() ? $request->getReferer() : '@passenger/userStep4';
     }
     // set other form1
     $this->form1 = new MissionRequestForm1($this->getUser()->getAttribute('miss_temp'));
     // set other form2
     $this->form2 = new MissionRequestForm2($this->getUser()->getAttribute('miss_temp'));
     // set other form3
     $this->form3 = new MissionRequestForm3($this->getUser()->getAttribute('miss_temp'));
     // set other form5
     $this->form5 = new MissionRequestForm5();
     $this->mission_request_temp = $mission_temp;
 }