Ejemplo n.º 1
0
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
 public function executeIndex(sfWebRequest $request)
 {
     # for navigation menu
     sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
     slot('nav_menu', array('instrument', ''));
     #security
     /* if( !$this->getUser()->hasCredential(array('Administrator','Staff','Pilot','Member','Coordinator','Volunteer'), false)){
            $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url '.$request->getReferer());
            $this->redirect('dashboard/index');
        }*/
     if ($request->getParameter('type')) {
         $this->flag = 1;
     }
     if ($request->hasParameter('return')) {
         $this->pilot_request = 1;
     }
     if ($request->hasParameter('avail')) {
         $this->window_loc = 'avail';
     }
     if ($request->hasParameter('window_loc_visual')) {
         $this->window_loc_visual = 'window_loc_visual';
     }
     $member_id = $this->getUser()->getMemberId();
     $member = MemberPeer::retrieveByPK($member_id);
     $pilot = $member->getPilot();
     if ($request->getParameter('first') == 1) {
         if ($pilot) {
             $first_airport = AirportPeer::retrieveByPK($pilot->getPrimaryAirportId());
             $this->orgin_airport = $first_airport->getIdent();
         }
         $this->types = MissionTypePeer::getOnlyNames();
         $this->dest_airport = null;
         $this->miss_type = null;
         $this->miss_date1 = null;
         $this->miss_date2 = null;
     } else {
         $this->processFilterVisual($request);
     }
     $this->airport_list = AirportPeer::getMappable();
     $this->legs = MissionLegPeer::getMappable($this->orgin_airport, $this->dest_airport, $this->miss_type, $this->miss_date1, $this->miss_date2);
     $this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text'));
 }
Ejemplo n.º 2
0
 public function executeCurrentMissions(sfWebRequest $request)
 {
     $this->airport_list = AirportPeer::getMappable();
     $this->legs = MissionLegPeer::getMappable();
 }
Ejemplo n.º 3
0
 public function executeVisual(sfWebRequest $request)
 {
     #security
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Member', 'Coordinator', 'Volunteer'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $member_id = $this->getUser()->getMemberId();
     $member = MemberPeer::retrieveByPK($member_id);
     $pilot = $member->getPilot();
     if ($request->getParameter('first') == 1) {
         if ($pilot) {
             $first_airport = AirportPeer::retrieveByPK($pilot->getPrimaryAirportId());
             $this->orgin_airport = $first_airport->getIdent();
         }
         $this->types = MissionTypePeer::getOnlyNames();
         $this->dest_airport = null;
         $this->miss_type = null;
         $this->miss_date1 = null;
         $this->miss_date2 = null;
     } else {
         $this->processFilterVisual($request);
     }
     $this->airport_list = AirportPeer::getMappable();
     $this->legs = MissionLegPeer::getMappable($this->orgin_airport, $this->dest_airport, $this->miss_type, $this->miss_date1, $this->miss_date2);
     $this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text'));
 }