예제 #1
0
 /**
  * Searches for camps
  * CODE:camp_index
  */
 public function executeIndex(sfWebRequest $request)
 {
     # security
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Coordinator', 'Volunteer'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     # for navigation menu
     sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
     slot('nav_menu', array('mission_coord', 'find-camp'));
     # recent item
     $this->getUser()->addRecentItem('Camps', 'camps', 'camp/index');
     # filter
     $this->processFilter($request);
     if ($request->isMethod('post') || $request->getParameter('page') || $request->hasParameter('showlist')) {
         $this->pager = CampPeer::getPager($this->max, $this->page, $this->camp_name, $this->agency_name, $this->agency_city, $this->agency_state, $this->agency_country, $this->airport_ident, $this->airport_city, $this->airport_state);
         $this->camps = $this->pager->getResults();
     }
 }