Пример #1
0
 /**
  * Searches for agencies
  * CODE: agency_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-agency'));
     # filter
     $this->processFilter($request);
     if ($request->isMethod('post') || $request->getParameter('page')) {
         $this->pager = AgencyPeer::getPager($this->max, $this->page, $this->name, $this->city, $this->state, $this->country);
         $this->agencies = $this->pager->getResults();
     }
     $this->getUser()->addRecentItem('Agency', 'agency', 'agency/index');
 }