Ejemplo n.º 1
0
 /**
  * Show Future and past missions for the pilot
  */
 public function executeSummary(sfWebRequest $request)
 {
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Coordinator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $pilot_id = (int) $this->getUser()->getPilotId();
     if ($pilot_id == 0) {
         $this->getUser()->setFlash('warning', 'You seems not a pilot. Make sure you have a pilot record created!');
         $this->redirect($request->getReferer());
     }
     $this->past = false;
     if ($request->getParameter('past') == 1) {
         $this->past = true;
     }
     $page = (int) $request->getParameter('page');
     $max = sfConfig::get('app_max_mission_summary_per_page', 10);
     $this->pager = MissionLegPeer::getSummaryPagerPending($pilot_id, $max, $page, $this->past);
     $this->mission_legs = $this->pager->getResults();
     //$this->count = $this->pager->getNbResults();
 }