示例#1
0
 /**
  * Searches for afa orgs
  * It also handles followings:
  * CODE: afaorg_index
  */
 public function executeIndex(sfWebRequest $request)
 {
     # security
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $this->getUser()->addRecentItem('AFA Org', 'afa_org', 'afaOrg/index');
     sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
     slot('nav_menu', array('reference', 'find_afaorg'));
     # filter
     $this->processFilter($request);
     if ($request->isMethod('post') || $request->getParameter('page')) {
         $this->pager = AfaOrgPeer::getPager($this->max, $this->page, $this->name, $this->phone, $this->fax);
         $this->afaorgs = $this->pager->getResults();
     }
 }