Exemple #1
0
 /**
  * TODO: Camp Pilot match.
  * CODE:camp_pilot_match
  */
 public function executeMatch(sfWebRequest $request)
 {
     # security
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Coordinator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     if ($request->getParameter('id')) {
         $this->camp = CampPeer::retrieveByPK($request->getParameter('id'));
         if (isset($this->camp) && $this->camp instanceof Camp) {
             #passengers to fly
             $this->camp_request = PilotRequestPeer::getByCampId($this->camp->getId());
             /*
                     if(isset($this->camp_request) && $this->camp_request instanceof PilotRequest ){
              if($this->camp_request->getMemberId()){
                $this->pilot_dates = PilotDatePeer::getByMemberId($this->camp_request->getMemberId());
                $this->pilot_date_arr = array();
                $c = 0;
                if(isset($this->pilot_dates)){
                  foreach ($this->pilot_dates as $req){
                    if($req->getDate() != null){
                      $this->pilot_date_arr[$c] = $req->getDate();
                      $c++;
                    }
                  }
                }
              }
             *
             */
         }
     } else {
         $this->forward404Unless($this->camp);
     }
 }