Ejemplo n.º 1
0
 /**
  * missionRequests UserStep2 - MissionReququestForm2
  */
 public function executeUserStep2(sfWebRequest $request)
 {
     $this->setTemplate('userStep1');
     if (!$this->getUser()->getAttribute('miss_temp')) {
         return $this->forward('missionRequest', 'userStep1');
     } else {
         $temp_session = $this->getUser()->getAttribute('miss_temp');
     }
     if (isset($temp_session)) {
         $mission_temp = $temp_session;
     } else {
         $mission_temp = new MissionRequest();
     }
     $this->form2 = new MissionRequestForm2($mission_temp);
     $this->mission_request_temp = $mission_temp;
     $this->back = $request->getReferer();
     if ($request->isMethod('post')) {
         $this->referer = $request->getReferer();
         $this->form2->bind($request->getParameter('miss_req_temp2'));
         if ($this->form2->isValid()) {
             //step2
             $mission_temp->setPassFirstName($request->getParameter('miss_req_temp2[pass_first_name]'));
             $mission_temp->setPassLastName($request->getParameter('miss_req_temp2[pass_last_name]'));
             $mission_temp->setPassAddress1($request->getParameter('miss_req_temp2[pass_address1]'));
             $mission_temp->setPassAddress2($request->getParameter('miss_req_temp2[pass_address2]'));
             $mission_temp->setPassCity($request->getParameter('miss_req_temp2[pass_city]'));
             $mission_temp->setPassState($request->getParameter('miss_req_temp2[pass_state]'));
             $mission_temp->setPassZipcode($request->getParameter('miss_req_temp2[pass_zipcode]'));
             $mission_temp->setPassEmail($request->getParameter('miss_req_temp2[pass_email]'));
             $mission_temp->setPassWeight($request->getParameter('miss_req_temp2[pass_weight]'));
             $mission_temp->setPassHeight($request->getParameter('miss_req_temp2[pass_height]'));
             $mission_temp->setPassDayPhone($request->getParameter('miss_req_temp2[pass_day_phone]'));
             $mission_temp->setPassDayComment($request->getParameter('miss_req_temp2[pass_day_comment]'));
             $mission_temp->setPassEvePhone($request->getParameter('miss_req_temp2[pass_eve_phone]'));
             $mission_temp->setPassEveComment($request->getParameter('miss_req_temp2[pass_eve_comment]'));
             $mission_temp->setPassMobilePhone($request->getParameter('miss_req_temp2[pass_mobile_phone]'));
             $mission_temp->setPassMobileComment($request->getParameter('miss_req_temp2[pass_mobile_comment]'));
             $mission_temp->setPassPagerPhone($request->getParameter('miss_req_temp2[pass_pager_phone]'));
             $mission_temp->setPassPagerComment($request->getParameter('miss_req_temp2[pass_pager_comment]'));
             $mission_temp->setPassOtherPhone($request->getParameter('miss_req_temp2[pass_other_phone]'));
             $mission_temp->setPassOtherComment($request->getParameter('miss_req_temp2[pass_other_comment]'));
             $this->getUser()->setAttribute('miss_temp', $mission_temp);
             return $this->redirect('missionRequest/userStep3');
         }
     } else {
         $this->referer = $request->getReferer() ? $request->getReferer() : '@missionRequest/userStep2';
     }
     // set other form1
     $this->form1 = new MissionRequestForm1($this->getUser()->getAttribute('miss_temp'));
     // set other form3
     $this->form3 = new MissionRequestForm3();
     // set other form4
     $this->form4 = new MissionRequestForm4();
     // set other form5
     $this->form5 = new MissionRequestForm5();
     $this->mission_request_temp = $mission_temp;
 }