Пример #1
0
 private function processRosterFilter(sfWebRequest $request)
 {
     $params = $this->getUser()->getAttribute('member_roster', array(), 'person');
     if (!isset($params['pilot_status'])) {
         $params['pilot_status'] = null;
     }
     if (!isset($params['wing_id'])) {
         $params['wing_id'] = 0;
     }
     if (!isset($params['ifr'])) {
         $params['ifr'] = null;
     }
     if (!isset($params['multi'])) {
         $params['multi'] = null;
     }
     if (!isset($params['instructor'])) {
         $params['instructor'] = null;
     }
     if (!isset($params['board_member'])) {
         $params['board_member'] = null;
     }
     if (!isset($params['coordinator'])) {
         $params['coordinator'] = null;
     }
     if (!isset($params['orientation_pilot'])) {
         $params['orientation_pilot'] = null;
     }
     if (!isset($params['state'])) {
         $params['state'] = null;
     }
     if (!isset($params['home_base'])) {
         $params['home_base'] = null;
     }
     if (!isset($params['area_code'])) {
         $params['area_code'] = null;
     }
     if (!isset($params['email'])) {
         $params['email'] = null;
     }
     if (!isset($params['wing_job1'])) {
         $params['wing_job1'] = null;
     }
     $this->pilot_statuses = array_merge(array('' => 'All'), sfConfig::get('app_flight_statuses', array()));
     $this->wings = array_merge(array(0 => 'All'), WingPeer::getNames());
     if ($request->hasParameter('filter')) {
         $params['wing_id'] = in_array($request->getParameter('wing_id'), array_keys($this->wings)) ? $request->getParameter('wing_id') : 0;
         $params['pilot_status'] = in_array($request->getParameter('pilot_status'), array_keys($this->pilot_statuses)) ? $request->getParameter('pilot_status') : '';
         $params['ifr'] = $request->getParameter('ifr');
         $params['multi'] = $request->getParameter('multi');
         $params['instructor'] = $request->getParameter('instructor');
         $params['board_member'] = $request->getParameter('board_member');
         $params['coordinator'] = $request->getParameter('coordinator');
         $params['orientation_pilot'] = $request->getParameter('orientation_pilot');
         $params['state'] = $request->getParameter('state');
         $params['home_base'] = $request->getParameter('home_base');
         $params['area_code'] = $request->getParameter('area_code');
         $params['email'] = $request->getParameter('email');
         $params['wing_job1'] = $request->getParameter('wing_job1');
     }
     $this->page = $page = $request->getParameter('page', 1);
     $this->max = sfConfig::get('app_max_member_roster_per_pager');
     $this->pilot_status = $params['pilot_status'];
     $this->wing_id = $params['wing_id'];
     $this->ifr = $params['ifr'];
     $this->multi = $params['multi'];
     $this->instructor = $params['instructor'];
     $this->board_member = $params['board_member'];
     $this->coordinator = $params['coordinator'];
     $this->orientation_pilot = $params['orientation_pilot'];
     $this->state = $params['state'];
     $this->home_base = $params['home_base'];
     $this->area_code = $params['area_code'];
     $this->email = $params['email'];
     $this->wing_job1 = $params['wing_job1'];
     $this->getUser()->setAttribute('member_roster', $params, 'person');
 }
Пример #2
0
 public function executeEditPilot(sfWebRequest $request)
 {
     $member = MemberPeer::retrieveByPK($this->getUser()->getMemberId());
     $this->forward404Unless($member);
     $pilot = $member->getPilot();
     $this->forward404Unless($pilot);
     $this->flight_status = $member->getFlightStatus();
     $this->co_pilot = $member->getCoPilot();
     $this->license_type = $pilot->getLicenseType();
     $this->wing_id = $member->getWingId();
     $this->primary_airport_id = $pilot->getPrimaryAirportId();
     $this->secondary_airport_id = $pilot->getPrimaryAirportId();
     // TODO change to secondary
     $this->flight_statuses = sfConfig::get('app_flight_statuses', array());
     $this->license_types = sfConfig::get('app_pilot_license_types', array());
     $this->wings = WingPeer::getNames();
 }
Пример #3
0
 private function processPendingFilter(sfWebRequest $request)
 {
     $params = $this->getUser()->getAttribute('missions_pending', array(), 'person');
     if (!isset($params['wing_id'])) {
         $params['wing_id'] = null;
     }
     if (!isset($params['ident'])) {
         $params['ident'] = null;
     }
     $this->max_array = array(5, 10, 20, 30);
     $this->wings = WingPeer::getNames();
     if (in_array($request->getParameter('max'), $this->max_array)) {
         $params['max'] = $request->getParameter('max');
     } else {
         if (!isset($params['max'])) {
             $params['max'] = 10;
         }
     }
     if ($request->hasParameter('filter')) {
         $params['ident'] = $request->getParameter('ident');
         $params['wing_id'] = in_array($request->getParameter('wing_id'), array_keys($this->wings)) ? $request->getParameter('wing_id') : '';
     }
     $this->page = $page = $request->getParameter('page', 1);
     $this->max = $params['max'];
     $this->wing_id = $params['wing_id'];
     $this->ident = $params['ident'];
     $this->getUser()->setAttribute('missions_pending', $params, 'person');
 }